add new boxblur plugin, mods to videoscope, fix segv for menu btns kfrm-tweak/kfrm...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / filetiff.h
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 #ifndef FILETIFF_H
23 #define FILETIFF_H
24
25 #include <stdlib.h>
26
27 #include "edl.inc"
28 #include "file.inc"
29 #include "filelist.h"
30 #include "mutex.inc"
31 #include <tiffio.h>
32 #include "vframe.inc"
33
34 // This header file is representative of any single frame file format.
35
36 class FileTIFF : public FileList
37 {
38 public:
39         FileTIFF(Asset *asset, File *file);
40         ~FileTIFF();
41
42         static void get_parameters(BC_WindowBase *parent_window,
43                 Asset *asset, BC_WindowBase* &format_window,
44                 int audio_options, int video_options, EDL *edl);
45         static int check_sig(Asset *asset);
46         static const char* compression_to_str(int value);
47         static const char* cmodel_to_str(int value);
48         int can_copy_from(Asset *asset, int64_t position);
49         int colormodel_supported(int colormodel);
50         int get_best_colormodel(Asset *asset, int driver);
51         int read_frame_header(char *path);
52         int read_frame(VFrame *output, VFrame *input);
53         int write_frame(VFrame *frame, VFrame *data, FrameWriterUnit *unit);
54         FrameWriterUnit* new_writer_unit(FrameWriter *writer);
55
56         enum { NONE,
57 // values stored in Asset::tiff_cmodel
58 // Data types
59                 RGB_888, RGB_161616, RGBA_8888, RGBA_16161616,
60                 RGB_FLOAT, RGBA_FLOAT, GREYSCALE,
61 // values stored in Asset::tiff_compression
62 // Compression types
63                 LZW, PACK_BITS, DEFLATE, JPEG,
64                 PIXARFILM, PIXARLOG, JP2000, ADOBE_DEFLATE,
65                 SGILOG, LZMA
66         };
67
68         Mutex *unit_lock;
69 };
70
71 // For each write frame call, since multiple write_frames are running concurrently.
72 class FileTIFFUnit : public FrameWriterUnit
73 {
74 public:
75         FileTIFFUnit(FileTIFF *file, FrameWriter *writer);
76         ~FileTIFFUnit();
77
78         int offset;
79         VFrame *data;
80         VFrame *temp;
81         FileTIFF *file;
82 };
83
84
85 class TIFFConfigVideo : public  BC_Window
86 {
87 public:
88         TIFFConfigVideo(BC_WindowBase *parent_window, Asset *asset);
89         ~TIFFConfigVideo();
90
91
92         void create_objects();
93         int close_event();
94         static char* alpha_to_codec(int use_alpha);
95         static int codec_to_alpha(char *codec);
96         BC_WindowBase *parent_window;
97         Asset *asset;
98 };
99
100
101 class TIFFColorspace : public BC_PopupMenu
102 {
103 public:
104         TIFFColorspace(TIFFConfigVideo *gui, int x, int y, int w);
105         void create_objects();
106         int handle_event();
107         TIFFConfigVideo *gui;
108 };
109
110 class TIFFColorspaceItem : public BC_MenuItem
111 {
112 public:
113         TIFFColorspaceItem(TIFFConfigVideo *gui, int value);
114         int handle_event();
115         TIFFConfigVideo *gui;
116         int value;
117 };
118
119 class TIFFCompression : public BC_PopupMenu
120 {
121 public:
122         TIFFCompression(TIFFConfigVideo *gui, int x, int y, int w);
123         void create_objects();
124         int handle_event();
125         TIFFConfigVideo *gui;
126 };
127
128 class TIFFCompressionItem : public BC_MenuItem
129 {
130 public:
131         TIFFCompressionItem(TIFFConfigVideo *gui, int value);
132         int handle_event();
133         TIFFConfigVideo *gui;
134         int value;
135 };
136
137 #endif