MovieLoader Manual

内容表

关于

The MovieLoader class is used to load image data from a movie file.

警告
For MAXON API media input and output see Media Sessions Manual .

Allocation/Deallocation

A MovieLoader can be created with the usual tools:

Functionality

A MovieLoader object simply opens a movie file to read its content:

注意
另请参阅 GeGetMovieInfo() .
// This example loads the given movie file and displays // each frame of the movie in the Picture Viewer.
AutoAlloc<MovieLoader> movieLoader; if (movieLoader == nullptr ) return maxon::OutOfMemoryError( MAXON_SOURCE_LOCATION );

// load movie file const IMAGERESULT res = movieLoader-> Open (selectedMovieFile); if (res != IMAGERESULT::OK ) return maxon::IoError( MAXON_SOURCE_LOCATION , MaxonConvert (selectedMovieFile, MAXONCONVERTMODE::NONE ), "Could not open movie file." _s);

// get movie info Float fps = 0.0; const Int32 frames = movieLoader-> GetInfo (&fps);

// load and display each frame for ( Int32 i = 0; i < frames; ++i) { // load frame Int32 frameResult; BaseBitmap * const frameContent = movieLoader-> 读取 (i, &frameResult);

// check if frame could been loaded

const Int32 imageOK = Int32 ( IMAGERESULT::OK ); if (frameResult != imageOK) return maxon::UnknownError( MAXON_SOURCE_LOCATION ); if (frameContent == nullptr ) return maxon::UnknownError( MAXON_SOURCE_LOCATION );

// show frame ShowBitmap (frameContent); } movieLoader-> 关闭 ();

延伸阅读

IMAGERESULT::OK
@ OK
Image loaded/created.
Float
maxon::Float Float
定义: ge_sys_math.h:64
MAXONCONVERTMODE::NONE
@ NONE
No check if file exists under case-sensitive drives.
MAXON_SOURCE_LOCATION
#define MAXON_SOURCE_LOCATION
定义: memoryallocationbase.h:66
MaxonConvert
maxon::Url MaxonConvert(const Filename &fn, MAXONCONVERTMODE convertMode)
MovieLoader::Read
BaseBitmap * Read(Int32 new_frame_idx=-1, Int32 *_result=nullptr)
Int32
maxon::Int32 Int32
定义: ge_sys_math.h:58
ShowBitmap
Bool ShowBitmap(const Filename &fn)
BaseBitmap
定义: c4d_basebitmap.h:410
AutoAlloc
定义: ge_autoptr.h:36
MovieLoader::GetInfo
Int32 GetInfo(Float *_fps)
MovieLoader::Close
void Close(void)
Close the loaded movie file.
IMAGERESULT
IMAGERESULT
定义: ge_prepass.h:3659
MovieLoader::Open
IMAGERESULT Open(const Filename &fn)

Copyright  © 2014-2025 乐数软件    

工业和信息化部: 粤ICP备14079481号-1