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

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.¢% 閱讀(930) 評論(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>
            亚洲一区欧美激情| 欧美韩日一区二区| 亚洲一区二区在线播放| 欧美涩涩视频| 午夜精彩国产免费不卡不顿大片| 一区二区不卡在线视频 午夜欧美不卡'| 欧美激情视频在线免费观看 欧美视频免费一| 亚洲国产99精品国自产| 亚洲欧洲日本国产| 欧美日韩a区| 亚洲欧美在线看| 香蕉久久a毛片| 亚洲国产一区二区三区青草影视| 亚洲国产一二三| 国产精品国色综合久久| 久久久久久一区| 免费视频一区| 亚洲欧美日韩精品久久久| 欧美一区1区三区3区公司| 亚洲国产精品嫩草影院| 亚洲丶国产丶欧美一区二区三区| 欧美伦理91i| 欧美在线一级va免费观看| 久久人人97超碰人人澡爱香蕉| 亚洲精品久久嫩草网站秘色 | 国产精品日韩| 麻豆精品在线视频| 欧美日韩亚洲免费| 久久男人av资源网站| 欧美日韩123| 老色批av在线精品| 欧美日韩精品免费| 久久精品二区三区| 欧美精品一区二区三| 久久精品国产免费观看| 男女激情久久| 久久久久久亚洲综合影院红桃 | 亚洲在线成人精品| 国产女精品视频网站免费| 久久久无码精品亚洲日韩按摩| 欧美激情第六页| 久久精品欧美| 欧美日韩精品一区二区在线播放| 久久久久高清| 欧美午夜在线一二页| 欧美gay视频激情| 国产亚洲欧美另类中文| 一区二区三区视频在线观看 | 欧美精品大片| 开元免费观看欧美电视剧网站| 欧美色视频一区| 亚洲成人在线视频网站| 国产在线拍偷自揄拍精品| 一本色道久久综合| 亚洲精品免费观看| 久久综合狠狠综合久久激情| 久久se精品一区二区| 欧美日韩在线精品| 99国内精品久久| 99成人在线| 欧美伦理91i| 亚洲精品久久久久久一区二区| 亚洲电影免费观看高清完整版| 午夜精品视频在线观看| 性欧美暴力猛交69hd| 国产精品久久波多野结衣| 91久久久久| 夜夜嗨av一区二区三区四区| 欧美成黄导航| 亚洲日本va午夜在线影院| 亚洲区欧美区| 欧美激情小视频| 日韩视频在线免费观看| 夜夜嗨av色综合久久久综合网| 欧美韩国日本一区| 亚洲乱码国产乱码精品精天堂| 亚洲免费观看视频| 欧美日韩免费网站| 日韩亚洲欧美成人一区| 亚洲在线一区二区| 国产三级欧美三级| 久久夜色精品国产| 亚洲激情一区| 亚洲一区二区免费视频| 国产精品久久一卡二卡| 亚洲女女做受ⅹxx高潮| 久久久免费观看视频| 伊人久久久大香线蕉综合直播| 久久综合九色综合久99| 亚洲国产高潮在线观看| 正在播放亚洲| 国产欧美日韩在线| 老牛国产精品一区的观看方式| 亚洲精品乱码久久久久久按摩观| 亚洲午夜免费福利视频| 国产亚洲免费的视频看| 你懂的亚洲视频| 在线亚洲精品福利网址导航| 久久久久国产免费免费| 亚洲日本成人在线观看| 国产精品成人在线| 久久久久久久久综合| 99av国产精品欲麻豆| 欧美在线一二三四区| 亚洲人人精品| 国产亚洲欧美日韩在线一区| 欧美成人综合在线| 欧美一区二区三区四区夜夜大片 | 免费观看成人鲁鲁鲁鲁鲁视频| 亚洲国产精品久久久久秋霞影院 | 麻豆精品视频在线观看视频| 99精品国产99久久久久久福利| 久久精品国产免费| 夜夜爽夜夜爽精品视频| 国精品一区二区三区| 欧美日韩伦理在线| 久久久久久夜| 亚洲免费视频在线观看| 亚洲精品乱码久久久久久日本蜜臀 | 国产亚洲欧美在线| 欧美日韩国产精品一区| 久久久亚洲人| 午夜精品福利一区二区蜜股av| 亚洲电影免费观看高清完整版在线观看 | 免费欧美电影| 欧美一区二区三区视频在线 | 99国产精品一区| 在线精品视频一区二区三四| 国产精品夫妻自拍| 欧美国产乱视频| 久久久午夜精品| 久久爱另类一区二区小说| 亚洲在线网站| 一本色道久久综合亚洲精品不 | 亚洲电影在线免费观看| 久久―日本道色综合久久| 亚洲欧美一区二区三区在线| 日韩午夜av电影| 日韩视频在线播放| 亚洲欧洲久久| 亚洲黄色av一区| 亚洲国产成人av| 亚洲国产日韩欧美在线99| 精品成人国产在线观看男人呻吟| 国产嫩草影院久久久久| 欧美性猛片xxxx免费看久爱| 欧美日韩视频在线观看一区二区三区 | 久久久久久久综合色一本| 欧美一区二区啪啪| 久久精品99| 久久久久久综合网天天| 久久精品免费| 久久综合久久综合九色| 免费国产一区二区| 亚洲国产精品成人精品| 亚洲国产一区二区三区青草影视 | 免费在线看一区| 欧美a级片网| 亚洲第一级黄色片| 亚洲精品美女久久7777777| 亚洲人成精品久久久久| 亚洲美女在线国产| 在线综合+亚洲+欧美中文字幕| 中文在线资源观看网站视频免费不卡| 在线亚洲一区观看| 久久国产精品久久久久久久久久 | 欧美一区二区三区免费观看| 久久久99久久精品女同性| 美日韩精品免费观看视频| 欧美精品aa| 国产欧美va欧美不卡在线| 狠狠综合久久av一区二区老牛| 亚洲黄色有码视频| 亚洲综合三区| 美女久久网站| 亚洲乱码国产乱码精品精 | 欧美激情一区二区三区全黄| 日韩视频国产视频| 欧美在线一级va免费观看| 久久亚洲综合| 欧美日韩视频在线| 国产自产高清不卡| 亚洲乱码国产乱码精品精可以看| 亚洲午夜av| 麻豆精品视频在线观看| 亚洲精品美女免费| 欧美在线一二三| 欧美日韩一区高清| 在线观看不卡av| 性欧美video另类hd性玩具| 欧美成人黑人xx视频免费观看| 在线视频一区观看| 久久综合色婷婷| 国产亚洲日本欧美韩国| 一本久道久久综合中文字幕| 久久精品五月| 99视频在线观看一区三区| 久久综合久久久久88| 国产免费成人| 亚洲欧美清纯在线制服|