#include <ifl/iflFile.h> // open the file named by 'filename' iflStatus sts; iflFile* file = iflFile::open(filename, O_RDONLY, &sts); if (sts != iflOKAY) { /* handle the error */ } // read the entire image (just the first plane in z if image has depth) // into a buffer of unsiged chars iflSize dims; file->getDimensions(dims); unsigned char* data = new unsigned char[dims.x*dims.y*dims.c]; iflConfig cfg(iflUChar, iflInterleaved); sts = file->getTile(0, 0, 0, dims.x, dims.y, 1, data, &cfg); if (sts != iflOKAY) { /* handle error */ } // close the file file->close();
#include <ifl/iflCdefs.h> /* open the file named by 'filename' */ iflStatus sts; iflFile *file; iflSize dims; unsigned char *data; iflConfig* cfg; file = iflFileOpen(filename, O_RDONLY, &sts); if (sts != iflOKAY) { /* handle the error */ } /* read the entire image (just the first plane in z if image has depth) into a buffer of unsiged chars */ iflFileGetDimensions(file, &dims); data = (unsigned char*)malloc(dims.x*dims.y*dims.c); cfg = iflConfigCreate(iflUChar, iflInterleaved, 0, NULL, 0, 0); sts = iflFileGetTile(file, 0, 0, 0, dims.x, dims.y, 1, data, cfg); if (sts != iflOKAY) { /* handle error */ } /* close the file */ iflFileClose(file, 0);
// create a one-channel, unsigned char image file iflSize dims(width, height, 1); iflFileConfig fc(&dims, iflUChar); iflStatus sts; iflFile* file = iflFile::create(filename, NULL, &fc, NULL, &sts); if (sts != iflOKAY) { /* handle the create error */ } // write a tile of data to it sts = file->setTile(0, 0, 0, width, height, 1, data); if (sts != iflOKAY) { /* handle error */ } // make sure the data gets written out to disk (or you can close here) sts = file->flush(); if (sts != iflOKAY) { /* handle error */ }
iflFile *file; iflFileConfig *fc; iflStatus sts; iflSize dims; /* create a one-channel, unsigned char image file */ dims.x = width; dims.y = height; dims.z = 1; dims.c = 1; fc = iflFileConfigCreate(&dims, iflUChar, 0, 0, 0, 0, NULL); file = iflFileCreate(filename, NULL, fc, NULL, &sts); if (sts != iflOKAY) { /* handle the create error */ } /* write a tile of data to it */ sts = iflFileSetTile(file, 0, 0, 0, width, height, 1, data, NULL); if (sts != iflOKAY) { /* handle error */ } /* make sure the data gets written out to disk (or you can close here) */ sts = iflFileFlush(file); if (sts != iflOKAY) { /* handle error */ }
Data type
% CC -mips3 -n32 -o libiflTIFF.so -set_version sgi2.0 -shared -all \ iflTIFFFile.o -ltiff -lifl -lm
format | formatname |
match | matchrule |
description | "human-readable description of the format" |
dso | name of DSO file (only for Irix) |
dll | name of DLL file (only for WIN32) |
access | supported access modes |
subsystem | inst sub-system containing the DSO |
suffixes | comma-separated list of file name suffixes |
&& || == != < > <= >= ( )
match short(0) == 0x01da || short(0) == 0xda01
match long(0) == 0xffd8ffe0 && string(6,4) == "JFIF"
description "Kodak Photo CD image"
description "TIFF image"
suffixes .jpg,.jpeg
#include "filename"
#include <filename>