Instrument Neutral Distributed Interface INDI  2.0.2
Macros | Functions
ccvt_misc.c File Reference
#include "ccvt.h"
#include "ccvt_types.h"
#include "jpegutils.h"
#include <stdlib.h>
#include <string.h>

Go to the source code of this file.

Macros

#define RGBBGR_BODY24(TIN, TOUT)
 
#define RGBBGR_BODY32(TIN, TOUT)
 

Functions

void InitLookupTable (void)
 
void ccvt_yuyv_bgr32 (int width, int height, const void *src, void *dst)
 
void ccvt_yuyv_bgr24 (int width, int height, const void *src, void *dst)
 
void ccvt_yuyv_rgb24 (int width, int height, const void *src, void *dst)
 
void ccvt_yuyv_420p (int width, int height, const void *src, void *dsty, void *dstu, void *dstv)
 
void bayer2rgb24 (unsigned char *dst, unsigned char *src, long int WIDTH, long int HEIGHT)
 
void bayer16_2_rgb24 (unsigned short *dst, unsigned short *src, long int WIDTH, long int HEIGHT)
 
void bayer_rggb_2rgb24 (unsigned char *dst, unsigned char *src, long int WIDTH, long int HEIGHT)
 
void bayer_grbg_to_rgb24 (unsigned char *dst, unsigned char *src, long int WIDTH, long int HEIGHT)
 
int mjpegtoyuv420p (unsigned char *map, unsigned char *cap_map, int width, int height, unsigned int size)
 mjpegtoyuv420p MPEG to YUV 420 P More...
 
int RGB2YUV (int x_dim, int y_dim, void *bmp, void *y_out, void *u_out, void *v_out, int flip)
 
int BGR2YUV (int x_dim, int y_dim, void *bmp, void *y_out, void *u_out, void *v_out, int flip)
 

Macro Definition Documentation

◆ RGBBGR_BODY24

#define RGBBGR_BODY24 (   TIN,
  TOUT 
)
Value:
void ccvt_##TIN##_##TOUT(int width, int height, const void *const src, void *dst) \
{ \
const PIXTYPE_##TIN *in = src; \
PIXTYPE_##TOUT *out = dst; \
int l, c, stride = 0; \
\
stride = width; \
out += ((height - 1) * width); \
stride *= 2; \
for (l = 0; l < height; l++) \
{ \
for (c = 0; c < width; c++) \
{ \
out->r = in->r; \
out->g = in->g; \
out->b = in->b; \
in++; \
out++; \
} \
out -= stride; \
} \
}

Definition at line 1025 of file ccvt_misc.c.

◆ RGBBGR_BODY32

#define RGBBGR_BODY32 (   TIN,
  TOUT 
)
Value:
void ccvt_##TIN##_##TOUT(int width, int height, const void *const src, void *dst) \
{ \
const PIXTYPE_##TIN *in = src; \
PIXTYPE_##TOUT *out = dst; \
int l, c, stride = 0; \
\
stride = width; \
out += ((height - 1) * width); \
stride *= 2; \
for (l = 0; l < height; l++) \
{ \
for (c = 0; c < width; c++) \
{ \
out->r = in->r; \
out->g = in->g; \
out->b = in->b; \
out->z = 0; \
in++; \
out++; \
} \
out -= stride; \
} \
}

Definition at line 1049 of file ccvt_misc.c.

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

Definition at line 357 of file ccvt_misc.c.

◆ bayer2rgb24()

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

Bayer 8bit to RGB 24

Definition at line 263 of file ccvt_misc.c.

◆ bayer_grbg_to_rgb24()

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

Definition at line 545 of file ccvt_misc.c.

◆ bayer_rggb_2rgb24()

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

Bayer RGGB to RGB 24

Definition at line 451 of file ccvt_misc.c.

◆ 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

Definition at line 894 of file ccvt_misc.c.

◆ 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

Definition at line 219 of file ccvt_misc.c.

◆ ccvt_yuyv_bgr24()

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

4:2:2 YUYV interlaced to BGR24

Definition at line 127 of file ccvt_misc.c.

◆ 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

Definition at line 81 of file ccvt_misc.c.

◆ ccvt_yuyv_rgb24()

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

4:2:2 YUYV interlaced to RGB24

Definition at line 173 of file ccvt_misc.c.

◆ InitLookupTable()

void InitLookupTable ( void  )

Definition at line 1003 of file ccvt_misc.c.

◆ 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)

Definition at line 721 of file ccvt_misc.c.

◆ 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

Definition at line 785 of file ccvt_misc.c.