YARP
Yet Another Robot Platform
IplImage.cpp File Reference
#include <cstdio>
#include <cstring>
#include <yarp/os/Log.h>
#include <yarp/sig/impl/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)
 
IplConvKerneliplCreateConvKernel (int nCols, int nRows, int anchorX, int anchorY, int *values, int nShiftR)
 WARNING: most of this is implemented for PAD_BYTES == 0. More...
 
IplConvKernelFPiplCreateConvKernelFP (int nCols, int nRows, int anchorX, int anchorY, float *values)
 
void iplGetConvKernel (IplConvKernel *kernel, int *nCols, int *nRows, int *anchorX, int *anchorY, int **values, int *nShiftR)
 
void iplGetConvKernelFP (IplConvKernelFP *kernel, int *nCols, int *nRows, int *anchorX, int *anchorY, float **values)
 
void iplDeleteConvKernel (IplConvKernel *kernel)
 
void iplDeleteConvKernelFP (IplConvKernelFP *kernel)
 
void iplConvolve2D (IplImage *srcImage, IplImage *dstImage, IplConvKernel **kernel, int nKernels, int combineMethod)
 
void iplConvolve2DFP (IplImage *srcImage, IplImage *dstImage, IplConvKernelFP **kernel, int nKernels, int combineMethod)
 
void iplConvolveSep2DFP (IplImage *srcImage, IplImage *dstImage, IplConvKernelFP *xKernel, IplConvKernelFP *yKernel)
 
void iplConvolveSep2D (IplImage *srcImage, IplImage *dstImage, IplConvKernel *xKernel, IplConvKernel *yKernel)
 
void iplAllocateImage (IplImage *image, int doFill, int fillValue)
 
void iplAllocateImageFP (IplImage *image, int doFill, float fillValue)
 
void iplDeallocateImage (IplImage *image)
 
IplImageiplCreateImageHeader (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)
 
IplImageiplCloneImage (const IplImage *img)
 
void iplCopy (IplImage *srcImage, IplImage *dstImage)
 
void iplDeallocateHeader (IplImage *image)
 
void iplDeallocate (IplImage *image, int flag)
 
void iplSetBorderMode (IplImage *src, int mode, int border, int constVal)
 
void iplSet (IplImage *image, int fillValue)
 
void iplSetFP (IplImage *image, float fillValue)
 
void iplAddS (IplImage *srcImage, IplImage *dstImage, int value)
 
void iplAdd (IplImage *srcImageA, IplImage *srcImageB, IplImage *dstImage)
 
void iplSubtract (IplImage *srcImageA, IplImage *srcImageB, IplImage *dstImage)
 
void iplSubtractS (IplImage *srcImage, IplImage *dstImage, int value, bool flip)
 
void iplMultiplySFP (IplImage *srcImage, IplImage *dstImage, float value)
 
void iplAbs (IplImage *srcImage, IplImage *dstImage)
 
void iplThreshold (IplImage *srcImage, IplImage *dstImage, int threshold)
 
void iplColorToGray (IplImage *srcImage, IplImage *dstImage)
 
IplROIiplCreateROI (int coi, int xOffset, int yOffset, int width, int height)
 
void iplSetROI (IplROI *roi, int coi, int xOffset, int yOffset, int width, int height)
 
void iplRGB2HSV (IplImage *rgbImage, IplImage *hsvImage)
 
void iplHSV2RGB (IplImage *hsvImage, IplImage *rgbImage)
 
void iplXorS (IplImage *srcImage, IplImage *dstImage, unsigned int value)
 
int _iplCalcPadding (int lineSize, int align)
 Computes the ipl image padding. More...
 

Function Documentation

◆ _iplCalcPadding()

int _iplCalcPadding ( int  lineSize,
int  align 
)
inline

Computes the ipl image padding.

Parameters
lineSizethe total length in bytes of the row of the image.
alignis the alignment bytes (e.g. typically 8).
Returns
the number of bytes to add to the line to round with modulo 8.

Definition at line 1466 of file IplImage.cpp.

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

◆ iplAbs()

void iplAbs ( IplImage srcImage,
IplImage dstImage 
)

Definition at line 1235 of file IplImage.cpp.

◆ iplAdd()

void iplAdd ( IplImage srcImageA,
IplImage srcImageB,
IplImage dstImage 
)

Definition at line 1010 of file IplImage.cpp.

◆ iplAddS()

void iplAddS ( IplImage srcImage,
IplImage dstImage,
int  value 
)

Definition at line 952 of file IplImage.cpp.

