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

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>
            欧美精品免费观看二区| 亚洲美女淫视频| 一本在线高清不卡dvd| 亚洲精品乱码视频| 亚洲精品国精品久久99热一| 亚洲免费av电影| 亚洲视频在线观看三级| 亚洲一区中文字幕在线观看| 亚洲欧美激情四射在线日| 亚洲欧美日韩精品| 久久久综合香蕉尹人综合网| 欧美va亚洲va国产综合| 亚洲国产精品www| 欧美日韩ab| 欧美三级电影一区| 国产亚洲一区二区在线观看| 精品二区视频| 一本色道久久| 欧美在线观看一二区| 蜜桃av一区| 夜夜夜精品看看| 久久riav二区三区| 欧美精品二区| 国内精品久久久久久久97牛牛| 亚洲电影欧美电影有声小说| 一区二区三区色| 久久三级福利| 一区二区不卡在线视频 午夜欧美不卡'| 欧美日韩亚洲另类| 久久久噜久噜久久综合| 欧美日本在线一区| 国内精品伊人久久久久av影院 | 女女同性女同一区二区三区91| 欧美精品久久久久久久| 国产精品五月天| 亚洲美女色禁图| 久久婷婷成人综合色| 日韩视频二区| 欧美插天视频在线播放| 黑人巨大精品欧美一区二区 | 一区二区三区在线观看欧美| 99热精品在线观看| 久久综合成人精品亚洲另类欧美| 夜夜嗨av一区二区三区| 蜜桃伊人久久| 国内成人精品2018免费看 | 美女任你摸久久| 国产精品你懂的在线| 亚洲激情女人| 欧美成人免费全部观看天天性色| 午夜精品福利视频| 国产精品乱子乱xxxx| 99精品视频一区| 亚洲精品日韩激情在线电影| 卡通动漫国产精品| 一区二区三区在线不卡| 另类专区欧美制服同性| 久久国产精彩视频| 狠狠综合久久av一区二区老牛| 欧美自拍偷拍午夜视频| 亚洲影院一区| 国产欧美日韩亚洲精品| 亚洲欧美日韩国产精品| 亚洲精品视频免费| 欧美日韩91| 亚洲一卡久久| 国产精品手机视频| 久久精品电影| 午夜精品久久久久| 狠狠色综合色区| 欧美福利在线| 欧美成人免费全部| av成人免费| 亚洲天天影视| 国产精品videosex极品| 亚洲欧美日韩在线高清直播| 亚洲欧美精品suv| 国产一区二区三区电影在线观看 | 亚洲一区二区动漫| 先锋影音国产精品| 99riav1国产精品视频| 欧美午夜视频在线| 欧美一级一区| 久久久久国产精品人| 在线欧美影院| 亚洲精品日韩综合观看成人91| 欧美日韩的一区二区| 在线一区日本视频| 亚洲欧美一区二区三区久久| 伊人色综合久久天天| 亚洲第一天堂av| 欧美精品久久一区| 欧美亚洲自偷自偷| 老鸭窝亚洲一区二区三区| 亚洲精品黄网在线观看| 夜久久久久久| 在线观看欧美视频| av成人激情| 韩国免费一区| 亚洲一区二区三区免费在线观看| 激情欧美一区| 亚洲综合视频在线| 亚洲精品视频一区| 久久精品导航| 亚洲综合色婷婷| 美女黄网久久| 久久精品人人爽| 欧美视频中文在线看 | 亚洲精品1区2区| 国产乱人伦精品一区二区 | 性欧美激情精品| 亚洲国产岛国毛片在线| 宅男噜噜噜66一区二区66| 一区二区在线看| 亚洲午夜一区| 99视频在线观看一区三区| 欧美专区亚洲专区| 午夜一级久久| 欧美网站在线观看| 亚洲黄色av| 亚洲欧洲日产国码二区| 久久久久久久久久码影片| 亚久久调教视频| 亚洲午夜精品久久久久久浪潮| 久久综合精品国产一区二区三区| 午夜亚洲影视| 国产精品国产精品| 亚洲开发第一视频在线播放| 亚洲福利一区| 久久久噜噜噜久久中文字免| 欧美一区二区高清| 欧美三级在线视频| 一本色道久久综合一区| 一级日韩一区在线观看| 欧美激情一区二区三级高清视频| 蜜臀av性久久久久蜜臀aⅴ四虎| 国产一区999| 久久精品国产第一区二区三区| 久久欧美肥婆一二区| 国产午夜精品福利| 欧美专区日韩专区| 欧美日韩精品一区二区在线播放| 亚洲成色777777在线观看影院| 午夜精品婷婷| 久久久国产一区二区| 国产日韩欧美综合精品| 欧美亚洲日本一区| 老鸭窝毛片一区二区三区| 激情五月综合色婷婷一区二区| 久久精品人人做人人爽| 久久久久久999| 永久555www成人免费| 久久一区二区三区四区五区| 麻豆精品在线观看| 亚洲人成在线观看网站高清| 欧美理论在线播放| 亚洲免费网址| 欧美jizz19性欧美| 日韩亚洲精品在线| 国产精品毛片| 久久久久久午夜| 亚洲美女毛片| 久久久久久电影| 日韩视频不卡| 国产亚洲欧美一区二区三区| 男男成人高潮片免费网站| 亚洲激情一区二区| 欧美一级久久久久久久大片| 一区二区三区自拍| 欧美三级午夜理伦三级中视频| 亚洲欧美日韩国产综合在线| 欧美成人国产一区二区| 亚洲一卡久久| 一区在线视频| 国产精品福利在线观看网址| 久久久青草婷婷精品综合日韩| 亚洲精品在线免费| 蜜月aⅴ免费一区二区三区| 亚洲图色在线| 亚洲国产成人精品女人久久久| 国产精品久久久久久久久久久久久久| 久久国产精品一区二区三区四区| 亚洲精品小视频| 免费欧美日韩国产三级电影| 久久久噜噜噜久久中文字幕色伊伊 | 国产欧美在线播放| 女主播福利一区| 午夜精品一区二区三区在线| 亚洲高清在线视频| 久久久www成人免费毛片麻豆| 999亚洲国产精| 一色屋精品视频在线看| 国产精品日韩电影| 欧美国产日韩精品| 久久久噜噜噜久久狠狠50岁| 香蕉久久夜色精品国产使用方法| 亚洲最新视频在线| 亚洲国产欧美久久| 欧美国产精品| 欧美成人免费大片|