TIFFEXT Class Reference

Base class for TIFF image access. More...

#include <mi32/tiffext.h>

Inheritance diagram for TIFFEXT:
Inheritance graph
[legend]

List of all members.

Public Types

enum  COMPRESSION {
  COMPRESSION_None = 1, COMPRESSION_CCITT_RLE = 2, COMPRESSION_CCITT_FAX3 = 3, COMPRESSION_CCITT_FAX4 = 4,
  COMPRESSION_L_Z_W = 5, COMPRESSION_OldJPEG = 6, COMPRESSION_JPEG_DCT = 7, COMPRESSION_NeXT = 32766,
  COMPRESSION_CCITT_RLEW = 32771, COMPRESSION_PackBits = 32773, COMPRESSION_ThunderScan = 32809
}
enum  PHOTOMETRIC {
  PHOTOMETRIC_MinIsWhite = 0, PHOTOMETRIC_MinIsBlack = 1, PHOTOMETRIC_RedGreenBlue = 2, PHOTOMETRIC_Palette = 3,
  PHOTOMETRIC_Mask = 4, PHOTOMETRIC_Separated = 5, PHOTOMETRIC_YCbCr = 6, PHOTOMETRIC_CIE_Lab = 8,
  PHOTOMETRIC_ITU_Lab = 10, PHOTOMETRIC_CMYK = 65530
}
enum  PLANARCONFIG { PLANARCONFIG_Contiguous = 1, PLANARCONFIG_Separate = 2 }
enum  RESOLUTIONUNIT { RESOLUTIONUNIT_Inch = 2, RESOLUTIONUNIT_Centimeter = 3 }
enum  SAMPLEFORMAT {
  SAMPLEFORMAT_Unsigned = 1, SAMPLEFORMAT_Signed = 2, SAMPLEFORMAT_Float = 3, SAMPLEFORMAT_Undefined = 4,
  SAMPLEFORMAT_ComplexInt = 5, SAMPLEFORMAT_ComplexFloat = 6
}
enum  SUBTYPEFLAGS { SUBTYPEFLAG_None = 0x00, SUBTYPEFLAG_ReducedImage = 0x01, SUBTYPEFLAG_Page = 0x02, SUBTYPEFLAG_Mask = 0x04 }

Public Member Functions

 ~IMAGEINFO ()
void AddRef ()
UINT16 GetBitsPerSample () const
COMPRESSION GetCompression () const
int GetDefaultImageIdx () const
MISTRING GetDescription () const
IMAGEINFO GetImageInfo () const
INT32 GetImageLength () const
INT32 GetImageWidth () const
int GetNumImages () const
int GetOpenImageIdx () const
PHOTOMETRIC GetPhotometric () const
PLANARCONFIG GetPlanarConfig () const
SAMPLEFORMAT GetSampleFormat () const
MISTRING GetSampleName (INT16 sample) const
UINT16 GetSamplesPerPixel () const
INT32 GetSegmentLength () const
INT32 GetSegmentWidth () const
SUBTYPEFLAGS GetSubTypeFlags () const
 IMAGEINFO (const IMAGEINFO &rhs)
 IMAGEINFO (INT32 ImageLength, INT32 ImageWidth, UINT16 SamplesPerPixel, UINT16 BitsPerSample, SAMPLEFORMAT SampleFormat=SAMPLEFORMAT_Unsigned)
