fix editpanel wdw lock issues, use undo bracketing to avoid stop playback deadlocks
[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
57         {
58                 NONE,
59 // values stored in Asset::tiff_cmodel
60 // Data types
61                 RGB_888,
62                 RGB_161616,
63                 RGBA_8888,
64                 RGBA_16161616,
65                 RGB_FLOAT,
66                 RGBA_FLOAT,
67                 GREYSCALE,
68 // values stored in Asset::tiff_compression
69 // Compression types
70                 LZW,
71                 PACK_BITS,
72                 DEFLATE,
73                 JPEG
74         };
75
76         Mutex *unit_lock;
77 };
78
79
80 // For each write frame call, since multiple write_frames are running concurrently.
81 class FileTIFFUnit : public FrameWriterUnit
82 {
83 public:
84         FileTIFFUnit(FileTIFF *file, FrameWriter *writer);
85         ~FileTIFFUnit();
86
87         int offset;
88         VFrame *data;
89         VFrame *temp;
90         FileTIFF *file;
91 };
92
93
94
95
96 class TIFFConfigVideo : public  BC_Window
97 {
98 public:
99         TIFFConfigVideo(BC_WindowBase *parent_window, Asset *asset);
100         ~TIFFConfigVideo();
101
102
103         void create_objects();
104         int close_event();
105         static char* alpha_to_codec(int use_alpha);
106         static int codec_to_alpha(char *codec);
107         BC_WindowBase *parent_window;
108         Asset *asset;
109 };
110
111
112 class TIFFColorspace : public BC_PopupMenu
113 {
114 public:
115         TIFFColorspace(TIFFConfigVideo *gui, int x, int y, int w);
116         void create_objects();
117         int handle_event();
118         TIFFConfigVideo *gui;
119 };
120
121 class TIFFColorspaceItem : public BC_MenuItem
122 {
123 public:
124         TIFFColorspaceItem(TIFFConfigVideo *gui, int value);
125         int handle_event();
126         TIFFConfigVideo *gui;
127         int value;
128 };
129
130
131
132
133 class TIFFCompression : public BC_PopupMenu
134 {
135 public:
136         TIFFCompression(TIFFConfigVideo *gui, int x, int y, int w);
137         void create_objects();
138         int handle_event();
139         TIFFConfigVideo *gui;
140 };
141
142 class TIFFCompressionItem : public BC_MenuItem
143 {
144 public:
145         TIFFCompressionItem(TIFFConfigVideo *gui, int value);
146         int handle_event();
147         TIFFConfigVideo *gui;
148         int value;
149 };
150
151
152
153
154
155 #endif