Cinder  0.9.1
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
cinder::qtime::MovieWriter Class Reference

#include <MovieWriter.h>

Classes

class  Format
 

Public Types

enum  Codec { H264, JPEG, PRO_RES_4444, PRO_RES_422 }
 
enum  FileType { QUICK_TIME_MOVIE, MPEG4, M4V }
 
enum  {
  CODEC_H264 = 'avc1', CODEC_JPEG = 'jpeg', CODEC_MP4 = 'mp4v', CODEC_PNG = 'png ',
  CODEC_RAW = 'raw ', CODEC_ANIMATION = 'rle '
}
 
typedef enum cinder::qtime::MovieWriter::Codec Codec
 
typedef enum cinder::qtime::MovieWriter::FileType FileType
 

Public Member Functions

 ~MovieWriter ()
 
float getDefaultDuration () const
 
int32_t getWidth () const
 
int32_t getHeight () const
 
ivec2 getSize () const
 
float getAspectRatio () const
 
Area getBounds () const
 
const FormatgetFormat () const
 
void addFrame (const Surface8u &imageSource, float duration=-1.0f)
 
uint32_t getNumFrames () const
 
void finish ()
 
 MovieWriter ()
 
 MovieWriter (const fs::path &path, int32_t width, int32_t height, const Format &format=Format::Format())
 
float getDefaultDuration () const
 
int32_t getWidth () const
 
int32_t getHeight () const
 
ivec2 getSize () const
 
float getAspectRatio () const
 
Area getBounds () const
 
const FormatgetFormat () const
 
void addFrame (const ImageSourceRef &imageSource, float duration=-1.0f)
 
uint32_t getNumFrames () const
 
void finish ()
 

Static Public Member Functions

static MovieWriterRef create (const fs::path &path, int32_t width, int32_t height, const Format &format=Format::Format())
 
static MovieWriterRef create (const fs::path &path, int32_t width, int32_t height, const Format &format=Format::Format())
 
static bool getUserCompressionSettings (Format *result, ImageSourceRef previewImage=ImageSourceRef())
 
typedef std::shared_ptr< Obj > MovieWriter::* unspecified_bool_type
 
 operator unspecified_bool_type () const
 
void reset ()
 

Member Typedef Documentation

typedef std::shared_ptr<Obj> MovieWriter::* cinder::qtime::MovieWriter::unspecified_bool_type

Emulates shared_ptr-like behavior.

Member Enumeration Documentation

Enumerator
H264 
JPEG 
PRO_RES_4444 
PRO_RES_422 
Enumerator
QUICK_TIME_MOVIE 
MPEG4 
M4V 
anonymous enum
Enumerator
CODEC_H264 
CODEC_JPEG 
CODEC_MP4 
CODEC_PNG 
CODEC_RAW 
CODEC_ANIMATION 

Constructor & Destructor Documentation

cinder::qtime::MovieWriter::~MovieWriter ( )
cinder::qtime::MovieWriter::MovieWriter ( )
cinder::qtime::MovieWriter::MovieWriter ( const fs::path &  path,
int32_t  width,
int32_t  height,
const Format format = Format::Format() 
)

Member Function Documentation

static MovieWriterRef cinder::qtime::MovieWriter::create ( const fs::path &  path,
int32_t  width,
int32_t  height,
const Format format = Format::Format() 
)
static
float cinder::qtime::MovieWriter::getDefaultDuration ( ) const

Returns the Movie's default frame duration measured in seconds. You can also think of this as the Movie's frameRate.

int32_t cinder::qtime::MovieWriter::getWidth ( ) const

Returns the width of the Movie in pixels.

int32_t cinder::qtime::MovieWriter::getHeight ( ) const

Returns the height of the Movie in pixels.

ivec2 cinder::qtime::MovieWriter::getSize ( ) const

Returns the size of the Movie in pixels.

float cinder::qtime::MovieWriter::getAspectRatio ( ) const

Returns the Movie's aspect ratio, which is its width / height.

Area cinder::qtime::MovieWriter::getBounds ( ) const

Returns the bounding Area of the Movie in pixels: [0,0]-(width,height)

const Format& cinder::qtime::MovieWriter::getFormat ( ) const

Returns the Movie's Format.

void cinder::qtime::MovieWriter::addFrame ( const Surface8u imageSource,
float  duration = -1.0f 
)

Appends a frame to the Movie. The optional duration parameter allows a frame to be inserted for a durationtime other than the Format's default duration.

uint32_t cinder::qtime::MovieWriter::getNumFrames ( ) const

Returns the number of frames in the movie.

void cinder::qtime::MovieWriter::finish ( )

Completes the encoding of the movie and closes the file. Calling finish() more than once has no effect. It is an error to call addFrame() after calling finish().

static MovieWriterRef cinder::qtime::MovieWriter::create ( const fs::path &  path,
int32_t  width,
int32_t  height,
const Format format = Format::Format() 
)
static
float cinder::qtime::MovieWriter::getDefaultDuration ( ) const

Returns the Movie's default frame duration measured in seconds. You can also think of this as the Movie's frameRate.

int32_t cinder::qtime::MovieWriter::getWidth ( ) const

Returns the width of the Movie in pixels.

int32_t cinder::qtime::MovieWriter::getHeight ( ) const

Returns the height of the Movie in pixels.

ivec2 cinder::qtime::MovieWriter::getSize ( ) const

Returns the size of the Movie in pixels.

float cinder::qtime::MovieWriter::getAspectRatio ( ) const

Returns the Movie's aspect ratio, which is its width / height.

Area cinder::qtime::MovieWriter::getBounds ( ) const

Returns the bounding Area of the Movie in pixels: [0,0]-(width,height)

const Format& cinder::qtime::MovieWriter::getFormat ( ) const

Returns the Movie's Format.

bool cinder::qtime::MovieWriter::getUserCompressionSettings ( Format result,
ImageSourceRef  previewImage = ImageSourceRef() 
)
static

Presents the user with the standard compression options dialog. Optional previewImage provides a still image as a preview (currently ignored on Mac OS X). Returns false if user cancelled.

qtime_settings_small.png
void cinder::qtime::MovieWriter::addFrame ( const ImageSourceRef imageSource,
float  duration = -1.0f 
)

Appends a frame to the Movie. The optional duration parameter allows a frame to be inserted for a time other than the Format's default duration.

Note
Calling addFrame() after a call to finish() will throw a MovieWriterExcAlreadyFinished exception.
uint32_t cinder::qtime::MovieWriter::getNumFrames ( ) const

Returns the number of frames in the movie.

void cinder::qtime::MovieWriter::finish ( )

Completes the encoding of the movie and closes the file. Calling finish() more than once has no effect.

cinder::qtime::MovieWriter::operator unspecified_bool_type ( ) const

Emulates shared_ptr-like behavior.

void cinder::qtime::MovieWriter::reset ( )

Emulates shared_ptr-like behavior.


The documentation for this class was generated from the following files: