OpenShot Library | libopenshot
0.2.7
|
This class uses the ImageMagick library to write image files (including animated GIFs) More...
#include <ImageWriter.h>
Public Member Functions | |
void | Close () |
Close the writer and encode/output final image to the disk. This is a requirement of ImageMagick, which writes all frames of a multi-frame image at one time. More... | |
int | GetCacheSize () |
Get the cache size. More... | |
ImageWriter (std::string path) | |
Constructor for ImageWriter. Throws one of the following exceptions. More... | |
bool | IsOpen () |
Determine if writer is open or closed. More... | |
void | Open () |
Open writer. More... | |
void | SetCacheSize (int new_size) |
Set the cache size (number of frames to queue before writing) More... | |
void | SetVideoOptions (std::string format, Fraction fps, int width, int height, int quality, int loops, bool combine) |
Set the video export options. More... | |
void | WriteFrame (ReaderBase *reader, int64_t start, int64_t length) |
Write a block of frames from a reader. More... | |
void | WriteFrame (std::shared_ptr< Frame > frame) |
Add a frame to the stack waiting to be encoded. More... | |
![]() | |
void | CopyReaderInfo (openshot::ReaderBase *reader) |
This method copy's the info struct of a reader, and sets the writer with the same info. More... | |
void | DisplayInfo () |
Display file information in the standard output stream (stdout) More... | |
std::string | Json () const |
Generate JSON string of this object. More... | |
Json::Value | JsonValue () const |
Generate Json::Value for this object. More... | |
void | SetJson (const std::string value) |
Load JSON string into this object. More... | |
void | SetJsonValue (const Json::Value root) |
Load Json::Value into this object. More... | |
WriterBase () | |
Constructor for WriterBase class, many things are initialized here. More... | |
virtual | ~WriterBase ()=default |
Additional Inherited Members | |
![]() | |
WriterInfo | info |
Information about the current media file. More... | |
This class uses the ImageMagick library to write image files (including animated GIFs)
All image formats supported by ImageMagick are supported by this class.
Definition at line 85 of file ImageWriter.h.
ImageWriter::ImageWriter | ( | std::string | path | ) |
Constructor for ImageWriter. Throws one of the following exceptions.
path | The path of the file you want to create |
Definition at line 42 of file ImageWriter.cpp.
void ImageWriter::Close | ( | ) |
Close the writer and encode/output final image to the disk. This is a requirement of ImageMagick, which writes all frames of a multi-frame image at one time.
Definition at line 146 of file ImageWriter.cpp.
|
inline |
Get the cache size.
Definition at line 110 of file ImageWriter.h.
|
inlinevirtual |
Determine if writer is open or closed.
Implements openshot::WriterBase.
Definition at line 113 of file ImageWriter.h.
|
virtual |
|
inline |
Set the cache size (number of frames to queue before writing)
new_size | Number of frames to queue before writing |
Definition at line 120 of file ImageWriter.h.
void ImageWriter::SetVideoOptions | ( | std::string | format, |
Fraction | fps, | ||
int | width, | ||
int | height, | ||
int | quality, | ||
int | loops, | ||
bool | combine | ||
) |
Set the video export options.
format | The image format (such as GIF) |
fps | Frames per second of the image (used on certain multi-frame image formats, such as GIF) |
width | Width in pixels of image |
height | Height in pixels of image |
quality | Quality of image (0 to 100, 70 is default) |
loops | Number of times to repeat the image (used on certain multi-frame image formats, such as GIF) |
combine | Combine frames into a single image (if possible), or save each frame as its own image |
Definition at line 52 of file ImageWriter.cpp.
|
virtual |
Write a block of frames from a reader.
reader | A openshot::ReaderBase object which will provide frames to be written |
start | The starting frame number of the reader |
length | The number of frames to write |
Implements openshot::WriterBase.
Definition at line 130 of file ImageWriter.cpp.
Referenced by WriteFrame().
|
virtual |
Add a frame to the stack waiting to be encoded.
frame | The openshot::Frame object to write to this image |
Implements openshot::WriterBase.
Definition at line 96 of file ImageWriter.cpp.