青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

S.l.e!ep.¢%

像打了激速一樣,以四倍的速度運轉,開心的工作
簡單、開放、平等的公司文化;尊重個性、自由與個人價值;
posts - 1098, comments - 335, trackbacks - 0, articles - 1
  C++博客 :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

BLENDFUNCTION

Posted on 2010-09-07 14:39 S.l.e!ep.¢% 閱讀(931) 評論(1)  編輯 收藏 引用 所屬分類: DirectUI

typedef struct _BLENDFUNCTION {
? BYTE BlendOp;
? BYTE BlendFlags;
? BYTE SourceConstantAlpha;
? BYTE AlphaFormat;
} BLENDFUNCTION, *PBLENDFUNCTION, *LPBLENDFUNCTION;


The BLENDFUNCTION structure controls blending by specifying the blending functions for source and destination bitmaps.
BLENDFUNCTION這種結構的混合控制通過指定源和目標位圖的混合功能
BlendOp

The source blend operation. Currently, the only source and destination blend operation that has been defined is AC_SRC_OVER. For details, see the following Remarks section.

指定源混合操作。目前,唯一的源和目標混合,已定義的AC_SRC_OVER; 即根據源alpha值把源圖像疊加到目標圖像上。OpenGLalpha混合還支持其他的方式,如常量顏色源。

BlendFlags

Must be zero.


SourceConstantAlpha

Specifies an alpha transparency value to be used on the entire source bitmap. The SourceConstantAlpha value is combined with any per-pixel alpha values in the source bitmap. If you set SourceConstantAlpha to 0, it is assumed that your image is transparent. Set the SourceConstantAlpha value to 255 (opaque) when you only want to use per-pixel alpha values.

指定一個alpha透明度值將用于整個源位圖;該SourceConstantAlpha值與任何在源位圖的每個像素的alpha值組合;如果設置為0,就會假定你的圖片是透明的;如果需要使用每像素alpha值,設置SourceConstantAlpha值255(不透明);

AlphaFormat

This member controls the way the source and destination bitmaps are interpreted. AlphaFormat has the following value.

Value Meaning
AC_SRC_ALPHA This flag is set when the bitmap has an Alpha channel (that is, per-pixel alpha). Note that the APIs use premultiplied alpha, which means that the red, green and blue channel values in the bitmap must be premultiplied with the alpha channel value. For example, if the alpha channel value is x, the red, green and blue channels must be multiplied by x and divided by 0xff prior to the call.


  AlphaFormat 此成員控制源和目標位圖的解釋;看以下值:
  AC_SRC_ALPHA 這個標志被設置當那位圖有Alpha通道(也就是說,每個像素的Alpha);
  例如,如果Alpha通道值是x,紅色,綠色和藍色通道必須乘以x和由
  0xff分開在調用之前

Remarks

When the AlphaFormat member is AC_SRC_ALPHA, the source bitmap must be 32 bpp. If it is not, the AlphaBlend function will fail.

When the BlendOp member is AC_SRC_OVER, the source bitmap is placed over the destination bitmap based on the alpha values of the source pixels.

If the source bitmap has no per-pixel alpha value (that is, AC_SRC_ALPHA is not set), the SourceConstantAlpha value determines the blend of the source and destination bitmaps, as shown in the following table. Note that SCA is used for SourceConstantAlpha here. Also, SCA is divided by 255 because it has a value that ranges from 0 to 255.

Dst.Red= Src.Red * (SCA/255.0)+ Dst.Red * (1.0 - (SCA/255.0))
Dst.Green= Src.Green * (SCA/255.0)+ Dst.Green * (1.0 - (SCA/255.0))
Dst.Blue= Src.Blue * (SCA/255.0)+ Dst.Blue * (1.0 - (SCA/255.0))

?

If the destination bitmap has an alpha channel, then the blend is as follows.

Dst.Alpha= Src.Alpha * (SCA/255.0)+ Dst.Alpha * (1.0 - (SCA/255.0))

?

If the source bitmap does not use SourceConstantAlpha (that is, it equals 0xFF), the per-pixel alpha determines the blend of the source and destination bitmaps, as shown in the following table.

Dst.Red= Src.Red+ (1 - Src.Alpha) * Dst.Red
Dst.Green= Src.Green+ (1 - Src.Alpha) * Dst.Green
Dst.Blue= Src.Blue+ (1 - Src.Alpha) * Dst.Blue

?

If the destination bitmap has an alpha channel, then the blend is as follows.

Dest.alpha= Src.Alpha+ (1 - SrcAlpha) * Dst.Alpha

?

