Unit Tifffile

This is a component I wrote to read tiff files, as part of a project that subsequently didn't go anywhere. I thought about writing it up as a shareware component, but I didn't have time to add writing to the tiff file, which I would have had to do and also color images. So I have chosen to release the code for general use. Warning: this isn't finished. There's a bug or to, and some shortcomings you might consider bugs. Where I am aware of these, they are clearly documented. There's no native vcl to read tiff files. Something like imageknife or other things are available, but dll's, ocx's and vbx's just not as convenient as having source code. Hence this component, which will compile either under delphi 1 or 2. This component is based on the official tiff 6.0 specification. I downloaded this from adobe in .pdf format. This component will parse standard tiff files, and read mono images - uncompressed and ccitt 3.0 compressed images. Copyright © Grahame Grieve. This code is public domain, but if you distribute components based on this you must acknowledge the source. If you develop any more sophisticated components from this source, please send me a copy.

Classes

tbitstream - tbitstream is used in the reading and writing of ccitt compressed images
TFileNameProperty -
TTiffFile -

Functions

Register -

Types

byte2
byte4
et_compress
et_imagetype
PTiffImageMap
TTiffImageMap
Ttifftag

Constants

Variables


Functions


procedure Register;


Types


byte2 = array [1..2] of byte;

byte4 = array [1..4] of byte;

et_compress = (tfc_none, tfc_ccitt, tfc_packbit, tfc_unknown);
public properties / routines Filename: use to open a file ImageCount: how many images are in the file FCurrImage: which image the following read only properties relate to: Width,Length,InvertColour,ImageType readbitmap - returns HBitmap containing current image
et_imagetype = (ti_mono, ti_grayscale, ti_palette, ti_rgb);

PTiffImageMap = ^TTiffImageMap

TTiffImageMap = record
imageID : word;
next : PTiffImageMap;
imagetype : et_imagetype;
IFDOffset : longint;
width : word;
length : word;
bitspersample : word;
compression : et_compress;
invertcolour : boolean;
resunits : string;
Xres : real;
Yres : real;
numstrips : word;
rowsperstrip : word;
stripoffsetstart : longint;
stripbytecountstart : longint;
end;

Ttifftag = record
tagtype : word;
ftype : word;
vcount : longint;
value : byte4;
end;

Constants


Variables