ImageTextureInterface Class Reference

#include <gfx_image.h>

Inheritance diagram for ImageTextureInterface:

Detailed Description

A Image texture represents a texture object with layers.

Public Member Functions

MAXON_METHOD Result< MediaSessionRef > Load (const Url &url, const TimeValue &targetTime, MEDIASESSIONFLAGS flags, const Class< ImagePixelStorage > &pixelStorageClass=GetZeroRef< Class< ImagePixelStorage >>(), const LayerSetInterface *layerSet=nullptr)
 
MAXON_METHOD Result< void > Save (const MediaOutputRef &fileFormat, MEDIASESSIONFLAGS flags, MediaSessionRef *returnOpenSession=nullptr) const
 
MAXON_FUNCTION Result< void > Save (const Url &fileName, const MediaOutputUrlRef &fileFormat, MEDIASESSIONFLAGS flags, MediaSessionRef *returnOpenSession=nullptr) const
 

Static Public Member Functions

static MAXON_METHOD Result< ImageTextureRef > LoadTexture (const Url &name, const TimeValue &targetTime=TimeValue(), MEDIASESSIONFLAGS flags=MEDIASESSIONFLAGS::NONE, const Class< ImagePixelStorage > &pixelStorageClass=GetNormalPixelStorageClass(), const LayerSetInterface *layerSet=nullptr)
 

Private Member Functions

 MAXON_INTERFACE (ImageTextureInterface, MAXON_REFERENCE_NORMAL, "net.maxon.image.interface.imagetexture")
 

Member Function Documentation

◆ MAXON_INTERFACE()

MAXON_INTERFACE ( ImageTextureInterface  ,
MAXON_REFERENCE_NORMAL  ,
"net.maxon.image.interface.imagetexture"   
)
private

◆ LoadTexture()

static MAXON_METHOD Result<ImageTextureRef> LoadTexture ( const Url name,
const TimeValue targetTime = TimeValue(),
MEDIASESSIONFLAGS  flags = MEDIASESSIONFLAGS::NONE,
const Class< ImagePixelStorage > &  pixelStorageClass = GetNormalPixelStorageClass(),
const LayerSetInterface layerSet = nullptr 
)
static

Creates a new texture and loads the given url into this texture.

Parameters
[in]nameUrl to load.
[in]targetTimeTarget time to receive the media samples from.
[in]flagsSee MEDIASESSIONFLAGS for details.
[in]pixelStorageClassDefines the storage class for all layers of the texture. See ImagePixelStorageClasses::
[in]layerSetOptional LayerSet or nullptr.
Returns
Return an instance to a MediaSessionRef for further reading if necessary.

◆ Load()

MAXON_METHOD Result<MediaSessionRef> Load ( const Url url,
const TimeValue targetTime,
MEDIASESSIONFLAGS  flags,
const Class< ImagePixelStorage > &  pixelStorageClass = GetZeroRef< Class< ImagePixelStorage >>(),
const LayerSetInterface layerSet = nullptr 
)

Loads a media into this texture.

Parameters
[in]urlUrl to the media to load.
[in]targetTimeTarget time to receive the media samples from.
[in]flagsSee MEDIASESSIONFLAGS for details.
[in]pixelStorageClassDefines the storage class for all layers of the texture. See ImagePixelStorageClasses::
[in]layerSetOptional LayerSet or nullptr.
Returns
Return an instance to a MediaSessionRef for further reading if necessary.

◆ Save() [1/2]

MAXON_METHOD Result<void> Save ( const MediaOutputRef &  fileFormat,
MEDIASESSIONFLAGS  flags,
MediaSessionRef *  returnOpenSession = nullptr 
) const

Saves this texture using the media session interface.

Parameters
[in]fileFormatA ready to use MediaOutputRef which will be used as output node of the media session.
[in]flagsSee MEDIASESSIONFLAGS for details.
[in]returnOpenSessionIf nullptr the session will be closed directly. If a pointer to a MediaSessionRef is given the session will stay open. Don't forget session.Close() in that case.
Returns
OK on success.

◆ Save() [2/2]

MAXON_FUNCTION Result<void> Save ( const Url fileName,
const MediaOutputUrlRef &  fileFormat,
MEDIASESSIONFLAGS  flags,
MediaSessionRef *  returnOpenSession = nullptr 
) const

Saves this texture using the media session interface. This function simplifies the use of registered ImageSaverClasses from their registry. The usage is simple:

imageTexture.Save(url, ImageSaverClasses::Bmp) iferr_return;
#define iferr_return
Definition: resultbase.h:1521
Parameters
[in]fileNameUrl to write to.
[in]fileFormatA MediaOutputUrlRef which will be used as output node of the media session. MediaOutputUrlRef::SetOutputUrl will be called in this function to set the url.
[in]flagsSee MEDIASESSIONFLAGS for details.
[in]returnOpenSessionIf nullptr the session will be closed directly. If a pointer to a MediaSessionRef is given the session will stay open. Don't forget session.Close() in that case.
Returns
OK on success.