YARP  2.3.70
Yet Another Robot Platform
ImageCopy.cpp File Reference
#include <yarp/os/Log.h>
#include <yarp/sig/Image.h>
#include <yarp/sig/IplImage.h>
#include <cstring>
#include <cstdio>
+ Include dependency graph for ImageCopy.cpp:

Go to the source code of this file.

Macros

#define DBG   if(0)
 
#define VALID_PIXEL(x)   ((x>255)?255:((x<0)?0:x))
 
#define SPECIAL_COPY_BEGIN   static void YARPDummyCopyPixel() {
 
#define SPECIAL_COPY(id1, id2)   } static inline void CopyPixel(const Def_##id1 *src, Def_##id2 *dest) {
 
#define SPECIAL_COPY_END   }
 
#define HASH(id1, id2)   ((int)(((int)(id1%65537))*11+((long int)(id2))))
 
#define HANDLE_CASE(len, x1, T1, q1, o1, x2, T2, q2, o2)   CopyPixels((T1*)x1,q1,(T2*)x2,q2,w,h,o1!=o2);
 
#define MAKE_CASE(id1, id2)   case HASH(id1,id2): HANDLE_CASE(len,src,Def_##id1,quantum1,topIsLow1,dest,Def_##id2,quantum2,topIsLow2); break;
 
#define MAKE_2CASE(id1, id2)   MAKE_CASE(id1,id2); MAKE_CASE(id2,id1);
 

Typedefs

typedef PixelMono Def_VOCAB_PIXEL_MONO
 
typedef PixelMono16 Def_VOCAB_PIXEL_MONO16
 
typedef PixelRgb Def_VOCAB_PIXEL_RGB
 
typedef PixelRgba Def_VOCAB_PIXEL_RGBA
 
typedef PixelBgra Def_VOCAB_PIXEL_BGRA
 
typedef PixelHsv Def_VOCAB_PIXEL_HSV
 
typedef PixelBgr Def_VOCAB_PIXEL_BGR
 
typedef PixelMonoSigned Def_VOCAB_PIXEL_MONO_SIGNED
 
typedef PixelRgbSigned Def_VOCAB_PIXEL_RGB_SIGNED
 
typedef PixelFloat Def_VOCAB_PIXEL_MONO_FLOAT
 
typedef PixelRgbFloat Def_VOCAB_PIXEL_RGB_FLOAT
 
typedef PixelHsvFloat Def_VOCAB_PIXEL_HSV_FLOAT
 
typedef PixelInt Def_VOCAB_PIXEL_INT
 
typedef PixelRgbInt Def_VOCAB_PIXEL_RGB_INT
 

Functions

template<class T1 , class T2 >
static void CopyPixel (const T1 *src, T2 *dest)
 
 yAssert (implemented_yet==0)
 
template<class T1 , class T2 >
static SPECIAL_COPY_END void CopyPixels (const T1 *osrc, int q1, T2 *odest, int q2, int w, int h, bool flip)
 

Variables

static int implemented_yet = 1
 
SPECIAL_COPY_BEGIN dest r = dest->g = dest->b = *src
 
dest a = 255
 
dest v = *src
 
dest h = dest->s = 0
 
dest = *src >> 1
 
dest g = src->g
 
dest b = src->b
 

Macro Definition Documentation

◆ DBG

#define DBG   if(0)

Definition at line 16 of file ImageCopy.cpp.

◆ HANDLE_CASE

#define HANDLE_CASE (   len,
  x1,
  T1,
  q1,
  o1,
  x2,
  T2,
  q2,
  o2 
)    CopyPixels((T1*)x1,q1,(T2*)x2,q2,w,h,o1!=o2);

Definition at line 581 of file ImageCopy.cpp.

◆ HASH

#define HASH (   id1,
  id2 
)    ((int)(((int)(id1%65537))*11+((long int)(id2))))

Definition at line 580 of file ImageCopy.cpp.

◆ MAKE_2CASE

#define MAKE_2CASE (   id1,
  id2 
)    MAKE_CASE(id1,id2); MAKE_CASE(id2,id1);

Definition at line 583 of file ImageCopy.cpp.

◆ MAKE_CASE

