Partager via


D3DMBLENDOP

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

This enumeration provides values that identify functions for alpha blending operations. For more information, see Alpha Blending. These functions are all of the form

O = f(S,D)

where O, S and D are scaled pixel values for the output, source, and destination respectively. Each pixel value has a red, green, blue and alpha color channel, denoted by r, g, b, and a.

Syntax

typedef enum _D3DMBLENDOP {
  D3DMBLENDOP_ADD         = 1,
  D3DMBLENDOP_SUBTRACT    = 2,
  D3DMBLENDOP_REVSUBTRACT = 3,
  D3DMBLENDOP_MIN         = 4,
  D3DMBLENDOP_MAX         = 5,
  D3DMBLENDOP_FORCE_ULONG = 0x7fffffff,
} D3DMBLENDOP;

Elements

  • D3DMBLENDOP_ADD
    Indicates that the output pixel's color channels are the source and destination pixel's color channels added together. The results are bounded by the bit depth of the display surface.

    Or = Sr + Dr
    Og = Sg + Dg
    Ob = Sb + Db
    Oa = Sa + Da
    
  • D3DMBLENDOP_SUBTRACT
    Indicates that the output pixel's color channels are the destination pixel's color channel subtracted from the source pixel's color channels. The results are bounded by the bit depth of the display surface.

    Or = Sr – Dr
    Og = Sg – Dg
    Ob = Sb – Db
    Oa = Sa – Da
    
  • D3DMBLENDOP_REVSUBTRACT
    Indicates that the output pixel's color channels are the source pixel's color channel subtracted from the destination pixel's color channels. The results are bounded by the bit depth of the display surface.

    Or = Dr – Sr
    Og = Dg – Sg
    Ob = Db – Sb
    Oa = Da – Sa
    
  • D3DMBLENDOP_MIN
    Indicates that the output pixel's color channels are each set to the minimum of the corresponding source and destination pixel's color channels.

    Or = min(Sr, Dr)
    Og = min(Sg, Dg)
    Ob = min(Sb, Db)
    Oa = min(Sa, Da)
    
  • D3DMBLENDOP_MAX
    Indicates that the output pixel's color channels are each set to the maximum of the corresponding source and destination pixel's color channels.

    Or = max(Sr, Dr)
    Og = max(Sg, Dg)
    Ob = max(Sb, Db)
    Oa = max(Sa, Da)
    
  • D3DMBLENDOP_FORCE_ULONG
    Forces the compiler to interpret the enumeration as a ULONG value. This value is not used directly in Direct3D Mobile programming.

Remarks

This enumerated type defines values used by the D3DMRS_BLENDOP render state. For more information, see D3DMRENDERSTATETYPE.

The Direct3D Mobile blending functions, D3DMBLENDOP_MIN and D3DMBLENDOP_MAX, are not impacted by the blending factors enumerated in D3DMBLEND.

Requirements

Header d3dmtypes.h
Windows Embedded CE Windows CE 5.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

Direct3D Mobile Enumerations
D3DMRENDERSTATETYPE

Concepts

Alpha Blending