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

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精品久久| 夜夜嗨av色一区二区不卡| 欧美日韩国产91| 亚洲免费影视| 久久福利资源站| 亚洲国产精品成人久久综合一区| 欧美黄色影院| 欧美午夜www高清视频| 欧美一区二区三区啪啪| 欧美一区午夜视频在线观看| 亚洲成色www8888| 亚洲日本理论电影| 国产精品v欧美精品∨日韩| 欧美在线日韩精品| 老司机一区二区| 亚洲在线观看视频| 久久国产视频网| 日韩视频二区| 欧美怡红院视频| 亚洲伦理在线| 久久av红桃一区二区小说| 亚洲三级视频| 久久国产精品99精品国产| 亚洲精品中文字幕女同| 性色av一区二区三区在线观看| 亚洲国产精品嫩草影院| 亚洲深夜av| 亚洲人成亚洲人成在线观看| 亚洲一区二区三区三| 亚洲韩国青草视频| 亚洲在线免费| 亚洲精品一品区二品区三品区| 亚洲专区免费| 一区二区av在线| 久久字幕精品一区| 欧美在线短视频| 欧美日韩在线一区| 亚洲福利视频一区| 国内久久视频| 亚洲影院免费观看| 一区二区三区欧美日韩| 黑人极品videos精品欧美裸| 欧美影片第一页| 久久久www成人免费毛片麻豆| 日韩视频免费| 久色婷婷小香蕉久久| 久久精品国产第一区二区三区最新章节 | 国产一区二区在线观看免费播放 | 午夜精品久久久久久久99热浪潮| 米奇777超碰欧美日韩亚洲| 久久久成人网| 国产日韩欧美高清| 亚洲综合电影一区二区三区| 欧美一区二区三区啪啪| 欧美成人有码| 女同性一区二区三区人了人一 | 欧美日韩性视频在线| 亚洲第一区在线| 亚洲国产另类久久久精品极度| 欧美一级理论片| 久久免费的精品国产v∧| 国产日韩欧美中文在线播放| 亚洲影院色无极综合| 午夜精品一区二区三区在线视 | 国产欧美视频在线观看| 亚洲在线国产日韩欧美| 欧美在线免费| 国产有码在线一区二区视频| 久久成人18免费观看| 玖玖国产精品视频| 有码中文亚洲精品| 噜噜爱69成人精品| 亚洲经典在线| 一区二区国产精品| 欧美三级中文字幕在线观看| 亚洲视频一区| 久久久久国色av免费看影院| 在线电影院国产精品| 欧美大片第1页| 亚洲免费观看在线观看| 欧美亚洲一区二区在线观看| 国内精品模特av私拍在线观看| 久久久久五月天| 亚洲国产高清一区| 亚洲免费视频在线观看| 国产亚洲日本欧美韩国| 两个人的视频www国产精品| 亚洲精品国产精品国产自| 亚洲女同同性videoxma| 国产一区二区三区成人欧美日韩在线观看| 久久精品国产69国产精品亚洲| 欧美激情视频免费观看| 亚洲永久精品大片| 伊人婷婷欧美激情| 欧美日韩一区免费| 久久精品视频导航| 亚洲精品视频免费在线观看| 香蕉成人伊视频在线观看| 亚洲电影在线播放| 国产精品久久久久久福利一牛影视| 久久精品一区蜜桃臀影院 | 午夜精品理论片| 亚洲国产成人在线| 国产精品毛片一区二区三区 | 亚洲图中文字幕| 欧美大色视频| 性欧美8khd高清极品| 亚洲精品三级| 一区视频在线看| 国产精品美女久久久免费| 欧美成人tv| 久久成人免费| 亚洲一级二级| 日韩一级黄色av| 欧美激情综合色| 久久综合给合久久狠狠狠97色69| 中日韩美女免费视频网址在线观看 | 亚洲综合精品自拍| 亚洲肉体裸体xxxx137| 国内外成人免费视频| 国产精品国产a级| 欧美久久久久久蜜桃| 久久全球大尺度高清视频| 亚洲欧美在线另类| 亚洲一级网站| 亚洲视频一二三| 99热在这里有精品免费| 亚洲清纯自拍| 亚洲国产高清一区| 欧美国产综合| 欧美福利网址| 欧美福利视频| 欧美激情偷拍| 亚洲成色777777在线观看影院| 久久裸体视频| 久久躁日日躁aaaaxxxx| 久久精品国产清自在天天线| 亚洲曰本av电影| 亚洲欧美另类在线观看| 亚洲欧美日韩综合国产aⅴ| 亚洲小说欧美另类婷婷| 亚洲深夜福利在线| 亚洲午夜精品久久久久久浪潮 | 国产在线精品二区| 国产亚洲成av人在线观看导航| 国产精品一区二区a| 国产精品视频午夜| 国产婷婷色一区二区三区四区| 国产精品亚洲激情| 国产欧美一级| 悠悠资源网亚洲青| 亚洲人成在线观看网站高清| 一本色道久久综合狠狠躁的推荐| 一区二区三区成人| 欧美亚洲色图校园春色| 久久婷婷蜜乳一本欲蜜臀| 欧美成人久久| 99成人在线| 亚洲欧美成人| 久久久午夜视频| 欧美久久久久久久| 国产精品亚洲综合天堂夜夜| 国产一区二区三区四区| 亚洲国产日韩精品| 亚洲视频在线一区观看| 久久精品国产亚洲5555| 欧美成人免费观看| 中文在线不卡视频| 久久久噜噜噜久久中文字幕色伊伊| 欧美成人免费大片| 国产精品久久久久久久久久三级 | 欧美精品七区| 国产伦精品一区二区三区高清版 | 亚洲品质自拍| 欧美专区18| 亚洲精品一二区| 久久国产精品久久久久久久久久 | 亚洲女女做受ⅹxx高潮| 浪潮色综合久久天堂| 国产精品高潮呻吟视频| 在线成人激情视频| 亚洲欧美日本另类| 欧美国产日韩视频| 午夜国产不卡在线观看视频| 男女av一区三区二区色多| 国产精品羞羞答答| 99精品欧美一区二区三区| 久久国产一区二区| 亚洲精品在线免费| 久久av免费一区| 国产精品美女一区二区在线观看| 亚洲福利视频免费观看| 久久精品欧美日韩精品| 这里是久久伊人| 欧美激情在线播放| 亚洲国产欧美一区二区三区久久| 欧美一区二区女人| 亚洲婷婷在线|