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

Go to the source code of this file.

Functions

bool compareHeader (IplImage *A, IplImage *B)
 
int PAD_BYTES (int len, int pad)
 this might turn out to be useful. More...
 
template<class T >
T * AllocAligned (int size)
 
template<class T >
void FreeAligned (T *ptr)
 
 IPLAPIIMPL (IplConvKernel *, iplCreateConvKernel,(int nCols, int nRows, int anchorX, int anchorY, int *values, int nShiftR))
 WARNING: most of this is implemented for PAD_BYTES == 0. More...
 
 IPLAPIIMPL (IplConvKernelFP *, iplCreateConvKernelFP,(int nCols, int nRows, int anchorX, int anchorY, float *values))
 
 IPLAPIIMPL (void, iplGetConvKernel,(IplConvKernel *kernel, int *nCols, int *nRows, int *anchorX, int *anchorY, int **values, int *nShiftR))
 
 IPLAPIIMPL (void, iplGetConvKernelFP,(IplConvKernelFP *kernel, int *nCols, int *nRows, int *anchorX, int *anchorY, float **values))
 
 IPLAPIIMPL (void, iplConvolve2D,(IplImage *srcImage, IplImage *dstImage, IplConvKernel **kernel, int nKernels, int combineMethod))
 
 IPLAPIIMPL (void, iplConvolve2DFP,(IplImage *srcImage, IplImage *dstImage, IplConvKernelFP **kernel, int nKernels, int combineMethod))
 
 IPLAPIIMPL (void, iplConvolveSep2DFP,(IplImage *srcImage, IplImage *dstImage, IplConvKernelFP *xKernel, IplConvKernelFP *yKernel))
 
 IPLAPIIMPL (void, iplConvolveSep2D,(IplImage *srcImage, IplImage *dstImage, IplConvKernel *xKernel, IplConvKernel *yKernel))
 
 yAssert (image->imageSize==image->widthStep *image->height)
 yAssert(image->widthStep == image->width * (image->depth & IPL_DEPTH_MASK) / 8 * image->nChannels); More...
 
 yAssert (image->imageData !=NULL)
 
 if (image->origin==IPL_ORIGIN_TL) image -> imageDataOrigin=image->imageData+image->imageSize - image->widthStep
 
 if (doFill)
 
 IPLAPIIMPL (IplImage *, iplCreateImageHeader,(int nChannels, int alphaChannel, int depth, char *colorModel, char *channelSeq, int dataOrder, int origin, int align, int width, int height, IplROI *roi, IplImage *maskROI, void *imageId, IplTileInfo *tileInfo))
 
 if (img->imageData !=NULL)
 
 memcpy (dstImage->imageData, srcImage->imageData, srcImage->imageSize)
 
 if (image->imageData !=NULL)
 

Variables

static int implemented_yet = 1
 
delete [] kernel values
 
delete kernel
 
image imageData = AllocAligned<char> (image->imageSize)
 delete[] image->imageData; More...
 
else image imageDataOrigin = image->imageData
 
image roi = NULL
 
return ret
 
delete image
 

Function Documentation

◆ AllocAligned()

template<class T >
T* AllocAligned ( int  size)

((rem != 0) ? (YARP_IMAGE_ALIGN - rem) : 0);

Definition at line 35 of file IplImage.cpp.

◆ compareHeader()

bool compareHeader ( IplImage A,
IplImage B 
)

Definition at line 17 of file IplImage.cpp.

◆ FreeAligned()

template<class T >
void FreeAligned ( T *  ptr)

Definition at line 48 of file IplImage.cpp.

◆ if() [1/4]

if ( image->  origin = =IPL_ORIGIN_TL) -> imageDataOrigin=image->imageData+image->imageSize - image->widthStep

◆ if() [2/4]

if ( doFill  )

Definition at line 677 of file IplImage.cpp.

◆ if() [3/4]

if ( img->imageData = NULL)

Definition at line 855 of file IplImage.cpp.

◆ if() [4/4]

if ( image->imageData = NULL)

delete[] image->imageData;

Definition at line 891 of file IplImage.cpp.

◆ IPLAPIIMPL() [1/9]

IPLAPIIMPL ( IplConvKernel ,
iplCreateConvKernel  ,
(int nCols, int nRows, int anchorX, int anchorY, int *values, int nShiftR)   
)

WARNING: most of this is implemented for PAD_BYTES == 0.

fixing the functions for != 0 is trivial though.

LATER: externd for PAD_BYTES != 0. NOT TESTED YET!

Definition at line 79 of file IplImage.cpp.

◆ IPLAPIIMPL() [2/9]