#define MAKE_CASE (   id1,
  id2 
)    case HASH(id1,id2): HANDLE_CASE(len,src,Def_##id1,quantum1,topIsLow1,dest,Def_##id2,quantum2,topIsLow2); break;

Definition at line 582 of file ImageCopy.cpp.

◆ SPECIAL_COPY

#define SPECIAL_COPY (   id1,
  id2 
)    } static inline void CopyPixel(const Def_##id1 *src, Def_##id2 *dest) {

Definition at line 42 of file ImageCopy.cpp.

◆ SPECIAL_COPY_BEGIN

#define SPECIAL_COPY_BEGIN   static void YARPDummyCopyPixel() {

Definition at line 41 of file ImageCopy.cpp.

◆ SPECIAL_COPY_END

#define SPECIAL_COPY_END   }

Definition at line 43 of file ImageCopy.cpp.

◆ VALID_PIXEL

#define VALID_PIXEL (   x)    ((x>255)?255:((x<0)?0:x))

Definition at line 40 of file ImageCopy.cpp.

Typedef Documentation

◆ Def_VOCAB_PIXEL_BGR

Definition at line 31 of file ImageCopy.cpp.

◆ Def_VOCAB_PIXEL_BGRA

Definition at line 29 of file ImageCopy.cpp.

◆ Def_VOCAB_PIXEL_HSV

Definition at line 30 of file ImageCopy.cpp.

◆ Def_VOCAB_PIXEL_HSV_FLOAT

Definition at line 36 of file ImageCopy.cpp.

◆ Def_VOCAB_PIXEL_INT

Definition at line 37 of file ImageCopy.cpp.

◆ Def_VOCAB_PIXEL_MONO

Definition at line 25 of file ImageCopy.cpp.

◆ Def_VOCAB_PIXEL_MONO16

Definition at line 26 of file ImageCopy.cpp.

◆ Def_VOCAB_PIXEL_MONO_FLOAT

typedef PixelFloat Def_VOCAB_PIXEL_MONO_FLOAT

Definition at line 34 of file ImageCopy.cpp.

◆ Def_VOCAB_PIXEL_MONO_SIGNED

typedef PixelMonoSigned Def_VOCAB_PIXEL_MONO_SIGNED

Definition at line 32 of file ImageCopy.cpp.

◆ Def_VOCAB_PIXEL_RGB

Definition at line 27 of file ImageCopy.cpp.

◆ Def_VOCAB_PIXEL_RGB_FLOAT

Definition at line 35 of file ImageCopy.cpp.

◆ Def_VOCAB_PIXEL_RGB_INT

Definition at line 38 of file ImageCopy.cpp.

◆ Def_VOCAB_PIXEL_RGB_SIGNED

Definition at line 33 of file ImageCopy.cpp.

◆ Def_VOCAB_PIXEL_RGBA

Definition at line 28 of file ImageCopy.cpp.

Function Documentation

◆ CopyPixel()

template<class T1 , class T2 >
static void CopyPixel ( const T1 *  src,
T2 *  dest 
)
inlinestatic

Definition at line 20 of file ImageCopy.cpp.

◆ CopyPixels()

template<class T1 , class T2 >
static SPECIAL_COPY_END void CopyPixels ( const T1 *  osrc,
int  q1,
T2 *  odest,
int  q2,
int  w,
int  h,
bool  flip 
)
static

Definition at line 545 of file ImageCopy.cpp.

◆ yAssert()

yAssert ( implemented_yet  = =0)

Variable Documentation

◆ a

dest a = 255

Definition at line 53 of file ImageCopy.cpp.

◆ b

◆ dest

* dest = *src >> 1
Examples:
imagemagick/main.cpp.

Definition at line 72 of file ImageCopy.cpp.

◆ g

dest g = src->g
Examples:
imagemagick/main.cpp.

Definition at line 91 of file ImageCopy.cpp.

◆ h

dest h = dest->s = 0
Examples:
dev/file_grabber.cpp, and imagemagick/main.cpp.

Definition at line 63 of file ImageCopy.cpp.

◆ implemented_yet

int implemented_yet = 1
static

Definition at line 45 of file ImageCopy.cpp.

◆ r

dest r = dest->g = dest->b = *src
Examples:
os/ratethread.cpp.

Definition at line 50 of file ImageCopy.cpp.

◆ v

dest v = *src
Examples:
os/database.cpp, and os/portable_pair.cpp.

Definition at line 62 of file ImageCopy.cpp.