Rediger

Del via


Uncompressed RGB Video Subtypes

[The feature associated with this page, DirectShow, is a legacy feature. It has been superseded by MediaPlayer, IMFMediaEngine, and Audio/Video Capture in Media Foundation. Those features have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer, IMFMediaEngine and Audio/Video Capture in Media Foundation instead of DirectShow, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The following subtypes define uncompressed RGB formats with no alpha channel.

Constant Description
MEDIASUBTYPE_RGB1
RGB, 1 bit per pixel (bpp), palettized
MEDIASUBTYPE_RGB4
RGB, 4 bpp, palettized
MEDIASUBTYPE_RGB8
RGB, 8 bpp, palettized
MEDIASUBTYPE_RGB555
RGB 555, 16 bpp
MEDIASUBTYPE_RGB565
RGB 565, 16 bpp
MEDIASUBTYPE_RGB24
RGB, 24 bpp
MEDIASUBTYPE_RGB32
RGB, 32 bpp

The following subtypes define uncompressed RGB formats with alpha channel.

Constant Description
MEDIASUBTYPE_ARGB1555
RGB 555 with alpha channel
MEDIASUBTYPE_ARGB32
RGB 32 with alpha channel
MEDIASUBTYPE_ARGB4444
16-bit RGB with alpha channel; 4 bits per channel
MEDIASUBTYPE_A2R10G10B10
32-bit RGB with alpha channel; 10 bits per RGB channel plus 2 bits for alpha.
MEDIASUBTYPE_A2B10G10R10
32-bit BGR with alpha channel; 10 bits per BGR channel plus 2 bits for alpha.

Remarks

For palettized formats, the color of each pixel is specified as an index into a palette. The palette must be included in the format block, following the BITMAPINFOHEADER structure. For non-palettized formats, the color of each pixel is specified directly; the memory layout depends on the bit depth:

  • RGB 555 uses the following memory layout:

    High-order byte:    Low-order byte: 
    X R R R R R G G     G G G B B B B B 
    
    X = Don't care, R = Red, G = Green, B = Blue
    
  • RGB 565 uses the following memory layout:

    High-order byte:    Low-order byte: 
    R R R R R G G G     G G G B B B B B 
    
  • For RGB 24, every pixel is an RGBTRIPLE. Each color is one byte, with a value from 0 to 255, inclusive. The memory layout is:

    Layout Layout Layout
    Byte 0 1 2
    Value Blue Green Red

     

  • For RGB 32, every pixel is an RGBQUAD. Each color is one byte, with a value from 0 to 255, inclusive. The memory layout is:

    Layout Layout Layout Layout
    Byte 0 1 2 3
    Value Blue Green Red Alpha or Don't Care

     

    If the subtype is MEDIASUBTYPE_ARGB32, byte 3 contains a value for the alpha channel. If the subtype is MEDIASUBTYPE_RGB32, byte 3 should be ignored.

  • A2R10G10B10 uses the following layout:

    Layout Layout Layout Layout
    Bit 0 - 9 10 - 19 20 - 29 30 - 31
    Value Blue Green Red Alpha

     

  • A2B10G10R10 uses the following layout:

    Layout Layout Layout Layout
    Bit 0 - 9 10 - 19 20 - 29 30 - 31
    Value Red Green Blue Alpha

     

Requirements

Requirement Value
Header
Dshow.h

See also

Video Subtypes

Working with Video Frames