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

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.¢% 閱讀(926) 評論(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>
            欧美视频一区二区三区…| 久久亚洲一区二区| 国产精品v日韩精品| 亚洲午夜av在线| 亚洲性感激情| 黄色精品免费| 亚洲国产成人久久综合一区| 欧美精品久久久久久久免费观看 | 免费成人高清视频| 日韩视频免费观看高清在线视频| 亚洲免费福利视频| 国产一区av在线| 亚洲第一精品影视| 欧美午夜免费影院| 老司机午夜免费精品视频| 欧美金8天国| 久久福利资源站| 欧美不卡视频一区| 欧美一区二区三区四区在线观看地址| 久久精品国产精品亚洲精品| 亚洲精品老司机| 亚洲自拍三区| 亚洲最新在线视频| 久久精品99久久香蕉国产色戒| 日韩一级片网址| 久久精品盗摄| 亚洲欧美国产不卡| 久久一区欧美| 午夜精品美女自拍福到在线| 免费在线视频一区| 久久精品视频亚洲| 国产精品多人| 亚洲国产成人91精品| 国产资源精品在线观看| 99热这里只有成人精品国产| 亚洲电影中文字幕| 欧美一区二区三区免费在线看| 中文av字幕一区| 欧美a级一区二区| 久久久噜噜噜久久中文字免| 欧美视频一区二区三区| 亚洲激情国产| 亚洲激情不卡| 久久精品一区| 久久久久久穴| 国产亚洲一级| 欧美一区二区三区视频| 亚洲欧美中文在线视频| 欧美日韩中文精品| 亚洲精品在线视频| 99在线|亚洲一区二区| 米奇777在线欧美播放| 免费日韩精品中文字幕视频在线| 国产欧美一区视频| 午夜久久久久久| 欧美在线观看天堂一区二区三区| 欧美调教vk| 夜夜嗨av一区二区三区网站四季av| 亚洲人成人99网站| 欧美a级在线| 最新国产拍偷乱拍精品| 亚洲美女黄色片| 欧美日韩另类字幕中文| 亚洲精品免费网站| 亚洲视频免费| 国产精品视频一| 欧美一级二级三级蜜桃| 久久久精品国产一区二区三区| 国产亚洲精久久久久久| 久久精品一区二区三区不卡牛牛| 久久一区精品| 亚洲国产日韩在线一区模特| 欧美jizz19hd性欧美| 亚洲国产激情| 亚洲一区二区三区免费视频| 国产精品午夜在线观看| 欧美影院成年免费版| 久久夜色精品国产欧美乱极品 | 欧美激情久久久久| 一本久久知道综合久久| 欧美中文字幕在线播放| 国产真实精品久久二三区| 美女露胸一区二区三区| 日韩视频一区二区在线观看 | 9国产精品视频| 国产女主播一区二区| 蜜桃av一区二区| 一区二区三区视频在线播放| 久久久久久久久久久久久女国产乱 | 国产色爱av资源综合区| 免费成人黄色片| 在线一区亚洲| 欧美成人精品不卡视频在线观看| 亚洲精品一区二区三区av| 国产精品久久久久毛片大屁完整版| 欧美一区二区三区在线观看| 欧美激情在线| 欧美一级艳片视频免费观看| 亚洲电影观看| 国产精品午夜电影| 欧美a级一区| 欧美中文在线免费| 亚洲靠逼com| 欧美成va人片在线观看| 亚洲免费影视第一页| 在线电影国产精品| 国产精品免费aⅴ片在线观看| 另类专区欧美制服同性| 亚洲一区二区在线免费观看视频 | 午夜精品在线看| 91久久国产自产拍夜夜嗨| 久久精品主播| 亚洲制服欧美中文字幕中文字幕| 亚洲国产欧美精品| 国内精品久久久久影院薰衣草| 欧美日韩网站| 欧美激情一区二区三区四区| 久久久久久国产精品一区| 亚洲欧美国产视频| 99精品国产热久久91蜜凸| 欧美激情五月| 欧美freesex交免费视频| 久久精品中文| 欧美中日韩免费视频| 亚洲欧美日韩一区二区| 一区二区日韩精品| 亚洲伦理在线免费看| 亚洲第一在线综合网站| 国产综合网站| 国模精品一区二区三区色天香| 国产精品一区二区男女羞羞无遮挡 | 女同性一区二区三区人了人一| 久久精品国产清高在天天线| 久久国产欧美精品| 久久精品国产清自在天天线| 欧美在线一级va免费观看| 欧美一级电影久久| 久久国产精品久久久久久久久久| 先锋a资源在线看亚洲| 午夜欧美大片免费观看| 亚洲欧美视频在线观看| 午夜精品久久久久久久久久久| 亚洲欧美激情诱惑| 性色一区二区| 久久人人超碰| 欧美大学生性色视频| 欧美另类69精品久久久久9999| 欧美精品二区| 国产精品久久精品日日| 国产精品资源在线观看| 韩国福利一区| 亚洲激情视频在线| 夜夜夜久久久| 欧美亚洲色图校园春色| 久久久久成人精品| 欧美国产日产韩国视频| 亚洲麻豆av| 亚洲欧美成人| 久久嫩草精品久久久久| 欧美精品aa| 国产女人精品视频| 永久免费精品影视网站| 一本久久a久久精品亚洲| 亚洲欧美日本日韩| 久久影视精品| 亚洲乱码视频| 欧美一二区视频| 欧美大片在线观看一区二区| 国产精品国产a级| 极品少妇一区二区三区精品视频 | 亚洲国产视频a| 亚洲一区二区免费| 久久视频在线视频| 99xxxx成人网| 久久久免费观看视频| 欧美日韩视频不卡| 国产一区二区三区四区五区美女| 亚洲人成久久| 久久国产综合精品| 亚洲三级电影全部在线观看高清| 亚洲在线视频观看| 欧美高清一区| 国模私拍一区二区三区| 一区二区三区免费观看| 免费不卡在线观看| 亚洲欧美伊人| 欧美视频中文一区二区三区在线观看| 激情丁香综合| 午夜在线不卡| 亚洲美女区一区| 老牛国产精品一区的观看方式| 国产精品欧美风情| 在线亚洲精品| 亚洲高清免费在线| 久久久久欧美| 国产一区二区三区免费不卡| 亚洲欧美bt| 日韩小视频在线观看专区| 免费国产一区二区| 在线视频国产日韩|