|
|
Class: TIFFReader
Object
|
+--ImageReader
|
+--TIFFReader
- Package:
- stx:libview2
- Category:
- Graphics-Images-Readers
- Version:
- rev:
1.83
date: 2004/03/05 19:07:44
- user: stefan
- file: TIFFReader.st directory: libview2
- module: stx stc-classLibrary: libview2
- Author:
- Claus Gittinger
This class knows how to read TIFF files and how to
write uncompressed TIFF files.
Implemented & Missing Features:
- Only single image files are supported.
- Not all formats are implemented, and of those that are, not all are tested.
It should read with most rgb, palette, mono and greyscale images,
although the alpha channel is currently not supported and ignored.
It supports reading of uncompressed, LZW, packbits and CCITT-G3 compressed images
JPEG and many other formats are currently not implemented.
- Only writing of uncompressed images is currently implemented.
It should write (at least) mono, 8-bit palette and 24 bit rgb formats.
More formats will come... (will they ever be needed ?)
TODO (?): since I dont want to spend all of my life adding more formats here and
reinventing the wheel, this code should be changed to use the tiff library.
That would give us most formats and also writing capabilities for free.
Late note:
I hate C and interfacing to C libraries: it almost always leads to trouble
w.r.t. memory leaks, non-reentrancy, non-interruptability etc.
(we recently fixed a malloc-non-reentrant bug for some architecture...)
So its robably better to do it all in a real programming language ;-)
Image
Form
Icon
BlitImageReader
FaceReader
GIFReader
JPEGReader
PBMReader
PCXReader
ST80FormReader
SunRasterReader
TargaReader
WindowsIconReader
XBMReader
XPMReader
XWDReader
initialization
-
initialize
-
install myself in the Image classes fileFormat table
for the `.tiff' and `.tif' extensions.
testing
-
canRepresent: anImage
-
return true, if anImage can be represented in my file format.
Any image is supported.
-
isValidImageFile: aFileName
-
return true, if aFileName contains a GIF image
private
-
decodeTiffTag: tagType numberType: numberType length: length
-
-
decompressPackBits: nIn from: srcBytes to: dstBytes startingAt: dstOffset
-
private-data reading
-
readCCITT3RLETiffImageData
-
-
readCCITT3RLEWTiffImageData
-
-
readCCITTGroup3TiffImageData
-
not really tested - all I got is a single fax from NeXT step
-
readCCITTGroup4TiffImageData
-
-
readCCITTRLEWTiffImageData
-
-
readDCSTiffImageData
-
-
readDeflateTiffImageData
-
-
readJBIGTiffImageData
-
-
readJPEGTiffImageData
-
-
readLZWTiffImageData
-
read LZW compressed tiff data; this method only
handles 3x8 rgb and 1x2 or 2x2 greyscale images.
For 2x2 greyscale images, the alpha plane is ignored.
(maybe other formats work also - its simply not
tested)
-
readNeXTJPEGTiffImageData
-
-
readNeXTRLE2TiffImageData
-
-
readNewJPEGTiffImageData
-
-
readPackbitsTiffImageData
-
this has only been tested with monochrome images
-
readPixarFilmTiffImageData
-
-
readPixarLogTiffImageData
-
-
readThunderScanTiffImageData
-
-
readTiffImageData
-
-
readUncompressedTiffImageData
-
private-reading
-
positionToStrip: stripNr
-
-
readBytes: n signed: isSigned
-
read n 8bit signed or unsigned integers and return them in an array or byteArray
-
readChars: n
-
read n characters and return them in a string
-
readDoubles: nFloats
-
read nFloats IEEE 32bit floats and return them in an array
-
readFloats: nFloats
-
read nFloats IEEE 32bit floats and return them in an array
-
readFracts: nFracts signed: isSigned
-
read nFracts fractions (2 32bit words) and return them in an array
-
readLongs: nLongs signed: isSigned
-
read nLongs signed or unsigned long numbers (32bit) and return them in an array
-
readShorts: nShorts signed: isSigned
-
read nShorts signed or unsigned short numbers (16bit) and return them in an array
private-writing
-
writeBitsPerSample
-
'bitsPerSample: ' print. bitsPerSample printNewline.
'store bitspersample at: ' print. outStream position printNewline.
-
writeColorMap
-
-
writeStripByteCounts
-
'stripByteCounts: ' print. stripByteCounts printNewline.
'store stripbytecounts at: ' print. outStream position printNewline.
-
writeStripOffsets
-
'stripOffsets: ' print. stripOffsets printNewline.
'store stripoffsets at: ' print. outStream position printNewline.
-
writeTag: tagType
-
-
writeTiffTag: tagType
-
-
writeUncompressedBits
-
write bits as one or multiple strips
reading
-
fromStream: aStream
-
read a stream containing a TIFF image.
Leave image description in instance variables.
writing
-
save: image onStream: aStream
-
save image as (uncompressed) TIFF file on aFileName
|