PlusLib  2.9.0
Software library for tracked ultrasound image acquisition, calibration, and processing.
Classes | Macros | Variables
PixelCodec.h File Reference
#include "PlusConfigure.h"
#include <iomanip>
Include dependency graph for PixelCodec.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  PixelCodec
 A utility class that contains static functions for converting between various pixel encodings. More...
 

Macros

#define BI_JPEG   4L
 
#define BI_RGB   0L
 
#define CLIP(t)   (((t)>255)?255:(((t)<0)?0:(t)))
 
#define FIX(a, b)   ((int)((a)*(1<<(b))))
 
#define FIXNUM   16
 
#define GET_B_FROM_YUV(y, u, v)   UNFIX((FIX(1.0, FIXNUM)*(y) + FIX(1.772, FIXNUM)*(u)), FIXNUM)
 
#define GET_G_FROM_YUV(y, u, v)   UNFIX((FIX(1.0, FIXNUM)*(y) + FIX(-0.344, FIXNUM)*(u) + FIX(-0.714, FIXNUM)*(v)), FIXNUM)
 
#define GET_R_FROM_YUV(y, u, v)   UNFIX((FIX(1.0, FIXNUM)*(y) + FIX(1.402, FIXNUM)*(v)), FIXNUM)
 
#define GET_U_FROM_RGB(r, g, b)   UNFIX((FIX(-0.169, FIXNUM)*(r) + FIX(-0.331, FIXNUM)*(g) + FIX(0.500, FIXNUM)*(b)), FIXNUM)
 
#define GET_V_FROM_RGB(r, g, b)   UNFIX((FIX(0.500, FIXNUM)*(r) + FIX(-0.419, FIXNUM)*(g) + FIX(-0.081, FIXNUM)*(b)), FIXNUM)
 
#define GET_Y_FROM_RGB(r, g, b)   UNFIX((FIX(0.299, FIXNUM)*(r) + FIX(0.587, FIXNUM)*(g) + FIX(0.114, FIXNUM)*(b)), FIXNUM)
 
#define ICCIRUV(x)   (((x)<<8)/224)
 
#define ICCIRY(x)   ((((x)-16)<<8)/219)
 
#define UNFIX(a, b)   ((a+(1<<(b-1)))>>(b))
 

Variables

static const long VTK_BI_UYVY = 0x59565955
 
static const long VTK_BI_YUY2 = 0x32595559
 

Macro Definition Documentation

◆ BI_JPEG

#define BI_JPEG   4L

Definition at line 38 of file PixelCodec.h.

◆ BI_RGB

#define BI_RGB   0L

Definition at line 35 of file PixelCodec.h.

◆ CLIP

#define CLIP (   t)    (((t)>255)?255:(((t)<0)?0:(t)))

Definition at line 22 of file PixelCodec.h.

◆ FIX

#define FIX (   a,
  b 
)    ((int)((a)*(1<<(b))))

Definition at line 16 of file PixelCodec.h.

◆ FIXNUM

#define FIXNUM   16

Definition at line 15 of file PixelCodec.h.

◆ GET_B_FROM_YUV

#define GET_B_FROM_YUV (   y,
  u,
  v 
)    UNFIX((FIX(1.0, FIXNUM)*(y) + FIX(1.772, FIXNUM)*(u)), FIXNUM)

Definition at line 25 of file PixelCodec.h.

◆ GET_G_FROM_YUV

#define GET_G_FROM_YUV (   y,
  u,
  v 
)    UNFIX((FIX(1.0, FIXNUM)*(y) + FIX(-0.344, FIXNUM)*(u) + FIX(-0.714, FIXNUM)*(v)), FIXNUM)

Definition at line 24 of file PixelCodec.h.

◆ GET_R_FROM_YUV

#define GET_R_FROM_YUV (   y,
  u,
  v 
)    UNFIX((FIX(1.0, FIXNUM)*(y) + FIX(1.402, FIXNUM)*(v)), FIXNUM)

Definition at line 23 of file PixelCodec.h.

◆ GET_U_FROM_RGB

#define GET_U_FROM_RGB (   r,
  g,
  b 
)    UNFIX((FIX(-0.169, FIXNUM)*(r) + FIX(-0.331, FIXNUM)*(g) + FIX(0.500, FIXNUM)*(b)), FIXNUM)

Definition at line 27 of file PixelCodec.h.

◆ GET_V_FROM_RGB

#define GET_V_FROM_RGB (   r,
  g,
  b 
)    UNFIX((FIX(0.500, FIXNUM)*(r) + FIX(-0.419, FIXNUM)*(g) + FIX(-0.081, FIXNUM)*(b)), FIXNUM)

Definition at line 28 of file PixelCodec.h.

◆ GET_Y_FROM_RGB

#define GET_Y_FROM_RGB (   r,
  g,
  b 
)    UNFIX((FIX(0.299, FIXNUM)*(r) + FIX(0.587, FIXNUM)*(g) + FIX(0.114, FIXNUM)*(b)), FIXNUM)

Definition at line 26 of file PixelCodec.h.

◆ ICCIRUV

#define ICCIRUV (   x)    (((x)<<8)/224)

Definition at line 19 of file PixelCodec.h.

◆ ICCIRY

#define ICCIRY (   x)    ((((x)-16)<<8)/219)

Definition at line 20 of file PixelCodec.h.

◆ UNFIX

#define UNFIX (   a,
  b 
)    ((a+(1<<(b-1)))>>(b))

Definition at line 17 of file PixelCodec.h.

Variable Documentation

◆ VTK_BI_UYVY

const long VTK_BI_UYVY = 0x59565955
static

Definition at line 31 of file PixelCodec.h.

◆ VTK_BI_YUY2

const long VTK_BI_YUY2 = 0x32595559
static

Definition at line 32 of file PixelCodec.h.