src/feature/imagemagick/imagemagick-gif-encoder.h (view raw)
1/* Copyright (c) 2013-2015 Jeffrey Pfau
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6#ifndef IMAGEMAGICK_GIF_ENCODER
7#define IMAGEMAGICK_GIF_ENCODER
8
9#include <mgba-util/common.h>
10
11CXX_GUARD_START
12
13#include <mgba/core/interface.h>
14
15#if MAGICKWAND_VERSION_MAJOR >= 7
16#include <MagickWand/MagickWand.h>
17#else
18#include <wand/MagickWand.h>
19#endif
20
21struct ImageMagickGIFEncoder {
22 struct mAVStream d;
23 MagickWand* wand;
24 char* outfile;
25 uint32_t* frame;
26
27 unsigned currentFrame;
28 int frameskip;
29 int delayMs;
30
31 unsigned iwidth;
32 unsigned iheight;
33};
34
35void ImageMagickGIFEncoderInit(struct ImageMagickGIFEncoder*);
36void ImageMagickGIFEncoderSetParams(struct ImageMagickGIFEncoder* encoder, int frameskip, int delayMs);
37bool ImageMagickGIFEncoderOpen(struct ImageMagickGIFEncoder*, const char* outfile);
38bool ImageMagickGIFEncoderClose(struct ImageMagickGIFEncoder*);
39bool ImageMagickGIFEncoderIsOpen(struct ImageMagickGIFEncoder*);
40
41CXX_GUARD_END
42
43#endif