IPLAPIIMPL ( IplConvKernelFP ,
iplCreateConvKernelFP  ,
(int nCols, int nRows, int anchorX, int anchorY, float *values  
)

Definition at line 107 of file IplImage.cpp.

◆ IPLAPIIMPL() [3/9]

IPLAPIIMPL ( void  ,
iplGetConvKernel  ,
(IplConvKernel *kernel, int *nCols, int *nRows, int *anchorX, int *anchorY, int **values, int *nShiftR)   
)

Definition at line 124 of file IplImage.cpp.

◆ IPLAPIIMPL() [4/9]

IPLAPIIMPL ( void  ,
iplGetConvKernelFP  ,
(IplConvKernelFP *kernel, int *nCols, int *nRows, int *anchorX, int *anchorY, float **values  
)

Definition at line 138 of file IplImage.cpp.

◆ IPLAPIIMPL() [5/9]

IPLAPIIMPL ( void  ,
iplConvolve2D  ,
(IplImage *srcImage, IplImage *dstImage, IplConvKernel **kernel, int nKernels, int combineMethod)   
)

__tmp_res = new char[dstImage->imageSize];

delete[] __tmp_res;

__tmp_res = new char[dstImage->imageSize];

Definition at line 171 of file IplImage.cpp.

◆ IPLAPIIMPL() [6/9]

IPLAPIIMPL ( void  ,
iplConvolve2DFP  ,
(IplImage *srcImage, IplImage *dstImage, IplConvKernelFP **kernel, int nKernels, int combineMethod)   
)

__tmp_res = new float[dstImage->imageSize / sizeof(float)];

delete[] __tmp_res;

__tmp_res = new float[dstImage->imageSize / sizeof(float)];

Definition at line 285 of file IplImage.cpp.

◆ IPLAPIIMPL() [7/9]

IPLAPIIMPL ( void  ,
iplConvolveSep2DFP  ,
(IplImage *srcImage, IplImage *dstImage, IplConvKernelFP *xKernel, IplConvKernelFP *yKernel)   
)

__tmp_res = new float[dstImage->imageSize / sizeof(float)];

delete[] __tmp_res;

__tmp_res = new float[dstImage->imageSize / sizeof(float)];

Definition at line 386 of file IplImage.cpp.

◆ IPLAPIIMPL() [8/9]

IPLAPIIMPL ( void  ,
iplConvolveSep2D  ,
(IplImage *srcImage, IplImage *dstImage, IplConvKernel *xKernel, IplConvKernel *yKernel)   
)

__tmp_res = new char[dstImage->imageSize];

delete[] __tmp_res;

__tmp_res = new char[dstImage->imageSize];

Definition at line 496 of file IplImage.cpp.

◆ IPLAPIIMPL() [9/9]

IPLAPIIMPL ( IplImage ,
iplCreateImageHeader  ,
(int nChannels, int alphaChannel, int depth, char *colorModel, char * channelSeq, int dataOrder, int origin, int align, int width, int height, IplROI *roi, IplImage *maskROI, void *imageId, IplTileInfo *tileInfo)   
)

the 8 bytes stuff.

Definition at line 781 of file IplImage.cpp.

◆ memcpy()

memcpy ( dstImage->  imageData,
srcImage->  imageData,
srcImage->  imageSize 
)

◆ PAD_BYTES()

int PAD_BYTES ( int  len,
int  pad 
)
inline

this might turn out to be useful.

Definition at line 28 of file IplImage.cpp.

◆ yAssert() [1/2]

yAssert ( image->  imageSize = =image->widthStep *image->height)
Initial value:
{
delete image
Definition: IplImage.cpp:897
yAssert(image->imageSize==image->widthStep *image->height)
yAssert(image->widthStep == image->width * (image->depth & IPL_DEPTH_MASK) / 8 * image->nChannels); ...
#define IPL_DEPTH_32F
Definition: IplImage.h:109

yAssert(image->widthStep == image->width * (image->depth & IPL_DEPTH_MASK) / 8 * image->nChannels);

◆ yAssert() [2/2]

yAssert ( image->imageData = NULL)

Variable Documentation

◆ image

delete image
Examples:
dev/file_grabber.cpp.

Definition at line 897 of file IplImage.cpp.

◆ imageData

image imageData = AllocAligned<char> (image->imageSize)

delete[] image->imageData;

Definition at line 669 of file IplImage.cpp.

◆ imageDataOrigin

else image imageDataOrigin = image->imageData

Definition at line 675 of file IplImage.cpp.

◆ implemented_yet

int implemented_yet = 1
static

Definition at line 14 of file IplImage.cpp.

◆ kernel

delete kernel

Definition at line 157 of file IplImage.cpp.

◆ ret

return ret

Definition at line 876 of file IplImage.cpp.

◆ roi

image roi = NULL

Definition at line 738 of file IplImage.cpp.

◆ values

delete [] kernel values
Initial value:
{
if (kernel == NULL)
return
delete kernel
Definition: IplImage.cpp:157

Definition at line 152 of file IplImage.cpp.