Public Member Functions | |
H5TiffIO (hid_t fileId) | |
virtual | ~H5TiffIO () |
void | setFileId (hid_t fileId) |
herr_t | importTiff (const std::string &filename, hid_t groupId, const std::string &datasetName, bool asGrayscale=true) |
imports a Tiff image into the MXADataModel | |
herr_t | exportTiff (hid_t fileId, const std::string &filename, const std::string &img_dataset_name) |
exports a TIFF image from the MXADataModel | |
void | extractTiffTagContents (ITiffTagExtractor *extractor) |
Extracts the contents of a tag using an instance of ITiffTagExtractor. | |
Protected Types | |
enum | tiffImageClasses { UnknownTiffImage = -1, BilevelTiffImage = 0, GrayscaleTiffImage, PaletteColorTiffImage, RGBFullColorTiffImage, FacsimileTiffImage, SeparatedTiffImage, YCbCrTiffImage } |
Protected Member Functions | |
int32 | _determineTiffImageClass (TIFF *in) |
Determines the image class for a given tiff image. | |
int32 | _determineTiffOutputImageClass (hid_t fileId, const string &img_dataset_name) |
Determines the value of the "Class" attribute for the image. | |
herr_t | _importGrayscaleTiffImage (TIFF *in, hid_t groupId, const std::string &datasetName) |
Reads a grayscale tiff file and stores the image as raw 8 bit values in the given dataset inside the give group. | |
herr_t | _importPaletteColorTiff (TIFF *in, hid_t groupId, const std::string &datasetName) |
Reads a grayscale tiff file and stores the image as raw 8 bit values in the given dataset inside the give group. | |
herr_t | _importRGBFullColorTiff (TIFF *in, hid_t groupId, const std::string &datasetName) |
Reads a true color tiff file and stores the image as raw rgb values in the given dataset inside the give group. | |
herr_t | _exportGrayScaleTiff (TIFF *image, uint8 *data, hsize_t width, hsize_t height, const std::string &documentName, const std::string &imageDescription) |
Writes a tiff image as a grayscale image HDF5 dataset. | |
herr_t | _exportRGBFullColorTiff (TIFF *out, hid_t fileId, const std::string &img_dataset_name, hsize_t width, hsize_t height, hsize_t planes, hssize_t numpalettes, const std::string &interlace) |
Exports an Image data set as a true color tiff file. | |
Protected Attributes | |
hid_t | _fileId |
TIFF * | _tiff |
Private Member Functions | |
int32 | _findColorMapIndex (int max, int32 imgR, int32 imgG, int32 imgB, unsigned char *colorMap) |
void | _closePaletteCreatedDataset (hid_t fileId, hid_t groupId, string datasetName, int32 num_attrs) |
enum H5TiffIO::tiffImageClasses [protected] |
H5TiffIO::H5TiffIO | ( | hid_t | fileId | ) | [explicit] |
H5TiffIO::~H5TiffIO | ( | ) | [virtual] |
void H5TiffIO::setFileId | ( | hid_t | fileId | ) | [inline] |
herr_t H5TiffIO::importTiff | ( | const std::string & | filename, | |
hid_t | groupId, | |||
const std::string & | datasetName, | |||
bool | asGrayscale = true | |||
) |
imports a Tiff image into the MXADataModel
filename | The absolute path to the Tiff file | |
groupId | The HDF Group/FileId to store the imported data | |
datasetName | The Name of the HDF5 dataset to store the data | |
asGrayscale | Should the tiff be stored as a grayscale image |
herr_t H5TiffIO::exportTiff | ( | hid_t | fileId, | |
const std::string & | filename, | |||
const std::string & | img_dataset_name | |||
) |
exports a TIFF image from the MXADataModel
fileId | - the hdf fileID | |
filename | - the output file to write the tiff to | |
img_dataset_name | - the image dataset in the XMData file |
void H5TiffIO::extractTiffTagContents | ( | ITiffTagExtractor * | extractor | ) |
Extracts the contents of a tag using an instance of ITiffTagExtractor.
extractor | An Instance of an ITiffTagExtractor class |
int H5TiffIO::_determineTiffImageClass | ( | TIFF * | in | ) | [protected] |
Determines the image class for a given tiff image.
in | The Tiff Image |
int H5TiffIO::_determineTiffOutputImageClass | ( | hid_t | fileId, | |
const string & | img_dataset_name | |||
) | [protected] |
Determines the value of the "Class" attribute for the image.
fileId | The HDF5 file id | |
img_dataset_name | The path to the dataset |
herr_t H5TiffIO::_importGrayscaleTiffImage | ( | TIFF * | in, | |
hid_t | groupId, | |||
const std::string & | datasetName | |||
) | [protected] |
Reads a grayscale tiff file and stores the image as raw 8 bit values in the given dataset inside the give group.
in | The Tiff Image | |
groupId | The HDF location identifier of the group into which to store the image data | |
datasetName | The name to store the data under in the HDF5 file. |
herr_t H5TiffIO::_importPaletteColorTiff | ( | TIFF * | in, | |
hid_t | groupId, | |||
const std::string & | datasetName | |||
) | [protected] |
Reads a grayscale tiff file and stores the image as raw 8 bit values in the given dataset inside the give group.
in | The Tiff Image | |
groupId | The HDF location identifier of the group into which to store the image data | |
datasetName | The name to store the data under in the HDF5 file. |
herr_t H5TiffIO::_importRGBFullColorTiff | ( | TIFF * | in, | |
hid_t | groupId, | |||
const std::string & | datasetName | |||
) | [protected] |
Reads a true color tiff file and stores the image as raw rgb values in the given dataset inside the give group.
in | The Tiff Image | |
groupId | The HDF location identifier of the group into which to store the image data | |
datasetName | The name to store the data under in the HDF5 file. |
herr_t H5TiffIO::_exportGrayScaleTiff | ( | TIFF * | image, | |
uint8 * | data, | |||
hsize_t | width, | |||
hsize_t | height, | |||
const std::string & | documentName, | |||
const std::string & | imageDescription | |||
) | [protected] |
Writes a tiff image as a grayscale image HDF5 dataset.
image | The TIFF image pointer | |
data | The tiff data to be written | |
width | The width of the image | |
height | The height of the image | |
documentName | The name of the file | |
imageDescription | A short description to be added to the file |
herr_t H5TiffIO::_exportRGBFullColorTiff | ( | TIFF * | out, | |
hid_t | fileId, | |||
const std::string & | img_dataset_name, | |||
hsize_t | width, | |||
hsize_t | height, | |||
hsize_t | planes, | |||
hssize_t | numpalettes, | |||
const std::string & | interlace | |||
) | [protected] |
Exports an Image data set as a true color tiff file.
out | The Tiff file to write the data into | |
fileId | The HDF5 file_id value | |
img_dataset_name | The Name of the data set | |
width | The width of the image | |
height | The heigth of the image | |
planes | The number of planes in the image | |
numpalettes | The number of palettes from the image | |
interlace | The interlace mode of the image |
int32 H5TiffIO::_findColorMapIndex | ( | int | max, | |
int32 | imgR, | |||
int32 | imgG, | |||
int32 | imgB, | |||
unsigned char * | colorMap | |||
) | [private] |
void H5TiffIO::_closePaletteCreatedDataset | ( | hid_t | fileId, | |
hid_t | groupId, | |||
string | datasetName, | |||
int32 | num_attrs | |||
) | [private] |
hid_t H5TiffIO::_fileId [protected] |
TIFF* H5TiffIO::_tiff [protected] |