record batch dir path fix, handle yuv in gl masking, sync up maskengine/playback3d...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / filegif.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2014 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 FILEGIF_H
23 #define FILEGIF_H
24
25 #include "arraylist.h"
26 #include "file.inc"
27 #include "filelist.h"
28 #include "vframe.inc"
29
30 #include "gif_lib.h"
31
32 // This header file is representative of any single frame file format.
33
34 class FileGIF : public FileBase
35 {
36 public:
37         FileGIF(Asset *asset, File *file);
38         ~FileGIF();
39
40         static int get_best_colormodel(Asset *asset, int driver);
41         static int check_sig(Asset *asset);
42         int colormodel_supported(int colormodel);
43         int open_file(int rd, int wr);
44         int ropen_path(const char *path);
45         int wopen_path(const char *path);
46         int wopen_data(VFrame *frame);
47         int open_gif();
48         int close_file();
49         int set_video_position(int64_t pos);
50
51         int read_frame_header(char *path);
52         int read_frame(VFrame *output);
53         int read_next_image(VFrame *output);
54         int scan_gif();
55         int write_frames(VFrame ***frames, int len);
56         int write_frame(VFrame *frame);
57
58         int64_t offset;
59         int err, eof;
60         int fd, depth, writes;
61         int rows, row_size;
62         FILE *fp;
63         GifFileType *gif_file;
64         GifPixelType *bg;
65         GifRowType *buffer;
66         ArrayList<int64_t> file_pos;
67         VFrame *output;
68 };
69
70 class FileGIFList : public FileList
71 {
72 public:
73         FileGIFList(Asset *asset, File *file);
74         ~FileGIFList();
75
76         static int check_sig(Asset *asset);
77         int colormodel_supported(int colormodel);
78         int get_best_colormodel(Asset *asset, int driver);
79         int read_frame_header(char *path);
80         int use_path() { return 1; }
81         int read_frame(VFrame *output, char *path);
82         int write_frame(VFrame *frame, VFrame *data, FrameWriterUnit *unit);
83         FrameWriterUnit* new_writer_unit(FrameWriter *writer);
84 };
85
86 class GIFUnit : public FrameWriterUnit
87 {
88 public:
89         GIFUnit(FileGIFList *file, FrameWriter *writer);
90         ~GIFUnit();
91
92         FileGIFList *file;
93         VFrame *temp_frame;
94 };
95
96 #endif