comparison tiffenc.c @ 4791:caafad01dec0 libavcodec

s/invert/photometric_interpretation/ patch by Kamil Nowosad k.nowosad students mimuw edu pl
author michael
date Fri, 06 Apr 2007 20:49:26 +0000
parents 95f58f0b70fc
children d8b17a09a114
comparison
equal deleted inserted replaced
4790:2b825cb391f2 4791:caafad01dec0
47 int width; ///< picture width 47 int width; ///< picture width
48 int height; ///< picture height 48 int height; ///< picture height
49 unsigned int bpp; ///< bits per pixel 49 unsigned int bpp; ///< bits per pixel
50 int compr; ///< compression level 50 int compr; ///< compression level
51 int bpp_tab_size; ///< bpp_tab size 51 int bpp_tab_size; ///< bpp_tab size
52 int invert; ///< photometric interpretation 52 int photometric_interpretation; ///< photometric interpretation
53 int strips; ///< number of strips 53 int strips; ///< number of strips
54 int rps; ///< row per strip 54 int rps; ///< row per strip
55 uint8_t entries[TIFF_MAX_ENTRY*12]; ///< entires in header 55 uint8_t entries[TIFF_MAX_ENTRY*12]; ///< entires in header
56 int num_entries; ///< number of entires 56 int num_entries; ///< number of entires
57 uint8_t **buf; ///< actual position in buffer 57 uint8_t **buf; ///< actual position in buffer
212 s->height = avctx->height; 212 s->height = avctx->height;
213 213
214 switch (avctx->pix_fmt) { 214 switch (avctx->pix_fmt) {
215 case PIX_FMT_RGB24: 215 case PIX_FMT_RGB24:
216 s->bpp = 24; 216 s->bpp = 24;
217 s->invert = 2; 217 s->photometric_interpretation = 2;
218 break; 218 break;
219 case PIX_FMT_GRAY8: 219 case PIX_FMT_GRAY8:
220 s->bpp = 8; 220 s->bpp = 8;
221 s->invert = 1; 221 s->photometric_interpretation = 1;
222 break; 222 break;
223 case PIX_FMT_PAL8: 223 case PIX_FMT_PAL8:
224 s->bpp = 8; 224 s->bpp = 8;
225 s->invert = 3; 225 s->photometric_interpretation = 3;
226 break; 226 break;
227 case PIX_FMT_MONOBLACK: 227 case PIX_FMT_MONOBLACK:
228 s->bpp = 1; 228 s->bpp = 1;
229 s->invert = 1; 229 s->photometric_interpretation = 1;
230 break; 230 break;
231 case PIX_FMT_MONOWHITE: 231 case PIX_FMT_MONOWHITE:
232 s->bpp = 1; 232 s->bpp = 1;
233 s->invert = 0; 233 s->photometric_interpretation = 0;
234 break; 234 break;
235 default: 235 default:
236 av_log(s->avctx, AV_LOG_ERROR, 236 av_log(s->avctx, AV_LOG_ERROR,
237 "This colors format is not supported\n"); 237 "This colors format is not supported\n");
238 return -1; 238 return -1;
310 310
311 if (s->bpp_tab_size) 311 if (s->bpp_tab_size)
312 add_entry(s, TIFF_BPP, TIFF_SHORT, s->bpp_tab_size, bpp_tab); 312 add_entry(s, TIFF_BPP, TIFF_SHORT, s->bpp_tab_size, bpp_tab);
313 313
314 add_entry1(s,TIFF_COMPR, TIFF_SHORT, s->compr); 314 add_entry1(s,TIFF_COMPR, TIFF_SHORT, s->compr);
315 add_entry1(s,TIFF_INVERT, TIFF_SHORT, s->invert); 315 add_entry1(s,TIFF_INVERT, TIFF_SHORT, s->photometric_interpretation);
316 add_entry(s, TIFF_STRIP_OFFS, TIFF_LONG, strips, strip_offsets); 316 add_entry(s, TIFF_STRIP_OFFS, TIFF_LONG, strips, strip_offsets);
317 317
318 if (s->bpp_tab_size) 318 if (s->bpp_tab_size)
319 add_entry1(s,TIFF_SAMPLES_PER_PIXEL, TIFF_SHORT, s->bpp_tab_size); 319 add_entry1(s,TIFF_SAMPLES_PER_PIXEL, TIFF_SHORT, s->bpp_tab_size);
320 320