Simple record to inform the size of two-dimensional structures. When is relevant the classes return this record by property iSize.
type TfiSize = record Width, Height: integer; end;
Function fiSize can be used to make a new record:
function fiSize(Width, Height: integer): TfiSize;
Record to store a float point.
type TFloatPoint = record X, Y: single; end;
Function FloatPoint can be used to make a new float point. Function RoundPoint round X and Y values to make a Delphi TPoint record:
function FloatPoint(const X: single; const Y: single): TFloatPoint; function RoundPoint(const fpt: TFloatPoint): TPoint;
The channels can be 8, 16 or 32 bits deep. Each channel is stored in a two-dimensional array which is called 'map' by package. A map is actually an array of rows, so you can access the entire map or one row at a time. Below the declarations of the lines and maps to the types of channels supported at this time.
type // 8 bits map PByteArray = ^TByteArray; TByteArray = array [0..MaxListSize-1] of byte; PByteMap = ^TByteMap; TByteMap = array [0..MaxListSize-1] of PByteArray; // 16 bits map PSIntArray = ^TSIntArray; TSIntArray = array [0..MaxListSize-1] of Smallint; PSIntMap = ^TSIntMap; TSIntMap = array [0..MaxListSize-1] of PSIntArray; // 32 bits map PFloatArray = ^TFloatArray; TFloatArray = array [0..MaxListSize-1] of single; PFloatMap = ^TFloatMap; TFloatMap = array [0..MaxListSize-1] of PFloatArray;
When is necessary, the constants below are use to inform the channel depth:
const // Channel's depth fi_U8 = 1; // unsigned 8 bits (byte) fi_S16 = 2; // signed 16 bits (smallint) fi_F32 = 3; // float 32 bits (single)
The histogram shows the intensities distribution of the image’s pixels, or in the case of channel, components of channel. This implementation only supports histograms for 8-bit channels. Histograms are discrete by nature; it makes no sense to try to produce a histogram of a float channel where each element can have any value. So, unless someone suggests some criteria (and usefulness), histograms for 32-bit channels are not in plans. In 16-bit channels, histograms are theoretically possible, but still need some practical use for them. Suggestions about it are welcome.
Below the array type defined to histograms:
type PHistogram = ^THistogram; THistogram = array[0..255] of integer;
Projections are a simple and powerful way to perform morphological analysis on images. A vertical projection is the sum of columns of the channel or region. A horizontal projection is the sum of rows. To store the vertical and horizontal projections this package defines the array type below:
type PProjection = ^TProjection; TProjection = array [0..MaxListSize-1] of integer;