TwiceAsNice  2019-02-18
Functions
Color space conversion functions

Colour ConVerT: going from one colour space to another. More...

Functions

void ccvt_420p_bgr24 (int width, int height, const void *src, void *dst)
 4:2:0 YUV planar to RGB/BGR More...
 
void ccvt_420p_rgb24 (int width, int height, const void *src, void *dst)
 4:2:0 YUV planar to RGB/BGR More...
 
void ccvt_420p_bgr32 (int width, int height, const void *src, void *dst)
 4:2:0 YUV planar to RGB/BGR More...
 
void ccvt_420p_rgb32 (int width, int height, const void *src, void *dst)
 4:2:0 YUV planar to RGB/BGR More...
 
void ccvt_yuyv_bgr32 (int width, int height, const void *src, void *dst)
 4:2:2 YUYV interlaced to RGB/BGR More...
 
void ccvt_yuyv_bgr24 (int width, int height, const void *src, void *dst)
 4:2:2 YUYV interlaced to BGR24 More...
 
void ccvt_yuyv_rgb24 (int width, int height, const void *src, void *dst)
 4:2:2 YUYV interlaced to RGB24 More...
 
void ccvt_yuyv_420p (int width, int height, const void *src, void *dsty, void *dstu, void *dstv)
 4:2:2 YUYV interlaced to 4:2:0 YUV planar More...
 
void ccvt_rgb24_420p (int width, int height, const void *src, void *dsty, void *dstu, void *dstv)
 RGB/BGR to 4:2:0 YUV planar. More...
 
void ccvt_bgr24_420p (int width, int height, const void *src, void *dsty, void *dstu, void *dstv)
 RGB/BGR to 4:2:0 YUV planar. More...
 
void ccvt_bgr24_bgr32 (int width, int height, const void *const src, void *const dst)
 RGB/BGR to RGB/BGR. More...
 
void ccvt_bgr24_rgb32 (int width, int height, const void *const src, void *const dst)
 RGB/BGR to RGB/BGR. More...
 
void ccvt_bgr32_bgr24 (int width, int height, const void *const src, void *const dst)
 RGB/BGR to RGB/BGR. More...
 
void ccvt_bgr32_rgb24 (int width, int height, const void *const src, void *const dst)
 RGB/BGR to RGB/BGR. More...
 
void ccvt_rgb24_bgr32 (int width, int height, const void *const src, void *const dst)
 RGB/BGR to RGB/BGR. More...
 
void ccvt_rgb24_rgb32 (int width, int height, const void *const src, void *const dst)
 RGB/BGR to RGB/BGR. More...
 
void ccvt_rgb32_bgr24 (int width, int height, const void *const src, void *const dst)
 RGB/BGR to RGB/BGR. More...
 
void ccvt_rgb32_rgb24 (int width, int height, const void *const src, void *const dst)
 RGB/BGR to RGB/BGR. More...
 
int RGB2YUV (int x_dim, int y_dim, void *bmp, void *y_out, void *u_out, void *v_out, int flip)
 RGB to YUV. More...
 
int BGR2YUV (int x_dim, int y_dim, void *bmp, void *y_out, void *u_out, void *v_out, int flip)
 BGR to YUV. More...
 
int mjpegtoyuv420p (unsigned char *map, unsigned char *cap_map, int width, int height, unsigned int size)
 mjpegtoyuv420p MPEG to YUV 420 P More...
 
void bayer2rgb24 (unsigned char *dst, unsigned char *src, long int WIDTH, long int HEIGHT)
 Bayer 8bit to RGB 24. More...
 
void bayer16_2_rgb24 (unsigned short *dst, unsigned short *src, long int WIDTH, long int HEIGHT)
 Bayer 16 bit to RGB 24. More...
 
void bayer_rggb_2rgb24 (unsigned char *dst, unsigned char *srcc, long int WIDTH, long int HEIGHT)
 Bayer RGGB to RGB 24. More...
 
void bayer_grbg_to_rgb24 (unsigned char *dst, unsigned char *srcc, long int WIDTH, long int HEIGHT)
 

Detailed Description

Colour ConVerT: going from one colour space to another.

Format descriptions:
420i = "4:2:0 interlaced"
YYYY UU YYYY UU even lines
YYYY VV YYYY VV odd lines
U/V data is subsampled by 2 both in horizontal and vertical directions, and intermixed with the Y values.

420p = "4:2:0 planar"
YYYYYYYY N lines
UUUU N/2 lines
VVVV N/2 lines
U/V is again subsampled, but all the Ys, Us and Vs are placed together in separate buffers. The buffers may be placed in one piece of contiguous memory though, with Y buffer first, followed by U, followed by V.

yuyv = "4:2:2 interlaced"
YUYV YUYV YUYV ... N lines
The U/V data is subsampled by 2 in horizontal direction only.

bgr24 = 3 bytes per pixel, in the order Blue Green Red (whoever came up with that idea...)
rgb24 = 3 bytes per pixel, in the order Red Green Blue (which is sensible)
rgb32 = 4 bytes per pixel, in the order Red Green Blue Alpha, with Alpha really being a filler byte (0)
bgr32 = last but not least, 4 bytes per pixel, in the order Blue Green Red Alpha, Alpha again a filler byte (0)

Function Documentation

◆ bayer16_2_rgb24()

void bayer16_2_rgb24 ( unsigned short *  dst,
unsigned short *  src,
long int  WIDTH,
long int  HEIGHT 
)

Bayer 16 bit to RGB 24.

◆ bayer2rgb24()

void bayer2rgb24 ( unsigned char *  dst,
unsigned char *  src,
long int  WIDTH,
long int  HEIGHT 
)

