tahoma2d/toonz/sources/image/ffmpeg/tiio_gif.h
turtletooth 04d8fdc45c FFmpeg Integration - mp4, webm, gif (#624)
* Webm and Gif Export

* added intermediate jpg conversion to save hard drive space

* Started preferences ffmpegPath selection

* grouped ffmpeg files together

* Working with intermediate format

* Fixed running multiple CPU cores for export

* audio works

* all working, need refactoring and error checking

* Changed Qt includes

* revisited Qt includes

* Clean up code, refactor file cleanup, clean up includes

* started gif import

* import working

* Removed import again, fixed export settings being remembered

* import working, bypassed precompute, back to single core export

* clang formatting applied

* added beta warnings in Preferences Popup

* fixed frame flipping and made looping gif default

* added toonzlibs

* added format checks

* added check to help t32bitsrv crash

* sliders for settings are back

* added customizable timeout for ffmpeg

* fixed gif fps and scale for no palette
2016-07-29 14:35:10 +09:00

90 lines
2.1 KiB
C++

#pragma once
#ifndef TTIO_GIF_INCLUDED
#define TTIO_GIF_INCLUDED
#include "tproperty.h"
#include "tlevel_io.h"
#include "tiio_ffmpeg.h"
//#include "tthreadmessage.h"
//===========================================================
//
// TLevelWriterGif
//
//===========================================================
class TLevelWriterGif : public TLevelWriter {
public:
TLevelWriterGif(const TFilePath &path, TPropertyGroup *winfo);
~TLevelWriterGif();
// FfmpegBridge* ffmpeg;
void setFrameRate(double fps);
TImageWriterP getFrameWriter(TFrameId fid) override;
void save(const TImageP &image, int frameIndex);
void saveSoundTrack(TSoundTrack *st);
static TLevelWriter *create(const TFilePath &path, TPropertyGroup *winfo) {
return new TLevelWriterGif(path, winfo);
}
private:
Ffmpeg *ffmpegWriter;
int m_frameCount, m_lx, m_ly;
// double m_fps;
int m_scale;
bool m_looping = false;
bool m_palette = false;
};
//===========================================================
//
// TLevelReaderGif
//
//===========================================================
class TLevelReaderGif final : public TLevelReader {
public:
TLevelReaderGif(const TFilePath &path);
~TLevelReaderGif();
TImageReaderP getFrameReader(TFrameId fid) override;
static TLevelReader *create(const TFilePath &f) {
return new TLevelReaderGif(f);
}
TLevelP loadInfo() override;
TImageP load(int frameIndex);
TDimension getSize();
// TThread::Mutex m_mutex;
// void *m_decompressedBuffer;
private:
Ffmpeg *ffmpegReader;
TDimension m_size;
int m_frameCount, m_lx, m_ly;
};
//===========================================================================
namespace Tiio {
//===========================================================================
class GifWriterProperties : public TPropertyGroup {
public:
TIntProperty m_scale;
TBoolProperty m_looping;
TBoolProperty m_palette;
GifWriterProperties();
};
//===========================================================================
// Tiio::Reader *makeGifReader();
// Tiio::Writer *makeGifWriter();
} // namespace
#endif