Credit Andrew - improve in-tree documentation
[goodguy/cinelerra.git] / cinelerra / filetiff.C
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  *
20  */
21
22 #include "asset.h"
23 #include "edit.h"
24 #include "file.h"
25 #include "filetiff.h"
26 #include "interlacemodes.h"
27 #include "language.h"
28 #include "vframe.h"
29 #include "mainerror.h"
30
31 #include <stdint.h>
32 #include <string.h>
33 #include <unistd.h>
34
35 FileTIFF::FileTIFF(Asset *asset, File *file)
36  : FileList(asset, file, "TIFFLIST", ".tif", FILE_TIFF, FILE_TIFF_LIST)
37 {
38         asset->video_data = 1;
39         temp = 0;
40 }
41
42 FileTIFF::~FileTIFF()
43 {
44         if(temp) delete temp;
45 }
46
47
48 void FileTIFF::get_parameters(BC_WindowBase *parent_window,
49         Asset *asset, BC_WindowBase* &format_window,
50         int audio_options, int video_options, EDL *edl)
51 {
52         if(video_options)
53         {
54                 TIFFConfigVideo *window = new TIFFConfigVideo(parent_window, asset);
55                 format_window = window;
56                 window->create_objects();
57                 window->run_window();
58                 delete window;
59         }
60 }
61
62
63 int FileTIFF::check_sig(Asset *asset)
64 {
65         FILE *stream = fopen(asset->path, "rb");
66
67         if(stream)
68         {
69                 char test[10];
70                 (void)fread(test, 10, 1, stream);
71                 fclose(stream);
72
73                 if(test[0] == 'I' && test[1] == 'I')
74                 {
75                         // Reject cr2, libtiff fails with it
76                         if( test[4] == 0x10 && !test[5] && !test[6] && !test[7] &&
77                                         test[8] == 'C' && test[9] == 'R' )
78                                 return 0;
79                         return 1;
80                 }
81                 else
82                 if(test[0] == 'T' && test[1] == 'I' && test[2] == 'F' && test[3] == 'F' &&
83                         test[4] == 'L' && test[5] == 'I' && test[6] == 'S' && test[7] == 'T')
84                 {
85                         return 1;
86                 }
87                 else
88                 if(strlen(asset->path) > 4 &&
89                         !strcasecmp(asset->path + strlen(asset->path) - 4, ".tif"))
90                 {
91                         return 1;
92                 }
93                 else
94                 if(strlen(asset->path) > 5 &&
95                         !strcasecmp(asset->path + strlen(asset->path) - 5, ".tiff"))
96                 {
97                         return 1;
98                 }
99         }
100         return 0;
101 }
102
103 const char* FileTIFF::compression_to_str(int value)
104 {
105         switch(value)
106         {
107                 case FileTIFF::NONE: return "None"; break;
108                 case FileTIFF::LZW: return "LZW"; break;
109                 case FileTIFF::PACK_BITS: return "Pack Bits"; break;
110                 case FileTIFF::DEFLATE: return "Deflate"; break;
111                 case FileTIFF::JPEG: return "JPEG"; break;
112                 default:
113                         return "None";
114                         break;
115         }
116 }
117
118 const char* FileTIFF::cmodel_to_str(int value)
119 {
120         switch(value)
121         {
122                 case FileTIFF::GREYSCALE: return "Greyscale"; break;
123                 case FileTIFF::RGB_888: return "RGB-8 Bit"; break;
124                 case FileTIFF::RGB_161616: return "RGB-16 Bit"; break;
125                 case FileTIFF::RGBA_8888: return "RGBA-8 Bit"; break;
126                 case FileTIFF::RGBA_16161616: return "RGBA-16 Bit"; break;
127                 case FileTIFF::RGB_FLOAT: return "RGB-FLOAT"; break;
128                 case FileTIFF::RGBA_FLOAT: return "RGBA-FLOAT"; break;
129                 default:
130                         return "RGB-8 Bit";
131                         break;
132         }
133 }
134
135
136 int FileTIFF::can_copy_from(Asset *asset, int64_t position)
137 {
138         if(asset->format == FILE_TIFF_LIST ||
139                 asset->format == FILE_TIFF)
140                 return 1;
141
142         return 0;
143 }
144
145
146
147 int FileTIFF::read_frame_header(char *path)
148 {
149         TIFF *stream;
150         int result = 0;
151
152         if(!(stream = TIFFOpen(path, "rb")))
153         {
154                 eprintf("Error while opening \"%s\" for reading. \n%m\n", asset->path);
155                 return 1;
156         }
157
158         char *ptr = 0;
159         TIFFGetField(stream, TIFFTAG_MODEL, &ptr);
160 //printf("FileTIFF::read_frame_header 1 %s\n", ptr);
161         if(ptr && !strcmp(ptr, "Canon EOS-1DS"))       // FIXME: Does this have a purpose?
162         {
163                 printf("FileTIFF::read_frame_header: got a %s.\n",
164                         ptr);
165         }
166
167 // The raw format for certain cameras deviates from TIFF here.
168
169         TIFFGetField(stream, TIFFTAG_IMAGEWIDTH, &(asset->width));
170         TIFFGetField(stream, TIFFTAG_IMAGELENGTH, &(asset->height));
171
172         int components = 0;
173         TIFFGetField(stream, TIFFTAG_SAMPLESPERPIXEL, &components);
174         int bitspersample = 0;
175         TIFFGetField(stream, TIFFTAG_BITSPERSAMPLE, &bitspersample);
176         int sampleformat = 0;
177         TIFFGetField(stream, TIFFTAG_SAMPLEFORMAT, &sampleformat);
178
179         if(bitspersample == 8 && components == 3)
180                 asset->tiff_cmodel = FileTIFF::RGB_888;
181         else
182         if(bitspersample == 16 && components == 3)
183                 asset->tiff_cmodel = FileTIFF::RGB_161616;
184         else
185         if(bitspersample == 8 && components == 4)
186                 asset->tiff_cmodel = FileTIFF::RGBA_8888;
187         else
188         if(bitspersample == 16 && components == 4)
189                 asset->tiff_cmodel = FileTIFF::RGBA_16161616;
190         else
191         if(bitspersample == 32 && components == 3)
192                 asset->tiff_cmodel = FileTIFF::RGB_FLOAT;
193         else
194         if(bitspersample == 32 && components == 4)
195                 asset->tiff_cmodel = FileTIFF::RGBA_FLOAT;
196         else
197         if(bitspersample == 8 && (components == 1 || components == 0))
198                 asset->tiff_cmodel = FileTIFF::GREYSCALE;
199
200 //printf("FileTIFF::read_frame_header %d %d %d\n", bitspersample, components, asset->tiff_cmodel);
201         TIFFClose(stream);
202
203         asset->interlace_mode = ILACE_MODE_NOTINTERLACED;
204         return result;
205 }
206
207 int FileTIFF::colormodel_supported(int colormodel)
208 {
209         switch(asset->tiff_cmodel)
210         {
211                 case FileTIFF::RGB_888: return BC_RGB888; break;
212                 case FileTIFF::RGB_161616: return BC_RGB_FLOAT; break;
213                 case FileTIFF::GREYSCALE: return BC_RGB888; break;
214                 case FileTIFF::RGBA_8888: return BC_RGBA8888; break;
215                 case FileTIFF::RGBA_16161616: return BC_RGBA_FLOAT; break;
216                 case FileTIFF::RGB_FLOAT: return BC_RGB_FLOAT; break;
217                 case FileTIFF::RGBA_FLOAT: return BC_RGBA_FLOAT; break;
218                 default: return BC_RGB888; break;
219         }
220 }
221
222 int FileTIFF::get_best_colormodel(Asset *asset, int driver)
223 {
224         switch(asset->tiff_cmodel)
225         {
226                 case FileTIFF::GREYSCALE: return BC_RGB888; break;
227                 case FileTIFF::RGB_888: return BC_RGB888; break;
228                 case FileTIFF::RGB_161616: return BC_RGB_FLOAT; break;
229                 case FileTIFF::RGBA_8888: return BC_RGBA8888; break;
230                 case FileTIFF::RGBA_16161616: return BC_RGBA_FLOAT; break;
231                 case FileTIFF::RGB_FLOAT: return BC_RGB_FLOAT; break;
232                 case FileTIFF::RGBA_FLOAT: return BC_RGBA_FLOAT; break;
233                 default: return BC_RGB888; break;
234         }
235 }
236
237
238 static tsize_t tiff_read(thandle_t ptr, tdata_t buf, tsize_t size)
239 {
240         FileTIFFUnit *tiff_unit = (FileTIFFUnit*)ptr;
241         if(tiff_unit->data->get_compressed_size() < tiff_unit->offset + size)
242                 return 0;
243         memcpy(buf, tiff_unit->data->get_data() + tiff_unit->offset, size);
244         tiff_unit->offset += size;
245         return size;
246 }
247
248 static tsize_t tiff_write(thandle_t ptr, tdata_t buf, tsize_t size)
249 {
250         FileTIFFUnit *tiff_unit = (FileTIFFUnit*)ptr;
251         if(tiff_unit->data->get_compressed_allocated() < tiff_unit->offset + size)
252         {
253                 tiff_unit->data->allocate_compressed_data((tiff_unit->offset + size) * 2);
254         }
255
256
257         if(tiff_unit->data->get_compressed_size() < tiff_unit->offset + size)
258                 tiff_unit->data->set_compressed_size(tiff_unit->offset + size);
259         memcpy(tiff_unit->data->get_data() + tiff_unit->offset,
260                 buf,
261                 size);
262         tiff_unit->offset += size;
263         return size;
264 }
265
266 static toff_t tiff_seek(thandle_t ptr, toff_t off, int whence)
267 {
268         FileTIFFUnit *tiff_unit = (FileTIFFUnit*)ptr;
269         switch(whence)
270         {
271                 case SEEK_SET:
272                         tiff_unit->offset = off;
273                         break;
274                 case SEEK_CUR:
275                         tiff_unit->offset += off;
276                         break;
277                 case SEEK_END:
278                         tiff_unit->offset = tiff_unit->data->get_compressed_size() + off;
279                         break;
280         }
281         return tiff_unit->offset;
282 }
283
284 static int tiff_close(thandle_t ptr)
285 {
286         return 0;
287 }
288
289 static toff_t tiff_size(thandle_t ptr)
290 {
291         FileTIFFUnit *tiff_unit = (FileTIFFUnit*)ptr;
292         return tiff_unit->data->get_compressed_size();
293 }
294
295 static int tiff_mmap(thandle_t ptr, tdata_t* pbase, toff_t* psize)
296 {
297         FileTIFFUnit *tiff_unit = (FileTIFFUnit*)ptr;
298         *pbase = tiff_unit->data->get_data();
299         *psize = tiff_unit->data->get_compressed_size();
300         return 0;
301 }
302
303 void tiff_unmap(thandle_t ptr, tdata_t base, toff_t size)
304 {
305 }
306
307 int FileTIFF::read_frame(VFrame *output, VFrame *input)
308 {
309         FileTIFFUnit *unit = new FileTIFFUnit(this, 0);
310         TIFF *stream;
311         unit->offset = 0;
312         unit->data = input;
313
314         stream = TIFFClientOpen("FileTIFF",
315                 "r",
316             (void*)unit,
317             tiff_read,
318                 tiff_write,
319             tiff_seek,
320                 tiff_close,
321             tiff_size,
322             tiff_mmap,
323                 tiff_unmap);
324
325 // This loads the original TIFF data into each scanline of the output frame,
326 // assuming the output scanlines are bigger than the input scanlines.
327 // Then it expands the input data in reverse to fill the row.
328         for(int i = 0; i < asset->height; i++)
329         {
330                 TIFFReadScanline(stream, output->get_rows()[i], i, 0);
331
332 // For the greyscale model, the output is RGB888 but the input must be expanded
333                 if(asset->tiff_cmodel == FileTIFF::GREYSCALE)
334                 {
335                         unsigned char *row = output->get_rows()[i];
336                         for(int j = output->get_w() - 1; j >= 0; j--)
337                         {
338                                 unsigned char value = row[j];
339                                 row[j * 3] = value;
340                                 row[j * 3 + 1] = value;
341                                 row[j * 3 + 2] = value;
342                         }
343                 }
344 // For the 16 bit models, the output is floating point.
345                 else
346                 if(asset->tiff_cmodel == FileTIFF::RGB_161616)
347                 {
348                         uint16_t *input_row = (uint16_t*)output->get_rows()[i];
349                         float *output_row = (float*)output->get_rows()[i];
350                         for(int j = output->get_w() - 1; j >= 0; j--)
351                         {
352                                 uint16_t r = input_row[j * 3];
353                                 uint16_t g = input_row[j * 3 + 1];
354                                 uint16_t b = input_row[j * 3 + 2];
355                                 output_row[j * 3] = (float)r / 65535;
356                                 output_row[j * 3 + 1] = (float)g / 65535;
357                                 output_row[j * 3 + 2] = (float)b / 65535;
358                         }
359                 }
360                 else
361                 if(asset->tiff_cmodel == FileTIFF::RGBA_16161616)
362                 {
363                         uint16_t *input_row = (uint16_t*)output->get_rows()[i];
364                         float *output_row = (float*)output->get_rows()[i];
365                         for(int j = output->get_w() - 1; j >= 0; j--)
366                         {
367                                 uint16_t r = input_row[j * 4];
368                                 uint16_t g = input_row[j * 4 + 1];
369                                 uint16_t b = input_row[j * 4 + 2];
370                                 output_row[j * 4] = (float)r / 65535;
371                                 output_row[j * 4 + 1] = (float)g / 65535;
372                                 output_row[j * 4 + 2] = (float)b / 65535;
373                         }
374                 }
375         }
376
377         TIFFClose(stream);
378         delete unit;
379
380         return 0;
381 }
382
383 int FileTIFF::write_frame(VFrame *frame, VFrame *data, FrameWriterUnit *unit)
384 {
385 //printf("FileTIFF::write_frame 1\n");
386         FileTIFFUnit *tiff_unit = (FileTIFFUnit*)unit;
387         int result = 0;
388         TIFF *stream;
389         tiff_unit->offset = 0;
390         tiff_unit->data = data;
391         tiff_unit->data->set_compressed_size(0);
392
393         stream = TIFFClientOpen("FileTIFF",
394                 "w",
395             (void*)tiff_unit,
396             tiff_read,
397                 tiff_write,
398             tiff_seek,
399                 tiff_close,
400             tiff_size,
401             tiff_mmap,
402                 tiff_unmap);
403
404         int components, color_model, bits, compression;
405         int sampleformat = SAMPLEFORMAT_UINT;
406         //int bytesperrow, type;
407         switch(asset->tiff_cmodel)
408         {
409                 case FileTIFF::RGB_888:
410                         components = 3;
411                         color_model = BC_RGB888;
412                         bits = 8;
413                         //type = TIFF_BYTE;
414                         //bytesperrow = 3 * asset->width;
415                         break;
416                 case FileTIFF::RGB_161616:
417                         components = 3;
418                         color_model = BC_RGB_FLOAT;
419                         bits = 16;
420                         //type = TIFF_SHORT;
421                         //bytesperrow = 6 * asset->width;
422                         break;
423                 case FileTIFF::RGBA_8888:
424                         components = 4;
425                         color_model = BC_RGBA8888;
426                         bits = 8;
427                         //type = TIFF_BYTE;
428                         //bytesperrow = 4 * asset->width;
429                         break;
430                 case FileTIFF::RGBA_16161616:
431                         components = 4;
432                         color_model = BC_RGBA_FLOAT;
433                         bits = 16;
434                         //type = TIFF_SHORT;
435                         //bytesperrow = 8 * asset->width;
436                         break;
437                 case FileTIFF::RGB_FLOAT:
438                         components = 3;
439                         color_model = BC_RGB_FLOAT;
440                         bits = 32;
441                         //type = TIFF_FLOAT;
442                         sampleformat = SAMPLEFORMAT_IEEEFP;
443                         //bytesperrow = 12 * asset->width;
444                         break;
445                 case FileTIFF::RGBA_FLOAT:
446                         components = 4;
447                         color_model = BC_RGBA_FLOAT;
448                         bits = 32;
449                         //type = TIFF_FLOAT;
450                         sampleformat = SAMPLEFORMAT_IEEEFP;
451                         //bytesperrow = 16 * asset->width;
452                         break;
453                 default:
454                         components = 3;
455                         color_model = BC_RGB888;
456                         bits = 8;
457                         //type = TIFF_BYTE;
458                         //bytesperrow = 3 * asset->width;
459                         break;
460         }
461
462
463         switch(asset->tiff_compression)
464         {
465                 case FileTIFF::LZW:
466                         compression = COMPRESSION_LZW;
467                         break;
468                 case FileTIFF::PACK_BITS:
469                         compression = COMPRESSION_PACKBITS;
470                         break;
471                 case FileTIFF::DEFLATE:
472                         compression = COMPRESSION_DEFLATE;
473                         break;
474                 case FileTIFF::JPEG:
475                         compression = COMPRESSION_JPEG;
476                         break;
477                 default:
478                         compression = COMPRESSION_NONE;
479                         break;
480         }
481
482         TIFFSetField(stream, TIFFTAG_IMAGEWIDTH, asset->width);
483         TIFFSetField(stream, TIFFTAG_IMAGELENGTH, asset->height);
484         TIFFSetField(stream, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
485         TIFFSetField(stream, TIFFTAG_SAMPLESPERPIXEL, components);
486         TIFFSetField(stream, TIFFTAG_BITSPERSAMPLE, bits);
487     TIFFSetField(stream, TIFFTAG_SAMPLEFORMAT, sampleformat);
488         TIFFSetField(stream, TIFFTAG_COMPRESSION, compression);
489         TIFFSetField(stream, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
490         TIFFSetField(stream, TIFFTAG_ROWSPERSTRIP,
491                 TIFFDefaultStripSize(stream, (uint32_t)-1));
492 //      TIFFSetField(stream, TIFFTAG_ROWSPERSTRIP,
493 //              (8 * 1024) / bytesperrow);
494         TIFFSetField(stream, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_RGB);
495
496         if(frame->get_color_model() == color_model)
497         {
498                 for(int i = 0; i < asset->height; i++)
499                 {
500                         TIFFWriteScanline(stream, frame->get_rows()[i], i, 0);
501                 }
502         }
503         else
504         {
505                 if(tiff_unit->temp &&
506                         tiff_unit->temp->get_color_model() != color_model)
507                 {
508                         delete tiff_unit->temp;
509                         tiff_unit->temp = 0;
510                 }
511                 if(!tiff_unit->temp)
512                 {
513                         tiff_unit->temp =
514                                 new VFrame(asset->width, asset->height, color_model, 0);
515                 }
516
517                 BC_CModels::transfer(tiff_unit->temp->get_rows(),
518                         frame->get_rows(),
519                         tiff_unit->temp->get_y(),
520                         tiff_unit->temp->get_u(),
521                         tiff_unit->temp->get_v(),
522                         frame->get_y(),
523                         frame->get_u(),
524                         frame->get_v(),
525                         0,
526                         0,
527                         frame->get_w(),
528                         frame->get_h(),
529                         0,
530                         0,
531                         frame->get_w(),
532                         frame->get_h(),
533                         frame->get_color_model(),
534                         color_model,
535                         0,
536                         frame->get_w(),
537                         frame->get_w());
538                 for(int i = 0; i < asset->height; i++)
539                 {
540                         TIFFWriteScanline(stream, tiff_unit->temp->get_rows()[i], i, 0);
541                 }
542         }
543
544         TIFFClose(stream);
545
546 //printf("FileTIFF::write_frame 10\n");
547         return result;
548 }
549
550 FrameWriterUnit* FileTIFF::new_writer_unit(FrameWriter *writer)
551 {
552         return new FileTIFFUnit(this, writer);
553 }
554
555
556
557
558
559
560
561
562 FileTIFFUnit::FileTIFFUnit(FileTIFF *file, FrameWriter *writer)
563  : FrameWriterUnit(writer)
564 {
565         this->file = file;
566         temp = 0;
567 }
568
569 FileTIFFUnit::~FileTIFFUnit()
570 {
571         if(temp) delete temp;
572 }
573
574
575
576
577
578
579
580
581
582
583
584
585 TIFFConfigVideo::TIFFConfigVideo(BC_WindowBase *parent_window, Asset *asset)
586  : BC_Window(_(PROGRAM_NAME ": Video Compression"),
587         parent_window->get_abs_cursor_x(1),
588         parent_window->get_abs_cursor_y(1),
589         400,
590         200)
591 {
592         this->parent_window = parent_window;
593         this->asset = asset;
594 }
595
596 TIFFConfigVideo::~TIFFConfigVideo()
597 {
598 }
599
600 void TIFFConfigVideo::create_objects()
601 {
602         lock_window("TIFFConfigVideo::create_objects");
603         int x = 10, y = 10;
604
605         add_subwindow(new BC_Title(x, y, _("Colorspace:")));
606         TIFFColorspace *menu1;
607         add_subwindow(menu1 = new TIFFColorspace(this, x + 150, y, 200));
608         menu1->create_objects();
609         y += 40;
610         add_subwindow(new BC_Title(x, y, _("Compression:")));
611         TIFFCompression *menu2;
612         add_subwindow(menu2 = new TIFFCompression(this, x + 150, y, 200));
613         menu2->create_objects();
614
615         add_subwindow(new BC_OKButton(this));
616         show_window(1);
617         unlock_window();
618 }
619
620 int TIFFConfigVideo::close_event()
621 {
622         set_done(0);
623         return 1;
624 }
625
626
627
628
629
630
631 TIFFColorspace::TIFFColorspace(TIFFConfigVideo *gui, int x, int y, int w)
632  : BC_PopupMenu(x,
633         y,
634         w,
635         FileTIFF::cmodel_to_str(gui->asset->tiff_cmodel))
636 {
637         this->gui = gui;
638 }
639 int TIFFColorspace::handle_event()
640 {
641         return 1;
642 }
643 void TIFFColorspace::create_objects()
644 {
645         add_item(new TIFFColorspaceItem(gui, FileTIFF::RGB_888));
646 //      add_item(new TIFFColorspaceItem(gui, FileTIFF::RGB_16161616));
647         add_item(new TIFFColorspaceItem(gui, FileTIFF::RGBA_8888));
648 //      add_item(new TIFFColorspaceItem(gui, FileTIFF::RGBA_16161616));
649         add_item(new TIFFColorspaceItem(gui, FileTIFF::RGB_FLOAT));
650         add_item(new TIFFColorspaceItem(gui, FileTIFF::RGBA_FLOAT));
651 }
652
653
654 TIFFColorspaceItem::TIFFColorspaceItem(TIFFConfigVideo *gui, int value)
655  : BC_MenuItem(FileTIFF::cmodel_to_str(value))
656 {
657         this->gui = gui;
658         this->value = value;
659 }
660 int TIFFColorspaceItem::handle_event()
661 {
662         gui->asset->tiff_cmodel = value;
663         return 0;
664 }
665
666
667
668
669
670
671
672 TIFFCompression::TIFFCompression(TIFFConfigVideo *gui, int x, int y, int w)
673  : BC_PopupMenu(x, y, w, FileTIFF::compression_to_str(gui->asset->tiff_compression))
674 {
675         this->gui = gui;
676 }
677 int TIFFCompression::handle_event()
678 {
679         return 1;
680 }
681 void TIFFCompression::create_objects()
682 {
683         add_item(new TIFFCompressionItem(gui, FileTIFF::NONE));
684 //      add_item(new TIFFCompressionItem(gui, FileTIFF::LZW));
685         add_item(new TIFFCompressionItem(gui, FileTIFF::PACK_BITS));
686 //      add_item(new TIFFCompressionItem(gui, FileTIFF::DEFLATE));
687 //      add_item(new TIFFCompressionItem(gui, FileTIFF::JPEG));
688 }
689
690
691
692
693
694 TIFFCompressionItem::TIFFCompressionItem(TIFFConfigVideo *gui, int value)
695  : BC_MenuItem(FileTIFF::compression_to_str(value))
696 {
697         this->gui = gui;
698         this->value = value;
699 }
700 int TIFFCompressionItem::handle_event()
701 {
702         gui->asset->tiff_compression = value;
703         return 0;
704 }
705
706
707