all repos — mgba @ 8ca80d4a94ccbd06ecfffaabd89822071e3244d5

mGBA Game Boy Advance Emulator

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	unsigned numerator;
35	unsigned denominator;
36};
37
38void ImageMagickGIFEncoderInit(struct ImageMagickGIFEncoder*);
39void ImageMagickGIFEncoderSetParams(struct ImageMagickGIFEncoder* encoder, int frameskip, int delayMs);
40bool ImageMagickGIFEncoderOpen(struct ImageMagickGIFEncoder*, const char* outfile);
41bool ImageMagickGIFEncoderClose(struct ImageMagickGIFEncoder*);
42bool ImageMagickGIFEncoderIsOpen(struct ImageMagickGIFEncoder*);
43
44CXX_GUARD_END
45
46#endif