00001
00028 #ifndef TIFFWriter_h
00029 #define TIFFWriter_h
00030
00031 #ifndef uint8
00032 #define uint8 unsigned char
00033 #define uint16 unsigned short
00034 #define uint32 unsigned int
00035 #endif
00036
00042 class CLUT {
00043 public:
00044 int r_entries;
00045 int r_first_value;
00046 int r_num_bits;
00047 int r_bytes;
00048 union {
00049 uint8* r_table8;
00050 uint16* r_table16;
00051 };
00052
00053 int g_entries;
00054 int g_first_value;
00055 int g_num_bits;
00056 int g_bytes;
00057 union {
00058 uint8* g_table8;
00059 uint16* g_table16;
00060 };
00061
00062 int b_entries;
00063 int b_first_value;
00064 int b_num_bits;
00065 int b_bytes;
00066 union {
00067 uint8* b_table8;
00068 uint16* b_table16;
00069 };
00070
00072 CLUT ( ) {
00073 this->r_entries = this->g_entries = this->b_entries = 0;
00074 this->r_first_value = this->g_first_value = this->b_first_value = 0;
00075 this->r_num_bits = this->g_num_bits = this->b_num_bits = 0;
00076 this->r_bytes = this->g_bytes = this->b_bytes = 0;
00077 this->r_table8 = this->g_table8 = this->b_table8 = NULL;
00078 };
00079 };
00080
00081 extern CLUT clut;
00082
00089 class TIFFWriter {
00090 public:
00092 static void write_tiff_data8_rgb ( uint8* buff, int width, int height, FILE* fp,
00093 const bool use_clut, const int samples_per_pixel );
00096 static void write_tiff_float_grey ( const float* const buff, const int width, const int height,
00097 const char* const fname );
00100 static void write_tiff_double_grey ( const double* const buff, const int width, const int height,
00101 const char* const fname );
00103 static void write_tiff_data8_grey ( uint8* buff, int width, int height, FILE* fp,
00104 const int samples_per_pixel );
00107 static void write_tiff_data16 ( uint16* buff, int width, int height, FILE* fp );
00108 };
00109
00110 #endif
00111