bool IsTiled () const
int MakeImage (const IMAGEINFO &imageinfo)
ERRVALUE OpenImage (UINT16 ImageIdx)
IMAGEINFO & operator= (const IMAGEINFO &rhs)
int ReadContrastTable (SIMPLE_ARRAY< UINT8 > &table)
int ReadGeoreference (SPATREF::COORDREFSYS &CoordRefSys, TRANS2D_AFFINE &TransAffine, SIMPLE_ARRAY< CTRLPOINT3 > &CtrlPoints)
ERRVALUE ReadMetadata (MISTRING &string)
int ReadPalette (COLOR_ARRAY &palette)
ERRVALUE ReadPixels (INT32 sample, INT32 line, INT32 column, INT32 numpixels, void *buffer, bool leavepacked=false)
bool Release ()
void SetCompression (COMPRESSION compression)
void SetDescription (const MISTRING &desc)
void SetPhotometric (PHOTOMETRIC photometric)
void SetPlanarConfig (PLANARCONFIG PlanarConfig)
void SetResolution (double xres, double yres, RESOLUTIONUNIT resunit)
void SetSegmentSize (INT32 SegmentLength, INT32 SegmentWidth)
void SetSubTypeFlags (SUBTYPEFLAGS SubTypeFlags)
void SetWriteUserDefinedCRS (bool WriteUserDefinedCRS=true)
ERRVALUE WriteContrast (UINT16 MaxValue, UINT16 MinValue)
ERRVALUE WriteGeoreference (const SPATREF::COORDREFSYS &CoordRefSys, const SIMPLE_ARRAY< CTRLPOINT3 > &CtrlPoints, bool ForceNonRotated=false)
ERRVALUE WriteGeoreference (const SPATREF::COORDREFSYS &CoordRefSys, const CTRLPOINT3 *CtrlPoints, int NumCtrlPoints, bool ForceNonRotated=false)
ERRVALUE WriteGeoreference (const SPATREF::COORDREFSYS &CoordRefSys, const TRANS2D_AFFINE &TransAffine, bool ForceNonRotated=false)
ERRVALUE WritePalette (const COLOR_ARRAY &palette)
ERRVALUE WritePixels (INT32 sample, INT32 line, INT32 column, INT32 numpixels, const void *buffer, bool prepacked=false)

Protected Types

enum  OPENMODE { OPENMODE_Read = 0, OPENMODE_Write = 1 }

Protected Member Functions

 TIFFEXT ()
virtual ~TIFFEXT ()
ERRVALUE CloseTIFF ()
ERRVALUE OpenTIFF (GENERICRW *pGenRW, const MIUNICODE *name, OPENMODE openmode, bool IsBigTiff=false)

Detailed Description

Base class for TIFF image access.

Container for information about specific TIFF image.


Member Enumeration Documentation

Enumerator:
COMPRESSION_None 

dump mode

COMPRESSION_CCITT_RLE 

CCITT modified Huffman RLE.

COMPRESSION_CCITT_FAX3 

CCITT Group 3 fax encoding.

COMPRESSION_CCITT_FAX4 

CCITT Group 4 fax encoding.

COMPRESSION_L_Z_W 

Lempel-Ziv & Welch.

COMPRESSION_OldJPEG 

!6.0 JPEG

COMPRESSION_JPEG_DCT 

JPEG DCT compression

COMPRESSION_NeXT 

NeXT 2-bit RLE.

COMPRESSION_CCITT_RLEW 

#1 w/ word alignment

COMPRESSION_PackBits 

Macintosh RLE.

COMPRESSION_ThunderScan 

ThunderScan RLE.

enum TIFFEXT::OPENMODE [protected]
Enumerator:
OPENMODE_Read 
OPENMODE_Write 
Enumerator:
PHOTOMETRIC_MinIsWhite 
PHOTOMETRIC_MinIsBlack 
PHOTOMETRIC_RedGreenBlue 
PHOTOMETRIC_Palette 
PHOTOMETRIC_Mask 
PHOTOMETRIC_Separated 
PHOTOMETRIC_YCbCr 
PHOTOMETRIC_CIE_Lab 
PHOTOMETRIC_ITU_Lab 
PHOTOMETRIC_CMYK 
Enumerator:
PLANARCONFIG_Contiguous 
PLANARCONFIG_Separate 
Enumerator:
RESOLUTIONUNIT_Inch 
RESOLUTIONUNIT_Centimeter 
Enumerator:
SAMPLEFORMAT_Unsigned 
SAMPLEFORMAT_Signed 
SAMPLEFORMAT_Float 
SAMPLEFORMAT_Undefined 
SAMPLEFORMAT_ComplexInt 
SAMPLEFORMAT_ComplexFloat 
Enumerator:
SUBTYPEFLAG_None 
SUBTYPEFLAG_ReducedImage 
SUBTYPEFLAG_Page 
SUBTYPEFLAG_Mask 

Constructor & Destructor Documentation

TIFFEXT::TIFFEXT (  )  [protected]

Constructor.

virtual TIFFEXT::~TIFFEXT (  )  [protected, virtual]

Destructor.

TIFFEXT::~IMAGEINFO (  ) 

Destructor.


Member Function Documentation

void TIFFEXT::AddRef (  ) 

Increment reference count.

Reference count will be 1 after construction, only use if require reference counting.

ERRVALUE TIFFEXT::CloseTIFF (  )  [protected]

Close TIFF instance.

UINT16 TIFFEXT::GetBitsPerSample (  )  const

Get number of bits per sample.

Although the TIFF spec allows a different number of bits for each sample, the libtiff implementation does not, so at present all samples must have the same number of bits.

COMPRESSION TIFFEXT::GetCompression (  )  const

Get compression method.

int TIFFEXT::GetDefaultImageIdx (  )  const

Get index of 'default' image.

MISTRING TIFFEXT::GetDescription (  )  const

Get image description.

IMAGEINFO TIFFEXT::GetImageInfo (  )  const

Get information about currently opened image.

INT32 TIFFEXT::GetImageLength (  )  const

Get image length (number of lines).

INT32 TIFFEXT::GetImageWidth (  )  const

Get image width (number of columns).

int TIFFEXT::GetNumImages (  )  const

Get number of images in file.

int TIFFEXT::GetOpenImageIdx (  )  const

Get index of currently opened image.

PHOTOMETRIC TIFFEXT::GetPhotometric (  )  const

Get photometric intepretation.

PLANARCONFIG TIFFEXT::GetPlanarConfig (  )  const

Get planar configuration.

Returns:
PLANARCONFIG_Contiguous (pixel-interleaved) or PLANARCONFIG_Separate (band sequential)
SAMPLEFORMAT TIFFEXT::GetSampleFormat (  )  const

Get sample numeric format.

Although the TIFF spec allows a different numeric format for each sample, the libtiff implementation does not, so at present all samples must have the same numeric format.

MISTRING TIFFEXT::GetSampleName ( INT16  sample  )  const

Get 'name' of sample.

Returns:
String, guaranteed not to be empty for valid sample index.
Parameters:
sample Sample index
UINT16 TIFFEXT::GetSamplesPerPixel (  )  const

Get number of samples per pixel.

INT32 TIFFEXT::GetSegmentLength (  )  const

Get segment (tile or strip) length (number of lines).

INT32 TIFFEXT::GetSegmentWidth (  )  const

Get segment (tile or strip) width (number of columns).

SUBTYPEFLAGS TIFFEXT::GetSubTypeFlags (  )  const

Get subtype flags.

TIFFEXT::IMAGEINFO ( const IMAGEINFO &  rhs  ) 

Copy constructor.

TIFFEXT::IMAGEINFO ( INT32  ImageLength,
INT32  ImageWidth,
UINT16  SamplesPerPixel,
UINT16  BitsPerSample,
SAMPLEFORMAT  SampleFormat = SAMPLEFORMAT_Unsigned 
)

Constructor for setting up new info.

Parameters:
ImageLength Image length (number of lines)
ImageWidth Image width (number of columns)
SamplesPerPixel Number of samples (components) per pixel
BitsPerSample Number of bits per sample, same for all samples
SampleFormat Sample numeric format
bool TIFFEXT::IsTiled (  )  const

Determine if image is 'tiled'.

int TIFFEXT::MakeImage ( const IMAGEINFO &  imageinfo  ) 

Make and open new image.

Returns:
New image index or error < 0.
Parameters:
imageinfo Settings for image to create
ERRVALUE TIFFEXT::OpenImage ( UINT16  ImageIdx  ) 

Open specified image.

If file is opened for reading the first image is opened by default.

ERRVALUE TIFFEXT::OpenTIFF ( GENERICRW pGenRW,
const MIUNICODE name,
OPENMODE  openmode,
bool  IsBigTiff = false 
) [protected]

Open TIFF instance.

Parameters:
pGenRW Read/write class instance, must support seeking
name "Name" of file or instance
openmode OPENMODE_Read or OPENMODE_Write,
IMAGEINFO& TIFFEXT::operator= ( const IMAGEINFO &  rhs  ) 

Assignment operator.

int TIFFEXT::ReadContrastTable ( SIMPLE_ARRAY< UINT8 > &  table  ) 

Read contrast table.

Returns:
TRUE if has table, FALSE if not, < 0 if error.
Parameters:
table Contrast table returned
int TIFFEXT::ReadGeoreference ( SPATREF::COORDREFSYS CoordRefSys,
TRANS2D_AFFINE TransAffine,
SIMPLE_ARRAY< CTRLPOINT3 > &  CtrlPoints 
)

Read georeference information.

Returns:
TRUE if has georeference, FALSE if not, < 0 if error.
Parameters:
CoordRefSys Coordinate Reference System definition returned
TransAffine Affine transformation returned
CtrlPoints Control point array returned, empty if no control points
ERRVALUE TIFFEXT::ReadMetadata ( MISTRING string  ) 
Parameters:
string String to contain metadata
int TIFFEXT::ReadPalette ( COLOR_ARRAY palette  ) 

Read color palette.

Returns:
TRUE if has table, FALSE if not, < 0 if error.
Parameters:
palette Color palette returned
ERRVALUE TIFFEXT::ReadPixels ( INT32  sample,
INT32  line,
INT32  column,
INT32  numpixels,
void *  buffer,
bool  leavepacked = false 
)

Read all or part of a line of pixels from image.

Parameters:
sample Sample index, -1 for all samples if PLANARCONFIG_Contiguous
line Starting line
column Starting column
numpixels Number of pixels to read
buffer Buffer to contain pixels
leavepacked Leave buffer packed if < 8 bits per sample
bool TIFFEXT::Release (  ) 

Decrement reference count and destroy if no more references.

Returns:
'true' if instance was deleted, false if not.
void TIFFEXT::SetCompression ( COMPRESSION  compression  ) 

Set compression type.

void TIFFEXT::SetDescription ( const MISTRING desc  ) 

Set image description.

void TIFFEXT::SetPhotometric ( PHOTOMETRIC  photometric  ) 

Set photometric interpretation.

void TIFFEXT::SetPlanarConfig ( PLANARCONFIG  PlanarConfig  ) 

Set planar configuration.

void TIFFEXT::SetResolution ( double  xres,
double  yres,
RESOLUTIONUNIT  resunit 
)

Set resolution.

void TIFFEXT::SetSegmentSize ( INT32  SegmentLength,
INT32  SegmentWidth 
)

Set segment size.

Actual segment size may be adjusted based on format requirements. Adjusted size may be retrieved via GetSegmentHeight/Width.

void TIFFEXT::SetSubTypeFlags ( SUBTYPEFLAGS  SubTypeFlags  ) 

Set image subtype flags.

void TIFFEXT::SetWriteUserDefinedCRS ( bool  WriteUserDefinedCRS = true  ) 

Set to write user-defined Coordinate Reference System when writing georeference.

This may improve compatibility with some GeoTIFF readers.

ERRVALUE TIFFEXT::WriteContrast ( UINT16  MaxValue,
UINT16  MinValue 
)

Set to write the Maximum and Minimum cell values to HALFTONEHINTS Used for linear contrast stretching.

Parameters:
MaxValue Maximum Cell Value
MinValue Minimum Cell Value
ERRVALUE TIFFEXT::WriteGeoreference ( const SPATREF::COORDREFSYS CoordRefSys,
const SIMPLE_ARRAY< CTRLPOINT3 > &  CtrlPoints,
bool  ForceNonRotated = false 
)

Write georeference information using control point array.

Parameters:
CoordRefSys Coordinate Reference System definition
ERRVALUE TIFFEXT::WriteGeoreference ( const SPATREF::COORDREFSYS CoordRefSys,
const CTRLPOINT3 CtrlPoints,
int  NumCtrlPoints,
bool  ForceNonRotated = false 
)

Write georeference information using control point array.

Parameters:
CoordRefSys Coordinate Reference System definition
ERRVALUE TIFFEXT::WriteGeoreference ( const SPATREF::COORDREFSYS CoordRefSys,
const TRANS2D_AFFINE TransAffine,
bool  ForceNonRotated = false 
)

Write georeference information using TRANS2D_AFFINE.

Parameters:
CoordRefSys Coordinate Reference System definition
ERRVALUE TIFFEXT::WritePalette ( const COLOR_ARRAY palette  ) 

Write color palette.

ERRVALUE TIFFEXT::WritePixels ( INT32  sample,
INT32  line,
INT32  column,
INT32  numpixels,
const void *  buffer,
bool  prepacked = false 
)

Write all or part of a line of pixels from image.

Parameters:
sample Sample index, -1 for all samples if PLANARCONFIG_Contiguous
line Starting line
column Starting column
numpixels Number of pixels to read
buffer Buffer containing pixels to write
prepacked Is buffer pre-packed for data less than 8 bits per sample

The documentation for this class was generated from the following file:

Generated on Sun Oct 7 21:33:55 2012 for TNTsdk 2012 by  doxygen 1.6.1