18 #ifndef itkTIFFImageIO_h
19 #define itkTIFFImageIO_h
20 #include "ITKIOTIFFExport.h"
28 class TIFFReaderInternal;
64 virtual bool CanReadFile(
const char *) ITK_OVERRIDE;
67 virtual
void ReadImageInformation() ITK_OVERRIDE;
70 virtual
void Read(
void *buffer) ITK_OVERRIDE;
73 virtual
void ReadVolume(
void *buffer);
79 virtual
bool CanWriteFile(const
char *) ITK_OVERRIDE;
83 virtual
void WriteImageInformation() ITK_OVERRIDE;
87 virtual
void Write(const
void *buffer) ITK_OVERRIDE;
89 enum { NOFORMAT,
RGB_, GRAYSCALE, PALETTE_RGB, PALETTE_GRAYSCALE, OTHER };
112 m_Compression = compression;
118 if ( compression == NoCompression )
120 this->SetUseCompression(
false);
124 this->SetUseCompression(
true);
131 itkSetClampMacro(JPEGQuality,
int, 1, 100);
132 itkGetConstMacro(JPEGQuality,
int);
139 itkGetConstReferenceMacro(ColorPalette, PaletteType);
144 virtual
void PrintSelf(std::ostream & os,
Indent indent) const ITK_OVERRIDE;
146 void InternalWrite(const
void *buffer);
148 void InitializeColors();
150 void ReadGenericImage(
void *out,
152 unsigned int height);
155 void ReadTwoSamplesPerPixelImage(
void *out,
157 unsigned int height);
159 unsigned int GetFormat();
161 void GetColor(
unsigned int index,
unsigned short *red,
162 unsigned short *green,
unsigned short *blue);
165 bool CanFindTIFFTag(
unsigned int t);
168 void * ReadRawByteFromTag(
unsigned int t,
unsigned int & value_count);
172 void PopulateColorPalette();
174 TIFFReaderInternal *m_InternalImage;
186 void ReadCurrentPage(
void *out,
size_t pixelOffset);
188 template <typename TComponent>
189 void ReadGenericImage(
void *out,
191 unsigned int height);
193 template <typename TComponent>
194 void RGBAImageToBuffer(
void *out, const
uint32_t *tempImage );
196 template <typename TType>
197 void PutGrayscale( TType *to, TType * from,
198 unsigned int xsize,
unsigned int ysize,
199 unsigned int toskew,
unsigned int fromskew );
201 template <typename TType>
202 void PutRGB_( TType *to, TType * from,
203 unsigned int xsize,
unsigned int ysize,
204 unsigned int toskew,
unsigned int fromskew );
207 template <typename TType, typename TFromType>
208 void PutPaletteGrayscale( TType *to, TFromType * from,
209 unsigned int xsize,
unsigned int ysize,
210 unsigned int toskew,
unsigned int fromskew );
212 template <typename TType, typename TFromType>
213 void PutPaletteRGB( TType *to, TFromType * from,
214 unsigned int xsize,
unsigned int ysize,
215 unsigned int toskew,
unsigned int fromskew );
217 template <typename TType, typename TFromType>
218 void PutPaletteScalar( TType *to, TFromType * from,
219 unsigned int xsize,
unsigned int ysize,
220 unsigned int toskew,
unsigned int fromskew );
222 unsigned short *m_ColorRed;
223 unsigned short *m_ColorGreen;
224 unsigned short *m_ColorBlue;
226 unsigned int m_ImageFormat;
230 #endif // itkTIFFImageIO_h
Light weight base class for most itk classes.
void SetCompressionToLZW()
Abstract superclass defines image IO interface.
ImageIO object for reading and writing TIFF images.
void SetCompression(int compression)
RGBPixel< unsigned short > RGBPixelType
void SetCompressionToDeflate()
KWIML_INT_uint32_t uint32_t
void SetCompressionToNoCompression()
std::vector< RGBPixelType > PaletteType
void SetCompressionToJPEG()
Represent Red, Green and Blue components for color images.
Control indentation during Print() invocation.
SmartPointer< Self > Pointer
void SetCompressionToPackBits()