11 #define MWFOURCC(ch0, ch1, ch2, ch3) \ 12 ((uint32_t)(uint8_t)(ch0) | ((uint32_t)(uint8_t)(ch1) << 8) | \ 13 ((uint32_t)(uint8_t)(ch2) << 16) | ((uint32_t)(uint8_t)(ch3) << 24)) 16 #define MWFOURCC_UNK MWFOURCC('U', 'N', 'K', 'N') 19 #define MWFOURCC_GREY MWFOURCC('G', 'R', 'E', 'Y') // Y0, Y1, Y2, ... 20 #define MWFOURCC_Y800 MWFOURCC('Y', '8', '0', '0') // = GREY 21 #define MWFOURCC_Y8 MWFOURCC('Y', '8', ' ', ' ') // = GREY 24 #define MWFOURCC_Y16 MWFOURCC('Y', '1', '6', ' ') // Y0, Y1, Y2 27 #define MWFOURCC_RGB15 MWFOURCC('R', 'G', 'B', '5') // R0, G0, B0, A0, ... 28 #define MWFOURCC_RGB16 MWFOURCC('R', 'G', 'B', '6') // R0, G0, B0, R1, ... 29 #define MWFOURCC_RGB24 MWFOURCC('R', 'G', 'B', ' ') // R0, G0, B0, R1, ... 30 #define MWFOURCC_RGBA MWFOURCC('R', 'G', 'B', 'A') // R0, G0, B0, A0, R1, ... 31 #define MWFOURCC_ARGB MWFOURCC('A', 'R', 'G', 'B') // A0, R0, G0, B0, A1, ... 33 #define MWFOURCC_BGR15 MWFOURCC('B', 'G', 'R', '5') // B0, G0, R0, A0, ... 34 #define MWFOURCC_BGR16 MWFOURCC('B', 'G', 'R', '6') // B0, G0, R0, B1, ... 35 #define MWFOURCC_BGR24 MWFOURCC('B', 'G', 'R', ' ') // B0, G0, R0, B1, ... 36 #define MWFOURCC_BGRA MWFOURCC('B', 'G', 'R', 'A') // B0, G0, R0, A0, B1, ... 37 #define MWFOURCC_ABGR MWFOURCC('A', 'B', 'G', 'R') // A0, B0, G0, R0, A1, ... 40 #define MWFOURCC_NV16 MWFOURCC('N', 'V', '1', '6') // Y Plane, UV Plane 41 #define MWFOURCC_NV61 MWFOURCC('N', 'V', '6', '1') // Y Plane, VU Plane 42 #define MWFOURCC_I422 MWFOURCC('I', '4', '2', '2') // Y Plane, U Plane, V Plane 43 #define MWFOURCC_YV16 MWFOURCC('Y', 'V', '1', '6') // Y Plane, V Plane, U Plane 46 #define MWFOURCC_YUY2 MWFOURCC('Y', 'U', 'Y', '2') // Y0, U01, Y1, V01, ... 47 #define MWFOURCC_YUYV MWFOURCC('Y', 'U', 'Y', 'V') // = YUY2 48 #define MWFOURCC_UYVY MWFOURCC('U', 'Y', 'V', 'Y') // U01, Y0, V01, Y1, ... 50 #define MWFOURCC_YVYU MWFOURCC('Y', 'V', 'Y', 'U') // Y0, V01, Y1, U01, ... 51 #define MWFOURCC_VYUY MWFOURCC('V', 'Y', 'U', 'Y') // V01, Y0, U01, Y1, ... 54 #define MWFOURCC_I420 MWFOURCC('I', '4', '2', '0') // Y Plane, U Plane, V Plane 55 #define MWFOURCC_IYUV MWFOURCC('I', 'Y', 'U', 'V') // = I420 56 #define MWFOURCC_NV12 MWFOURCC('N', 'V', '1', '2') // Y Plane, UV Plane 58 #define MWFOURCC_YV12 MWFOURCC('Y', 'V', '1', '2') // Y Plane, V Plane, U Plane 59 #define MWFOURCC_NV21 MWFOURCC('N', 'V', '2', '1') // Y Plane, VU Plane 62 #define MWFOURCC_P010 MWFOURCC('P', '0', '1', '0') // Y Plane, UV Plane 65 #define MWFOURCC_P210 MWFOURCC('P', '2', '1', '0') // Y Plane, UV Plane 68 #define MWFOURCC_IYU2 MWFOURCC('I', 'Y', 'U', '2') // U0, Y0, V0, U1, Y1, V1, ... 69 #define MWFOURCC_V308 MWFOURCC('v', '3', '0', '8') // V0, Y0, U0, V1, Y1, U1, ... 72 #define MWFOURCC_AYUV MWFOURCC('A', 'Y', 'U', 'V') // A0, Y0, U0, V0, ... 73 #define MWFOURCC_UYVA MWFOURCC('U', 'Y', 'V', 'A') // U0, Y0, V0, A0, U1, Y1, ... 74 #define MWFOURCC_V408 MWFOURCC('v', '4', '0', '8') // = MWFOURCC_UYVA 75 #define MWFOURCC_VYUA MWFOURCC('V', 'Y', 'U', 'A') // V0, Y0, U0, A0, V1, Y1, ... 78 #define MWFOURCC_Y410 MWFOURCC('Y', '4', '1', '0') // U0, Y0, V0, A0, ... 79 #define MWFOURCC_V410 MWFOURCC('v', '4', '1', '0') // A0, U0, Y0, V0, ... 82 #define MWFOURCC_RGB10 MWFOURCC('R', 'G', '1', '0') // R0, G0, B0, A0, ... 83 #define MWFOURCC_BGR10 MWFOURCC('B', 'G', '1', '0') // B0, G0, R0, A0, ... 200 cbLine = (cx * nBpp) / 8;
214 return (cbLine + dwAlign - 1) & ~(dwAlign - 1);
228 uint32_t cbLine = (cx * nBpp) / 8;
229 if (cbStride < cbLine)
232 return cbStride * cy;
235 if (cbStride < (uint32_t)cx)
244 if ((cbStride & 1) || (cy & 1))
246 return cbStride * cy * 3 / 2;
253 return cbStride * cy * 2;
255 if ((cbStride & 3) || (cy & 1))
257 return cbStride * cy * 3 / 2;
261 return cbStride * cy * 2;
268 inline bool FOURCC_IsMask(
const uint32_t * pdwMasks, uint32_t dwRedMask, uint32_t dwGreenMask, uint32_t dwBlueMask)
270 return ((pdwMasks[0] == dwRedMask) && (pdwMasks[1] == dwGreenMask) && (pdwMasks[2] == dwBlueMask));
#define MWFOURCC_Y410
Y410.
Definition: MWFOURCC.h:636
#define MWFOURCC_YUY2
YUY2.
Definition: MWFOURCC.h:290
#define MWFOURCC_Y800
8bits Grey
Definition: MWFOURCC.h:45
#define MWFOURCC_BGR15
16bits B5G5R5A1
Definition: MWFOURCC.h:133
#define MWFOURCC_V408
V408.
Definition: MWFOURCC.h:593
#define MWFOURCC_IYUV
IYUV.
Definition: MWFOURCC.h:398
#define MWFOURCC_NV16
NV16.
Definition: MWFOURCC.h:199
#define MWFOURCC_P010
P010.
Definition: MWFOURCC.h:496
#define MWFOURCC_YV12
YV12.
Definition: MWFOURCC.h:448
#define MWFOURCC_GREY
8bits Grey
Definition: MWFOURCC.h:34
#define MWFOURCC_VYUY
VYUY.
Definition: MWFOURCC.h:346
#define MWFOURCC_BGRA
32bits B8G8R8A8
Definition: MWFOURCC.h:166
#define MWFOURCC_ARGB
32bits A8R8G8B8
Definition: MWFOURCC.h:122
#define MWFOURCC_AYUV
AYUV.
Definition: MWFOURCC.h:565
#define MWFOURCC_NV12
NV12.
Definition: MWFOURCC.h:422
BOOLEAN FOURCC_IsPacked(DWORD dwFOURCC)
Determines whether the color format is packed.
Definition: MWFOURCC.h:709
BOOLEAN FOURCC_IsRGB(DWORD dwFOURCC)
Determines whether the color format is RGB.
Definition: MWFOURCC.h:680
#define MWFOURCC_RGB15
16bits R5G5B5A1
Definition: MWFOURCC.h:78
#define MWFOURCC_UYVY
UYVY.
Definition: MWFOURCC.h:318
#define MWFOURCC_IYU2
IYU2.
Definition: MWFOURCC.h:536
#define MWFOURCC_UYVA
UYVA.
Definition: MWFOURCC.h:579
#define MWFOURCC_I420
I420.
Definition: MWFOURCC.h:372
#define MWFOURCC_V308
V308.
Definition: MWFOURCC.h:550
#define MWFOURCC_RGB16
16bits R5G6B5
Definition: MWFOURCC.h:89
#define MWFOURCC_BGR10
BGR10.
Definition: MWFOURCC.h:672
#define MWFOURCC_RGB10
RGB10.
Definition: MWFOURCC.h:661
#define MWFOURCC_BGR24
24bits B8G8R8
Definition: MWFOURCC.h:155
DWORD FOURCC_CalcImageSize(DWORD dwFOURCC, int cx, int cy, DWORD cbStride)
Counts the number of bytes that a frame takes, depending on the color format, resolution and the line...
Definition: MWFOURCC.h:846
#define MWFOURCC_P210
P210.
Definition: MWFOURCC.h:522
#define MWFOURCC_RGB24
24bits R8G8B8
Definition: MWFOURCC.h:100
#define MWFOURCC_ABGR
32bits A8B8G8R8
Definition: MWFOURCC.h:177
#define MWFOURCC_VYUA
VYUA.
Definition: MWFOURCC.h:607
DWORD FOURCC_CalcMinStride(DWORD dwFOURCC, int cx, DWORD dwAlign)
Counts the number of bytes that a line data of image takes, depending on the width of image and the c...
Definition: MWFOURCC.h:804
#define MWFOURCC_I422
I422.
Definition: MWFOURCC.h:248
#define MWFOURCC_Y8
8bits Grey
Definition: MWFOURCC.h:56
#define MWFOURCC_YUYV
YUYV.
Definition: MWFOURCC.h:304
int FOURCC_GetBpp(DWORD dwFOURCC)
Gets the bits that pixel of color format takes.
Definition: MWFOURCC.h:737
#define MWFOURCC_NV61
NV61.
Definition: MWFOURCC.h:221
#define MWFOURCC_YV16
YV16.
Definition: MWFOURCC.h:275
#define MWFOURCC_RGBA
32bits R8G8B8A8
Definition: MWFOURCC.h:111
#define MWFOURCC_BGR16
16bits B5G6R5
Definition: MWFOURCC.h:144
BOOLEAN FOURCC_IsMask(const DWORD *pdwMasks, DWORD dwRedMask, DWORD dwGreenMask, DWORD dwBlueMask)
Determins whether the mask is the same as specified color format.
Definition: MWFOURCC.h:938
#define MWFOURCC_NV21
NV21.
Definition: MWFOURCC.h:472
#define MWFOURCC_V410
V410.
Definition: MWFOURCC.h:650
#define MWFOURCC_YVYU
YVYU.
Definition: MWFOURCC.h:332
#define MWFOURCC_Y16
16bits Grey
Definition: MWFOURCC.h:67