📄 ipl.h
字号:
#define IPL_BORDER_CONSTANT 0
#define IPL_BORDER_REPLICATE 1
#define IPL_BORDER_REFLECT 2
#define IPL_BORDER_WRAP 3
/*--- Indexes to access IplImage.BorderMode[],IplImage.BorderConst[] ----*/
#define IPL_SIDE_TOP_INDEX 0
#define IPL_SIDE_BOTTOM_INDEX 1
#define IPL_SIDE_LEFT_INDEX 2
#define IPL_SIDE_RIGHT_INDEX 3
/*---------- values of argument of iplSetBorderMode(,,border,) ----------*/
#define IPL_SIDE_TOP (1<<IPL_SIDE_TOP_INDEX)
#define IPL_SIDE_BOTTOM (1<<IPL_SIDE_BOTTOM_INDEX)
#define IPL_SIDE_LEFT (1<<IPL_SIDE_LEFT_INDEX)
#define IPL_SIDE_RIGHT (1<<IPL_SIDE_RIGHT_INDEX)
#define IPL_SIDE_ALL \
(IPL_SIDE_RIGHT | IPL_SIDE_TOP | IPL_SIDE_LEFT | IPL_SIDE_BOTTOM)
/* /////////////////////////////////////////////////////////////////////////
// Name: iplSetBorderMode
// Purpose:
// Returns:
// Parameters:
// mode - The following modes are supported:
// IPL_BORDER_CONSTANT - The value constVal will be used for
// all pixels.
// IPL_BORDER_REPLICATE - The last row or column will be
// replicated for the border.
// IPL_BORDER_REFLECT - The last n rows or columns will be
// reflected in reverse order to create
// the border.
// IPL_BORDER_WRAP - The required border rows or columns
// are taken from the opposite side of
// the image.
// border - The side that this function is called for. Can be an OR of
// one or more of the following four sides of an image:
// IPL_SIDE_TOP - Top side.
// IPL_SIDE_BOTTOM - Bottom side.
// IPL_SIDE_LEFT - Left side.
// IPL_SIDE_RIGHT - Right side.
// IPL_SIDE_ALL - All sides
// If no mode has been set for a side, the default
// IPL_BORDER_CONSTANT
// constVal - The value to use for the border when the mode is set
// to IPL_BORDER_CONSTANT.
//
// Notes:
*/
IPLAPI(void,iplSetBorderMode,(IplImage *src,int mode,int border,int constVal))
/* /////////////////////////////////////////////////////////////////////////
// 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:
*/
IPLAPI(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))
/* /////////////////////////////////////////////////////////////////////////
// Name: iplAllocateImage, iplAllocateImageFP
// Purpose: Allocates memory for image data according to the
// specified header.
// Returns:
// Parameters:
// image - An IPL image header with a NULL image data pointer.
// The image data pointer will be set to newly allocated
// image data memory after calling this function.
// doFill - Use a 0 to leave the pixel data uninitialized.
// Use a not 0 to initialized the pixel data of fillValue
// fillValue - The initial value to use for pixel data.
//
// Notes:
*/
IPLAPI(void, iplAllocateImage,(IplImage* image, int doFill, int fillValue))
IPLAPI(void, iplAllocateImageFP,(IplImage* image, int doFill, float fillValue))
/* /////////////////////////////////////////////////////////////////////////
// Name: iplCreateImageJaehne
// Purpose: Creates a gray (one channel) test image
// Returns: IPL image or NULL
// Parameters:
// depth - depth of the image to be created.
// All IPL depths are possible including 32f.
// For the 32f depth a data range is [0..1)
// width - width of the image to be created
// height - height of the image to be created
//
// Notes: This test image was seen in
// B.Jaehne, Digital Image Processing, third edition, 1995
*/
IPLAPI(IplImage*, iplCreateImageJaehne, ( int depth, int width, int height ))
/* /////////////////////////////////////////////////////////////////////////
// Name: iplCloneImage
// Purpose: Creates a clone of an image
// Returns: IPL image or NULL
// Parameters: img - image to be cloned.
//
// Notes: The function creates a copy of an image img including
// the field roi by copying. The following fields of the
// created image are set by function
// ID = 0, imageId = NULL, maskROI = NULL, tileInfo = NULL
// All IPL depths are possible including 32f.
*/
IPLAPI(IplImage*, iplCloneImage, ( const IplImage* img ) )
/* /////////////////////////////////////////////////////////////////////////
// Name: iplDeallocateHeader
// Purpose: deallocate IPL header
// Returns:
// Parameters:
//
// Notes: if image->imageData!=NULL, then first frees imageData
*/
IPLAPI(void, iplDeallocateHeader,(IplImage* image))
/* /////////////////////////////////////////////////////////////////////////
// Name: iplDeallocateImage
// Purpose: Deallocates (frees) memory for image data pointed to in
// the image header.
// Returns:
// Parameters:
// image - An IPL image header with a pointer
// to allocated image data memory.
//
// Notes: The image data pointer will be set to NULL after this
// function executes.
*/
IPLAPI(void, iplDeallocateImage,(IplImage* image))
#define IPL_IMAGE_HEADER 1
#define IPL_IMAGE_DATA 2
#define IPL_IMAGE_ROI 4
#define IPL_IMAGE_TILE 8
#define IPL_IMAGE_MASK 16
#define IPL_IMAGE_ALL (IPL_IMAGE_HEADER|IPL_IMAGE_DATA|\
IPL_IMAGE_TILE|IPL_IMAGE_ROI|IPL_IMAGE_MASK)
#define IPL_IMAGE_ALL_WITHOUT_MASK (IPL_IMAGE_HEADER|IPL_IMAGE_DATA|\
IPL_IMAGE_TILE|IPL_IMAGE_ROI)
/* /////////////////////////////////////////////////////////////////////////
// Name: iplDeallocate
// Purpose: Deallocates or frees memory for image header or data or
// mask ROI or rectangular ROI, etc or all.
// Returns:
// Parameters:
// image - An IPL image header
// flag - what item to free:
// IPL_IMAGE_HEADER - free header structure
// IPL_IMAGE_DATA - free image data, set pointer to NULL
// IPL_IMAGE_ROI - free image roi, set pointer to NULL
// IPL_IMAGE_TILE - free image tile, set pointer to NULL
// IPL_IMAGE_MASK - free image maskROI, set pointer to NULL
// IPL_IMAGE_ALL - free image data, roi, header, maskROI, tile
// IPL_IMAGE_ALL_WITHOUT_MASK
// - as well as IPL_IMAGE_ALL, but maskROI does not
// release
//
// Notes:
*/
IPLAPI(void, iplDeallocate,(IplImage* image, int flag))
/* /////////////////////////////////////////////////////////////////////////
// Name: iplCreateROI
// Purpose: Allocates and sets the region of interest (ROI) structure.
// Returns: Newly constructed ROI structure.
// Parameters:
// coi - The channel region of interest. It can be set to 0
// (for all channels) or a specific channel number.
// xOffset,
// yOffset - The offset from the origin of the rectangular region.
// height,
// width - The size of the rectangular region.
//
// Notes:
*/
IPLAPI(IplROI *,iplCreateROI,(int coi, int xOffset, int yOffset,
int width, int height ))
/* /////////////////////////////////////////////////////////////////////////
// Name: iplSetROI
// Purpose: Sets the IplROI structure fields.
// Returns:
// Parameters:
// roi - The ROI structure to modify.
// coi - The channel region of interest. It can be set to 0
// (for all channels) or a specific channel number.
// xOffset,
// yOffset - The offset from the origin of the rectangular region.
// height,
// width - The size of the rectangular region.
//
// Notes:
*/
IPLAPI(void, iplSetROI,(IplROI* roi, int coi,
int xOffset, int yOffset,
int width, int height))
/* /////////////////////////////////////////////////////////////////////////
// Name: iplDeleteROI
// Purpose: Deletes ROI structure
// Returns:
// Parameters:
// roi The ROI structure to be deleted.
//
// Notes:
*/
IPLAPI(void, iplDeleteROI,(IplROI* roi))
/* /////////////////////////////////////////////////////////////////////////
// Name: iplCreateTileInfo
// Purpose: Creates the IplTileInfo structure.
// Returns: Newly constructed TileInfo structure.
// Parameters:
// callBack callback function
// id additional identification field
// width width of tile
// height height of tile
//
// Notes:
*/
IPLAPI(IplTileInfo*, iplCreateTileInfo, ( IplCallBack callBack,
void* id, int width, int height ))
/* /////////////////////////////////////////////////////////////////////////
// Name: iplSetTileInfo
// Purpose: Sets attributes for an existing IplTileInfo structure.
// Returns:
// Parameters:
// tileInfo The TileInfo structure to modify.
// callBack callback function
// id additional identification field
// width width of tile
// height height of tile
//
// Notes:
*/
IPLAPI(void, iplSetTileInfo, ( IplTileInfo* tileInfo,
IplCallBack callBack, void* id, int width, int height ))
/* /////////////////////////////////////////////////////////////////////////
// Name: iplDeleteTileInfo
// Purpose: Deletes the IplTileInfo structure.
// Returns:
// Parameters:
// tileInfo - The pointer to the IplTileInfo structure.
//
// Notes:
*/
IPLAPI(void, iplDeleteTileInfo, (IplTileInfo* tileInfo))
/*==========================================================================
Section: Windows* DIB Conversion Functions
==========================================================================*/
/* /////////////////////////////////////////////////////////////////////////
// Name: iplTranslateDIB
// Purpose: Translates a DIB image into an IPL image.
// Returns: The constructed IPL image.
// Parameters:
// dib - The DIB image.
// cloneData - A boolean, result of work of the function. If true,
// the image data pointer in IPL image is made to point
// to the DIB image data. Otherwise the DIB image data
// was converting to the IPL image data.
//
// Notes:
*/
IPLAPI(IplImage*, iplTranslateDIB,(BITMAPINFOHEADER* dib, BOOL* cloneData))
/* /////////////////////////////////////////////////////////////////////////
// Name: iplConvertFromDIB
// Purpose: Converts a DIB image to an IPL image with specified attributes.
// Returns:
// Parameters:
// dib - The input DIB image.
// image - The IPL image header with specified attributes.
//
// Notes: If the data pointer is NULL, image data memory
// will be allocated and the pointer set to it.
*/
IPLAPI(void, iplConvertFromDIB,(BITMAPINFOHEADER* dib, IplImage* image))
/*---------- Consts of Palette conversion for iplConvertToDIB* ----------*/
#define IPL_PALCONV_NONE 0
#define IPL_PALCONV_POPULATE 1
#define IPL_PALCONV_MEDCUT 2
/* /////////////////////////////////////////////////////////////////////////
// Name: iplConvertToDIB
// Purpose: Converts an IPL image to a DIB image with specified attributes.
// Returns:
// Parameters:
// image - The input IPL image.
// dib - The output DIB image.
// dither - The dithering algorithm to use if applicable.
// Dithering will be done if the bit depth in the DIB
// is less than that of the IPL image.
// The following algorithms are supported for all dither
// type (see iplReduceBits).
// paletteConversion -
// Applicable when the DIB is a palette image.
// Specifies the palette algorithm to use when converting
// the IPL absolute color image.
// The following options are supported:
// IPL_PALCONV_NONE - The existing palette in the DIB is used.
// IPL_PALCONV_POPULATE - The popularity palette conversion
// algorithm is used.
// IPL_PALCONV_MEDCUT - The median cut algorithm palette
// conversion algorithm is used.
//
// Notes:
*/
IPLAPI(void, iplConvertToDIB,(IplImage* image, BITMAPINFOHEADER* dib,
int dither, int paletteConversion))
/* /////////////////////////////////////////////////////////////////////////
// Name: iplConvertFromDIBSep
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -