About
The maxon::FileFormatHandlerInterface provides functionality to access files of a given type. It is typically used to create specific handlers using CreateHandler().
FileFormatHandlerInterface
The FileFormatHandler for a given file is typically obtained with maxon::FileFormatDetectionInterface::Detect().
The maxon::FileFormatHandlerInterface provides these functions:
Registered Handlers
The following maxon::FileFormatHandler implementations are registered at the maxon::FileFormatHandlers registry and are accessible at these published objects:
- maxon::FileFormatHandlers::GenericFile: Returns no handler because it indicates just a regular file
- maxon::FileFormatHandlers::Browsable: Returns maxon::IoBrowseRef for directories.
- maxon::FileFormatHandlers::MaxonDocumentBinaryHandler: Returns maxon::DataFormatReaderRef.
- maxon::FileFormatHandlers::MaxonDocumentJsonHandler: Returns maxon::DataFormatReaderRef.
- maxon::FileFormatHandlers::MaxonDocumentXmlHandler: Returns maxon::DataFormatReaderRef.
Archive files. See also Archives Manual.
- maxon::FileFormatHandlers::ZipDirectoryBrowser: Returns maxon::IoBrowseRef for directories.
- maxon::FileFormatHandlers::ZipArchiveHandler: Returns maxon::ReadArchiveRef for directories.
- maxon::FileFormatHandlers::GZipDirectoryBrowser: Returns maxon::IoBrowseRef for directories.
const maxon::FileFormatHandler& handler = maxon::FileFormatHandlers::ZipArchiveHandler();
const maxon::ReadArchiveRef zipArchive = handler.CreateHandler<maxon::ReadArchiveRef>(
maxon::Url())
iferr_return;
PyCompilerFlags * flags
Definition: ast.h:14
IOARCHIVEEXTRACTFLAGS
Extract Flags used in ReadArchiveInterface::Extract() and ReadArchiveInterface::ExtractSingleFile().
Definition: ioarchivehandler.h:33
@ OVERWRITE_EXISTING_FILE
Overwrites the file silently if it already exists in the directory.
#define iferr_return
Definition: resultbase.h:1524
These handlers access image and video files and return a maxon::MediaInputRef. See Images Manual and Media Sessions Manual.
- maxon::FileFormatHandlers::ImageLoaderJpg
- maxon::FileFormatHandlers::ImageLoaderBmp
- maxon::FileFormatHandlers::ImageLoaderIff
- maxon::FileFormatHandlers::ImageLoaderIco
- maxon::FileFormatHandlers::ImageLoaderPng
- maxon::FileFormatHandlers::ImageLoaderTiff
- maxon::FileFormatHandlers::ImageLoaderHdr
- maxon::FileFormatHandlers::ImageLoaderPict
- maxon::FileFormatHandlers::ImageLoaderPsd
- maxon::FileFormatHandlers::ImageLoaderPsb
- maxon::FileFormatHandlers::MovieImageSequence
- maxon::FileFormatHandlers::MovieWinMF
- maxon::FileFormatHandlers::AudioWinMF
Audio files are handled with these handler which also return a maxon::MediaInputRef:
- maxon::FileFormatHandlers::AudioLoaderWav
- maxon::FileFormatHandlers::AudioLoaderAiff
{
if (url.IsEmpty())
const maxon::FileFormatHandler importFileFormat = maxon::FileFormatDetectionInterface::Detect<maxon::MediaInputRef>(url)
iferr_return;
const maxon::MediaInputRef
source = importFileFormat.CreateHandler<maxon::MediaInputRef>(url)
iferr_return;
const maxon::MediaOutputTextureRef destination = maxon::MediaOutputTextureClass().Create()
iferr_return;
destination.SetOutputTexture(targetTexture, maxon::ImagePixelStorageClasses::Normal())
iferr_return;
const maxon::MediaSessionRef session = maxon::MediaSessionObject().Create()
iferr_return;
}
The TimeValue class encapsulates a timer value.
Definition: timevalue.h:33
const Py_UNICODE * source
Definition: unicodeobject.h:54
return OK
Definition: apibase.h:2735
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:67
#define iferr_scope
Definition: resultbase.h:1389
{
if (folder.IsEmpty() || images.
IsEmpty())
sequenceURL.
Set(maxon::URLFLAGS::IMAGESEQUENCE_FIRSTFRAME, firstFrame)
iferr_return;
sequenceURL.
Set(maxon::URLFLAGS::IMAGESEQUENCE_LASTFRAME, lastFrame)
iferr_return;
const maxon::FileFormatHandler imageSequence = maxon::FileFormatHandlers::MovieImageSequence();
const maxon::MediaInputRef
source = imageSequence.CreateHandler<maxon::MediaInputRef>(sequenceURL)
iferr_return;
const maxon::ImageTextureRef texture = maxon::ImageTextureClasses::TEXTURE().Create()
iferr_return;
const maxon::MediaOutputTextureRef destination = maxon::MediaOutputTextureClass().Create()
iferr_return;
destination.SetOutputTexture(texture, maxon::ImagePixelStorageClasses::Normal())
iferr_return;
const maxon::MediaSessionRef session = maxon::MediaSessionObject().Create()
iferr_return;
{
currentTime += frameDuration;
}
return session.Close();
}
const char const char * name
Definition: abstract.h:195
PyCompilerFlags const char * filename
Definition: ast.h:15
Definition: basearray.h:415
MAXON_ATTRIBUTE_FORCE_INLINE Int GetCount() const
Definition: basearray.h:585
MAXON_ATTRIBUTE_FORCE_INLINE Bool IsEmpty() const
Definition: collection.h:348
Definition: string.h:1237
void SetSeconds(Float64 seconds)
Definition: timevalue.h:225
Result< void > Set(KEY &&key, T &&data, Bool persistent=true)
Definition: url.h:1042
Int64 Int
signed 32/64 bit int, size depends on the platform
Definition: apibase.h:202
Float64 Float
Definition: apibase.h:211
ImageRef GetImageOf(const ImageBaseRef &bmp)
PyFrameObject * frame
Definition: pycore_traceback.h:92
Further Reading