If the source has both the SourceConstantAlpha (that is, it is not 0xFF) and per-pixel alpha, the source is pre-multiplied by the SourceConstantAlpha and then the blend is based on the per-pixel alpha. The following tables show this. Note that SourceConstantAlpha is divided by 255 because it has a value that ranges from 0 to 255.

Src.Red= Src.Red* SourceConstantAlpha / 255.0;
Src.Green= Src.Green* SourceConstantAlpha / 255.0;
Src.Blue= Src.Blue* SourceConstantAlpha / 255.0;
Src.Alpha= Src.Alpha* SourceConstantAlpha / 255.0;
Dst.Red= Src.Red+ (1 - Src.Alpha) * Dst.Red
Dst.Green= Src.Green+ (1 - Src.Alpha) * Dst.Green
Dst.Blue= Src.Blue+ (1 - Src.Alpha) * Dst.Blue
Dst.Alpha= Src.Alpha+ (1 - Src.Alpha) * Dst.Alpha

?

最后一個字段AlphaFormat有兩個選擇:0表示常量alpha值,AC_SRC_ALPHA表示每個像素有各自的alpha通道。

如果AlphaFormat字段為0,源位圖中的所有像素使用同樣的常量alpha值,即SourceConstantAlpha字段中的值,該值實際上是0255,而不是01。這里0表示完全透明,255表示完全不透明。目標像素以255-SourceConstantAlpha值作為alpha值。

如果AlphaFormat字段的值是AC_SRC_ALPHA,源設備表面的每個像素必須有各自的alpha通道。即,必須是32-bpp的物理設備上下文,或是選中了32-bpp DDBDIB段的內存設備上下文。這些情況下,每個源像素有48位通道:紅、綠、藍和alpha。每個像素的alpha通道和SourceConstantAlpha字段一起用于把源和目標混合起來。實際用于計算的運算式如下:

Tmp.Red ??= Src.Red ??* SourceConstantAlpha / 255;

Tmp.Green = Src.Green * SourceConstantAlpha / 255;

Tmp.Blue ?= Src.Blue ?* SourceConstantAlpha / 255;

Tmp.Alpha = Src.Alpha * SourceConstantAlpha / 255;

Beta????? = 255 – Tmp.alpha;

Dst.Red ??= Tmp.Red? ?+ Round((Beta * Dst.Red? )/255);

Dst.Green = Tmp.Green + Round((Beta * Dst.Green)/255);

Dst.Blue ?= Tmp.Blue ?+ Round((Beta * Dst.Blue )/255);

Dst.Alpha = Tmp.Alpha + Round((Beta * Dst.Alpha)/255);


Feedback

# re: BLENDFUNCTION   回復  更多評論   

