📄 ipl.pas
字号:
Parameters:
Img - header provided for the parent image
XIndex,YIndex - indices of the requested tile. They refer to the tile
number not pixel number, and count from the origin at (0,0)
Mode - one of the following:
IPL_GET_TILE_TO_READ - get a tile for reading;
tile data is returned in "img->tileInfo->tileData",
and must not be changed
IPL_GET_TILE_TO_WRITE - get a tile for writing;
tile data is returned in "img->tileInfo->tileData"
and may be changed;
changes will be reflected in the image
IPL_RELEASE_TILE - release tile; commit writes
Notes: Memory pointers provided by a get function will not be used after the
corresponding release function has been called.
}
PIplTileInfo = ^TIplTileInfo;
TIplTileInfo = record
CallBack : TIplCallBack; // callback function
Id : Pointer; // additional identification field
TileData : PByte; // pointer on tile data
Width : Integer; // width of tile
Height : Integer; // height of tile
end;
PIplROI = ^TIplROI;
TIplROI = record
Coi : Integer;
XOffset : Integer;
YOffset : Integer;
Width : Integer;
Height : Integer;
end;
TIplImage = record
NSize : Integer; // size of iplImage struct
ID : Integer; // version
NChannels : Integer;
AlphaChannel : Integer;
Depth : Integer; // pixel depth in bits
ColorModel : array [0..3] of Char;
ChannelSeq : array [0..3] of Char;
DataOrder : Integer;
Origin : Integer;
Align : Integer; // 4 or 8 byte align
Width : Integer;
Height : Integer;
Roi : PIplROI;
MaskROI : PIplImage; // poiner to maskROI if any
ImageId : Pointer; // use of the application
TileInfo : PIplTileInfo; // contains information on tiling
ImageSize : Integer; // useful size in bytes
ImageData : PByte; // pointer to aligned image
WidthStep : Integer; // size of aligned line in bytes
BorderMode : array [0..3] of Integer;
BorderConst : array [0..3] of Integer;
ImageDataOrigin : PByte; // ptr to full, nonaligned image
end;
PIplLUT = ^TIplLUT;
TIplLUT = record
Num : Integer;
Key : PInteger;
Value : PInteger;
Factor : PInteger;
InterpolateType : Integer;
end;
PIplColorTwist = ^TIplColorTwist;
TIplColorTwist = record
Data : array [0..15] of Integer;
ScalingValue : Integer;
end;
PIplConvKernel = ^TIplConvKernel;
TIplConvKernel = record
NCols : Integer;
NRows : Integer;
AnchorX : Integer;
AnchorY : Integer;
Values : PInteger;
NShiftR : Integer;
end;
PIplConvKernelFP = ^TIplConvKernelFP;
TIplConvKernelFP = record
NCols : Integer;
NRows : Integer;
AnchorX : Integer;
AnchorY : Integer;
Values : PFloat;
end;
TIplFilter = (
IPL_PREWITT_3x3_V,
IPL_PREWITT_3x3_H,
IPL_SOBEL_3x3_V, //* vertical */
IPL_SOBEL_3x3_H, //* horizontal */
IPL_LAPLACIAN_3x3,
IPL_LAPLACIAN_5x5,
IPL_GAUSSIAN_3x3,
IPL_GAUSSIAN_5x5,
IPL_HIPASS_3x3,
IPL_HIPASS_5x5,
IPL_SHARPEN_3x3);
POwnMoment = ^TOwnMoment;
TOwnMoment = record // spatial moment structure:
Scale : Double; // value to scale (m,n)th moment
Value : Double; // spatial (m,n)th moment
end;
// spatial moments array
PIplMomentState = ^TIplMomentState;
TIplMomentState = array [0..3,0..3] of TOwnMoment;
{==========================================================================
Section: Wavelet transform constants and types.
=========================================================================}
{-------------------- Types of wavelet transforms. ---------------------}
TIplWtType = (
IPL_WT_HAAR,
IPL_WT_DAUBLET,
IPL_WT_SYMMLET,
IPL_WT_COIFLET,
IPL_WT_VAIDYANATHAN,
IPL_WT_BSPLINE,
IPL_WT_BSPLINEDUAL,
IPL_WT_LINSPLINE,
IPL_WT_QUADSPLINE,
IPL_WT_TYPE_UNKNOWN
);
{----------------------- Filters symmetry type. ------------------------}
TIplWtFiltSymm = (
IPL_WT_SYMMETRIC,
IPL_WT_ANTISYMMETRIC,
IPL_WT_ASYMMETRIC,
IPL_WT_SYMM_UNKNOWN
);
{--------------------- Filter bank orthogonality. ----------------------}
TIplWtOrthType = (
IPL_WT_ORTHOGONAL,
IPL_WT_BIORTHOGONAL,
IPL_WT_NOORTHOGONAL,
IPL_WT_ORTH_UNKNOWN
);
{-------------------------- Filter structure ---------------------------}
PIplWtFilter = ^TIplWtFilter;
TIplWtFilter = record
Taps : PFloat; // filter taps
Len : Integer; // length of filter
Offset : Integer; // offset of filter
Symmetry : TIplWtFiltSymm; // filter symmetry property
end;
{--------------- Wavelet functions interchange structure ---------------}
PIplWtKernel = ^TIplWtKernel;
TIplWtKernel = record
WtType : TIplWtType; // type of wavelet transform
Par1 : Integer; // first param. (transform order)
Par2 : Integer; // second param. (only for biorth. tr.)
Orth : TIplWtOrthType; // orthogonality property
FiltDecLow : TIplWtFilter; // low-pass decomposition filter
FiltDecHigh : TIplWtFilter; // high-pass decomposition filter
FiltRecLow : TIplWtFilter; // low-pass reconstruction filter
FiltRecHigh : TIplWtFilter; // high-pass reconstruction filter
end;
{--------------------- Noise generators structure ----------------------}
TIplNoise = (
IPL_NOISE_UNIFORM,
IPL_NOISE_GAUSSIAN
);
PIplNoiseParam = ^TIplNoiseParam;
TIplNoiseParam = record
Noise : TIplNoise;
Seed : UINT;
LowInt : Integer;
HighInt : Integer;
LowFlt : Float;
HighFlt : Float;
end;
{==========================================================================
Section: User function types.
=========================================================================}
{/////////////////////////////////////////////////////////////////////////
type IplUserFunc
Purpose: Type of callback functions for user point operation.
Provides user to write his own code to process each channel of
srcImage pixel. This function would be passed to iplUserProcess
function as its last parameter.
Parameters:
src - value of src image pixel's channel converted to integer
Returns: value of dst image pixel's channel. You wouldn't support
value saturatation, it will be done by iplUserProcess function
Notes: For more information see iplUserProcess function description
/////////////////////////////////////////////////////////////////////////}
TIplUserFunc = function(Src : Integer) : Integer; stdcall;
{/////////////////////////////////////////////////////////////////////////
type IplUserFuncFP
Purpose: Type of callback functions for user point operation.
Provides user to write his own code to process each channel
of srcImage pixel. This function would be passed to
iplUserProcessFP function as its last parameter.
Parameters:
src - value of src image pixel's channel converted to float
Returns: value of dst image pixel's channel. You wouldn't support
value saturatation for integer data types, it will be done
by iplUserProcessFP function
Notes: For more information see iplUserProcessFP function description
/////////////////////////////////////////////////////////////////////////}
TIplUserFuncFP = function(Src : Float) : Float; stdcall;
{/////////////////////////////////////////////////////////////////////////
type IplUserFuncPixel
Purpose: Type of callback functions for user point operation.
Provides user to write his own code to process all channels
of srcImage pixel simultaneously. This function would be
passed to iplUserProcessPixel function as its last parameter.
Function may call IPL_ERROR to set IplError status.
Returns: None
Parameters:
srcImage - src image header to access image depth and number of channels
srcPixel - pointer to array of src image pixel values.
Function ought to convert this pointer to an array of src depth.
dstImage - dst image header to access image depth and number of channels
dstPixel - pointer to array of dst image pixel values.
Function ought to convert this pointer to an array of dst depth.
Notes: For more information see iplUserProcessPixel function description
/////////////////////////////////////////////////////////////////////////}
TIplUserFuncPixel = procedure(srcImg : PIplImage; srcPixel : Pointer;
dstImg : PIplImage; dstPixel : Pointer); stdcall;
{==========================================================================
Section: Image Creation Functions
==========================================================================}
const
IPL_BORDER_CONSTANT = 0;
IPL_BORDER_REPLICATE = 1;
IPL_BORDER_REFLECT = 2;
IPL_BORDER_WRAP = 3;
{ Indexes to access IplImage.BorderMode[],IplImage.BorderConst[] }
IPL_SIDE_TOP_INDEX = 0;
IPL_SIDE_BOTTOM_INDEX = 1;
IPL_SIDE_LEFT_INDEX = 2;
IPL_SIDE_RIGHT_INDEX = 3;
{ values of argument of iplSetBorderMode(,,border,) }
IPL_SIDE_TOP = 1 shl IPL_SIDE_TOP_INDEX;
IPL_SIDE_BOTTOM = 1 shl IPL_SIDE_BOTTOM_INDEX;
IPL_SIDE_LEFT = 1 shl IPL_SIDE_LEFT_INDEX;
IPL_SIDE_RIGHT = 1 shl IPL_SIDE_RIGHT_INDEX;
IPL_SIDE_ALL = IPL_SIDE_RIGHT or
IPL_SIDE_TOP or
IPL_SIDE_LEFT or
IPL_SIDE_BOTTOM;
procedure iplSetBorderMode(Src : PIplImage; Mode : Integer;
Border : Integer; ConstVal : Integer); stdcall;
{
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.
}
function iplCreateImageHeader(NChannels : Integer; AlphaChannel : Integer;
Depth : Integer; ColorModel : PChar;
ChannelSeq : PChar; DataOrder : Integer;
Origin : Integer; Align : Integer;
Width : Integer; Height : Integer;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -