src/libYARP_sig/src/cvbase.cpp
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))
{
	switch (depth)
	{
	default:
	case IPL_DEPTH_1U:
		return NULL;

    case IPL_DEPTH_8U:
    case IPL_DEPTH_8S:
    case IPL_DEPTH_32F:
    case IPL_DEPTH_16U:
	case IPL_DEPTH_16S:
    case IPL_DEPTH_32S:
		break;
	}

	IplImage *r = NULL;
	r = new IplImage;
	assert (r != NULL);

	r->nSize = sizeof(IplImage);
	r->ID = 0xf0f0f0f0;			// pasa's ID for IPL under QNX.

	r->nChannels = nChannels;
	r->alphaChannel = alphaChannel;
	r->depth = depth;

	memcpy (r->colorModel, colorModel, 4);
	memcpy (r->channelSeq, channelSeq, 4);

	assert (dataOrder == IPL_DATA_ORDER_PIXEL);

	r->dataOrder = dataOrder;	// IPL_DATA_ORDER_PIXEL, IPL_DATA_ORDER_PLANE
	r->origin = origin;
	
	assert (align == IPL_ALIGN_QWORD);	/// don't want to be bothered w/ alignment beside the 
										/// the 8 bytes stuff.
	assert (align == YARP_IMAGE_ALIGN);

	r->align = align;
	r->width = width;
	r->height = height;
	r->roi = NULL;
	r->maskROI = NULL;
	r->imageId = NULL;

	r->tileInfo = NULL;
	const int linew = width * (depth & IPL_DEPTH_MASK) / 8 * nChannels;
	r->widthStep = linew + PAD_BYTES(linew, YARP_IMAGE_ALIGN);

	r->imageSize = r->widthStep * height;
	r->imageData = NULL;
	r->tileInfo = NULL;

	memset (r->BorderMode, 0, 4);
	memset (r->BorderConst, 0, 4);

	r->imageDataOrigin = NULL;
	return r;
}
/* /////////////////////////////////////////////////////////////////////////
// Name:       iplCreateImageHeader
// Purpose:    Creates an IPL image header according to the specified 
//             attributes.
// Returns:    The newly constructed IPL image header.
// Parameters: 
//  nChannels     - Number of channels in the image.
//  alphaChannel  - Alpha channel number (0 if no alpha channel in image).
//  depth         - Bit depth of  pixels. Can be one of
//                      IPL_DEPTH_1U,
//                      IPL_DEPTH_8U,
//                      IPL_DEPTH_8S,
//                      IPL_DEPTH_16U,
//                      IPL_DEPTH_16S,
//                      IPL_DEPTH_32S.
//                      IPL_DEPTH_32F.
//  colorModel    - A four character array describing the color model,
//                  e.g. "RGB", "GRAY", "MSI" etc.
//  channelSeq    - The sequence of channels in the image,
//                  e.g. "BGR" for an RGB image.
//  dataOrder     - IPL_DATA_ORDER_PIXEL or IPL_DATA_ORDER_PLANE.
//  origin        - The origin of the image.
//                  Can be IPL_ORIGIN_TL or IPL_ORIGIN_BL.
//  align         - Alignment of image data.
//                  Can be IPL_ALIGN_4BYTES (IPL_ALIGN_DWORD) or 
//                  IPL_ALIGN_8BYTES (IPL_ALIGN_QWORD) or 
//                  IPL_ALIGN_16BYTES IPL_ALIGN_32BYTES.
//  width         - Width of  the image in pixels.
//  height        - Height of  the image in pixels.
//  roi           - Pointer to an ROI (region of interest) structure.
//                  This can be NULL (implying a region of interest comprising
//                  all channels and the entire image area).
//  maskROI       - Pointer on mask image
//  imageId       - use of the application
//  tileInfo      - contains information on tiling
//
// Notes:      
*/
iplCreateImageHeader
Purpose:    Creates an IPL image header according to the specified
attributes.
Returns:    The newly constructed IPL image header.
Parameters:
nChannels     - Number of channels in the image.
alphaChannel  - Alpha channel number (0 if no alpha channel in image).
depth         - Bit depth of  pixels.


iplCreateImageHeader Purpose : Creates an IPL image header according to the specified attributes . Returns : The newly constructed IPL image header . Parameters : nChannels - Number of channels in the image . alphaChannel - Alpha channel number ( 0 if no alpha channel in image ) . depth - Bit depth of pixels .
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))
{
	switch (depth)
	{
	default:
	case IPL_DEPTH_1U:
		return NULL;
    case IPL_DEPTH_8U:
    case IPL_DEPTH_8S:
    case IPL_DEPTH_32F:
    case IPL_DEPTH_16U:
	case IPL_DEPTH_16S:
    case IPL_DEPTH_32S:
		break;
	}
	IplImage *r = NULL;
	r = new IplImage;
	assert (r != NULL);
	r->nSize = sizeof(IplImage);
	r->ID = 0xf0f0f0f0;			
	r->nChannels = nChannels;
	r->alphaChannel = alphaChannel;
	r->depth = depth;
	memcpy (r->colorModel, colorModel, 4);
	memcpy (r->channelSeq, channelSeq, 4);
	assert (dataOrder == IPL_DATA_ORDER_PIXEL);
	r->dataOrder = dataOrder;	
	r->origin = origin;
	assert (align == IPL_ALIGN_QWORD);	
	assert (align == YARP_IMAGE_ALIGN);
	r->align = align;
	r->width = width;
	r->height = height;
	r->roi = NULL;
	r->maskROI = NULL;
	r->imageId = NULL;
	r->tileInfo = NULL;
	const int linew = width * (depth & IPL_DEPTH_MASK) / 8 * nChannels;
	r->widthStep = linew + PAD_BYTES(linew, YARP_IMAGE_ALIGN);
	r->imageSize = r->widthStep * height;
	r->imageData = NULL;
	r->tileInfo = NULL;
	memset (r->BorderMode, 0, 4);
	memset (r->BorderConst, 0, 4);
	r->imageDataOrigin = NULL;
	return r;
}
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 ) ) { switch ( depth ) { default : case IPL_DEPTH_1U : return NULL ; case IPL_DEPTH_8U : case IPL_DEPTH_8S : case IPL_DEPTH_32F : case IPL_DEPTH_16U : case IPL_DEPTH_16S : case IPL_DEPTH_32S : break ; } IplImage * r = NULL ; r = new IplImage ; assert ( r != NULL ) ; r -> nSize = sizeof ( IplImage ) ; r -> ID = 0xf0f0f0f0 ; r -> nChannels = nChannels ; r -> alphaChannel = alphaChannel ; r -> depth = depth ; memcpy ( r -> colorModel , colorModel , 4 ) ; memcpy ( r -> channelSeq , channelSeq , 4 ) ; assert ( dataOrder == IPL_DATA_ORDER_PIXEL ) ; r -> dataOrder = dataOrder ; r -> origin = origin ; assert ( align == IPL_ALIGN_QWORD ) ; assert ( align == YARP_IMAGE_ALIGN ) ; r -> align = align ; r -> width = width ; r -> height = height ; r -> roi = NULL ; r -> maskROI = NULL ; r -> imageId = NULL ; r -> tileInfo = NULL ; const int linew = width * ( depth & IPL_DEPTH_MASK ) / 8 * nChannels ; r -> widthStep = linew + PAD_BYTES ( linew , YARP_IMAGE_ALIGN ) ; r -> imageSize = r -> widthStep * height ; r -> imageData = NULL ; r -> tileInfo = NULL ; memset ( r -> BorderMode , 0 , 4 ) ; memset ( r -> BorderConst , 0 , 4 ) ; r -> imageDataOrigin = NULL ; return r ; }
Name:       iplCreateImageHeader
Purpose:    Creates an IPL image header according to the specified
attributes.
Name : iplCreateImageHeader Purpose : Creates an IPL image header according to the specified attributes .
// pasa's ID for IPL under QNX. // IPL_DATA_ORDER_PIXEL, IPL_DATA_ORDER_PLANE /// don't want to be bothered w/ alignment beside the  /// the 8 bytes stuff.