Table of Contents

NAME

QccIMGImageComponentToDataset, QccIMGDatasetToImageComponent - convert image component to/from dataset

SYNOPSIS

#include "libQccPack.h"

int QccIMGImageComponentToDataset(const QccIMGImageComponent *image_component, QccDataset *dataset, int tile_num_rows, int tile_num_cols);

int QccIMGDatasetToImageComponent(QccIMGImageComponent *image_component, const QccDataset *dataset, int tile_num_rows, int tile_num_cols);

DESCRIPTION

QccIMGImageComponentToDataset() converts image_component, a QccIMGImageComponent structure, to dataset, a QccDataset structure. Two-dimensional tiles of size tile_num_rows by tile_num_cols are extracted from image_component in raster-scan order, converted to one-dimensional vectors of length tile_num_rows x tile_num_cols, and placed sequentially into dataset. If image_component does not have size that is a multiple of the requested tile size, then tiles are extracted from the upper-left part of the image. Leftover rows and/or columns at the bottom and right sides of the image, if any, are ignored and not output to dataset. If dataset is not allocated prior to calling QccIMGImageComponentToDataset(), dataset is allocated to accommodate the number of tiles that will be generated; dataset->access_block_size is set equal to QCCDATASET_ACCESSWHOLEFILE. On the other hand, if dataset is allocated, its block size (as returned by QccDatasetGetBlockSize(3) ) must be large enough to accommodate the number of tiles that will be generated.

QccIMGDatasetToImageComponent() converts dataset, a QccDataset structure, to image_component, a QccIMGImageComponent structure. Each one-dimensional vector in dataset is assembled into a two-dimensional tile and then placed in image_component. The tiles are taken sequentially from dataset and placed into image_component in raster-scan order. image_component must be allocated prior to calling QccIMGDatasetToImageComponent(). If the size of the image_component is not a multiple of the requested tile size, additional rows and/or columns are appended to the bottom and/or right of the image as necessary to meet the requested size. These rows and/or columns are duplicates of the last full row or column available in image_component.

RETURN VALUE

These routines return 0 on success, 1 on failure.

SEE ALSO

QccIMGImageComponent(3) , QccDataset(3) , QccPackIMG(3) , QccPack(3)

AUTHOR

Copyright (C) 1997-2021 James E. Fowler


Table of Contents



Get QccPack at SourceForge.net. Fast, secure and Free Open Source software downloads