◆ iplAllocateImage()

void iplAllocateImage ( IplImage image,
int  doFill,
int  fillValue 
)

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

Definition at line 661 of file IplImage.cpp.

◆ iplAllocateImageFP()

void iplAllocateImageFP ( IplImage image,
int  doFill,
float  fillValue 
)

Definition at line 694 of file IplImage.cpp.

◆ iplCloneImage()

IplImage* iplCloneImage ( const IplImage img)

Definition at line 848 of file IplImage.cpp.

◆ iplColorToGray()

void iplColorToGray ( IplImage srcImage,
IplImage dstImage 
)

Definition at line 1312 of file IplImage.cpp.

◆ iplConvolve2D()

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 172 of file IplImage.cpp.

◆ iplConvolve2DFP()

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 286 of file IplImage.cpp.

◆ iplConvolveSep2D()

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 497 of file IplImage.cpp.

◆ iplConvolveSep2DFP()

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 389 of file IplImage.cpp.

◆ iplCopy()

void iplCopy ( IplImage srcImage,
IplImage dstImage 
)

Definition at line 879 of file IplImage.cpp.

◆ iplCreateConvKernel()

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 80 of file IplImage.cpp.

◆ iplCreateConvKernelFP()

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

Definition at line 108 of file IplImage.cpp.

◆ iplCreateImageHeader()

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 786 of file IplImage.cpp.

◆ iplCreateROI()

IplROI* iplCreateROI ( int  coi,
int  xOffset,
int  yOffset,
int  width,
int  height 
)

Definition at line 1337 of file IplImage.cpp.

◆ iplDeallocate()

void iplDeallocate ( IplImage image,
int  flag 
)

Definition at line 900 of file IplImage.cpp.

◆ iplDeallocateHeader()

void iplDeallocateHeader ( IplImage image)

delete[] image->imageData;

Definition at line 885 of file IplImage.cpp.

◆ iplDeallocateImage()

void iplDeallocateImage ( IplImage image)

delete[] image->imageData;

Definition at line 731 of file IplImage.cpp.

◆ iplDeleteConvKernel()

void iplDeleteConvKernel ( IplConvKernel kernel)

Definition at line 151 of file IplImage.cpp.

◆ iplDeleteConvKernelFP()

void iplDeleteConvKernelFP ( IplConvKernelFP kernel)

Definition at line 160 of file IplImage.cpp.

◆ iplGetConvKernel()

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

Definition at line 125 of file IplImage.cpp.

◆ iplGetConvKernelFP()

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

Definition at line 139 of file IplImage.cpp.

◆ iplHSV2RGB()

void iplHSV2RGB ( IplImage hsvImage,
IplImage rgbImage 
)

Definition at line 1451 of file IplImage.cpp.

◆ iplMultiplySFP()

void iplMultiplySFP ( IplImage srcImage,
IplImage dstImage,
float  value 
)

Definition at line 1220 of file IplImage.cpp.

◆ iplRGB2HSV()

void iplRGB2HSV ( IplImage rgbImage,
IplImage hsvImage 
)

Definition at line 1353 of file IplImage.cpp.

◆ iplSet()

void iplSet ( IplImage image,
int  fillValue 
)

Definition at line 933 of file IplImage.cpp.

◆ iplSetBorderMode()

void iplSetBorderMode ( IplImage src,
int  mode,
int  border,
int  constVal 
)

Definition at line 922 of file IplImage.cpp.

◆ iplSetFP()

void iplSetFP ( IplImage image,
float  fillValue 
)

Definition at line 940 of file IplImage.cpp.

◆ iplSetROI()

void iplSetROI ( IplROI roi,
int  coi,
int  xOffset,
int  yOffset,
int  width,
int  height 
)

Definition at line 1346 of file IplImage.cpp.

◆ iplSubtract()

void iplSubtract ( IplImage srcImageA,
IplImage srcImageB,
IplImage dstImage 
)

Definition at line 1084 of file IplImage.cpp.

◆ iplSubtractS()

void iplSubtractS ( IplImage srcImage,
IplImage dstImage,
int  value,
bool  flip 
)

Definition at line 1157 of file IplImage.cpp.

◆ iplThreshold()

void iplThreshold ( IplImage srcImage,
IplImage dstImage,
int  threshold 
)

Definition at line 1268 of file IplImage.cpp.

◆ iplXorS()

void iplXorS ( IplImage srcImage,
IplImage dstImage,
unsigned int  value 
)

Definition at line 1458 of file IplImage.cpp.

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