Returns NULL if an error was found, and error is in E2TParsingError
Parameters:
GI: | General info. for the expression tree parsing functions.
|
---|
s: | String expression to parse.
|
---|
Returned Value:
IritE2TExprNodeStruct *: Built binary tree.
|
---|
See Also:
Keywords:
(exprtree.c:101)
Prototype:
void IritE2TExpr2TreeFree(MiscExprTreeGenInfoStruct *GI)
Description:
Frees the local data and info needed by the expression tree module.
Parameters:
Returned Value:
Keywords:
(exprtree.c:74)
Prototype:
MiscExprTreeGenInfoStruct *IritE2TExpr2TreeInit()
Description:
Initializes local data and info needed by the expression tree module.
Parameters:
Returned Value:
MiscExprTreeGenInfoStruct *: Local info. structure.
|
---|
Keywords:
(exprtree.c:1101)
Prototype:
void IritE2TFreeTree(IritE2TExprNodeStruct *Root)
Description:
Frees a given expression tree.
Parameters:
Returned Value:
See Also:
Keywords:
(exprtree.c:1758)
Prototype:
int IritE2TParamInTree(const IritE2TExprNodeStruct *Root,
const char *ParamName)
Description:
Routine to test if the parameter is in the tree:
If ParamName is NULL then any parameter return TRUE.
Parameters:
Root: | Tree to examine for an existence of a parameter.
|
---|
ParamName: | Name of parameter to seek, or NULL to seek if any param.
|
---|
Returned Value:
int: TRUE if parameter exists, FALSE otherwise.
|
---|
See Also:
Keywords:
(exprtree.c:1898)
Prototype:
int IritE2TParseError(MiscExprTreeGenInfoStruct *GI)
Description:
Get a parsing error is was one or 0 in none.
Parameters:
GI: | General info. for the expression tree parsing functions.
|
---|
Returned Value:
Keywords:
(exprtree.c:784)
Prototype:
void IritE2TPrintTree(const IritE2TExprNodeStruct *Root, char *Str)
Description:
Routine to print a content of Root (using inorder traversal):
If *str = NULL print on stdout, else on given string str.
Parameters:
Root: | Tree to print.
|
---|
Str: | Destination.
|
---|
Returned Value:
See Also:
Keywords:
(exprtree.c:1879)
Prototype:
void IritE2TSetParamValue(MiscExprTreeGenInfoStruct *GI,
IrtRType Value,
int Index)
Description:
Routine to set the value of a Parameter before evaluating an expression.
Parameters:
GI: | General info. for the expression tree parsing functions.
|
---|
Value: | New value to assign to a parameter.
|
---|
Index: | The index of the parameter.
|
---|
Returned Value:
Keywords:
(xgeneral.c:888)
Prototype:
void IritEmulatePthreadMutexLock(IRIT_MUTEX *Mx)
Description:
Locking a mutex and also initializing it on the fly if so needed.
Used by parallel code if needed.
Parameters:
Mx: | The mutex to initialize/lock.
|
---|
Returned Value:
Keywords:
(xgeneral.c:917)
Prototype:
void IritEmulatePthreadMutexUnLock(IRIT_MUTEX Mx)
Description:
Unlocking a mutex. Used by parallel code if needed.
Parameters:
Returned Value:
Keywords:
(irit_ftl.c:60)
Prototype:
void IritFatalError(const char *Msg)
Description:
Default trap for IRIT programs for irit fatal errors.
This function just prints the given error message and die.
Parameters:
Msg: | Error message to print.
|
---|
Returned Value:
See Also:
IritWarningMsg
IritInformationMsg
IritFatalErrorPrintf
Keywords:
error trap
(irit2ftl.c:35)
Prototype:
void IritFatalErrorPrintf(const char *va_alist, ...)
Description:
Default trap for IRIT programs for irit fatal errors, printf style.
Parameters:
va_alist: | Do "man stdarg".
|
---|
Returned Value:
See Also:
IritFatalError
IritWarningMsgPrintf
IritInformationMsgPrintf
Keywords:
error trap
(imalloc.c:639)
Prototype:
void IritFree(VoidPtr p)
Description:
Routine to free dynamic memory for all IRIT program/tool/libraries.
All requests to free dynamic memory should invoke this function.
Parameters:
p: | Pointer to a block that needs to be freed.
|
---|
Returned Value:
See Also:
IritMalloc
IritRealloc
IritDynMemoryDbgCheckMark
IritDynMemoryDbgInitTest
Keywords:
allocation
(imalloc.c:150)
Prototype:
void IritFree2UnixFree(void *p)
Description:
For those who need to call IRIT insiead of C library functions.
Parameters:
p: | Dynamically allocated pointer to free.
|
---|
Returned Value:
Keywords:
(levenmar.c:575)
Prototype:
int IritGaussJordan(IrtRType *A, IrtRType *B, unsigned N, unsigned M)
Description:
This functions solves the linear equation Ax=B, using the Gauss-Jordan
elimination algorithm.
Parameters:
A: | matrix of N*N elements, is invalid on exit.
|
---|
B: | matrix of N*M elements, contains the result on exit.
|
---|
N: | escribed above.
|
---|
M: | escribed above.
|
---|
Returned Value:
int: TRUE on success, FALSE if singular.
|
---|
See Also:
Keywords:
Gauss-Jordan elimination
(hash_tbl.c:38)
Prototype:
IritHashTableStruct *IritHashTableCreate(IrtRType MinKeyVal,
IrtRType MaxKeyVal,
IrtRType KeyEps,
int VecSize)
Description:
Constructs a simple hasing table.
Parameters:
MinKeyVal: | Minimum expected key value.
|
---|
MaxKeyVal: | Maximum expected key value.
|
---|
KeyEps: | Tolerance of two keys to be considered the same. Negative
to never consider the same.
|
---|
VecSize: | Size of hash table to use.
|
---|
Returned Value:
IritHashTableStruct *: Constructed has table.
|
---|
See Also:
IritHashTableInsert
IritHashTableRemove
IritHashTableFree
IritHashTableFind
Keywords:
(hash_tbl.c:163)
Prototype:
VoidPtr IritHashTableFind(IritHashTableStruct *IHT,
VoidPtr Data,
IritHashCmpFuncType HashCmpFunc,
IrtRType Key)
Description:
Find an element in the hashing table. Search is conducted in two steps.
First the search is performed by key and then by HashCmpFunc against Data.
Parameters:
IHT: | IritHashTable structure.
|
---|
Data: | Element to compare against during the search.
|
---|
HashCmpFunc: | Test function to compare two data items. Returns -1,0,1
if first item is less, equal, greater than second item.
If NULL, search is conducted by the Key only.
|
---|
Key: | Key with which to search in the table.
|
---|
Returned Value:
VoidPtr: Found element, or NULL if none.
|
---|
See Also:
IritHashTableCreate
IritHashTableRemove
IritHashTableInsert
IritHashTableFree
Keywords:
(hash_tbl.c:277)
Prototype:
void IritHashTableFree(IritHashTableStruct *IHT)
Description:
Free the entire hash table.
Parameters:
IHT: | IritHashTable structure to free.
|
---|
Returned Value:
See Also:
IritHashTableCreate
IritHashTableInsert
IritHashTableFind
IritHashTableRemove
Keywords:
(hash_tbl.c:89)
Prototype:
int IritHashTableInsert(IritHashTableStruct *IHT,
VoidPtr Data,
IritHashCmpFuncType HashCmpFunc,
IrtRType Key,
int RplcSame)
Description:
Insert one element into the hashing table.
Parameters:
IHT: | IritHashTable structure.
|
---|
Data: | Element to insert into the hash table.
|
---|
HashCmpFunc: | Test function to compare two data items. Returns -1,0,1
if first item is less, equal, greater than second item.
If NULL, search is conducted by the Key only.
|
---|
Key: | Key with which to insert into the table.
|
---|
RplcSame: | RUE, to replace a similar Data if detected, FALSE to skip.
|
---|
Returned Value:
int: TRUE if old element with the same key was found and replaced,
FALSE if indeed a data with new key.
|
---|
See Also:
IritHashTableCreate
IritHashTableFind
IritHashTableRemove
IritHashTableFree
Keywords:
(hash_tbl.c:219)
Prototype:
int IritHashTableRemove(IritHashTableStruct *IHT,
VoidPtr Data,
IritHashCmpFuncType HashCmpFunc,
IrtRType Key)
Description:
Remove an element from the hashing table. Search is conducted in two
steps. First the search is performed by key and then by HashCmpFunc
against Data.
Parameters:
IHT: | IritHashTable structure.
|
---|
Data: | Element to compare against during the search.
|
---|
HashCmpFunc: | Test function to compare two data items. Returns -1,0,1
if first item is less, equal, greater than second item.
If NULL, search is conducted by the Key only.
|
---|
Key: | Key with which to search in the table.
|
---|
Returned Value:
int: TRUE if element found and removed, FALSE if not found.
|
---|
See Also:
IritHashTableCreate
IritHashTableFind
IritHashTableInsert
IritHashTableFree
Keywords:
(img_prcss.c:746)
Prototype:
void IritImgPrcssAppFunOnLine(IritImgPrcssImgStruct *Image,
int X0,
int Y0,
int X1,
int Y1,
IritImgPrcssFunctionOnPixel F,
void *Data)
Description:
Given an image and two points on the image, iterates over the pixels that
lay on the line between the two points, and for each pixel, calls the
function with the provided data and the pixel coordinates
Parameters:
Image: | The image processing library image struct.
|
---|
X0, Y0: | The coordinates for the first image.
|
---|
X1, Y1: | The coordinates for the second image.
|
---|
F: | The function to call on the iterated pixels
|
---|
Data: | Data for the function
|
---|
Returned Value:
Keywords:
(img_prcss.c:409)
Prototype:
IritImgPrcssImgStruct *IritImgPrcssBiSobel(const IritImgPrcssImgStruct *Image)
Description:
Given an image, applies the Sobel operator twice(vertical and horizontal)
on it. it then calculates the final color value by:
SQRT ((G1 ^ 2) + (G2 ^ 2)) where G1 and G2 are the gray scale
intensities for the results of the vertical and horizontal runs.
Equivalent to calling ApplyConvolution3Image with the following filters
{ -1, 0, 1, -2, 0, 2, -1, 0, 1 }
{ -1, -2, -1, 0, 0, 0, 1, 2, 1 }.
Parameters:
Image: | The image to apply the Bi Directional Sobel operator on.
|
---|
Returned Value:
IritImgPrcssImgStruct *: A copy of the image after applying the Bi
Directional Sobel operator.
|
---|
Keywords:
Convolution
filter
Sobel
Edges
Edge detection
Bi Directional
(img_prcss.c:305)
Prototype:
IritImgPrcssImgStruct *IritImgPrcssConv3(const IritImgPrcssImgStruct *Image,
float Filter[9],
int Normalize)
Description:
Given an image and a 3x3 filter, applies the filter on a zero padded
version of the image. the function prepares the filter for convolution.
Parameters:
Image: | The image to apply the convolution on.
|
---|
Filter: | An array of floats containing the 3x3 filter data.
|
---|
Normalize: | RUE to clip to [0, 1] the results.
|
---|
Returned Value:
IritImgPrcssImgStruct *: The image after applying the filter by
convolution.
|
---|
Keywords:
convolution
filter
(img_prcss.c:150)
Prototype:
IritImgPrcssImgStruct *IritImgPrcssCopyImg(const IritImgPrcssImgStruct *Image)
Description:
Allocates a new image filled with pixels from provided Image.
Parameters:
Returned Value:
IritImgPrcssImgStruct *: A copy of the provided image.
|
---|
Keywords:
Copy image
copy constructor
(img_prcss.c:93)
Prototype:
IritImgPrcssImgStruct *IritImgPrcssCreateBlkImg(unsigned int Height,
unsigned int Width)
Description:
Allotcates a new image filled with black pixels of the dimensions Height
and Width.
Parameters:
Height: | Height of the image to be produced.
|
---|
Width: | Width of the image to be produced.
|
---|
Returned Value:
IritImgPrcssImgStruct *: The black produced image.
|
---|
Keywords:
Create image
constructor
black
(img_prcss.c:122)
Prototype:
IritImgPrcssImgStruct *IritImgPrcssCreateImg(unsigned int Height,
unsigned int Width,
float *Data)
Description:
Allotcates a new image filled with pixels from provided data of the
dimensions Height and Width.
Parameters:
Height: | Height of the image to be produced.
|
---|
Width: | Width of the image to be produced.
|
---|
Data: | Data to occupy the image with of size Height * Width * 4.
|
---|
Returned Value:
IritImgPrcssImgStruct *: The newly allocated image.
|
---|
Keywords:
create image
constructor
(img_prcss.c:67)
Prototype:
IritImgPrcssImgStruct *IritImgPrcssCreateWhiteImg(unsigned int Height,
unsigned int Width)
Description:
Allotcates a new image filled with white pixels of the dimensions Height
and Width.
Parameters:
Height: | Height of the image to be produced.
|
---|
Width: | Width of the image to be produced.
|
---|
Returned Value:
IritImgPrcssImgStruct *: The white produced image.
|
---|
Keywords:
Create image
constructor
white
(img_prcss.c:277)
Prototype:
void IritImgPrcssDeleteImg(IritImgPrcssImgStruct *Image)
Description:
Deletes the allocated memory for the given image.
Parameters:
Image: | Pointer for the image to free.
|
---|
Returned Value:
Keywords:
delete
free
(img_prcss.c:592)
Prototype:
IritImgPrcssImgStruct *IritImgPrcssDetectEdges(const IritImgPrcssImgStruct
*Image,
int BlurAmount)
Description:
Given an image, detects the edges in the image by applying gaussian blue
BlurAmount times and then running the Bi-Sobel operator on the blurred.
Parameters:
Image: | The image to Detect its edges.
|
---|
BlurAmount: | The amount of times to blur the image before applying the
bi Sobel operator.
|
---|
Returned Value:
IritImgPrcssImgStruct *: The edges in the image.
|
---|
Keywords:
convolution
filter
Sharpening
(img_prcss.c:470)
Prototype:
IritImgPrcssImgStruct *IritImgPrcssGaussianBlur(const IritImgPrcssImgStruct
*Image)
Description:
Given an image, applies the Gaussian Blur filter on it.
Equivilant to calling ApplyConvolution3Image with the following filter
{ 1, 2, 1, 2, 4, 2, 1, 2, 1 }.
Parameters:
Image: | The image to apply the convolution on.
|
---|
Returned Value:
IritImgPrcssImgStruct *: A copy of the image after applying the
Gaussian Blur operator.
|
---|
Keywords:
convolution
filter
Gaussian blur
(img_prcss.c:504)
Prototype:
IritImgPrcssImgStruct *
IritImgPrcssGaussianBlurMult(IritImgPrcssImgStruct *Image,
int Amount)
Description:
Given an image, applies the Gaussian Blur filter on it multiple times.
Equivalent to calling ApplyConvolution3Image with the following filter
(1 / 16) * {1, 2, 1, 2, 4, 2, 1, 2, 1} multiple times.
Parameters:
Image: | The image to apply the convolution on.
|
---|
Amount: | he amount of times to run the Gaussian blur on the given image.
|
---|
Returned Value:
IritImgPrcssImgStruct *: A copy of the image after applying the
Gaussian blur operator Amount times.
|
---|
Keywords:
convolution
filter
blur
gaussian blur
(img_prcss.c:177)
Prototype:
int IritImgPrcssGetPixelVal(const IritImgPrcssImgStruct *Image,
unsigned int i,
unsigned int j,
float Color[4])
Description:
Returns the values of the (j, i) pixel in the provided color array.
Parameters:
Image: | Image struct to read the pixel value from.
|
---|
i: | Column index for the pixel.
|
---|
j: | Row index for the pixel.
|
---|
Color: | Array of floats to save the pixel data in.
|
---|
Returned Value:
int: TRUE if successful, FALSE otherwise.
|
---|
Keywords:
get pixel
read pixel
(img_prcss.c:544)
Prototype:
IritImgPrcssImgStruct *IritImgPrcssInvert(const IritImgPrcssImgStruct *Image)
Description:
Given an image, inverts its colors.
Parameters:
Image: | The image to invert.
|
---|
Returned Value:
IritImgPrcssImgStruct *: A copy of the image after applying the sharpen
operator.
|
---|
Keywords:
filter
Invert
(img_prcss.c:621)
Prototype:
IritImgPrcssImgStruct *IritImgPrcssReadImg(const char *Path)
Description:
Given a path, reads the image in that path and creates an image
processing library image struct out of it.
Parameters:
Path: | The path for the image to load.
|
---|
Returned Value:
IritImgPrcssImgStruct *: Read image.
|
---|
Keywords:
(img_prcss.c:209)
Prototype:
int IritImgPrcssSetPixelVal(IritImgPrcssImgStruct *Image,
unsigned int i,
unsigned int j,
const float color[4])
Description:
Puts the given pixel in the (j, i) pixel of the provided image.
Parameters:
Image: | Image struct to write the pixel value to.
|
---|
i: | Column index for the pixel.
|
---|
j: | Row index for the pixel.
|
---|
color: | Array of floats containing the pixel data.
|
---|
Returned Value:
int: TRUE if successful, FALSE otherwise.
|
---|
Keywords:
set pixel
write pixel
(img_prcss.c:378)
Prototype:
IritImgPrcssImgStruct *IritImgPrcssSharpen(const IritImgPrcssImgStruct *Image)
Description:
Given an image, applies the sharpen filter on it.
Equivalent to calling ApplyConvolution3Image with the following filter
{ 0, -1, 0, -1, 5, -1, 0, -1, 0 }.
Parameters:
Image: | The image to apply the convolution on.
|
---|
Returned Value:
IritImgPrcssImgStruct *: A copy of the image after applying the
sharpen operator.
|
---|
Keywords:
Convolution
filter
Sharpe
(img_prcss.c:235)
Prototype:
IritImgPrcssImgStruct *IritImgPrcssToGrayScale(const IritImgPrcssImgStruct
*Image)
Description:
Creates a gray scale image out of the provided image
Gray intensity is calculated according to Y = 0.2126R + 0.7152G + 0.0722B
following CIE 1931 (i.e. https://en.wikipedia.org/wiki/Grayscale)
Parameters:
Image: | Input color image to convert to gray scale.
|
---|
Returned Value:
IritImgPrcssImgStruct *: Grayscale image of the provided image.
|
---|
Keywords:
gray scale
(img_prcss.c:686)
Prototype:
void IritImgPrcssWriteImg(IritImgPrcssImgStruct *Image, const char *SavePath)
Description:
Given a path, write the image to that path
Parameters:
Image: | The image processing library image struct.
|
---|
SavePath: | The path to save the image to
|
---|
Returned Value:
See Also:
IritImgWriteImg
Keywords:
(irit_inf.c:121)
Prototype:
void IritInformationMsg(const char *Msg)
Description:
Default trap for IRIT programs for irit information.
This function just prints the given message.
Parameters:
Msg: | Error message to print.
|
---|
Returned Value:
See Also:
IritInformationMsgPrintf
IritFatalError
IritWarningMsg
IritInformationWMsg
Keywords:
information messages
(irit2inf.c:35)
Prototype:
void IritInformationMsgPrintf(const char *va_alist, ...)
Description:
Default trap for IRIT programs for irit warning errors, printf style.
Parameters:
va_alist: | Do "man stdarg".
|
---|
Returned Value:
See Also:
IritInformationMsg
IritFatalErrorPrintf
IritWarningMsgPrintf
Keywords:
information messages
(irit_inf.c:181)
Prototype:
void IritInformationWMsg(const wchar_t *Msg)
Description:
Default trap for IRIT programs for irit information.
This function just prints the given message.
Parameters:
Msg: | Error message to print.
|
---|
Returned Value:
See Also:
IritInformationMsgPrintf
IritFatalError
IritWarningMsg
IritInformationMsg
Keywords:
information messages
(intrv_arit.c:234)
Prototype:
void IritIntrvlArithAbs(const IritIntrvlArithStruct *A,
IritIntrvlArithStruct *Result)
Description:
Calcualtes the absolute value of an interval.
Parameters:
A: | Interval A.
|
---|
Result: | The resulting interval.
|
---|
Returned Value:
See Also:
Keywords:
(intrv_arit.c:32)
Prototype:
void IritIntrvlArithAdd(const IritIntrvlArithStruct *A,
const IritIntrvlArithStruct *B,
IritIntrvlArithStruct *Result)
Description:
Adds two intervals.
Parameters:
A: | Interval A.
|
---|
B: | Interval B.
|
---|
Result: | The resulting interval.
|
---|
Returned Value:
See Also:
Keywords:
(intrv_arit.c:129)
Prototype:
void IritIntrvlArithDiv(const IritIntrvlArithStruct *A,
const IritIntrvlArithStruct *B,
IritIntrvlArithStruct *Result)
Description:
divides interval A by interval B.
Parameters:
A: | Interval A.
|
---|
B: | Interval B.
|
---|
Result: | The resulting interval.
|
---|
Returned Value:
See Also:
Keywords:
(intrv_arit.c:92)
Prototype:
void IritIntrvlArithMult(const IritIntrvlArithStruct *A,
const IritIntrvlArithStruct *B,
IritIntrvlArithStruct *Result)
Description:
Multiplies two intervals.
Parameters:
A: | Interval A.
|
---|
B: | Interval B.
|
---|
Result: | The resulting interval.
|
---|
Returned Value:
See Also:
Keywords:
(intrv_arit.c:200)
Prototype:
void IritIntrvlArithMultScalar(const IritIntrvlArithStruct *A,
IrtRType Val,
IritIntrvlArithStruct *Result)
Description:
Multiplies an interval by a scalar value.
Parameters:
A: | Interval A.
|
---|
Val: | A scalar value.
|
---|
Result: | The resulting interval.
|
---|
Returned Value:
See Also:
Keywords:
(intrv_arit.c:174)
Prototype:
void IritIntrvlArithSqrt(const IritIntrvlArithStruct *A,
IritIntrvlArithStruct *Result)
Description:
Calculates the square root of an interval.
Parameters:
A: | Interval A.
|
---|
Result: | The resulting interval.
|
---|
Returned Value:
See Also:
Keywords:
(intrv_arit.c:62)
Prototype:
void IritIntrvlArithSub(const IritIntrvlArithStruct *A,
const IritIntrvlArithStruct *B,
IritIntrvlArithStruct *Result)
Description:
Subtracts interval B from Interval A.
Parameters:
A: | Interval A.
|
---|
B: | Interval B.
|
---|
Result: | The resulting interval.
|
---|
Returned Value:
See Also:
Keywords:
(intrv_arit.c:275)
Prototype:
void IritIntrvlArithUnion(const IritIntrvlArithStruct *A,
const IritIntrvlArithStruct *B,
IritIntrvlArithStruct *Result)
Description:
Calcualtes the union of two intervals.
Parameters:
A: | Interval A.
|
---|
B: | Interval B.
|
---|
Result: | The resulting interval.
|
---|
Returned Value:
See Also:
Keywords:
(intrv_arit.c:301)
Prototype:
void IritIntrvlArithVAdd(const IritIntrvlArithStruct *A,
const IritIntrvlArithStruct *B,
IritIntrvlArithStruct *Result)
Description:
Adds two vector(3d) intervals.
Parameters:
A: | Interval vector A.
|
---|
B: | Interval vector B.
|
---|
Result: | The resulting interval vector.
|
---|
Returned Value:
See Also:
Keywords:
(intrv_arit.c:364)
Prototype:
void IritIntrvlArithVCross(const IritIntrvlArithStruct *A,
const IritIntrvlArithStruct *B,
IritIntrvlArithStruct *Result)
Description:
The cross product of two vector(3d) intervals.
Parameters:
A: | Interval vector A.
|
---|
B: | Interval vector B.
|
---|
Result: | The resulting interval vector.
|
---|
Returned Value:
See Also:
Keywords:
(intrv_arit.c:330)
Prototype:
void IritIntrvlArithVDot(const IritIntrvlArithStruct *A,
const IritIntrvlArithStruct *B,
IritIntrvlArithStruct *Result)
Description:
The dot product of two vector(3d) intervals.
Parameters:
A: | Interval vector A.
|
---|
B: | Interval vector B.
|
---|
Result: | The resulting interval vector.
|
---|
Returned Value:
See Also:
Keywords:
(intrv_arit.c:401)
Prototype:
void IritIntrvlArithVFromCone(const IrtRType *Dir,
IrtRType Angle,
IritIntrvlArithStruct *Result)
Description:
Generates an interval vector from a given cone (apex at origin).
Parameters:
Dir: | Cone direction (axis).
|
---|
Angle: | Cone angle.
|
---|
Result: | The resulting interval vector.
|
---|
Returned Value:
See Also:
Keywords:
(intrv_arit.c:579)
Prototype:
void IritIntrvlArithVMultScalar(const IritIntrvlArithStruct *A,
IrtRType Val,
IritIntrvlArithStruct *Result)
Description:
Multiplies an interval vector by a scalar value.
Parameters:
A: | The interval vector.
|
---|
Val: | A scalar value.
|
---|
Result: | The resulting interval vector.
|
---|
Returned Value:
See Also:
Keywords:
(intrv_arit.c:436)
Prototype:
void IritIntrvlArithVToCone(const IritIntrvlArithStruct *IntervalV,
IrtRType *Dir,
IrtRType *Angle)
Description:
Generates a cone (apex at origin) from a given interval vector.
Parameters:
IntervalV: | The interval vector.
|
---|
Dir: | Cone direction (axis).
|
---|
Angle: | Cone angle.
|
---|
Returned Value:
See Also:
Keywords:
(intrv_arit.c:541)
Prototype:
void IritIntrvlArithVToSphere(const IritIntrvlArithStruct *IntervalV,
IrtRType *Center,
IrtRType *Radius)
Description:
Generates a sphere of an average radius around the interval vector.
Parameters:
IntervalV: | The interval vector.
|
---|
Center: | sphere center.
|
---|
Radius: | Sphere radius.
|
---|
Returned Value:
See Also:
Keywords:
(levenmar.c:433)
Prototype:
IrtRType IritLevenMarMin(IrtRType **X,
IrtRType Y[],
IrtRType Sigma[],
unsigned NumberOfDataElements,
IrtRType ModelParams[],
IritLevenEvalFuncType *ShapeFunc,
IritLevenNumerProtectionFuncType *ProtectionFunc,
IritLevenIsModelValidFuncType *ModelValidatorFunc,
unsigned NumberOfModelParams,
IrtRType Tolerance)
Description:
This function calculates the levenberg-marquardt minimization of the
Specified function.
Parameters:
X: | Pointer to a list of data.
|
---|
Y: | Pointer to the list of expected results.
|
---|
Sigma: | Pointer to the expected variance vector.
|
---|
NumberOfDataElements: | he number of data elements in X, Y & Sigma.
|
---|
ModelParams: | The model params to be checked.
|
---|
ShapeFunc: | The shape function.
|
---|
ProtectionFunc: | The numerical protection function.
|
---|
ModelValidatorFunc: | The model validator.
|
---|
NumberOfModelParams: | he number of model params.
|
---|
Tolerance: | If the error is smaller then Tolerance return.
|
---|
Returned Value:
IrtRType: The squared sum of the error.
|
---|
See Also:
IritLevenMarMinSig1
IritLevenMarSetMaxIterations
Keywords:
(levenmar.c:510)
Prototype:
IrtRType IritLevenMarMinSig1(IrtRType **X,
IrtRType Y[],
unsigned NumberOfDataElements,
IrtRType ModelParams[],
IritLevenEvalFuncType *ShapeFunc,
IritLevenNumerProtectionFuncType *ProtectionFunc,
IritLevenIsModelValidFuncType *ModelValidatorFunc,
unsigned NumberOfModelParams,
IrtRType Tolerance)
Description:
This function calculates the levenberg-marquardt minimization of the
Specified function.
This function is similar to LevenMin except that sigma is allways 1.
Parameters:
X: | Pointer to a list of data.
|
---|
Y: | Pointer to the list of expected results.
|
---|
NumberOfDataElements: | he number of data elements in X, Y & Sigma.
|
---|
ModelParams: | The model params to be checked.
|
---|
ShapeFunc: | The shape function.
|
---|
ProtectionFunc: | The numerical protection function.
|
---|
ModelValidatorFunc: | The model validator.
|
---|
NumberOfModelParams: | he number of model params.
|
---|
Tolerance: | If the error is smaller then Tolerance return.
|
---|
Returned Value:
IrtRType: The squared sum of the error.
|
---|
See Also:
IritLevenMarMin
IritLevenMarSetMaxIterations
Keywords:
(levenmar.c:88)
Prototype:
unsigned IritLevenMarSetMaxIterations(unsigned NewVal)
Description:
This function modifies the maximum number of iteration when calculating
Levenberg-Marquardt.
Parameters:
NewVal: | he new maximum number of iterations.
|
---|
Returned Value:
unsigned: The old maximum number of iterations.
|
---|
See Also:
IritLevenMarMinSig1
IritLevenMarMin
Keywords:
(irit_inf.c:91)
Prototype:
int IritLineHasCntrlChar(const char *Line)
Description:
Test if the given line contains control chars.
Parameters:
Line: | ine to examine for control char's existence.
|
---|
Returned Value:
int: TRUE if this line holds control chars, FALSE otherwise.
|
---|
Keywords:
(imalloc.c:494)
Prototype:
VoidPtr IritMalloc(unsigned Size,
const char *ObjType,
const char *FileName,
int LineNum)
Description:
Routine to allocate dynamic memory for all IRIT program/tool/libraries.
All requests for dynamic memory should invoke this function.
If the environment variable "IRIT_MALLOC" is set when an IRIT program
is executed, the consistency of the dynamic memory is tested on every
invokation of this routine. See IritDynMemoryDbgTestAll function for more.
Parameters:
Size: | Size of block to allocate, in bytes.
|
---|
ObjType: | This variable exists iff "#define DEBUG_IRIT_MALLOC".
This holds the object descriptions.
|
---|
FileName: | his variable exists iff "#define DEBUG_IRIT_MALLOC".
This holds the file name where the call is invoked from.
|
---|
LineNum: | This variable exists iff "#define DEBUG_IRIT_MALLOC".
This holds the line number where the call is invoked from.
|
---|
Returned Value:
VoidPtr: A pointer to the allocated block. A function calling this
may assume return value will never be NULL, since no more
memory cases are trapped locally.
|
---|
See Also:
IritFree
IritRealloc
IritDynMemoryDbgCheckMark
IritDynMemoryDbgInitTest
Keywords:
allocation
(priorque.c:98)
Prototype:
void IritPQCompFunc(IritPQCompFuncType NewCompFunc)
Description:
Sets (a pointer to) the function that is used in comparing two items in
the queue.
This comparison function will get two item pointers, and should return
>0, 0, <0 as comparison result for greater than, equal, or less than
relation, respectively.
Parameters:
NewCompFunc: | A comparison function to used on item in the queue.
|
---|
Returned Value:
Keywords:
priority queue
(priorque.c:197)
Prototype:
VoidPtr IritPQDelete(IritPriorQue **PQ, VoidPtr OldItem)
Description:
Deletes an old item from the queue, using comparison function CompFunc.
Returns a pointer to Deleted item if was fould and deleted from the
queue, NULL otherwise.
Parameters:
PQ: | To delete OldItem from.
|
---|
OldItem: | Old element in priority queue PQ to remove from.
|
---|
Returned Value:
VoidPtr: Removed OldItem if found, NULL otherwise.
|
---|
Keywords:
priority queue
(priorque.c:76)
Prototype:
int IritPQEmpty(IritPriorQue *PQ)
Description:
returns TRUE iff PQ priority queue is empty.
Parameters:
PQ: | Priority queue to test for containment.
|
---|
Returned Value:
int: TRUE if not empty, FALSE otherwise.
|
---|
Keywords:
priority queue
(priorque.c:278)
Prototype:
VoidPtr IritPQFind(IritPriorQue *PQ, VoidPtr OldItem)
Description:
Finds old item on the queue, PQ, using the comparison function CompFunc.
Returns a pointer to item if was fould, NULL otherwise.
Parameters:
PQ: | To search for OldItem at.
|
---|
OldItem: | Element to search in PQ.
|
---|
Returned Value:
VoidPtr: Found element or othewise NULL.
|
---|
Keywords:
priority queue
(priorque.c:118)
Prototype:
VoidPtr IritPQFirst(IritPriorQue **PQ, int Delete)
Description:
Returns the first element in the given priority queue, and delete it from
the queue if Delete is TRUE. returns NULL if empty queue.
Parameters:
PQ: | To examine/remove first element from.
|
---|
Delete: | If TRUE first element is being removed from the queue.
|
---|
Returned Value:
VoidPtr: A pointer to the first element in the queue.
|
---|
Keywords:
priority queue
(priorque.c:416)
Prototype:
void IritPQFree(IritPriorQue *PQ, int FreeItem)
Description:
Frees the given queue. The elelents are also freed if FreeItems is TRUE.
Parameters:
PQ: | Priority queue to release.
|
---|
FreeItem: | If TRUE, elements are being freed as well.
|
---|
Returned Value:
Keywords:
priority queue
(priorque.c:444)
Prototype:
void IritPQFreeFunc(IritPriorQue *PQ, void (*FreeFunc)(VoidPtr))
Description:
Frees the given queue. The elelents are also freed by invoking FreeFunc
onall of them as FreeFunc's only argument.
Parameters:
PQ: | Priority queue to release.
|
---|
FreeFunc: | "Printing function".
|
---|
Returned Value:
Keywords:
priority queue
(priorque.c:57)
Prototype:
void IritPQInit(IritPriorQue **PQ)
Description:
Initializes the priority queue.
Parameters:
Returned Value:
Keywords:
priority queue
(priorque.c:154)
Prototype:
VoidPtr IritPQInsert(IritPriorQue **PQ, VoidPtr NewItem)
Description:
Insert a new element into the queue (NewItem is a pointer to new element)
using given compare function CompFunc (See IritPQCompFunc).
Insert element will always be a leaf of the constructed tree.
Returns a pointer to old element if was replaced or NULL if the element
is new.
Parameters:
PQ: | To insert a new element to.
|
---|
NewItem: | The new element to insert.
|
---|
Returned Value:
VoidPtr: An old element NewItem replaced, or NULL otherwise.
|
---|
Keywords:
priority queue
(priorque.c:319)
Prototype:
VoidPtr IritPQNext(IritPriorQue *PQ, VoidPtr CmpItem, VoidPtr LargerThan)
Description:
Returns the smallest element in PQ that is larger than given element
CmpItem.
PQ is not modified. Return NULL if none was found.
LargerThan will allways hold the smallest Item Larger than current one.
Parameters:
PQ: | To examine.
|
---|
CmpItem: | To find the smallest item in PQ that is larger than it.
|
---|
LargerThan: | The item that is found larger so far.
|
---|
Returned Value:
VoidPtr: The samllest item in PQ that is larger than CmpItem or
NULL if no found.
|
---|
Keywords:
priority queue
(priorque.c:390)
Prototype:
void IritPQPrint(IritPriorQue *PQ, void (*PrintFunc)(VoidPtr))
Description:
Scans the priority queue in order and invokes the "printing" routine,
PrintFunc on every item in the queue as its only argument.
Parameters:
PQ: | Pritority queue to traverse.
|
---|
PrintFunc: | "Printing function".
|
---|
Returned Value:
Keywords:
priority queue
(priorque.c:363)
Prototype:
int IritPQSize(IritPriorQue *PQ)
Description:
Computes the size of the given tree - number of nodes/elements.
Parameters:
PQ: | Pritority queue to traverse.
|
---|
Returned Value:
int: Number of nodes in tree == number of elements.
|
---|
Keywords:
(xgeneral.c:403)
Prototype:
IrtRType IritPseudoRandom()
Description:
Computes a pseudo random number generator using the large Bezier
evaluation table of the cagd library...
Parameters:
Returned Value:
IrtRType: A pseudo random number between zero and one.
|
---|
See Also:
CagdIChooseKTable
IritPseudoRandomInit
IritRandom
Keywords:
(xgeneral.c:381)
Prototype:
void IritPseudoRandomInit(unsigned int Seed)
Description:
A seed generator for a pseudo random number generator using the large
Bezier evaluation table of the cagd library...
Parameters:
Seed: | New seed for the randomization process.
|
---|
Returned Value:
See Also:
CagdIChooseKTable
IritPseudoRandom
IritRandom
Keywords:
(qrfactor.c:52)
Prototype:
int IritQRFactorization(IrtRType *A,
int n,
int m,
IrtRType *Q,
IrtRType *R)
Description:
Performs a QR factorization of matrix A.
Parameters:
A: | The matrix of size n by m (m <= n), must be preallocated
dynamically by the user.
|
---|
n, m: | Dimensions of matrix A.
|
---|
Q, R: | The computed decomposition matrices, must be preallocated
dynamically by the user. Q is n by m (like A), R is m by m.
|
---|
Returned Value:
int: TRUE if Singular, FALSE otherwise.
|
---|
See Also:
SvdLeastSqr
Keywords:
QR factorization
linear systems
matrices
(qrfactor.c:285)
Prototype:
int IritQRUnderdetermined(IrtRType *A,
IrtRType *x,
const IrtRType *b,
int m,
int n,
void **QRCache)
Description:
Solve for Ax = b when the system is under-determined (singular). The
solution is a minimum 2-norm solution.
See "matrix Computation", by Gene H. Golub and Charles F. Van Loan, 3rd
edition, pp 271-272.
Caches the QR factorizations so we can solve multiples b's as follows:
1. If A != NULL a QR factorization is computed for A and cached.
2. if A == NULL and X != NULL, a solution is computed for the given b.
3. If A == NULL and x == NULL the cache is freed.
Parameters:
A: | The matrix of size m by n (m <= n), must be preallocated
dynamically by the user.
|
---|
x: | The solution vector of size n.
|
---|
b: | A vector of size m.
|
---|
m, n: | Dimensions of matrix A. Because A is under-determined m <= n.
|
---|
QRCache: | A reference to a cache used internally.
|
---|
Returned Value:
int: TRUE if Singular, FALSE otherwise.
|
---|
See Also:
IritQRFactorization
IritSolveUpperDiagMatrix
SvdLeastSqr
Keywords:
QR factorization
linear systems
matrices
(qrfactor.c:377)
Prototype:
int IritQRUnderdetermined2(IrtRType *A,
IrtRType *x,
const IrtRType *b,
int m,
int n)
Description:
Solve for Ax = b when the system is under-determined (singular). The
solution is a minimum 2-norm solution.
See "matrix Computation", by Gene H. Golub and Charles F. Van Loan, 3rd
edition, pp 271-272.
Same as IritQRUnderdetermined but handles one solution vector.
Parameters:
A: | The matrix of size m by n (m <= n), must be preallocated
dynamically by the user.
|
---|
x: | The solution vector of size n.
|
---|
b: | A vector of size m.
|
---|
m, n: | Dimensions of matrix A. Because A is under-determined m <= n.
|
---|
Returned Value:
int: TRUE if Singular, FALSE otherwise.
|
---|
See Also:
IritQRFactorization
IritSolveUpperDiagMatrix
SvdLeastSqr
IritQRUnderdetermined
Keywords:
QR factorization
linear systems
matrices
(mincover.c:279)
Prototype:
void IritRLAdd(VoidPtr RLC, IrtRType l, IrtRType r, int Attr)
Description:
Creates and links a new range node to an existing list of nodes.
Parameters:
RLC: | An existing list which will be added a new node.
|
---|
l, r, Attr: | Node details; Left, Right and Attribute.
|
---|
Returned Value:
See Also:
IritRLNew
IritRLFindCyclicCover
IritRLDelete
Keywords:
(mincover.c:233)
Prototype:
void IritRLDelete(VoidPtr RLC)
Description:
Cleanup of RLStruct (a whole list)
Parameters:
Returned Value:
See Also:
IritRLNew
IritRLAdd
IritRLFindCyclicCover
Keywords:
(mincover.c:1103)
Prototype:
int *IritRLFindCyclicCover(VoidPtr RLC, IrtRType Tol)
Description:
Finds a cyclic cover from nodes in RL to cover [0,1]
This function decides the type of the cover SignleRange or MultiRange
and calls the suitable internal function to find a cover.
Parameters:
RLC: | A list (RL) of candidate ranges to cover [0,1].
|
---|
Tol: | Accuracy of merges of sets.
|
---|
Returned Value:
int *: A vector of indices (attributes) of covering set, terminated
by -1.
|
---|
See Also:
IritRLNew
IritRLAdd
IritRLDelete
Keywords:
(mincover.c:194)
Prototype:
VoidPtr IritRLNew(void)
Description:
Initializes a new Range List (RL) - which is an empty double link list
The list specifier is Plist*, which points, always, at the tail.
Parameters:
Returned Value:
VoidPtr: The new allocated list structure.
|
---|
See Also:
IritRLAdd
IritRLFindCyclicCover
IritRLDelete
Keywords:
(mincover.c:109)
Prototype:
int IritRLSetGaurdiansNumber(int g)
Description:
Sets the maximum number of views allowed to generate a min cover.
Actually this is the maximum number of subsets to be generated
by the FindMRCyclicCover() function.
Parameters:
g: | Maximum number of gaurdians required.
|
---|
Returned Value:
int: The previously used number of gaurdians.
|
---|
See Also:
IritRLAdd
IritRLFindCyclicCover
IritRLDelete
Keywords:
(xgeneral.c:339)
Prototype:
IrtRType IritRandom(IrtRType Min, IrtRType Max)
Description:
Routine to compute a random number in a specified range.
See also IritRandomInit.
Parameters:
Min: | Minimum range of random number requested.
|
---|
Max: | Maximum range of random number requested.
|
---|
Returned Value:
IrtRType: A random number between Min andMax.
|
---|
See Also:
IritRandomInit
IritPseudoRandom
Keywords:
random numbers
(xgeneral.c:304)
Prototype:
void IritRandomInit(long Seed)
Description:
Routine to initialize the random number generator.
Parameters:
Seed: | To initialize the random number generator with.
|
---|
Returned Value:
See Also:
IritRandom
IritPseudoRandom
Keywords:
random numbers
(xgeneral.c:524)
Prototype:
char *IritRealTimeDate(char *StrTime)
Description:
Routine to create and return a string describing current date and time.
Parameters:
StrTime: | Where to save the written date/time. Same as return value.
|
---|
Returned Value:
char *: A string describing current date and time. Same as StrTime.
|
---|
Keywords:
date
time
(imalloc.c:447)
Prototype:
VoidPtr IritRealloc(VoidPtr p, unsigned OldSize, unsigned NewSize)
Description:
Routine to reallocate dynamic memory for all IRIT program/tool/libraries.
All requests for dynamic memory should invoke this function.
If the environment variable "IRIT_MALLOC" is set when an IRIT program
is executed, the consistency of the dynamic memory is tested on every
invokation of this routine. See IritDynMemoryDbgTestAll function for more.
Parameters:
p: | Old pointer to reallocate. Freed at the end of this routine.
|
---|
OldSize: | Size of old block pointed by p, zero if unknown.
|
---|
NewSize: | Size of new block to allocate, in bytes. Must be larger than
OldSize.
|
---|
Returned Value:
VoidPtr: A pointer to the allocated block. A function calling this
may assume return value will never be NULL, since no more
memory cases are trapped locally.
|
---|
See Also:
IritFree
IritMalloc
IritDynMemoryDbgCheckMark
IritDynMemoryDbgInitTest
Keywords:
allocation
(search.c:210)
Prototype:
int IritSearch2DFindElem(VoidPtr S2D,
IrtRType XKey,
IrtRType YKey,
VoidPtr Data)
Description:
Looks for an existing element in the data structure. If found an
element within prescribed tolerance, Data is updated with the saved data
Parameters:
S2D: | Internal data structure, aiding search.
|
---|
XKey, YKey: | The 2D coordinates to search for.
|
---|
Data: | A pointer to the location to copy the found data into.
|
---|
Returned Value:
int: TRUE if element was found, FALSE otherwise.
|
---|
See Also:
IritSearch2DFree
IritSearch2DInsertElem
IritSearch2DInit
Keywords:
(search.c:119)
Prototype:
void IritSearch2DFree(VoidPtr S2D)
Description:
Free auxiliary data structure aiding in 2D search.
Parameters:
S2D: | Internal data structure, aiding search, to be freed.
|
---|
Returned Value:
See Also:
IritSearch2DInsertElem
IritSearch2DFindElem
IritSearch2DInit
Keywords:
(search.c:58)
Prototype:
VoidPtr IritSearch2DInit(IrtRType XMin,
IrtRType XMax,
IrtRType YMin,
IrtRType YMax,
IrtRType Tol,
int DataSize)
Description:
Initialize the search data structure.
Parameters:
XMin, XMax, YMin, YMax: | Dimensions of 2D domain.
|
---|
Tol: | Tolerance of expected search.
|
---|
DataSize: | Size, in bytes, of expected data elements to keep.
|
---|
Returned Value:
VoidPtr: An internal auxiliary structure to be provided to the
insertion and searching routines, NULL if error.
|
---|
See Also:
IritSearch2DInsertElem
IritSearch2DFindElem
IritSearch2DFree
Keywords:
(search.c:167)
Prototype:
void IritSearch2DInsertElem(VoidPtr S2D,
IrtRType XKey,
IrtRType YKey,
VoidPtr Data)
Description:
Insert a new element into the data structure. No test is made if a
similar element already exists.
Parameters:
S2D: | Internal data structure, aiding search.
|
---|
XKey, YKey: | The new 2D coordinates to insert.
|
---|
Data: | A pointer to the data to save with this 2D coordinate key.
|
---|
Returned Value:
See Also:
IritSearch2DFree
IritSearch2DFindElem
IritSearch2DInit
Keywords:
(irit_ftl.c:30)
Prototype:
IritFatalMsgFuncType IritSetFatalErrorFunc(IritFatalMsgFuncType FatalMsgFunc)
Description:
Sets the warning function of irit.
Parameters:
FatalMsgFunc: | New function to use.
|
---|
Returned Value:
IritFatalMsgFuncType: Old function reference.
|
---|
Keywords:
error handling
(irit_inf.c:36)
Prototype:
IritInfoMsgFuncType IritSetInfoMsgFunc(IritInfoMsgFuncType InfoMsgFunc)
Description:
Sets the warning function of irit.
Parameters:
InfoMsgFunc: | New function to use.
|
---|
Returned Value:
IritInfoMsgFuncType: Old function reference.
|
---|
See Also:
IritSetInfoWMsgFunc
Keywords:
error handling
(irit_inf.c:65)
Prototype:
IritInfoWMsgFuncType IritSetInfoWMsgFunc(IritInfoWMsgFuncType InfoWMsgFunc)
Description:
Sets the warning function of irit (for wide charachers).
Parameters:
InfoWMsgFunc: | New function to use.
|
---|
Returned Value:
IritInfoWMsgFuncType: Old function reference.
|
---|
See Also:
IritSetInfoMsgFunc
Keywords:
error handling
(xgeneral.c:938)
Prototype:
int IritSetIritParallelExec(int Prll)
Description:
Controls parallel execution - enab;ed and maximal number of threads.
Parameters:
Prll: | If not zero enables parallel computation, while a positive
value controls the maximal number of threads.
|
---|
Returned Value:
int: old value of Prll flag.
|
---|
Keywords:
parallel computation
(irit_wrn.c:30)
Prototype:
IritWarningMsgFuncType IritSetWarningMsgFunc(IritWarningMsgFuncType WrnMsgFunc)
Description:
Sets the warning function of irit.
Parameters:
WrnMsgFunc: | New function to use.
|
---|
Returned Value:
IritWarningMsgFuncType: Old function reference.
|
---|
Keywords:
error handling
(xgeneral.c:158)
Prototype:
void IritSleep(int MilliSeconds)
Description:
Routine to force a process to sleep.
Parameters:
MilliSeconds: | Sleeping time required, in miliseconds.
|
---|
Returned Value:
Keywords:
sleep
(qrfactor.c:232)
Prototype:
int IritSolveLowerDiagMatrix(const IrtRType *A,
int n,
const IrtRType *b,
IrtRType *x)
Description:
Solve for Ax = b when R is lower diagonal using forward substitution.
Parameters:
A: | The diagonal matrix of size n by n, must be preallocated
dynamically by the user.
|
---|
n: | Dimension of matrix A.
|
---|
b: | A vector of size n.
|
---|
x: | The solution vector of size n.
|
---|
Returned Value:
int: TRUE if Singular, FALSE otheriwse.
|
---|
See Also:
IritSolveUpperDiagMatrix
IritQRFactorization
IritQRUnderdetermined
SvdLeastSqr
Keywords:
QR factorization
linear systems
matrices
(qrfactor.c:188)
Prototype:
int IritSolveUpperDiagMatrix(const IrtRType *A,
int n,
const IrtRType *b,
IrtRType *x)
Description:
Solve for Ax = b when R is upper diagonal using back substitution.
Parameters:
A: | The diagonal matrix of size n by n, must be preallocated
dynamically by the user.
|
---|
n: | Dimension of matrix A.
|
---|
b: | A vector of size n.
|
---|
x: | The solution vector of size n.
|
---|
Returned Value:
int: TRUE if Singular, FALSE otheriwse.
|
---|
See Also:
IritSolveLowerDiagMatrix
IritQRFactorization
IritQRUnderdetermined
SvdLeastSqr
Keywords:
QR factorization
linear systems
matrices
(xgeneral.c:697)
Prototype:
const char *IritStrIStr(const char *s, const char *Pattern)
Description:
Routine to search for a Pattern (no regular expression) in s. Returns
address in s of first occurrence of Pattern, NULL if non found. Case
insensitive.
Parameters:
s: | To search for Pattern in.
|
---|
Pattern: | To search in s.
|
---|
Returned Value:
const char *: Address in s where Pattern was 1st found, NULL otherwise.
|
---|
Keywords:
(xgeneral.c:118)
Prototype:
char *IritStrLower(char *s)
Description:
Routine to convert all upper case chars into lower case, in place.
Parameters:
s: | String to convert to lower case.
|
---|
Returned Value:
Keywords:
lower case
upper case
(xgeneral.c:94)
Prototype:
char *IritStrUpper(char *s)
Description:
Routine to convert all lower case chars into upper case, in place.
Parameters:
s: | String to convert to upper case.
|
---|
Returned Value:
Keywords:
upper case
lower case
(xgeneral.c:69)
Prototype:
char *IritStrdup(const char *s)
Description:
Routine to duplicate a string. Exists in some computer environments.
Parameters:
Returned Value:
char *: Duplicated string.
|
---|
Keywords:
strdup
(xgeneral.c:733)
Prototype:
char *IritSubstStr(const char *s,
const char *Src,
const char *Dst,
int CaseInsensitive)
Description:
A find (Src) and replace (into Dst) function.
Parameters:
s: | Input string.
|
---|
Src: | Pattern to look for in S and substitute with Dst.
|
---|
Dst: | Replacement patter for Src.
|
---|
CaseInsensitive: | TRUE for case insensitive, FALSE for case sensitive.
|
---|
Returned Value:
char *: new string, allocated dynamically.
|
---|
Keywords:
(config.c:728)
Prototype:
const char *IritTextLocaleInit(void)
Description:
Initializes the text locale to be used.
Parameters:
Returned Value:
const char *: The locale initialized ot NULL if failed.
|
---|
See Also:
IritWChar2Ascii
IritAscii2WChar
Keywords:
(config.c:784)
Prototype:
char *IritWChar2Ascii(const wchar_t *Str)
Description:
Converts a wide (multi-short) string to an Ascii (multi-byte) string.
Parameters:
Str: | Input wide (multi-short) string to convert to a multi-byte
Ascii string.
|
---|
Returned Value:
char *: Converted string, allocated dynamically, or NULL if error.
|
---|
See Also:
IritDspAscii2WChar
IritTextLocaleInit
Keywords:
(irit_wrn.c:60)
Prototype:
void IritWarningMsg(const char *Msg)
Description:
Default trap for IRIT programs for irit warnings.
This function just prints the given warning message.
Parameters:
Msg: | Error message to print.
|
---|
Returned Value:
See Also:
IritWarningMsgPrintf
IritFatalError
Keywords:
warning trap
error trap
(irit2wrn.c:35)
Prototype:
void IritWarningMsgPrintf(const char *va_alist, ...)
Description:
Default trap for IRIT programs for irit warning errors, printf style.
Parameters:
va_alist: | Do "man stdarg".
|
---|
Returned Value:
See Also:
IritWarningMsg
IritFatalErrorPrintf
Keywords:
warning trap
error trap
(dither2.c:427)
Prototype:
IrtImgRGBAPxlStruct *IrtDitherBurkes(IrtImgRGBAPxlStruct *Image,
int XSize,
int YSize,
int NumColors,
const IrtImgRGBAPxlStruct *DitherColors)
Description:
A function implementing serpentine Burkes error diffusion algorithm.
PAPER:
Presentation of the Burkes error filter for use in preparing
continuous-tone images for presentation on bi-level devices
(Burkes, 1988)
Parameters:
Image: | The image to diffuse.
|
---|
XSize: | The width of the image.
|
---|
YSize: | The height of the image
|
---|
NumColors: | The number of colors in the palette.
|
---|
DitherColors: | The color palette to dither into.
|
---|
Returned Value:
IrtImgRGBAPxlStruct *: The dithered output image.
|
---|
See Also:
IrtDitherStucki
IrtDitherFloydSteinberg
IrtDitherJarvisJudiceNinke
IrtDitherSierraFirst
IrtDitherSierraSecond
IrtDitherSierraThird
IrtDitherSerpentineSimpleAlgorithm
IrtImgDitherImageClr
Keywords:
Dithering
Dither
Error Diffusion
Burkes
(dither2.c:343)
Prototype:
IrtImgRGBAPxlStruct *IrtDitherFloydSteinberg(
IrtImgRGBAPxlStruct *Image,
int XSize,
int YSize,
int NumColors,
const IrtImgRGBAPxlStruct *DitherColors)
Description:
A function implementing serpentine FloydSteinberg error diffusion
algorithm.
PAPER:
An adaptive algorithm for spatial grey scale (Floyd & Steinberg, 1976)
Parameters:
Image: | The image to diffuse.
|
---|
XSize: | The width of the image.
|
---|
YSize: | The height of the image
|
---|
NumColors: | The number of colors in the palette.
|
---|
DitherColors: | The color palette to dither into.
|
---|
Returned Value:
IrtImgRGBAPxlStruct *: The dithered output image.
|
---|
See Also:
IrtDitherStucki
IrtDitherJarvisJudiceNinke
IrtDitherBurkes
IrtDitherSierraFirst
IrtDitherSierraSecond
IrtDitherSierraThird
IrtDitherSerpentineSimpleAlgorithm
IrtImgDitherImageClr
Keywords:
Dithering
Dither
Error Diffusion
Floyd-Steinberg
(dither2.c:385)
Prototype:
IrtImgRGBAPxlStruct *IrtDitherJarvisJudiceNinke(
IrtImgRGBAPxlStruct *Image,
int XSize,
int YSize,
int NumColors,
const IrtImgRGBAPxlStruct *DitherColors)
Description:
A function implementing serpentine Jarvis-Judice-Ninke ED algorithm.
PAPER:
A Survey of Techniques for the Display of Continuous Tone Pictures on
Bi-level Displays (Jarvis, Judice and Ninke, 1976)
Parameters:
Image: | The image to diffuse.
|
---|
XSize: | The width of the image.
|
---|
YSize: | The height of the image
|
---|
NumColors: | The number of colors in the palette.
|
---|
DitherColors: | The color palette to dither into.
|
---|
Returned Value:
IrtImgRGBAPxlStruct *: The dithered output image.
|
---|
See Also:
IrtDitherStucki
IrtDitherFloydSteinberg
IrtDitherBurkes
IrtDitherSierraFirst
IrtDitherSierraSecond
IrtDitherSierraThird
IrtDitherSerpentineSimpleAlgorithm
IrtImgDitherImageClr
Keywords:
Dithering
Dither
Error Diffusion
Jarvis-Judice-Ninke
(dither2.c:467)
Prototype:
IrtImgRGBAPxlStruct *IrtDitherSierraFirst(
IrtImgRGBAPxlStruct *Image,
int XSize,
int YSize,
int NumColors,
const IrtImgRGBAPxlStruct *DitherColors)
Description:
A function implementing serpentine Sierra First error diffusion algorithm.
PAPER:
Frankie Sierra, in LIB 17 (Developer's Den), CIS Graphics Support Forum,
1989.
Parameters:
Image: | The image to diffuse.
|
---|
XSize: | The width of the image.
|
---|
YSize: | The height of the image
|
---|
NumColors: | The number of colors in the palette.
|
---|
DitherColors: | The color palette to dither into.
|
---|
Returned Value:
IrtImgRGBAPxlStruct *: The dithered output image.
|
---|
See Also:
IrtDitherStucki
IrtDitherFloydSteinberg
IrtDitherJarvisJudiceNinke
IrtDitherBurkes
IrtDitherSierraSecond
IrtDitherSierraThird
IrtDitherSerpentineSimpleAlgorithm
IrtImgDitherImageClr
Keywords:
Dithering
Dither
Error Diffusion
Sierra
(dither2.c:509)
Prototype:
IrtImgRGBAPxlStruct *IrtDitherSierraSecond(
IrtImgRGBAPxlStruct *Image,
int XSize,
int YSize,
int NumColors,
const IrtImgRGBAPxlStruct *DitherColors)
Description:
A function implementing serpentine Sierra Second error diffusion
algorithm.
PAPER:
Frankie Sierra, in LIB 17 (Developer's Den), CIS Graphics Support Forum,
1989.
Parameters:
Image: | The image to diffuse.
|
---|
XSize: | The width of the image.
|
---|
YSize: | The height of the image
|
---|
NumColors: | The number of colors in the palette.
|
---|
DitherColors: | The color palette to dither into.
|
---|
Returned Value:
IrtImgRGBAPxlStruct *: The dithered output image.
|
---|
See Also:
IrtDitherStucki
IrtDitherFloydSteinberg
IrtDitherJarvisJudiceNinke
IrtDitherBurkes
IrtDitherSierraFirst
IrtDitherSierraThird
IrtDitherSerpentineSimpleAlgorithm
IrtImgDitherImageClr
Keywords:
Dithering
Dither
Error Diffusion
Sierra
(dither2.c:549)
Prototype:
IrtImgRGBAPxlStruct *IrtDitherSierraThird(
IrtImgRGBAPxlStruct *Image,
int XSize,
int YSize,
int NumColors,
const IrtImgRGBAPxlStruct *DitherColors)
Description:
A function implementing serpentine Sierra Third error diffusion algorithm.
PAPER:
Frankie Sierra, in LIB 17 (Developer's Den), CIS Graphics Support Forum,
1989
Parameters:
Image: | The image to diffuse.
|
---|
XSize: | The width of the image.
|
---|
YSize: | The height of the image
|
---|
NumColors: | The number of colors in the palette.
|
---|
DitherColors: | The color palette to dither into.
|
---|
Returned Value:
IrtImgRGBAPxlStruct *: The dithered output image.
|
---|
See Also:
IrtDitherStucki
IrtDitherFloydSteinberg
IrtDitherJarvisJudiceNinke
IrtDitherBurkes
IrtDitherSierraFirst
IrtDitherSierraSecond
IrtDitherSerpentineSimpleAlgorithm
IrtImgDitherImageClr
Keywords:
Dithering
Dither
Error Diffusion
Sierra
(dither2.c:300)
Prototype:
IrtImgRGBAPxlStruct *IrtDitherStucki(IrtImgRGBAPxlStruct *Image,
int XSize,
int YSize,
int NumColors,
const IrtImgRGBAPxlStruct *DitherColors)
Description:
A function implementing serpentine Stucki error diffusion algorithm.
PAPER:
Mecca-a multiple-error correcting computation algorithm for bilevel
image hardcopy reproduction (Stucki, 1981)
Parameters:
Image: | The image to diffuse.
|
---|
XSize: | The width of the image.
|
---|
YSize: | The height of the image
|
---|
NumColors: | The number of colors in the palette.
|
---|
DitherColors: | The color palette to dither into.
|
---|
Returned Value:
IrtImgRGBAPxlStruct *: The dithered output image.
|
---|
See Also:
IrtDitherFloydSteinberg
IrtDitherJarvisJudiceNinke
IrtDitherBurkes
IrtDitherSierraFirst
IrtDitherSierraSecond
IrtDitherSierraThird
IrtDitherSerpentineSimpleAlgorithm
IrtImgDitherImageClr
Keywords:
Dithering
Dither
Error Diffusion
Stucki.
(writimag.c:406)
Prototype:
IrtImgRGBAPxlStruct *IrtImgCnvrtRGB2RGBA(const IrtImgPixelStruct *RGBImg,
int XSize,
int YSize)
Description:
Maps an RGB image to RGBA image with a full alpha coverage.
Parameters:
RGBImg: | Input RGB image.
|
---|
XSize, YSize: | imensions of input RGB image.
|
---|
Returned Value:
IrtImgRGBAPxlStruct *: Mapped image into RGBA space.
|
---|
See Also:
Keywords:
(dither.c:524)
Prototype:
IrtImgRGBAPxlStruct *IrtImgDitherImage(IrtImgRGBAPxlStruct *Image,
int XSize,
int YSize,
int DitherSize,
IrtBType ErrorDiffusion,
int NumColors,
const IrtImgRGBAPxlStruct *DitherColors)
Description:
A wrapper routine to read an image from a file, dither it and save into
a file the dithered image.
Parameters:
Image: | To dither.
|
---|
XSize, YSize: | Size of the image to dither.
|
---|
DitherSize: | Dithering matrices size: 2, 3, or 4.
|
---|
ErrorDiffusion: | RUE, to also diffuse the error in the image.
|
---|
NumColors: | Optional set of colors (in DitherColors) to color
dither the image. 0 to ignore (and do B&W dithering).
|
---|
DitherColors: | Optional set of NumDitherColors colors to color-dither.
NULL to ignore (and do B&W dithering).
|
---|
Returned Value:
IrtImgRGBAPxlStruct *: Dithered image.
|
---|
See Also:
IrtImgDitherImage2
IrtImgDitherImageBW
IrtImgDitherImageClr
IrtImgDitherImageBW2
Keywords:
(dither.c:571)
Prototype:
int IrtImgDitherImage2(const char *InputImage,
const char *OutputImage,
int DitherSize,
IrtBType ErrorDiffusion,
int NumColors,
const IrtImgRGBAPxlStruct *DitherColors)
Description:
A wrapper routine to read an image from a file, dither it and save into
a file the dithered image.
Parameters:
InputImage: | To dither.
|
---|
OutputImage: | Dithered image.
|
---|
DitherSize: | Dithering matrices size: 2, 3, or 4.
|
---|
ErrorDiffusion: | RUE, to also diffuse the error in the image.
|
---|
NumColors: | Optional set of colors (in DitherColors) to color
dither the image. 0 to ignore (and do B&W dithering).
|
---|
DitherColors: | Optional set of NumDitherColors colors to color-dither.
NULL to ignore (and do B&W dithering).
|
---|
Returned Value:
int: TRUE if successful, FALSE if failed.
|
---|
See Also:
IrtImgDitherImage
IrtImgDitherImageBW
IrtImgDitherImageBW2
IrtImgDitherImageClr
Keywords:
(dither2.c:653)
Prototype:
int IrtImgDitherImage3(const char *InputImage,
const char *OutputImage,
int NumColors,
const IrtImgRGBAPxlStruct *DitherColors,
IrtImgImageDitherType DitherMethod)
Description:
A wrapper routine to read an image from a file, dither it and save into
a file the dithered image.
Parameters:
InputImage: | To dither.
|
---|
OutputImage: | Dithered image.
|
---|
NumColors: | Optional set of colors (in DitherColors) to color
dither the image. 0 to ignore (and do B&W dithering).
|
---|
DitherColors: | Optional set of NumDitherColors colors to color-dither.
NULL to ignore (and do B&W dithering).
|
---|
DitherMethod: | Dithering matrix to use.
|
---|
Returned Value:
int: TRUE if successful, FALSE if failed.
|
---|
See Also:
IrtImgDitherImage
IrtImgDitherImageBW
IrtImgDitherImageBW2
IrtImgDitherImageClr
IrtImgDitherImageClr3
Keywords:
(dither.c:187)
Prototype:
IrtBType *IrtImgDitherImageBW(IrtImgRGBAPxlStruct *Image,
int XSize,
int YSize,
int DitherSize,
IrtBType ErrorDiffusion)
Description:
Routine to dither a given Image of RGBA pixels using dithering matrices
of size DitherSize to B&W. Alpha is duplicated.
Parameters:
Image: | To dither.
|
---|
XSize, YSize: | Size of the image to dither.
|
---|
DitherSize: | Dithering matrices size: 2, 3, or 4.
|
---|
ErrorDiffusion: | RUE, to also diffuse the error in the image.
|
---|
Returned Value:
IrtBType *: The dithered B&W image of size X/YSize * DitherSize.
|
---|
See Also:
IrtImgDitherImage
IrtImgDitherImage2
IrtImgDitherImageClr
IrtImgDitherImageBW1
IrtImgDitherImageBW2
Keywords:
(dither.c:257)
Prototype:
IrtBType *IrtImgDitherImageBW1(IrtImgPixelStruct *Image,
int XSize,
int YSize,
int DitherSize,
IrtBType ErrorDiffusion)
Description:
Routine to dither a given Image of RGB pixels using dithering matrices
of size DitherSize to B&W.
Parameters:
Image: | To dither.
|
---|
XSize, YSize: | Size of the image to dither.
|
---|
DitherSize: | Dithering matrices size: 2, 3, or 4.
|
---|
ErrorDiffusion: | RUE, to also diffuse the error in the image.
|
---|
Returned Value:
IrtBType *: The dithered B&W image of size X/YSize * DitherSize.
|
---|
See Also:
IrtImgDitherImage
IrtImgDitherImage2
IrtImgDitherImageBW
IrtImgDitherImageBW2
IrtImgDitherImageClr
Keywords:
(dither.c:296)
Prototype:
IrtImgRGBAPxlStruct *IrtImgDitherImageBW2(IrtImgRGBAPxlStruct *Image,
int XSize,
int YSize,
int DitherSize,
IrtBType ErrorDiffusion)
Description:
Routine to dither a given Image of RGB pixels using dithering matrices
of size DitherSize to B&W.
Parameters:
Image: | To dither.
|
---|
XSize, YSize: | Size of the image to dither.
|
---|
DitherSize: | Dithering matrices size: 2, 3, or 4.
|
---|
ErrorDiffusion: | RUE, to also diffuse the error in the image.
|
---|
Returned Value:
IrtImgRGBAPxlStruct *: Dithered B&W image of size X/YSize * DitherSize.
|
---|
See Also:
IrtImgDitherImage
IrtImgDitherImage2
IrtImgDitherImageClr
IrtImgDitherImageBW
IrtImgDitherImageBW1
Keywords:
(dither.c:466)
Prototype:
IrtImgRGBAPxlStruct *IrtImgDitherImageClr(
IrtImgRGBAPxlStruct *Image,
int XSize,
int YSize,
int DitherSize,
IrtBType ErrorDiffusion,
int NumColors,
const IrtImgRGBAPxlStruct *DitherColors)
Description:
Routine to dither a given Image of RGBA pixels using dithering matrices
of size DitherSize to colors. Alpha is duplicated.
Parameters:
Image: | To dither.
|
---|
XSize, YSize: | Size of the image to dither.
|
---|
DitherSize: | Dithering matrices size: 2, 3, or 4.
|
---|
ErrorDiffusion: | RUE, to also diffuse the error in the image.
|
---|
NumColors: | Optional set of colors (in DitherColors) to color
dither the image.
|
---|
DitherColors: | Optional set of NumDitherColors colors to color-dither.
|
---|
Returned Value:
IrtImgRGBAPxlStruct *: The dithered colored image of size
X/YSize * DitherSize.
|
---|
See Also:
IrtImgDitherImage
IrtImgDitherImage2
IrtImgDitherImageBW
IrtImgDitherImageBW2
Keywords:
(dither2.c:589)
Prototype:
IrtImgRGBAPxlStruct *IrtImgDitherImageClr3(
IrtImgRGBAPxlStruct *Image,
int XSize,
int YSize,
int NumColors,
const IrtImgRGBAPxlStruct *DitherColors,
IrtImgImageDitherType DitherMethod)
Description:
A function implementing the chosen error diffusion algorithm,
I chose to use Stucki algorithm.
Parameters:
Image: | The image to diffuse.
|
---|
XSize: | The width of the image.
|
---|
YSize: | The height of the image
|
---|
NumColors: | The number of colors in the palette.
|
---|
DitherColors: | The color palette to dither into.
|
---|
DitherMethod: | Dithering matrix to use.
|
---|
Returned Value:
IrtImgRGBAPxlStruct *: The dithered output image.
|
---|
See Also:
IrtDitherStucki
IrtDitherFloydSteinberg
IrtDitherJarvisJudiceNinke
IrtDitherBurkes
IrtDitherSierraFirst
IrtDitherSierraSecond
IrtDitherSierraThird
IritDitherSerpentineSimpleAlgorithm
IrtImgDitherImage3
Keywords:
Dithering
Dither
Error Diffusion
(dither2.c:715)
Prototype:
void IrtImgDitherImageClrBatch(const char **ImagePaths,
int NumImages,
const char *OutputFolder,
int NumColors,
const IrtImgRGBAPxlStruct *DitherColors,
IrtImgImageDitherType DitherMethod)
Description:
Applies dithering to a given set of images, in parallel.
We assume all parameters to be valid, and the files and folders to exist.
We also assume the images to have 4 channels per pixel.
Parameters:
ImagePaths: | an array of the image file paths that we want to dither.
|
---|
NumImages: | The number of the images we want to dither.
|
---|
OutputFolder: | he folder path to put the output images in.
|
---|
NumColors: | The number of colors in the palette.
|
---|
DitherColors: | he color palette to dither into.
|
---|
DitherMethod: | he dithering function to use.
|
---|
Returned Value:
See Also:
IrtImgDitherImageClr.
Keywords:
Dither
Batch
Parallel
Layered Dithering.
(editimag.c:134)
Prototype:
IrtImgPixelStruct *IrtImgFlipHorizontallyImage(const IrtImgPixelStruct *Img,
int MaxX,
int MaxY,
int Alpha)
Description:
Reads one image in from a file named ImageFileName. The image is
returned as a vector of RGBRGB... of size (MaxX+1) * (MaxY+1) * 3.
Parameters:
Img: | Image to flip its X and Y axes.
|
---|
MaxX: | Maximum X of Img image.
|
---|
MaxY: | Maximum Y of Img image.
|
---|
Alpha: | RUE if this image has alpha and is actually RGBARGBA...
|
---|
Returned Value:
IrtImgPixelStruct *: Flipped image.
|
---|
See Also:
IrtImgNegateImage
IrtImgScaleImage
Keywords:
(editimag.c:193)
Prototype:
IrtImgPixelStruct *IrtImgFlipVerticallyImage(const IrtImgPixelStruct *Img,
int MaxX,
int MaxY,
int Alpha)
Description:
Reads one image in from a file named ImageFileName. The image is
returned as a vector of RGBRGB... of size (MaxX+1) * (MaxY+1) * 3.
Parameters:
Img: | Image to flip its X and Y axes.
|
---|
MaxX: | Maximum X of Img image.
|
---|
MaxY: | Maximum Y of Img image.
|
---|
Alpha: | RUE if this image has alpha and is actually RGBARGBA...
|
---|
Returned Value:
IrtImgPixelStruct *: Flipped image.
|
---|
See Also:
IrtImgNegateImage
IrtImgScaleImage
Keywords:
(editimag.c:36)
Prototype:
IrtImgPixelStruct *IrtImgFlipXYImage(const IrtImgPixelStruct *Img,
int MaxX,
int MaxY,
int Alpha)
Description:
Reads one image in from a file named ImageFileName. The image is
returned as a vector of RGBRGB... of size (MaxX+1) * (MaxY+1) * 3.
Parameters:
Img: | Image to flip its X and Y axes.
|
---|
MaxX: | Maximum X of Img image.
|
---|
MaxY: | Maximum Y of Img image.
|
---|
Alpha: | RUE if this image has alpha and is actually RGBARGBA...
|
---|
Returned Value:
IrtImgPixelStruct *: Flipped image.
|
---|
See Also:
IrtImgNegateImage
IrtImgScaleImage
Keywords:
(readimag.c:447)
Prototype:
int IrtImgGetImageSize(const char *ImageFileName,
int *Width,
int *Height)
Description:
Reads the dimensions of one image in from a file named ImageFileName.
Parameters:
ImageFileName: | Name of image to read.
|
---|
Width: | The width of the image.
|
---|
Height: | The height of the image.
|
---|
Returned Value:
int: TRUE, if loaded successfully. Otherwise FALSE.
|
---|
Keywords:
(editimag.c:92)
Prototype:
IrtImgPixelStruct *IrtImgNegateImage(const IrtImgPixelStruct *InImage,
int MaxX,
int MaxY)
Description:
Negate an image.
Parameters:
InImage: | A vector of IrtImgPixelStruct of size (MaxX+1) * (MaxY+1).
|
---|
MaxX: | Maximum X of input image.
|
---|
MaxY: | Maximum Y of input image.
|
---|
Returned Value:
IrtImgPixelStruct *: The scaled image as vector of RGBRGB (or RGBARGBA).
|
---|
See Also:
IrtImgFlipXYImage
IrtImgScaleImage
Keywords:
(readimag.c:1161)
Prototype:
int IrtImgParsePTextureString(const char *PTexture,
char *FName,
IrtRType *Scale,
int *Flip,
int *NewImage)
Description:
Parses the string of the "ptexture" attribute.
"ImageName {, S X Y {Z}} {, F} {, N}" where
1. X, Y, and possibly Z are scaling factors of how many times the image
should fit into the object,
2. 'F' optionally request to flip X and Y axes of the image.
3. 'N' optionally forces reload the image as a New image, even if an image
by this exact same name was already loaded and cached.
Parameters:
PTexture: | The string of the "ptexture" attribute.
|
---|
FName: | The texture file name will be placed here.
|
---|
Scale: | The scaling vector in XYZ or just XY if Z = IRIT_INFNTY.
|
---|
Flip: | If Image flipping was requested.
|
---|
NewImage: | if a new image of same name - replace in cache.
|
---|
Returned Value:
int: TRUE if parsed succesfully, FALSE otherwise.
|
---|
Keywords:
(readimag.c:1078)
Prototype:
int IrtImgParsePTextureString2(const char *PTexture,
char *FName,
IrtRType *Scale,
int *Flip,
int *NewImage,
int *FlipHorizontally,
int *FlipVertically)
Description:
Parses the string of the "ptexture" attribute.
"ImageName {, S X Y {Z}} {, F} {, N}, {, H}, {, V}" where
1. X, Y, and possibly Z are scaling factors of how many times the image
should fit into the object,
2. 'F' optionally request to flip X and Y axes of the image.
3. 'N' optionally forces reload the image as a New image, even if an image
by this exact same name was already loaded and cached.
4. 'H' optionally request to filp the image pixels horizontally.
5. 'V' optionally request to flip the image pixels vertically
Parameters:
PTexture: | The string of the "ptexture" attribute.
|
---|
FName: | The texture file name will be placed here.
|
---|
Scale: | The scaling vector in XYZ or just XY if
Z = IRIT_INFNTY.
|
---|
Flip: | If Image flipping was requested.
|
---|
NewImage: | if a new image of same name - replace in cache.
|
---|
FlipHorizontally: | If horizontal Image flipping was requested.
|
---|
FlipVertically: | If vertical Image flipping was requested.
|
---|
Returned Value:
int: TRUE if parsed succesfully, FALSE otherwise.
|
---|
Keywords:
(readimag.c:367)
Prototype:
void IrtImgReadClrCache(void)
Description:
Clears the cache of read images.
Parameters:
Returned Value:
See Also:
IrtImgReadImage2
IrtImgReadClrOneImage
IrtImgReadUpdateCache
Keywords:
(readimag.c:396)
Prototype:
void IrtImgReadClrOneImage(const char *ImageName)
Description:
Removes one image, by name from the cache of images.
Parameters:
ImageName: | Name of image to remove.
|
---|
Returned Value:
See Also:
IrtImgReadImage2
IrtImgReadClrCache
Keywords:
(readimag.c:131)
Prototype:
IrtImgPixelStruct *IrtImgReadImage(const char *ImageFileName,
int *MaxX,
int *MaxY,
int *Alpha)
Description:
Reads one image in from a file named ImageFileName. The image is
returned as a vector of RGBRGB... of size (MaxX+1) * (MaxY+1) * 3.
Parameters:
ImageFileName: | Name of image to read.
|
---|
MaxX: | Maximum X of read image is saved here.
|
---|
MaxY: | Maximum Y of read image is saved here.
|
---|
Alpha: | If TRUE, will attempt to load alpha channel if has any
and will return TRUE if successful in loading it.
|
---|
Returned Value:
IrtImgPixelStruct *: A vector of RGBRGB... of size
(MaxX+1) * (MaxY+1) * 3 or NULL if failed.
If however, Alpha is requested and found RGBARGBA... is
returned as IrtImgRGBAPxlStruct.
|
---|
See Also:
IrtImgReadImage2
IrtImgReadImage3
IrtImgReadImageXAlign
Keywords:
(readimag.c:205)
Prototype:
IrtImgPixelStruct *IrtImgReadImage2(const char *ImageFileName,
int *MaxX,
int *MaxY,
int *Alpha)
Description:
Same as IrtImgReadImage2 but if a name of an image repeats itself, the
image is read only once.
Parameters:
ImageFileName: | Name of image to read.
|
---|
MaxX: | Maximum X of read image is saved here.
|
---|
MaxY: | Maximum Y of read image is saved here.
|
---|
Alpha: | If TRUE, will attempt to load alpha channel if has any
and will return TRUE if successful in loading it.
|
---|
Returned Value:
IrtImgPixelStruct *: A vector of RGBRGB... of size
(MaxX+1) * (MaxY+1) * 3 or NULL if failed.
If however, Alpha is requested and found RGBARGBA... is
returned as IrtImgRGBAPxlStruct.
|
---|
See Also:
IrtImgReadImage
IrtImgReadImage3
IrtImgReadClrCache
IrtImgReadUpdateCache
Keywords:
(readimag.c:268)
Prototype:
IrtImgPixelStruct *IrtImgReadImage3(const char *ImageFileName,
int *MaxX,
int *MaxY,
int *Alpha)
Description:
Same as IrtImgReadImage2 but if a name of an image repeats itself, the
new image replaces the old one.
Parameters:
ImageFileName: | Name of image to read.
|
---|
MaxX: | Maximum X of read image is saved here.
|
---|
MaxY: | Maximum Y of read image is saved here.
|
---|
Alpha: | If TRUE, will attempt to load alpha channel if has any
and will return TRUE if successful in loading it.
|
---|
Returned Value:
IrtImgPixelStruct *: A vector of RGBRGB... of size
(MaxX+1) * (MaxY+1) * 3 or NULL if failed.
If however, Alpha is requested and found RGBARGBA... is
returned as IrtImgRGBAPxlStruct.
|
---|
See Also:
IrtImgReadImage
IrtImgReadImage2
IrtImgReadClrCache
IrtImgReadUpdateCache
Keywords:
(readimag.c:92)
Prototype:
int IrtImgReadImageXAlign(int Alignment)
Description:
Sets an alignment of the width of the image. For example, OGL requires
images to have width aligned on 4-bytes words (alignment 4).
Parameters:
Alignment: | Word size alignment required.
|
---|
Returned Value:
See Also:
IrtImgReadImage
IritImgWriteImg
Keywords:
(readimag.c:330)
Prototype:
int IrtImgReadUpdateCache(const char *ImageFileName,
int MaxX,
int MaxY,
int Alpha,
IrtBType *Image)
Description:
Update the cached image with the given one, in place, if found.
Parameters:
ImageFileName: | ame of image to update.
|
---|
MaxX: | Maximum X of updated image.
|
---|
MaxY: | Maximum Y of updated image.
|
---|
Alpha: | TRUE if image has alpha channel, in which case Image is
a sequence of RGBA. FALSE if only RGB is given in Image.
|
---|
Image: | The new image to replace old one with.
|
---|
Returned Value:
int: TRUE if image was found and updated. FALSE otherwise.
|
---|
See Also:
IrtImgReadImage2
IrtImgReadImage3
IrtImgReadClrOneImage
IrtImgReadClrCache
Keywords:
(writimag.c:369)
Prototype:
void IrtImgWriteCloseFile(MiscWriteGenInfoStruct *GI)
Description:
Closes output image file.
Parameters:
GI: | General info of the image write module.
|
---|
Returned Value:
Keywords:
output image
(writimag.c:225)
Prototype:
IrtImgImageType IrtImgWriteGetType(const char *ImageType)
Description:
Gets image type.
Parameters:
ImageType: | A string describing the image type.
|
---|
Returned Value:
IrtImgImageType: Returns the detected type.
|
---|
Keywords:
(writimag.c:279)
Prototype:
MiscWriteGenInfoStruct *IrtImgWriteOpenFile(const char **argv,
const char *FName,
IrtImgImageType ImageType,
int Alpha,
int XSize,
int YSize)
Description:
Opens output image file.
Parameters:
argv: | Pointer to the name of this program.
|
---|
FName: | Filename to open, or NULL for stdout.
|
---|
ImageType: | Type of image to open.
|
---|
Alpha: | Do we have an alpha channel.
|
---|
XSize: | X dimension of the image.
|
---|
YSize: | Y dimension of the image.
|
---|
Returned Value:
MiscWriteGenInfoStruct *: A handle on local image info if successful,
NULL otherwise.
|
---|
Keywords:
output image
(writimag.c:339)
Prototype:
void IrtImgWritePutLine(MiscWriteGenInfoStruct *GI,
IrtBType *Alpha,
IrtImgPixelStruct *Pixels)
Description:
Outputs given line of color pixels and alpha correction values to the
ouput image file.
Parameters:
GI: | General info of the image write module.
|
---|
Alpha: | Array of alpha values.
|
---|
Pixels: | Array of color pixels.
|
---|
Returned Value:
Keywords:
output image
(readmovi.c:871)
Prototype:
int IrtMovieParsePMovieString(const char *PMovie,
char *FName,
IrtRType *Scale,
int *NewImage,
int *Flip,
int *Restart,
IrtRType *TimeSetup,
int *FlipHorizontally,
int *FlipVertically)
Description:
Parses the string of the "pmovie" attribute. Can be
"MovieName {, S X Y {Z}} {,F} {,R} {, T=tmin,tmax} where
1. X, Y, and possibly Z are scaling factors of how many times the image
should fit into the object,
2. F optionally request to flip X and Y axes of the image.
3. R optionally request to restart the movie once it gets to the end.
4. T=tmin,tmax sets the time range of the movie.
Parameters:
PMovie: | The string of the "pmovie" attribute.
|
---|
FName: | The texture file name will be placed here.
|
---|
Scale: | The scaling vector in XYZ or just XY if Z = IRIT_INFNTY.
|
---|
NewImage: | Force read an image even if in cache as the file is new?
|
---|
Flip: | If Image flipping was requested.
|
---|
Restart: | TRUE to restart the movie onces it ends.
|
---|
TimeSetup: | A vector of 3 slots to hold (tmin, tmax, dt) if specified
or all are zero if not specified.
|
---|
FlipHorizontally: | If horizontal Image flipping was requested.
|
---|
FlipVertically: | If vertical Image flipping was requested.
|
---|
Returned Value:
int: TRUE if parsed successfully, FALSE otherwise.
|
---|
Keywords:
(readmovi.c:366)
Prototype:
void IrtMovieReadClrCache(void)
Description:
Clears the cache of read images.
Parameters:
Returned Value:
See Also:
IrtMovieReadMovie2
Keywords:
(readmovi.c:115)
Prototype:
IrtImgPixelStruct **IrtMovieReadMovie(const char *MovieFileName,
int *MaxX,
int *MaxY,
int *Alpha)
Description:
Reads a movie in from a file named MovieFileName. The movies are
returned as a vector of images: vector of RGBRGB... of size
(MaxX+1) * (MaxY+1) * 3.
Parameters:
MovieFileName: | Name of movie to read.
|
---|
MaxX: | Maximum X of read image is saved here.
|
---|
MaxY: | Maximum Y of read image is saved here.
|
---|
Alpha: | If TRUE, will attempt to load alpha channel if has any
and will return TRUE if successful in loading it.
|
---|
Returned Value:
IrtImgPixelStruct **: A NULL terminated vector of images. Each image
is itself a vector of RGBRGB... of size
(MaxX+1) * (MaxY+1) * 3 or NULL if failed.
If however, Alpha is requested and found RGBARGBA... is
returned as IrtImgRGBAPxlStruct.
|
---|
See Also:
IrtMovieReadMovie2
IrtMovieReadMovie3
IrtImgReadMovieXAlign
Keywords:
(readmovi.c:181)
Prototype:
IrtImgPixelStruct **IrtMovieReadMovie2(const char *MovieFileName,
int *MaxX,
int *MaxY,
int *Alpha)
Description:
Same as IrtMovieReadMovie but if a name of a movie repeats itself, the
movie is read only once.
Parameters:
MovieFileName: | Name of movie to read.
|
---|
MaxX: | Maximum X of read image is saved here.
|
---|
MaxY: | Maximum Y of read image is saved here.
|
---|
Alpha: | If TRUE, will attempt to load alpha channel if has any
and will return TRUE if successful in loading it.
|
---|
Returned Value:
IrtImgPixelStruct **: A NULL terminated vector of images. Each image
is itself a vector of RGBRGB... of size
(MaxX+1) * (MaxY+1) * 3 or NULL if failed.
If however, Alpha is requested and found RGBARGBA... is
returned as IrtImgRGBAPxlStruct.
|
---|
See Also:
IrtMovieReadMovie
IrtImgReadMovie3
IrtMovieReadClrCache
Keywords:
(readmovi.c:242)
Prototype:
IrtImgPixelStruct **IrtMovieReadMovie3(const char *MovieFileName,
int *MaxX,
int *MaxY,
int *Alpha)
Description:
Same as IrtMovieReadMovie2 but if a name of a movie repeats itself, the
new movie replaces the old one.
Parameters:
MovieFileName: | Name of movie to read.
|
---|
MaxX: | Maximum X of read image is saved here.
|
---|
MaxY: | Maximum Y of read image is saved here.
|
---|
Alpha: | If TRUE, will attempt to load alpha channel if has any
and will return TRUE if successful in loading it.
|
---|
Returned Value:
IrtImgPixelStruct **: A NULL terminated vector of images. Each image
is itself a vector of RGBRGB... of size
(MaxX+1) * (MaxY+1) * 3 or NULL if failed.
If however, Alpha is requested and found RGBARGBA... is
returned as IrtImgRGBAPxlStruct.
|
---|
See Also:
IrtMovieReadMovie
IrtImgReadMovie2
IrtMovieReadClrCache
Keywords:
(gnrl_mat.c:665)
Prototype:
IrtRType Mat2x2Determinant(IrtRType a11,
IrtRType a12,
IrtRType a21,
IrtRType a22)
Description:
Computes a 2x2 determinant.
Parameters:
a11, a12, a21, a22: | Coefficients of the 2x2 matrix.
|
---|
Returned Value:
IrtRType: The determinant.
|
---|
Keywords:
(gnrl_mat.c:691)
Prototype:
IrtRType Mat3x3Determinant(IrtRType a11,
IrtRType a12,
IrtRType a13,
IrtRType a21,
IrtRType a22,
IrtRType a23,
IrtRType a31,
IrtRType a32,
IrtRType a33)
Description:
Computes 3x3 determinant.
Parameters:
a11, a12, a13, a21, a22, a23, a31, a32, a33: | oefficients of 3x3 matrix.
|
---|
Returned Value:
IrtRType: The determinant.
|
---|
Keywords:
(hmgn_mat.c:371)
Prototype:
void MatAddTwo4by4(IrtHmgnMatType MatRes,
IrtHmgnMatType Mat1,
IrtHmgnMatType Mat2)
Description:
Routine to add two 4by4 matrices.
MatRes may be one of Mat1 or Mat2.
Parameters:
MatRes: | Result of matrix addition.
|
---|
Mat1, Mat2: | The two operand of the matrix addition.
|
---|
Returned Value:
See Also:
MatGnrlAddTwo4by4
MatSubTwo4by4
MatMultTwo4by4
Keywords:
transformations
matrix addition
(hmgn_mat.c:601)
Prototype:
IrtRType MatDeterminantMatrix(IrtHmgnMatType Mat)
Description:
Computes the determinant of a 4 by 4 matrix.
Parameters:
Returned Value:
IrtRType: Determinant of Mat.
|
---|
Keywords:
determinant
(hmgn_mat.c:209)
Prototype:
void MatGenMatRotX(IrtRType CosTeta, IrtRType SinTeta, IrtHmgnMatType Mat)
Description:
Routine to generate a 4*4 matrix to Rotate around the X axis by Teta,
given the sin and cosine of Teta
Parameters:
CosTeta, SinTeta: | Amount of rotation, given as sine and cosine of Teta.
|
---|
Mat: | Matrix to initialize as a rotation matrix.
|
---|
Returned Value:
Keywords:
transformations
rotation
(hmgn_mat.c:185)
Prototype:
void MatGenMatRotX1(IrtRType Teta, IrtHmgnMatType Mat)
Description:
Routine to generate a 4*4 matrix to Rotate around the X axis by Teta
radians.
Parameters:
Teta: | Amount of rotation, in radians.
|
---|
Mat: | Matrix to initialize as a rotation matrix.
|
---|
Returned Value:
Keywords:
transformations
rotation
(hmgn_mat.c:257)
Prototype:
void MatGenMatRotY(IrtRType CosTeta, IrtRType SinTeta, IrtHmgnMatType Mat)
Description:
Routine to generate a 4*4 matrix to Rotate around the Y axis by Teta,
given the sin and cosine of Teta
Parameters:
CosTeta, SinTeta: | Amount of rotation, given as sine and cosine of Teta.
|
---|
Mat: | Matrix to initialize as a rotation matrix.
|
---|
Returned Value:
Keywords:
transformations
rotation
(hmgn_mat.c:233)
Prototype:
void MatGenMatRotY1(IrtRType Teta, IrtHmgnMatType Mat)
Description:
Routine to generate a 4*4 matrix to Rotate around the Y axis by Teta
radians.
Parameters:
Teta: | Amount of rotation, in radians.
|
---|
Mat: | Matrix to initialize as a rotation matrix.
|
---|
Returned Value:
Keywords:
transformations
rotation
(hmgn_mat.c:305)
Prototype:
void MatGenMatRotZ(IrtRType CosTeta, IrtRType SinTeta, IrtHmgnMatType Mat)
Description:
Routine to generate a 4*4 matrix to Rotate around the Z axis by Teta,
given the sin and cosine of Teta
Parameters:
CosTeta, SinTeta: | Amount of rotation, given as sine and cosine of Teta.
|
---|
Mat: | Matrix to initialize as a rotation matrix.
|
---|
Returned Value:
Keywords:
transformations
rotation
(hmgn_mat.c:281)
Prototype:
void MatGenMatRotZ1(IrtRType Teta, IrtHmgnMatType Mat)
Description:
Routine to generate a 4*4 matrix to Rotate around the Z axis by Teta
radians.
Parameters:
Teta: | Amount of rotation, in radians.
|
---|
Mat: | Matrix to initialize as a rotation matrix.
|
---|
Returned Value:
Keywords:
transformations
rotation
(hmgn_mat.c:143)
Prototype:
void MatGenMatScale(IrtRType Sx, IrtRType Sy, IrtRType Sz, IrtHmgnMatType Mat)
Description:
Routine to generate a 4*4 matrix to Scale x, y, z in Sx, Sy, Sz amounts.
Parameters:
Sx, Sy, Sz: | Scaling factors requested.
|
---|
Mat: | Matrix to initialize as a scaling matrix.
|
---|
Returned Value:
Keywords:
transformations
scaling
(hmgn_mat.c:121)
Prototype:
void MatGenMatTrans(IrtRType Tx, IrtRType Ty, IrtRType Tz, IrtHmgnMatType Mat)
Description:
Routine to generate a 4*4 matrix to translate in Tx, Ty, Tz amounts.
Parameters:
Tx, Ty, Tz: | Translational amounts requested.
|
---|
Mat: | Matrix to initialize as a translation matrix.
|
---|
Returned Value:
Keywords:
transformations
translation
(hmgn_mat.c:165)
Prototype:
void MatGenMatUnifScale(IrtRType Scale, IrtHmgnMatType Mat)
Description:
Routine to generate a 4*4 matrix to uniformly scale Scale amount.
Parameters:
Scale: | Uniform scaling factor requested.
|
---|
Mat: | Matrix to initialize as a scaling matrix.
|
---|
Returned Value:
Keywords:
transformations
scaling
(hmgn_mat.c:31)
Prototype:
void MatGenUnitMat(IrtHmgnMatType Mat)
Description:
Routine to generate a 4*4 unit matrix:
Parameters:
Mat: | Matrix to initialize as a unit matrix.
|
---|
Returned Value:
See Also:
MatGnrlUnitMat
Keywords:
transformations
unit matrix
(gnrl_mat.c:164)
Prototype:
void MatGnrlAddTwoMat(IrtGnrlMatType MatRes,
IrtGnrlMatType Mat1,
IrtGnrlMatType Mat2,
int n)
Description:
Routine to add two general matrices.
MatRes may be one of Mat1 or Mat2.
Parameters:
MatRes: | Result of matrix addition.
|
---|
Mat1, Mat2: | The two operand of the matrix addition.
|
---|
n: | Size of matrices MatRes/Mat1/Mat2.
|
---|
Returned Value:
See Also:
MatAddTwoMat
MatGntlMultTwomat
MatGnrlSubTwoMat
MatGnrlScaleMat
Keywords:
transformations
matrix addition
(gnrl_mat.c:29)
Prototype:
void MatGnrlCopy(IrtGnrlMatType Dst, IrtGnrlMatType Src, int n)
Description:
Routine to copy a (n x n) matrix:
Parameters:
Dst: | Matrix to copy to.
|
---|
Src: | Matrix to copy from.
|
---|
n: | Size of matrix Mat.
|
---|
Returned Value:
Keywords:
transformations
(gnrl_mat.c:480)
Prototype:
IrtRType MatGnrlDetMatrix(IrtGnrlMatType M, int n)
Description:
Given a general matrix, computes its determinant, recorsively. Note
this process is exponential as a function of n (as you might expect) so
use it with care (for small matrices only).
Parameters:
M: | The square matrix of size (n x n) to compute its determinant.
|
---|
n: | Size of the Matrix.
|
---|
Returned Value:
IrtRType: Value of the determinant.
|
---|
See Also:
MatGnrlInverseMatrix
MatGnrlTranspMatrix
Keywords:
(gnrl_mat.c:340)
Prototype:
int MatGnrlInverseMatrix(IrtGnrlMatType M, IrtGnrlMatType InvM, int n)
Description:
Routine to compute the INVERSE of a given matrix M which is not modified.
Return TRUE if inverted matrix (InvM) do exists.
Parameters:
M: | Original matrix to invert.
|
---|
InvM: | Inverted matrix will be placed here.
|
---|
n: | Sizes of matrices M/InvM.
|
---|
Returned Value:
int: TRUE if inverse exists, FALSE otherwise.
|
---|
See Also:
MatInverseMatrix
MatGnrlTranspMatrix
Keywords:
transformations
matrix inverse
(gnrl_mat.c:83)
Prototype:
int MatGnrlIsUnitMatrix(IrtGnrlMatType Mat, IrtRType Eps, int n)
Description:
Test if the given matrix is a unit matrix to within Eps.
Parameters:
Mat: | Matrix to test if a unit matrix.
|
---|
Eps: | Epsilon of test.
|
---|
n: | Size of matrix Mat.
|
---|
Returned Value:
int: TRUE if unit matrix to within epsilon, FALSE otherwise.
|
---|
See Also:
MatGnrlUnitMat
MatIsUnitMatrix
Keywords:
(gnrl_mat.c:119)
Prototype:
void MatGnrlMultTwoMat(IrtGnrlMatType MatRes,
IrtGnrlMatType Mat1,
IrtGnrlMatType Mat2,
int n)
Description:
Routine to multiply two general matrices.
MatRes may be one of Mat1 or Mat2 - it is only updated in the end.
Parameters:
MatRes: | Result of matrix product.
|
---|
Mat1, Mat2: | The two operand of the matrix product.
|
---|
n: | Size of matrices MatRes/Mat1/Mat2.
|
---|
Returned Value:
See Also:
MatMultTwoMat
MatGnrlAddTwoMat
MatGnrlSubTwoMat
Keywords:
transformations
matrix product
(gnrl_mat.c:256)
Prototype:
void MatGnrlMultVecbyMat(IrtVecGnrlType VecRes,
IrtGnrlMatType Mat,
IrtVecGnrlType Vec,
int n)
Description:
Routine to mult a vector of len n by a general matrix of size (n x n),
as VecRes = Mat * Vec.
Parameters:
VecRes: | Result of vector - matrix product. Can be Vec.
|
---|
Mat: | General matrix.
|
---|
Vec: | Vector to transform using Matrix.
|
---|
n: | Sizes of vectors Vec/VecRes and of matrix Mat.
|
---|
Returned Value:
See Also:
MatMultVecby4by4
MatGnrlMultVecbyMat2
Keywords:
transformations
vector matrix product
(gnrl_mat.c:299)
Prototype:
void MatGnrlMultVecbyMat2(IrtVecGnrlType VecRes,
IrtVecGnrlType Vec,
IrtGnrlMatType Mat,
int n)
Description:
Routine to mult a vector of len n by a general matrix of size (n x n),
as VecRes = Vec * Mat.
Parameters:
VecRes: | Result of vector - matrix product. Can be Vec.
|
---|
Vec: | Vector to transform using Matrix.
|
---|
Mat: | General matrix.
|
---|
n: | Sizes of vectors Vec/VecRes and of matrix Mat.
|
---|
Returned Value:
See Also:
MatMultVecby4by4
MatGnrlMultVecbyMat
Keywords:
transformations
vector matrix product
(gnrl_mat.c:529)
Prototype:
int MatGnrlOrthogonalSubspace(IrtGnrlMatType M, int n)
Description:
Given m (m < n) vectors as rows in matrix M, and zeros at the rest of
the rows, computes n-m new vectors of the orthogonal space to the space
spanned by the input m vectors. Uses SVD in the computation and saves
the new, orthogonal, vectors in the last n-m rows of M, in place.
Parameters:
M: | A matrix holding m (m < n) vectors as rows.
|
---|
n: | Size of marix M (and the space).
|
---|
Returned Value:
int: TRUE if successful, FALSE otherwise.
|
---|
Keywords:
(gnrl_mat.c:637)
Prototype:
void MatGnrlPrintMatrix(IrtGnrlMatType M, int n, FILE *F)
Description:
Routine to print matrix M to file F.
Parameters:
M: | Matrix to print.
|
---|
n: | Size of matrix Mat.
|
---|
F: | What file to print to.
|
---|
Returned Value:
Keywords:
transformations
matrix transpose
(gnrl_mat.c:225)
Prototype:
void MatGnrlScaleMat(IrtGnrlMatType MatRes,
IrtGnrlMatType Mat,
IrtRType *Scale,
int n)
Description:
Routine to scale a general matrix, by a scalar value.
MatRes may be Mat.
Parameters:
MatRes: | Result of matrix scaling.
|
---|
Mat: | The two operand of the matrix scaling.
|
---|
Scale: | Scalar value to multiple matrix with.
|
---|
n: | Size of matrices MatRes/Mat.
|
---|
Returned Value:
See Also:
MatScaleMat
MatGnrlAddTwoMat
MatGntlMultTwoMat
Keywords:
transformations
matrix scaling
(gnrl_mat.c:194)
Prototype:
void MatGnrlSubTwoMat(IrtGnrlMatType MatRes,
IrtGnrlMatType Mat1,
IrtGnrlMatType Mat2,
int n)
Description:
Routine to subtract two general matrices.
MatRes may be one of Mat1 or Mat2.
Parameters:
MatRes: | Result of matrix subtraction.
|
---|
Mat1, Mat2: | The two operand of the matrix subtraction.
|
---|
n: | Size of matrices MatRes/Mat1/Mat2.
|
---|
Returned Value:
See Also:
MatSubTwoMat
MatGnrlAddTwoMat
MatGntlMultTwoMat
MatGnrlScaleMat
Keywords:
transformations
matrix subtraction
(gnrl_mat.c:445)
Prototype:
void MatGnrlTranspMatrix(IrtGnrlMatType M, IrtGnrlMatType TranspM, int n)
Description:
Routine to compute the TRANSPOSE of matrix M which is not modified.
Parameters:
M: | Original matrix to transpose.
|
---|
TranspM: | Transposed matrix will be placed here.
|
---|
n: | Sizes of matrices M/TranspM.
|
---|
Returned Value:
See Also:
MatTranspMatrix
MatGnrlTranspMatrix
Keywords:
transformations
matrix transpose
(gnrl_mat.c:51)
Prototype:
void MatGnrlUnitMat(IrtGnrlMatType Mat, int n)
Description:
Routine to generate a (n x n) unit matrix:
Parameters:
Mat: | Matrix to initialize as a unit matrix.
|
---|
n: | Size of matrix Mat.
|
---|
Returned Value:
See Also:
MatGenUnitMat
Keywords:
transformations
unit matrix
(hmgn_mat.c:643)
Prototype:
int MatInverseMatrix(IrtHmgnMatType M, IrtHmgnMatType InvM)
Description:
Routine to compute the INVERSE of a given matrix M which is not modified.
The matrix is assumed to be 4 by 4 (transformation matrix).
Return TRUE if inverted matrix (InvM) do exists.
Parameters:
M: | Original matrix to invert.
|
---|
InvM: | Inverted matrix will be placed here. Can be same as M.
|
---|
Returned Value:
int: TRUE if inverse exists, FALSE otherwise.
|
---|
See Also:
MatTranspMatrix
Keywords:
transformations
matrix inverse
(hmgn_mat.c:60)
Prototype:
int MatIsUnitMatrix(IrtHmgnMatType Mat, IrtRType Eps)
Description:
Test if the given matrix is a unit matrix to within Eps.
Parameters:
Mat: | Matrix to test if a unit matrix.
|
---|
Eps: | Epsilon of test.
|
---|
Returned Value:
int: TRUE if unit matrix to within epsilon, FALSE otherwise.
|
---|
See Also:
MatGenUnitMat
MatGnrlIsUnitMatrix
MatIsWeightAffected
Keywords:
(hmgn_mat.c:92)
Prototype:
int MatIsWeightAffected(IrtHmgnMatType Mat, IrtRType Eps)
Description:
Test if the given matrix affects the weight in any way (i.e. W = 1 will
not be W = 1 after the transform).
Parameters:
Mat: | Matrix to test if weight is affected by it.
|
---|
Eps: | Epsilon of test.
|
---|
Returned Value:
int: TRUE if matrix indeed affects the weight coefficient.
|
---|
See Also:
MatGenUnitMat
MatGnrlIsUnitMatrix
MatIsUnitMatrix
Keywords:
(hmgn_mat.c:524)
Prototype:
void MatMultPtby4by4(IrtPtType PtRes,
const IrtPtType Pt,
IrtHmgnMatType Mat)
Description:
Routine to multiply a XYZ point by 4by4 matrix:
The point has only 3 components (X, Y, Z) and it is assumed that W = 1.
PtRes may be Pt as it is only updated in the end.
Parameters:
PtRes: | Result of point - matrix product.
|
---|
Pt: | Point to transfrom using Matrix.
|
---|
Mat: | Transformation matrix.
|
---|
Returned Value:
See Also:
MatMultVecby4by4
MatMultWVec2by4by4
Keywords:
transformations
vector matrix product
(hmgn_mat.c:335)
Prototype:
void MatMultTwo4by4(IrtHmgnMatType MatRes,
IrtHmgnMatType Mat1,
IrtHmgnMatType Mat2)
Description:
Routine to multiply two 4by4 matrices.
MatRes = Mat1 * Mat2 assumed Mat[i][j] refers to row i and column j.
MatRes may be one of Mat1 or Mat2 - it is only updated in the end.
Parameters:
MatRes: | Result of matrix product.
|
---|
Mat1, Mat2: | The two operand of the matrix product.
|
---|
Returned Value:
See Also:
MatGnrlMultTwo4by4
MatSubTwo4by4
MatAddTwo4by4
Keywords:
transformations
matrix product
(hmgn_mat.c:491)
Prototype:
void MatMultVecby4by4(IrtVecType VecRes,
const IrtVecType Vec,
IrtHmgnMatType Mat)
Description:
Routine to multiply an XYZ Vector by 4by4 matrix:
The Vector has only 3 components (X, Y, Z) and it is assumed that W = 0.
VRes may be Vec as it is only updated in the end.
Parameters:
VecRes: | Result of vector - matrix product.
|
---|
Vec: | Vector to transfrom using Matrix.
|
---|
Mat: | Transformation matrix.
|
---|
Returned Value:
See Also:
MatMultPtby4by4
MatMultWVec2by4by4
Keywords:
transformations
vector matrix product
(hmgn_mat.c:572)
Prototype:
void MatMultWVecby4by4(IrtRType VRes[4],
const IrtRType Vec[4],
IrtHmgnMatType Mat)
Description:
Routine to multiply a WXYZ Vector by 4by4 matrix:
The Vector has only 4 components (X, Y, Z, W).
VRes may be Vec as it is only updated in the end.
Parameters:
VRes: | Result of vector - matrix product.
|
---|
Vec: | Vector to transfrom using Matrix.
|
---|
Mat: | Transformation matrix.
|
---|
Returned Value:
See Also:
MatMultPtby4by4
MatMultVec2by4by4
Keywords:
transformations
vector matrix product
(hmgn_mat.c:883)
Prototype:
void MatRotSclFactorMatrix(IrtHmgnMatType M, IrtHmgnMatType RotSclMat)
Description:
Routine to estimate the rotation and scale factors in a matrix.
Parameters:
M: | Matrix to extract rotation and scale factors from.
|
---|
RotSclMat: | The rotation and scale factors of matrix M.
|
---|
Returned Value:
See Also:
MatScaleFactorMatrix
MatRotateFactorMatrix
MatTranslateFactorMatrix
Keywords:
transformations
(hmgn_mat.c:842)
Prototype:
void MatRotateFactorMatrix(IrtHmgnMatType M, IrtHmgnMatType RotMat)
Description:
Routine to estimate the rotation factor in a matrix.
Parameters:
M: | Matrix to extract rotation factors.
|
---|
RotMat: | The rotational factors of matrix M.
|
---|
Returned Value:
See Also:
MatScaleFactorMatrix
MatTranslateFactorMatrix
MatRotSclFactorMatrix
Keywords:
transformations
(hmgn_mat.c:455)
Prototype:
int MatSameTwo4by4(IrtHmgnMatType Mat1,
IrtHmgnMatType Mat2,
IrtRType Eps)
Description:
Compare two homogeneous matrices for approximate equality.
Parameters:
Mat1, Mat2: | Two homogeneous matrices to compare.
|
---|
Eps: | Tolerance of comparison.
|
---|
Returned Value:
int: TRUE if similar, FALSE otherwise.
|
---|
Keywords:
(hmgn_mat.c:430)
Prototype:
void MatScale4by4(IrtHmgnMatType MatRes,
IrtHmgnMatType Mat,
const IrtRType *Scale)
Description:
Routine to scale a 4by4 matrix.
MatRes may be Mat.
Parameters:
MatRes: | Result of matrix scaling.
|
---|
Mat: | The two operand of the matrix scaling.
|
---|
Scale: | Scalar value to multiple matrix with.
|
---|
Returned Value:
See Also:
MatGnrlScaleMat
MatSubTwo4by4
MatAddTwo4by4
MatMultTwo4by4
Keywords:
transformations
matrix scaling
(hmgn_mat.c:765)
Prototype:
IrtRType MatScaleFactorMatrix(IrtHmgnMatType M)
Description:
Routine to estimate the scaling factor in a matrix by computing the
SVD decomposition of the matrix and if fails, use average of the scale of
the X, Y, and Z unit vectors.
Parameters:
M: | Matrix to estimate scaling factors (assume positive scales).
|
---|
Returned Value:
IrtRType: Estimated Scaling factor (returns positive scale values).
|
---|
See Also:
MatRotateFactorMatrix
MatTranslateFactorMatrix
MatRotSclFactorMatrix
MatScaleFactorMatrix2
Keywords:
transformations
(hmgn_mat.c:795)
Prototype:
IrtRType *MatScaleFactorMatrix2(IrtHmgnMatType M, IrtVecType ScaleVec)
Description:
Routine to estimate the scaling factor in a matrix by computing the
SVD decomposition of the matrix and if fails, maps and measures the scale
of unit vectors in the X, Y, and Z direction.
Parameters:
M: | Matrix to estimate scaling factors (assume positive scales).
|
---|
ScaleVec: | To save the eEstimated Scaling factor in the XYZ directions.
|
---|
Returned Value:
IrtRType *: Estimated Scaling factor in the XYZ directions.
Same as ScaleVec.
|
---|
See Also:
MatRotateFactorMatrix
MatTranslateFactorMatrix
MatRotSclFactorMatrix
MatScaleFactorMatrix
Keywords:
transformations
(hmgn_mat.c:400)
Prototype:
void MatSubTwo4by4(IrtHmgnMatType MatRes,
IrtHmgnMatType Mat1,
IrtHmgnMatType Mat2)
Description:
Routine to subtract two 4by4 matrices.
MatRes may be one of Mat1 or Mat2.
Parameters:
MatRes: | Result of matrix subtraction.
|
---|
Mat1, Mat2: | The two operand of the matrix subtraction.
|
---|
Returned Value:
See Also:
MatGnrlSubTwo4by4
MatAddTwo4by4
MatMultTwo4by4
Keywords:
transformations
matrix subtraction
(hmgn_mat.c:908)
Prototype:
void MatTranslateFactorMatrix(IrtHmgnMatType M, IrtVecType Trans)
Description:
Routine to estimate the translation factors in a matrix.
Parameters:
M: | Matrix to extract rotation factors.
|
---|
Trans: | The translation factors of matrix M.
|
---|
Returned Value:
See Also:
MatScaleFactorMatrix
MatRotateFactorMatrix
Keywords:
transformations
(hmgn_mat.c:732)
Prototype:
void MatTranspMatrix(IrtHmgnMatType M, IrtHmgnMatType TranspM)
Description:
Routine to compute the TRANSPOSE of a given matrix M which is not modified.
The matrix is assumed to be 4 by 4 (transformation matrix).
Parameters:
M: | Original matrix to transpose.
|
---|
TranspM: | Transposed matrix will be placed here. Can be same as M.
|
---|
Returned Value:
See Also:
MatInverseMatrix
Keywords:
transformations
matrix transpose
(bipartte2.c:102)
Prototype:
int *MiscBiPrComputeMinCostRecMatching(const IrtRType *CostMat,
int NumRows,
int NumCols)
Description:
Implementation of Kunh-Munkres algorithm version of the Hungarian alg. for
the rectangular (unbalanced) weighted bi-partite graph. The original
Munkres algorithm finds the minimal assignment between N workers and N
jobs given the N x N cost matrix, by starring and priming the cost matrix
and covering and uncovering the rows and columns. This implementation is
the modified version of Munkres algorithm to handle the rectangular M x N
cost matrix. When k = min (M, N), this function finds at most k
assignments.
The cost matrix (CostMat) is a 1D array storing the costs(weights) in a
column-major order: CostMat[r + NumRows * c] stores the cost at row r and
column c from the cost matrix. Invalid costs are represented as infinity.
The flow diagram of the algorithm is as follows:
*
Step 1(Preprocess)
-> Step 2 -> Exit
-> Step 3 -> Step 4 -> Step 2
-> Step 5 -> Step 3
Time complexity of Munkres algorithm is O(n^3).
*
[Reference]
1. J. Munkres. Algorithms for the Assignment and Transportation Problems.
Journal of the Society for Industrial and Applied Mathematics, Vol. 5,
No. 1, pp. 32--38, 1958.
2. R.A. Pilgrim, Munkres' Assignment Algorithm. Modified for Rectangular
Matrices.
(http://csclab.murraystate.edu/~bob.pilgrim/445/munkres.html),
Course notes, Murray State University.
3. M. Buehren. Functions for the rectangular assignment problem.
(https://www.mathworks.com/matlabcentral/fileexchange/
6543-functions-for-the-rectangular-assignment-problem), MATLAB Central
File Exchange. 2020.
Parameters:
CostMat: | Cost matrix of size R x C. The costs are stored in a column-
major, i.e., CostMat[r + NumRows * c]. Costs should be
always nonnegative and invalid weights are represented as
infinity.
|
---|
NumRows: | Number of rows in the cost matrix.
|
---|
NumCols: | Number of columns in the cost matrix.
|
---|
Returned Value:
int *: A 1D array of size R. Stores the matched column index for each
row when Match[i] = -1, row i does not match to any column.
|
---|
See Also:
Keywords:
(bipartte.c:84)
Prototype:
int MiscBiPrWeightedMatchBipartite(const IrtRType **Weight,
IritBiPrWeightedMatchStruct *Match,
int n)
Description:
Implementation of Shortest-Path variation of the Hungarian algorithm, from
"Assignment Problems" by R. Burkard, M. Dell'Amico, S. Martello
Algorithm 4.10 Hungarian_SP, page 97. Complexity: O(n^3)
The sacnning order of the graph's vertices is chosen at random.
Parameters:
Weight: | Cost matrix of size n*n, passed as an array of size n holding
pointers to arrays of size n.
Weight[i][j] is the cost of the edge between vertices i and j.
Negative entry denotes that there is no edge (== edge cost is
infinite).
|
---|
Match: | Array of size n allocated in advance.
Returns with the optimal matching found. For every 0 <= i < n
Match[i].m1 = i
Match[i].m2 = vertex that is matched to i
Match[i].m3 = unused
|
---|
n: | Number of vertices in each side of the bi-partite graph.
|
---|
Returned Value:
int: 0 if an optimal match was found - in such case the array Match is
filled with the optimal matching found. Negative value if there is
no match in the graph - in such case Match may be undefined.
|
---|
Keywords:
(misc_err.c:43)
Prototype:
const char *MiscDescribeError(MiscFatalErrorType ErrorNum)
Description:
Returns a string describing a the given error. Errors can be raised by
any member of this misc library as well as other users. Raised error will
cause an invokation of MiscFatalError function which decides how to handle
this error. MiscFatalError can for example, invoke this routine with the
error type, print the appropriate message and quit the program.
Parameters:
ErrorNum: | Type of the error that was raised.
|
---|
Returned Value:
const char *: A string describing the error type.
|
---|
Keywords:
error handling
(misc_ftl.c:57)
Prototype:
void MiscFatalError(MiscFatalErrorType ErrID, char *ErrDesc)
Description:
Trap Misc_lib errors right here. Provides a default error handler for the
misc library. Gets an error description using MiscDescribeError, prints it
and exit the program using exit.
Parameters:
ErrID: | Error type that was raised.
|
---|
ErrDesc: | Possibly, an additional description on error.
|
---|
Returned Value:
Keywords:
error handling
(hash2tbl.c:136)
Prototype:
int MiscHashAddElement(MiscHashPtrType Hash,
void *Elem,
unsigned long SizeInByte)
Description:
Hash the given element and insert it into the table.
The added element is the returned value from the CopyFunc given to
MiscHashNewHash. More than one identical element can exist in the table.
The element's auxilary data is initialized to 0.
Parameters:
Hash: | The hash table.
|
---|
Elem: | The element to hash.
|
---|
SizeInByte: | he second parameter to pass to the hash function.
|
---|
Returned Value:
int: -1 if unable to add, 0 otherwise.
|
---|
Keywords:
(hash2tbl.c:233)
Prototype:
int MiscHashFindElement(MiscHashPtrType Hash,
void *Elem,
unsigned long SizeInByte)
Description:
Looks for the given element in the hash table (using the CompFunc
given to MiscHashNewHash).
The Element and SizeInByte will be passed to the hash function.
Parameters:
Hash: | The hash table.
|
---|
Elem: | The element to hash.
|
---|
SizeInByte: | he second parameter to pass to the hash function. If the
second parameter is not equal to the one used to hash the
element, the element may not be found even if it is in the
hash table.
|
---|
Returned Value:
int: 0 if found, -1 otherwise.
|
---|
Keywords:
(hash2tbl.c:288)
Prototype:
void MiscHashFreeHash(MiscHashPtrType Hash)
Description:
Frees the given hash table.
Parameters:
Hash: | he hash table to free.
|
---|
Returned Value:
Keywords:
(hash2tbl.c:265)
Prototype:
long *MiscHashGetElementAuxData(MiscHashPtrType Hash,
void *Elem,
unsigned long SizeInByte)
Description:
Find the first occurence of Elem in the hash table (using the CompFunc
given to MiscHashNewHash) and return a pointer to its auxilary data
(The auxilary data may be changed without influencing the hash table).
The Element and SizeInByte will be passed to the hash function.
Parameters:
Hash: | The hash table.
|
---|
Elem: | The element to retrieve its auxilary data.
|
---|
SizeInByte: | he second parameter to pass to the hash function. If the
second parameter is not equal to the one used to hash the
element, the element may not be found even if it is in the
hash table.
|
---|
Returned Value:
long *: Pointer to Elem's auxilary data. NULL if Elem doesn't exist
in the hash table.
|
---|
Keywords:
(hash2tbl.c:75)
Prototype:
MiscHashPtrType MiscHashNewHash(unsigned long Size,
MiscHashFuncType HashFunc,
MiscHashCopyFuncType CopyFunc,
MiscHashFreeFuncType FreeFunc,
MiscHashCompFuncType CompFunc)
Description:
Creates a new Hash Table.
Parameters:
Size: | The size of the hash table (the range of the hash function
should be compatible).
|
---|
HashFunc: | The function used for hashing (the range should be compatible
with HashSize). Receives 2 parameters to make it easy to hash
arrays.
|
---|
CopyFunc: | The function that will be used to copy elements (for example
when hashing a new element).
|
---|
FreeFunc: | The function that will be used to free elements (for example
when freeing the hash table).
|
---|
CompFunc: | The function that will be used to compare elements (for
example when looking for an element in the hash table).
|
---|
Returned Value:
MiscHashPtrType: The new hash table if successful, of NULL if failed.
|
---|
Keywords:
(imgstcvr.c:1648)
Prototype:
int MiscISCAddPicture(MiscISCCalculatorPtrType Calc, MiscISCPixelType *Picture)
Description:
Adds a picture to the calculator. Copies the picture (will be freed
when the calculator is freed).
Parameters:
Calc: | The calculator to add the picture to.
|
---|
Picture: | he picture to add.
|
---|
Returned Value:
int: FALSE if error occurred.
|
---|
See Also:
Keywords:
(imgstcvr.c:2685)
Prototype:
int MiscISCCalculateExact(MiscISCCalculatorPtrType Calc,
int SizeLimit,
int **SolutionByIndex,
int *SolutionSize,
IrtRType *CoverPart)
Description:
Calculates the cover. Uses an exact exponential Algorithm.
Each MiscISCCalculatorPtrType can be used only once with any search
algorithm.
Calling this funcion will move the calculator to compute phase.
Parameters:
Calc: | The calculator.
|
---|
SizeLimit: | IN, if this value is greater than 0 the algorithm will
stop adding pictures when getting to that size of
pictures combinations and revert to search in other
branches. This will speed the algorithm though may not
find any solution at all in which case the combination
with the best cover will be returned.
|
---|
SolutionByIndex: | UT, The solution as indices of pictures.
|
---|
SolutionSize: | OUT, The size of the solution (size of SolutionByIndex).
|
---|
CoverPart: | OUT, The part of the uprocessed picture covered by the
solution.
|
---|
Returned Value:
int: FALSE if error occurred.
|
---|
See Also:
Keywords:
MiscISCCalculateExactAux
(imgstcvr.c:2909)
Prototype:
int MiscISCCalculateExhaustive(MiscISCCalculatorPtrType Calc,
IrtRType CoverLimit,
int SizeLimit,
int **SolutionByIndex,
int *SolutionSize,
IrtRType *CoverPart)
Description:
Calculates the cover. Uses an exhaustive exponential Algorithm.
Each MiscISCCalculatorPtrType can be used only once with any search
algorithm.
Calling this funcion will move the calculator to compute phase.
Parameters:
Calc: | The calculator.
|
---|
CoverLimit: | IN, if this value is in (0,1), the algorithm will
consider a combination of pictures which covers
CoverLimit part of the image as a valid solution.
|
---|
SizeLimit: | IN, if this value is greater than 0 the algorithm will
stop adding pictures when getting to that size of
pictures combinations and revert to search in other
branches. This will speed the algorithm though may not
find any solution at all in which case the combination
with the best cover will be returned.
|
---|
SolutionByIndex: | UT, The solution as indices of pictures.
|
---|
SolutionSize: | OUT, The size of the solution (size of SolutionByIndex).
|
---|
CoverPart: | OUT, The part of the unprocessed pictured covered by the
solution.
|
---|
Returned Value:
int: FALSE if error occurred.
|
---|
See Also:
Keywords:
MiscISCCalculateExact
(imgstcvr.c:3389)
Prototype:
int MiscISCCalculateGreedy(MiscISCCalculatorPtrType Calc,
int **SolutionByIndex,
int *SolutionSize,
IrtRType *CoverPart)
Description:
Calculates the cover using quick and not optimal greedy algorithm. In
each step the algorithm choose the next picture to be the picture which
covers the maximum number of pixel out of the original unprocessed picture.
If Calc -> UseCoverLimit is TRUE, the algorithm's search will stop when
reaching cover the size of Calc -> CoverLimit and return the solution.
Each MiscISCCalculatorPtrType can be used only once with any search
algorithm.
Calling this funcion will move the calculator to compute phase.
Parameters:
Calc: | The calculator.
|
---|
SolutionByIndex: | UT, The solution as indices of pictures by the order
they were added to the solution.
|
---|
SolutionSize: | OUT, The size of the solution (size of SolutionByIndex).
|
---|
CoverPart: | OUT, The part of the unprocessed image covered by the
solution.
|
---|
Returned Value:
int: FALSE if error occurred.
|
---|
Keywords:
MiscISCCalculateGreedyAux
(imgstcvr.c:1560)
Prototype:
void MiscISCFreeCalculator(MiscISCCalculatorPtrType Calc)
Description:
Frees memory allocated for the calculator.
Parameters:
Returned Value:
See Also:
Keywords:
(imgstcvr.c:1422)
Prototype:
MiscISCCalculatorPtrType MiscISCNewCalculator(int MaxPictures,
MiscISCImageSizeType ImageSize,
MiscISCColorTypeEnum ColorType,
MiscISCPrintFuncType Print)
Description:
Creates a new calculator.
Parameters:
MaxPictures: | he maximal number of pictures the calculator will hold.
|
---|
ImageSize: | The number of pixels in each picture.
|
---|
ColorType: | Are the pictures in black & white or gray.
|
---|
Print: | Pointer to a printing routine where texture data should
go to or NULL to ignore.
|
---|
Returned Value:
MiscISCCalculatorPtrType: The new calculator or NULL if fails.
|
---|
Keywords:
(imgstcvr.c:1612)
Prototype:
int MiscISCSetImageToCover(MiscISCCalculatorPtrType Calc,
MiscISCPixelType *RequiredCover)
Description:
Set the image to be covered. A pixel with value 0 means that the pixel
isn't required to be covered. A pixel with value 1 means that the pixel is
required to be covered. If this function isn't called than all the pixel are
required to be covered.
The function makes an inner copy of RequiredCover (that copy will be freed
when the calculator is freed). The user may free or change RequiredCover's
memory without harming the process.
Parameters:
Calc: | The calculator to add the picture to.
|
---|
RequiredCover: | he cover picture to add.
|
---|
Returned Value:
int: FALSE if error occurred.
|
---|
See Also:
Keywords:
(list.c:91)
Prototype:
int MiscListAddElement(MiscListPtrType List,
void *Elem,
unsigned long SizeInByte)
Description:
Adds a new element to the beginning of the list.
The added element is the returned value from the CopyFunc given to
MiscListNewEmptyList.
Parameters:
List: | The list where the element will be inserted.
|
---|
Elem: | The element to add to the list. Must be compatible with the
functions given to MiscListNewEmptyList.
|
---|
SizeInByte: | an be used to pass an array size, for the Copy Function.
|
---|
Returned Value:
int: -1 if unable to add, 0 otherwise.
|
---|
Keywords:
(list.c:158)
Prototype:
int MiscListCompLists(MiscListPtrType L1, MiscListPtrType L2)
Description:
Compares the 2 given list element by element. The list are considered
equal if they have the same number of elements, in the same order.
Parameters:
L1: | A lists to compare.
|
---|
L2: | A lists to compare.
|
---|
Returned Value:
int: 0 if the lists are equal.
|
---|
Keywords:
(list.c:126)
Prototype:
int MiscListFindElementInList(MiscListPtrType List,
void *Elem,
unsigned long SizeInByte)
Description:
Looks for the give element in the list (using the CompFunc given to
MiscListNewEmptyList).
Parameters:
List: | The list where the element will be looked for.
|
---|
Elem: | The element to look for.
|
---|
SizeInByte: | he second parameter to pass to the CompFunc (CompFunc
takes 2 parametes to make it easy to compare arrays).
|
---|
Returned Value:
int: -1 if not found, 0 otherwise.
|
---|
Keywords:
(list.c:201)
Prototype:
void MiscListFreeList(MiscListPtrType List)
Description:
Frees the List (and elements).
Parameters:
Returned Value:
Keywords:
(list.c:264)
Prototype:
void MiscListFreeListIterator(MiscListIteratorPtrType It)
Description:
Frees the given iterator.
Parameters:
It: | The iterator to free.
|
---|
Returned Value:
Keywords:
(list.c:236)
Prototype:
MiscListIteratorPtrType MiscListGetListIterator(MiscListPtrType List)
Description:
Returns a new iterator to the given list. Before
MiscListIteratorFirst is used the place where the iterator points
to is undefined.
Parameters:
List: | The list to iterate over.
|
---|
Returned Value:
MiscListIteratorPtrType: The new iterator, of NULL if fails.
|
---|
Keywords:
(list.c:333)
Prototype:
int MiscListIteratorAtEnd(MiscListIteratorPtrType It)
Description:
Returns 1 if at the end of the List.
Parameters:
It: | The iterator to check.
|
---|
Returned Value:
int: 1 if at the end of the list, 0 otherwise.
|
---|
Keywords:
(list.c:286)
Prototype:
void *MiscListIteratorFirst(MiscListIteratorPtrType It)
Description:
Resets the iterator to the head of the list.
Parameters:
It: | The iterator to reset.
|
---|
Returned Value:
void *: The element at the head of the list.
|
---|
See Also:
Keywords:
(list.c:309)
Prototype:
void *MiscListIteratorNext(MiscListIteratorPtrType It)
Description:
Moves the iterator to the next element in the list. If used when the
iterator is at the end of the list the result is undefined.
Parameters:
It: | The iterator to move.
|
---|
Returned Value:
void *: The element at the new location in the list (if the new location
is the end of the list, the return value is NULL).
|
---|
Keywords:
(list.c:355)
Prototype:
void *MiscListIteratorValue(MiscListIteratorPtrType It)
Description:
Returns the data stored the the current element.
Parameters:
Returned Value:
void *: The data stored the the current element.
|
---|
Keywords:
(list.c:50)
Prototype:
MiscListPtrType MiscListNewEmptyList(MiscListCopyFuncType CopyFunc,
MiscListFreeFuncType FreeFunc,
MiscListCompFuncType CompFunc)
Description:
Creates a new List.
Parameters:
CopyFunc: | he function that will be used to copy elements (for example
when adding a new element to the list).
|
---|
FreeFunc: | he function that will be used to free elements (for example
when freeing the list).
|
---|
CompFunc: | he function that will be used to compare elements (for
example when looking for an element in the list).
|
---|
Returned Value:
MiscListPtrType: The new list if successful, of NULL if fails.
|
---|
Keywords:
(phashmap.c:56)
Prototype:
MiscPHashMap MiscPHashMapCreate(int HashSize)
Description:
Creates a hash map.
Parameters:
HashSize: | ize of the hash array.
|
---|
Returned Value:
MiscPHashMap: New hash map.
|
---|
Keywords:
(phashmap.c:94)
Prototype:
void MiscPHashMapDelete(MiscPHashMap HMap)
Description:
Destroys a hash map.
Parameters:
HMap: | ash map to destroy.
|
---|
Returned Value:
Keywords:
(phashmap.c:168)
Prototype:
MiscPHMResult MiscPHashMapGet(MiscPHashMap HMap,
MiscPHashMapKey Key,
MiscPHashMapValue *Value)
Description:
Gets the value of a given key in a hash map.
Parameters:
HMap: | ash map.
|
---|
Key: | ey to search for.
|
---|
Value: | eturn parameter of the key value if found.
|
---|
Returned Value:
MiscPHMResult: MISC_P_HMSUCCESS in success and MISC_P_MFAILURE otherwise.
|
---|
Keywords:
(phashmap.c:247)
Prototype:
void MiscPHashMapIterate(MiscPHashMap HMap, MiscPHashMapCBFunc CBFunc)
Description:
Iterates over the entries of a hash map and calls a call back
function on them.
Parameters:
HMap: | ash map.
|
---|
CBFunc: | ntries call back function.
|
---|
Returned Value:
Keywords:
(phashmap.c:274)
Prototype:
void MiscPHashMapPrint(MiscPHashMap HMap)
Description:
Prints the entries and other information of a hash map.
Parameters:
Returned Value:
Keywords:
(phashmap.c:203)
Prototype:
MiscPHMResult MiscPHashMapRemove(MiscPHashMap HMap, MiscPHashMapKey Key)
Description:
Removes key and its value from the hash map.
Parameters:
HMap: | Hash map.
|
---|
Key: | Key to search for.
|
---|
Returned Value:
MiscPHMResult: MISC_P_HMSUCCESS in success and MISC_P_MFAILURE otherwise
if the key is not found.
|
---|
Keywords:
(phashmap.c:127)
Prototype:
MiscPHMResult MiscPHashMapSet(MiscPHashMap HMap,
MiscPHashMapKey Key,
MiscPHashMapValue Value)
Description:
Add a key and a value to a hash map. If the key exists, its value is
replaced.
Parameters:
HMap: | ash map.
|
---|
Key, Value: | air of key,value to add.
|
---|
Returned Value:
MiscPHMResult: MISC_P_HMSUCCESS in success and MISC_P_MFAILURE otherwise.
|
---|
Keywords:
(misc_ftl.c:28)
Prototype:
MiscSetErrorFuncType MiscSetFatalErrorFunc(MiscSetErrorFuncType ErrorFunc)
Description:
Sets the error function to be used by Misc_lib.
Parameters:
ErrorFunc: | New error function to use.
|
---|
Returned Value:
MiscSetErrorFuncType: Old error function reference.
|
---|
Keywords:
error handling
(mincover.c:1180)
Prototype:
RLStruct *RLNewFromFile(const char *FileName)
Description:
Initializes an new RL using a file to describe the ranges.
Parameters:
FileName: | The file name containing the required details
|
---|
Returned Value:
RLStruct *: A new constrcuted RL
|
---|
See Also:
RLNew
Keywords:
RLNew
(miscattr.c:1631)
Prototype:
IPAttributeStruct *_AttrMallocAttributeHashNum(IPAttrNumType AttribHashNum,
IPAttributeType Type)
Description:
Allocated a new attribute structure, by hash number.
Parameters:
AttribHashNum: | Hash number of newly created attribute.
|
---|
Type: | Type of newly created attribute.
|
---|
Returned Value:
IPAttributeStruct *: The newly created attribute.
|
---|
Keywords:
(miscattr.c:1602)
Prototype:
IPAttributeStruct *_AttrMallocAttributeIDType(IPAttrNumType AttribID,
IPAttributeType Type)
Description:
Allocated a new attribute structure, by hash number.
Parameters:
AttribID: | ID of newly created attribute.
|
---|
Type: | Type of newly created attribute.
|
---|
Returned Value:
IPAttributeStruct *: The newly created attribute.
|
---|
See Also:
_AttrMallocAttributeNameType
Keywords:
(miscattr.c:1577)
Prototype:
IPAttributeStruct *_AttrMallocAttributeNameType(const char *Name,
IPAttributeType Type)
Description:
Allocated a new attribute structure.
Parameters:
Name: | Name of newly created attribute.
|
---|
Type: | Type of newly created attribute.
|
---|
Returned Value:
IPAttributeStruct *: The newly created attribute.
|
---|
See Also:
_AttrMallocAttributeIDType
Keywords:
(readimag.c:486)
Prototype:
IrtBType *_IrtImgVerifyAlignment(IrtBType *Data,
int *MaxX,
int *MaxY,
int Alpha)
Description:
Verifies the alignment of the image. Returned is either the input Data
if aligned, or a new aligned copy (and Data is freed).
Parameters:
Data: | Image data to verify alignment, in place.
|
---|
MaxX: | Current dimension of image. Might be changed after alignment.
|
---|
MaxY: | Current dimension of image.
|
---|
Alpha: | Do we have Alpha in the image?
|
---|
Returned Value:
IrtBType *: The verified image data.
|
---|
Keywords:
(xgeneral.c:980)
Prototype:
FILE *_wfopen(const wchar_t *Filename, const wchar_t *Mode)
Description:
Emulate, under non Windows OSs, the function _wfopen, by coercing the
wchar strings to ascii...
Parameters:
Filename: | The file name.
|
---|
Mode: | The file mode.
|
---|
Returned Value:
FILE *: Open file, or NULL if error.
|
---|
See Also:
_wpopen
_wgetenv
Keywords:
(xgeneral.c:1043)
Prototype:
wchar_t *_wgetenv(const wchar_t *WName)
Description:
Emulate, under non Windows OSs, the function _wgetenv, by coercing the
wchar strings to ascii...
Parameters:
WName: | Name of env. var. tofetch.
|
---|
Returned Value:
wchar_t *: Env. var. value, or NULL if not found.
|
---|
See Also:
_wfopen
_wpopen
Keywords:
(xgeneral.c:1012)
Prototype:
FILE *_wpopen(const wchar_t *Command, const wchar_t *Mode)
Description:
Emulate, under non Windows OSs, the function _wpopen, by coercing the
wchar strings to ascii...
Parameters:
Command: | The comamnd to execute.
|
---|
Mode: | The file mode.
|
---|
Returned Value:
FILE *: Open file, or NULL if error.
|
---|
See Also:
_wfopen
_wgetenv
Keywords:
(xgeneral.c:866)
Prototype:
char *getcwd(char *s, int Len)
Description:
Get current working directory - BSD4.3 style. *
Parameters:
s: | Where to save current working direction.
|
---|
Len: | Length of s.
|
---|
Returned Value:
Keywords:
(xgeneral.c:558)
Prototype:
void movmem(VoidPtr Src, VoidPtr Dest, int Len)
Description:
Routine to move a block in memory. Unlike memcpy/bcopy, this routine
should support overlaying blocks. This stupid implementation will copy it
twice - to a temporary block and back again. The temporary block size will
be allocated by demand.
Parameters:
Src: | Of block to copy.
|
---|
Dest: | Of block to copy.
|
---|
Len: | Of block to copy.
|
---|
Returned Value:
Keywords:
copy
(xgeneral.c:588)
Prototype:
const char *searchpath(const char *Name, char *FullPath)
Description:
Routine to search for a given file name.
Parameters:
Name: | Of file to search for.
|
---|
FullPath: | Where returned path will be written. Same as returned value.
|
---|
Returned Value:
const char *: Complete file name of Name. Same as FullPath.
|
---|
See Also:
searchpathW
Keywords:
(xgeneral.c:639)
Prototype:
const wchar_t *searchpathW(const wchar_t *Name, wchar_t *FullPath)
Description:
Routine to search for a given file name.
Parameters:
Name: | Of file to search for.
|
---|
FullPath: | Where returned path will be written. Same as returned value.
|
---|
Returned Value:
const wchar_t *: Complete file name of Name. Same as FullPath.
|
---|
See Also:
searchpath
Keywords:
(xgeneral.c:803)
Prototype:
int stricmp(const char *s1, const char *s2)
Description:
Routine to compare two strings, ignoring case.
Parameters:
s1, s2: | The two strings to compare.
|
---|
Returned Value:
int: <0, 0, >0 according to the relation between s1 and s2.
|
---|
Keywords:
(xgeneral.c:775)
Prototype:
int strnicmp(const char *s1, const char *s2, int n)
Description:
Routine to compare two strings, ignoring case, up to given length.
Parameters:
s1, s2: | The two strings to compare.
|
---|
n: | maximum number of characters to compare.
|
---|
Returned Value:
int: <0, 0, >0 according to the relation between s1 and s2.
|
---|
Keywords:
(xgeneral.c:835)
Prototype:
char *strstr(const char *s, const char *Pattern)
Description:
Routine to search for a Pattern (no regular expression) in s. Returns
address in s of first occurance of Pattern, NULL if non found.
Parameters:
s: | To search for Pattern in.
|
---|
Pattern: | To search in s.
|
---|
Returned Value:
char *: Address in s where Pattern was first found, NULL otherwise.
|
---|
Keywords: