4 * Copyright (C) 2014 Adam Williams <broadcast at earthling dot net>
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.
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.
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
25 #include "arraylist.h"
32 // This header file is representative of any single frame file format.
34 class FileGIF : public FileBase
37 FileGIF(Asset *asset, File *file);
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);
49 int set_video_position(int64_t pos);
51 int read_frame_header(char *path);
52 int read_frame(VFrame *output);
53 int read_next_image(VFrame *output);
55 int write_frames(VFrame ***frames, int len);
56 int write_frame(VFrame *frame);
60 int fd, depth, writes;
63 GifFileType *gif_file;
66 ArrayList<int64_t> file_pos;
70 class FileGIFList : public FileList
73 FileGIFList(Asset *asset, File *file);
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 // Need to override this method from FILEBASE class
84 int verify_file_list();
85 FrameWriterUnit* new_writer_unit(FrameWriter *writer);
88 class GIFUnit : public FrameWriterUnit
91 GIFUnit(FileGIFList *file, FrameWriter *writer);