18 #ifndef itkTIFFImageIO_h
19 #define itkTIFFImageIO_h
20 #include "ITKIOTIFFExport.h"
28 class TIFFReaderInternal;
66 bool CanReadFile(
const char *)
override;
69 void ReadImageInformation()
override;
72 void Read(
void *buffer)
override;
75 virtual void ReadVolume(
void *buffer);
81 bool CanWriteFile(
const char *)
override;
85 void WriteImageInformation()
override;
89 void Write(
const void *buffer)
override;
91 enum { NOFORMAT,
RGB_, GRAYSCALE, PALETTE_RGB, PALETTE_GRAYSCALE, OTHER };
114 m_Compression = compression;
120 if ( compression == NoCompression )
122 this->SetUseCompression(
false);
126 this->SetUseCompression(
true);
133 itkSetClampMacro(JPEGQuality,
int, 1, 100);
134 itkGetConstMacro(JPEGQuality,
int);
141 itkGetConstReferenceMacro(ColorPalette, PaletteType);
146 void PrintSelf(std::ostream & os,
Indent indent)
const override;
148 void InternalWrite(
const void *buffer);
150 void InitializeColors();
152 void ReadGenericImage(
void *out,
154 unsigned int height);
157 void ReadTwoSamplesPerPixelImage(
void *out,
159 unsigned int height);
161 unsigned int GetFormat();
163 void GetColor(
unsigned int index,
unsigned short *red,
164 unsigned short *green,
unsigned short *blue);
167 bool CanFindTIFFTag(
unsigned int t);
170 void * ReadRawByteFromTag(
unsigned int t,
unsigned int & value_count);
174 void PopulateColorPalette();
181 int m_JPEGQuality{ 75 };
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 );
225 int m_TotalColors{ -1 };
230 #endif // itkTIFFImageIO_h
Light weight base class for most itk classes.
void SetCompressionToLZW()
Abstract superclass defines image IO interface.
PaletteType m_ColorPalette
ImageIO object for reading and writing TIFF images.
void SetCompression(int compression)
std::vector< RGBPixelType > PaletteType
void SetCompressionToDeflate()
unsigned short * m_ColorGreen
void SetCompressionToNoCompression()
TIFFReaderInternal * m_InternalImage
unsigned short * m_ColorRed
void SetCompressionToJPEG()
unsigned short * m_ColorBlue
Represent Red, Green and Blue components for color images.
Control indentation during Print() invocation.
Base class for most ITK classes.
void SetCompressionToPackBits()