Bayer 8bit to RGB 24.

◆ bayer_grbg_to_rgb24()

void bayer_grbg_to_rgb24 ( unsigned char *  dst,
unsigned char *  srcc,
long int  WIDTH,
long int  HEIGHT 
)

◆ bayer_rggb_2rgb24()

void bayer_rggb_2rgb24 ( unsigned char *  dst,
unsigned char *  srcc,
long int  WIDTH,
long int  HEIGHT 
)

Bayer RGGB to RGB 24.

◆ BGR2YUV()

int BGR2YUV ( int  x_dim,
int  y_dim,
void *  bmp,
void *  y_out,
void *  u_out,
void *  v_out,
int  flip 
)

BGR to YUV.

◆ ccvt_420p_bgr24()

void ccvt_420p_bgr24 ( int  width,
int  height,
const void *  src,
void *  dst 
)

4:2:0 YUV planar to RGB/BGR

◆ ccvt_420p_bgr32()

void ccvt_420p_bgr32 ( int  width,
int  height,
const void *  src,
void *  dst 
)

4:2:0 YUV planar to RGB/BGR

◆ ccvt_420p_rgb24()

void ccvt_420p_rgb24 ( int  width,
int  height,
const void *  src,
void *  dst 
)

4:2:0 YUV planar to RGB/BGR

◆ ccvt_420p_rgb32()

void ccvt_420p_rgb32 ( int  width,
int  height,
const void *  src,
void *  dst 
)

4:2:0 YUV planar to RGB/BGR

◆ ccvt_bgr24_420p()

void ccvt_bgr24_420p ( int  width,
int  height,
const void *  src,
void *  dsty,
void *  dstu,
void *  dstv 
)

RGB/BGR to 4:2:0 YUV planar.

◆ ccvt_bgr24_bgr32()

void ccvt_bgr24_bgr32 ( int  width,
int  height,
const void *const  src,
void *const  dst 
)

RGB/BGR to RGB/BGR.

◆ ccvt_bgr24_rgb32()

void ccvt_bgr24_rgb32 ( int  width,
int  height,
const void *const  src,
void *const  dst 
)

RGB/BGR to RGB/BGR.

◆ ccvt_bgr32_bgr24()

void ccvt_bgr32_bgr24 ( int  width,
int  height,
const void *const  src,
void *const  dst 
)

RGB/BGR to RGB/BGR.

◆ ccvt_bgr32_rgb24()

void ccvt_bgr32_rgb24 ( int  width,
int  height,
const void *const  src,
void *const  dst 
)

RGB/BGR to RGB/BGR.

◆ ccvt_rgb24_420p()

void ccvt_rgb24_420p ( int  width,
int  height,
const void *  src,
void *  dsty,
void *  dstu,
void *  dstv 
)

RGB/BGR to 4:2:0 YUV planar.

◆ ccvt_rgb24_bgr32()

void ccvt_rgb24_bgr32 ( int  width,
int  height,
const void *const  src,
void *const  dst 
)

RGB/BGR to RGB/BGR.

◆ ccvt_rgb24_rgb32()

void ccvt_rgb24_rgb32 ( int  width,
int  height,
const void *const  src,
void *const  dst 
)

RGB/BGR to RGB/BGR.

◆ ccvt_rgb32_bgr24()

void ccvt_rgb32_bgr24 ( int  width,
int  height,
const void *const  src,
void *const  dst 
)

RGB/BGR to RGB/BGR.

◆ ccvt_rgb32_rgb24()

void ccvt_rgb32_rgb24 ( int  width,
int  height,
const void *const  src,
void *const  dst 
)

RGB/BGR to RGB/BGR.

◆ ccvt_yuyv_420p()

void ccvt_yuyv_420p ( int  width,
int  height,
const void *  src,
void *  dsty,
void *  dstu,
void *  dstv 
)

4:2:2 YUYV interlaced to 4:2:0 YUV planar

◆ ccvt_yuyv_bgr24()

void ccvt_yuyv_bgr24 ( int  width,
int  height,
const void *  src,
void *  dst 
)

4:2:2 YUYV interlaced to BGR24

◆ ccvt_yuyv_bgr32()

void ccvt_yuyv_bgr32 ( int  width,
int  height,
const void *  src,
void *  dst 
)

4:2:2 YUYV interlaced to RGB/BGR

4:2:2 YUYV interlaced to RGB/BGR

◆ ccvt_yuyv_rgb24()

void ccvt_yuyv_rgb24 ( int  width,
int  height,
const void *  src,
void *  dst 
)

4:2:2 YUYV interlaced to RGB24

◆ mjpegtoyuv420p()

int mjpegtoyuv420p ( unsigned char *  map,
unsigned char *  cap_map,
int  width,
int  height,
unsigned int  size 
)

mjpegtoyuv420p MPEG to YUV 420 P

Return values -1 on fatal error 0 on success 2 if jpeg lib threw a "corrupt jpeg data" warning. in this case, "a damaged output image is likely."

Copyright 2000 by Jeroen Vreeken (pe1rx.nosp@m.q@am.nosp@m.sat.o.nosp@m.rg) 2006 by Krzysztof Blaszkowski (kb@sy.nosp@m.smik.nosp@m.ro.co.nosp@m.m.pl) 2007 by Angel Carpinteo (ack@t.nosp@m.elef.nosp@m.onica.nosp@m..net)

◆ RGB2YUV()

int RGB2YUV ( int  x_dim,
int  y_dim,
void *  bmp,
void *  y_out,
void *  u_out,
void *  v_out,
int  flip 
)

RGB to YUV.