2012-08-09 09:16 by changmning
有這個函數BLENDFUNCTION的用法實例嗎?
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            国产精品一区二区欧美| 国产精品自在欧美一区| 亚洲人屁股眼子交8| 亚洲国产成人午夜在线一区| 免费观看亚洲视频大全| 亚洲国产精品尤物yw在线观看| 久久综合电影| 欧美资源在线| 欧美一区视频在线| 亚洲国产成人porn| 亚洲精品一区二区三区四区高清 | 久久激情婷婷| 久久久国产一区二区| 亚洲第一精品夜夜躁人人爽| 亚洲精品1234| 国产精品久久久久久久一区探花 | 国产欧美精品一区二区色综合| 欧美尤物巨大精品爽| 久久嫩草精品久久久精品| 99国产一区| 欧美一级播放| 日韩网站在线| 欧美一区二区三区在线播放| 亚洲激情自拍| 亚洲欧美日韩一区二区三区在线观看 | 亚洲精品久久久久久久久久久| 欧美亚洲一区二区在线观看| 亚洲国产黄色片| 亚洲最新视频在线播放| 激情久久婷婷| 99精品欧美一区二区蜜桃免费| 国产主播精品| aa级大片欧美三级| 影音先锋久久久| 亚洲一区在线播放| 最新国产拍偷乱拍精品| 亚洲欧美日韩国产一区| 亚洲精品综合在线| 久久精品日产第一区二区| 一区二区三区黄色| 老司机午夜精品视频| 欧美亚洲午夜视频在线观看| 欧美精品一区二区三区蜜臀| 美女91精品| 国产精品国产自产拍高清av王其 | 亚洲夫妻自拍| 午夜精品久久久久影视| 亚洲视频久久| 欧美成年人视频| 免播放器亚洲一区| 国产亚洲精品高潮| 亚洲字幕一区二区| aⅴ色国产欧美| 久久伊人一区二区| 久久精品亚洲精品| 欧美色道久久88综合亚洲精品| 欧美成人a∨高清免费观看| 国产一区 二区 三区一级| 中日韩高清电影网| 亚洲综合色丁香婷婷六月图片| 欧美激情第五页| 亚洲国产精品成人久久综合一区| 狠狠久久亚洲欧美专区| 久久av一区二区三区| 欧美在线观看视频一区二区| 国产精品毛片va一区二区三区| 日韩亚洲欧美高清| 欧美香蕉视频| 一区二区三区免费网站| 在线性视频日韩欧美| 欧美日韩在线第一页| 99精品久久| 亚洲欧美视频一区| 国产精品一区二区三区乱码| 亚洲欧美福利一区二区| 久久精品一级爱片| 欧美麻豆久久久久久中文| 亚洲激情一区二区| aa日韩免费精品视频一| 欧美午夜视频在线| 亚洲欧美国产另类| 久久资源av| 亚洲激情在线视频| 欧美日韩一区三区四区| 亚洲图色在线| 久久久噜噜噜| 亚洲看片网站| 国产精品久久久久影院亚瑟| 欧美一区亚洲| 亚洲第一毛片| 亚洲在线国产日韩欧美| 国产欧美亚洲视频| 免费在线观看日韩欧美| 一本久久a久久精品亚洲| 久久精品成人一区二区三区| 1024国产精品| 欧美性大战久久久久| 欧美影视一区| 亚洲人成久久| 久久久久九九九九| 亚洲精选视频免费看| 国产精品露脸自拍| 快播亚洲色图| 中文网丁香综合网| 欧美第一黄网免费网站| 亚洲欧美在线一区二区| 亚洲国产mv| 国产美女精品免费电影| 欧美大片va欧美在线播放| 亚洲专区一区| 亚洲日韩成人| 久久久噜噜噜久久中文字免| 一区二区三区四区国产精品| 韩国v欧美v日本v亚洲v| 欧美视频在线一区| 久久人人看视频| 亚洲欧美变态国产另类| 日韩视频亚洲视频| 欧美电影在线免费观看网站| 久久爱91午夜羞羞| 一区二区三区高清不卡| 亚洲激情黄色| 黄色成人av网| 国产日韩欧美高清免费| 欧美午夜电影网| 欧美激情1区2区3区| 久久一区中文字幕| 久久成人精品无人区| 亚洲综合首页| 在线性视频日韩欧美| 亚洲精品偷拍| 最新高清无码专区| 欧美激情视频给我| 欧美成人一品| 欧美成人免费va影院高清| 久久综合色8888| 久久高清福利视频| 久久成人亚洲| 久久超碰97中文字幕| 欧美一区二视频在线免费观看| 亚洲一区二区免费看| 中文av字幕一区| 亚洲一级片在线看| 亚洲欧美日韩网| 亚洲女人av| 欧美伊人久久久久久午夜久久久久 | 欧美精品黄色| 欧美日韩高清不卡| 欧美午夜精品久久久久久人妖| 欧美极品一区二区三区| 欧美日本乱大交xxxxx| 欧美日韩成人在线观看| 欧美色网一区二区| 国产精品久久久91| 国产午夜亚洲精品羞羞网站| 国产原创一区二区| 在线看片第一页欧美| 亚洲精品乱码久久久久久久久| 亚洲精品网站在线播放gif| 99这里只有久久精品视频| 在线中文字幕一区| 欧美在线高清| 欧美www视频| 亚洲乱码一区二区| 午夜一区二区三视频在线观看 | 亚洲精品国精品久久99热| 最近中文字幕日韩精品 | 免费人成网站在线观看欧美高清| 免费国产一区二区| 91久久国产综合久久91精品网站| 99re在线精品| 欧美亚洲色图校园春色| 美女精品一区| 欧美午夜免费影院| 狠狠色丁香婷婷综合久久片| 亚洲精品国精品久久99热一| 亚洲性视频网站| 美国成人直播| 日韩手机在线导航| 欧美在线影院在线视频| 欧美精品一区在线发布| 国产偷久久久精品专区| 亚洲每日在线| 久久久99爱| 99精品欧美一区| 久久米奇亚洲| 国产模特精品视频久久久久 | 黄色亚洲精品| 亚洲免费不卡| 老司机久久99久久精品播放免费 | 一本久道综合久久精品| 久久精品国产一区二区三区| 欧美另类一区二区三区| 国产夜色精品一区二区av| 日韩视频免费观看高清在线视频| 欧美一区二区三区的| 亚洲人成在线观看| 久久经典综合| 国产欧美在线视频| 亚洲少妇在线|