|
|
|
@ -1546,6 +1546,7 @@ yuv420p_to_rgb24(int width, int height, |
|
|
|
|
//
|
|
|
|
|
/* Converts from interlaced YUV420 to RGB24. */ |
|
|
|
|
/* [FD] untested... */ |
|
|
|
|
#ifdef HAVE_CAMV4L |
|
|
|
|
static void |
|
|
|
|
yuv420_to_rgb24(int width, int height, |
|
|
|
|
unsigned char *pIn0, unsigned char *pOut0) |
|
|
|
@ -1590,6 +1591,7 @@ yuv420_to_rgb24(int width, int height, |
|
|
|
|
pOut += width * bytes; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
#endif //HAVE_CAMV4L
|
|
|
|
|
|
|
|
|
|
// Consider a YUV411P image of 8x2 pixels.
|
|
|
|
|
//
|
|
|
|
@ -1641,6 +1643,8 @@ yuv411p_to_rgb24(int width, int height, |
|
|
|
|
/* based on ccvt_yuyv_bgr32() from camstream */ |
|
|
|
|
#define SAT(c) \ |
|
|
|
|
if (c & (~255)) { if (c < 0) c = 0; else c = 255; } |
|
|
|
|
|
|
|
|
|
#ifdef HAVE_CAMV4L2 |
|
|
|
|
static void |
|
|
|
|
yuyv_to_rgb24 (int width, int height, unsigned char *src, unsigned char *dst) |
|
|
|
|
{ |
|
|
|
@ -1732,6 +1736,7 @@ uyvy_to_rgb24 (int width, int height, unsigned char *src, unsigned char *dst) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
#endif //HAVE_CAMV4L2
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_JPEG |
|
|
|
|
|
|
|
|
@ -1758,6 +1763,7 @@ mjpeg_to_rgb24 (int width, int height, |
|
|
|
|
* |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
#ifdef HAVE_CAMV4L2 |
|
|
|
|
static void bayer2rgb24(long int WIDTH, long int HEIGHT, unsigned char *src, unsigned char *dst) |
|
|
|
|
{ |
|
|
|
|
long int i; |
|
|
|
@ -1919,7 +1925,6 @@ static void sgbrg2rgb24(long int WIDTH, long int HEIGHT, unsigned char *src, uns |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define CLAMP(x) ((x)<0?0:((x)>255)?255:(x)) |
|
|
|
|
|
|
|
|
|
typedef struct { |
|
|
|
@ -2090,7 +2095,7 @@ static int sonix_decompress(int width, int height, unsigned char *inp, unsigned |
|
|
|
|
|
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#endif //HAVE_CAMV4L2
|
|
|
|
|
|
|
|
|
|
static IplImage* icvRetrieveFrameCAM_V4L( CvCaptureCAM_V4L* capture, int) { |
|
|
|
|
|
|
|
|
@ -2191,7 +2196,6 @@ static IplImage* icvRetrieveFrameCAM_V4L( CvCaptureCAM_V4L* capture, int) { |
|
|
|
|
(unsigned char*)(capture->buffers[capture->bufferIndex].start), |
|
|
|
|
(unsigned char*)capture->frame.imageData); |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
case PALETTE_UYVY: |
|
|
|
|
uyvy_to_rgb24(capture->form.fmt.pix.width, |
|
|
|
|
capture->form.fmt.pix.height, |
|
|
|
@ -2233,7 +2237,8 @@ static IplImage* icvRetrieveFrameCAM_V4L( CvCaptureCAM_V4L* capture, int) { |
|
|
|
|
#ifdef HAVE_CAMV4L |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
switch(capture->imageProperties.palette) { |
|
|
|
|
switch(capture->imageProperties.palette) |
|
|
|
|
{ |
|
|
|
|
case VIDEO_PALETTE_RGB24: |
|
|
|
|
memcpy((char *)capture->frame.imageData, |
|
|
|
|
(char *)(capture->memoryMap + capture->memoryBuffer.offsets[capture->bufferIndex]), |
|
|
|
|