00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
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
00038 class CLUT {
00039
public:
00040 int r_entries;
00041 int r_first_value;
00042 int r_num_bits;
00043 int r_bytes;
00044
union {
00045 uint8*
r_table8;
00046 uint16*
r_table16;
00047 };
00048
00049
int g_entries, g_first_value, g_num_bits, g_bytes;
00050
union {
00051 uint8* g_table8;
00052 uint16* g_table16;
00053 };
00054
00055
int b_entries, b_first_value, b_num_bits, b_bytes;
00056
union {
00057 uint8* b_table8;
00058 uint16* b_table16;
00059 };
00060
00061
CLUT ( ) {
00062 this->
r_entries = this->g_entries = this->b_entries = 0;
00063 this->
r_first_value = this->g_first_value = this->b_first_value = 0;
00064 this->
r_num_bits = this->g_num_bits = this->b_num_bits = 0;
00065 this->
r_bytes = this->g_bytes = this->b_bytes = 0;
00066 this->
r_table8 = this->g_table8 = this->b_table8 = NULL;
00067 };
00068 };
00069
00070
extern CLUT clut;
00071
00072
00074
void write_tiff_data8_rgb ( uint8* buff,
int width,
int height, FILE* fp,
00075
const bool use_clut,
const int samples_per_pixel );
00076
00077
void write_tiff_float_grey (
const float*
const buff,
const int width,
const int height,
00078
const char*
const fname );
00079
00080
void write_tiff_double_grey (
const double*
const buff,
const int width,
const int height,
00081
const char*
const fname );
00082
00083
void write_tiff_data8_grey ( uint8* buff,
int width,
int height, FILE* fp,
00084
const int samples_per_pixel );
00085
00086
void write_tiff_data16 ( uint16* buff,
int width,
int height, FILE* fp );
00087
00088
#endif
00089