int QccIMGImageComponentInitialize(QccIMGImageComponent
*image_component);
int QccIMGImageComponentAlloc(QccIMGImageComponent
*image_component);
void QccIMGImageComponentFree(QccIMGImageComponent
*image_component);
int QccIMGImageComponentPrint(const QccIMGImageComponent
*image_component);
int QccIMGImageComponentSetMin(QccIMGImageComponent
*image_component);
int QccIMGImageComponentSetMax(QccIMGImageComponent
*image_component);
int QccIMGImageComponentSetMaxMin(QccIMGImageComponent
*image_component);
int QccIMGImageComponentResize(QccIMGImageComponent *image_component, int num_rows, int num_cols);
The main component of a QccIMGImageComponent structure is a two-dimensional array of floating-point values representing the component's pixels.
typedef QccMatrix QccIMGImageArray;
typedef struct
{
QccString filename;
QccString magic_num;
int major_version;
int minor_version;
int num_rows;
int num_cols;
double min_val;
double max_val;
QccIMGImageArray image;
} QccIMGImageComponent;
The fields of QccIMGImageComponent are as follows:
The ICP file format consists of the following information:
where ICP is the magic number, X.X is the version number, <white space> is white space and/or comment lines, C is the number of columns of the image component, R is the number of rows, and min and max give the range of the values of the image component. imn is the pixel for the mth row, nth column of the image. C, R, min, and max are stored in ASCII. The image component itself, imn, is stored as binary floating-point numbers (4 bytes each, MSB first, see QccFileWriteDouble(3) ).ICPX.X
<white space>
C R
min max
i11 i12...
i21 i22...
.
.
.
filename: NULL string
magic_num: QCCIMGIMAGECOMPONENT_MAGICNUM
major_version, minor_version: initialized to output of QccGetQccPackVersion(3)
num_rows: 0
num_cols: 0
min_val: 0
max_val: 0
image: NULL
QccIMGImageComponentAlloc() allocates storage space for image_component->image. If image_component->image is not NULL, QccIMGImageComponentAlloc() returns immediately without changing the state of any memory allocation. Otherwise, the image_component->image array is allocated. The fields image_component->num_rows and image_component->num_cols must be set prior to calling QccIMGImageComponentAlloc().
QccIMGImageComponentFree() frees the image_component->image array previously allocated by QccIMGImageComponentAlloc().
QccIMGImageComponentPrint() prints the contents of image_component to stdout.
QccIMGImageComponentSetMin() determines the smallest pixel value in image_component->image and sets image_component->min_val to that minimum value.
QccIMGImageComponentSetMax() determines the largest pixel value in image_component->image and sets image_component->max_val to that maximum value.
QccIMGImageComponentSetMaxMin() sets both image_component->max_val and image_component->min_val by calling QccIMGImageComponentSetMax() and QccIMGImageComponentSetMin() in succession.
QccIMGImageComponentResize() calls QccMatrixResize(3) to change the size of image_component to num_rows x num_cols.