The IImage resource object interface. More...

#include "murl_resource_i_image.h"

Inheritance diagram for Murl::Resource::IImage:

Classes

struct  Iff
 IFF file specific structs. More...
 

Public Member Functions

virtual IObjectGetObjectInterface ()=0
 Get the mutable Resource::IObject interface. More...
 
virtual const IObjectGetObjectInterface () const =0
 Get the constant Resource::IObject interface. More...
 
virtual IEnums::TextureType GetTextureType () const =0
 Get the texture type represented by the image. More...
 
virtual UInt32 GetNumberOfStreams () const =0
 Get the number of individual image streams. More...
 
virtual UInt32 GetNumberOfLayers () const =0
 Get the number of image layers. More...
 
virtual UInt32 GetNumberOfFaces () const =0
 Get the number of image faces. More...
 
virtual SInt32 GetStreamIndex (UInt32 layerIndex, UInt32 faceIndex) const =0
 Get the stream index for a given layer and face index. More...
 
virtual UInt32 GetNumberOfMipLevels (UInt32 streamIndex) const =0
 Get the number of actual MIP levels stored in the image resource. More...
 
virtual UInt32 GetPixelSizeX (UInt32 streamIndex) const =0
 Get the image's horizontal size in pixels, at the base MIP level. More...
 
virtual UInt32 GetPixelSizeY (UInt32 streamIndex) const =0
 Get the image's vertical size in pixels, at the base MIP level. More...
 
virtual IEnums::PixelFormat GetNativePixelFormat (UInt32 streamIndex) const =0
 Get the image's native pixel format. More...
 
virtual IEnums::PixelFormat GetPreferredPixelFormat (UInt32 streamIndex) const =0
 Get the image's preferred pixel format. More...
 
virtual IEnums::PixelFormat GetForcedPixelFormat (UInt32 streamIndex) const =0
 Get the image's forced pixel format, when no conversion is available. More...
 
virtual IEnums::VideoStreamFormat GetVideoStreamFormat (UInt32 streamIndex) const =0
 Get the image's actual format. More...
 
virtual IVideoStreamCreateStream (UInt32 streamIndex, IEnums::MipMapGenerationMode mipMapGen) const =0
 Create an IVideoStream object from the resource, with default pixel format and size. More...
 
virtual IVideoStreamCreateStream (UInt32 streamIndex, IEnums::PixelFormat pixelFormat, UInt32 pixelSizeX, UInt32 pixelSizeY, UInt32 divisor, IEnums::MipMapGenerationMode mipMapGen) const =0
 Create an IVideoStream object from the resource, with custom pixel format and size. More...
 
virtual Bool CreateDefaultBinary (Data &data) const =0
 Create a default binary encoded image. More...
 
virtual Bool CreateBinary (Data &data, IEnums::VideoStreamFormat streamFormat, IEnums::PixelFormat pixelFormat, UInt32 sizeX, UInt32 sizeY) const =0
 Create a binary encoded image, explicit stream and pixel formats and size. More...
 

Detailed Description

The IImage resource object interface.

An image resource holds a (possibly compressed) bitmap image in one of the available image formats, such as PNG, JPG etc.

Member Function Documentation

◆ GetObjectInterface() [1/2]

virtual IObject* Murl::Resource::IImage::GetObjectInterface ( )
pure virtual

Get the mutable Resource::IObject interface.

Returns
The IObject interface.

◆ GetObjectInterface() [2/2]

virtual const IObject* Murl::Resource::IImage::GetObjectInterface ( ) const
pure virtual

Get the constant Resource::IObject interface.

Returns
The IObject interface.

◆ GetTextureType()

virtual IEnums::TextureType Murl::Resource::IImage::GetTextureType ( ) const
pure virtual

Get the texture type represented by the image.

Returns
The texture type.

◆ GetNumberOfStreams()

virtual UInt32 Murl::Resource::IImage::GetNumberOfStreams ( ) const
pure virtual

Get the number of individual image streams.

Returns
The number of streams.

◆ GetNumberOfLayers()

virtual UInt32 Murl::Resource::IImage::GetNumberOfLayers ( ) const
pure virtual

Get the number of image layers.

For non-array images, this always returns 1.

Returns
The number of layers.

◆ GetNumberOfFaces()

virtual UInt32 Murl::Resource::IImage::GetNumberOfFaces ( ) const
pure virtual

Get the number of image faces.

For flat images or arrays, this always returns 1. For cubemap images or arrays, this returns 6.

Returns
The number of faces.

◆ GetStreamIndex()

virtual SInt32 Murl::Resource::IImage::GetStreamIndex ( UInt32  layerIndex,
UInt32  faceIndex 
) const
pure virtual

Get the stream index for a given layer and face index.

Parameters
layerIndexThe layer index, from 0 to GetNumberOfLayers()-1.
faceIndexThe face index, from 0 to GetNumberOfFaces()-1.
Returns
The stream index from 0 to GetNumberOfStreams()-1, or -1 if any of the given parameters is out of range.

◆ GetNumberOfMipLevels()

virtual UInt32 Murl::Resource::IImage::GetNumberOfMipLevels ( UInt32  streamIndex) const
pure virtual

Get the number of actual MIP levels stored in the image resource.

Parameters
streamIndexThe index of the stream, from 0 to GetNumberOfStreams()-1.
Returns
The number of MIP levels.

◆ GetPixelSizeX()

virtual UInt32 Murl::Resource::IImage::GetPixelSizeX ( UInt32  streamIndex) const
pure virtual

Get the image's horizontal size in pixels, at the base MIP level.

Parameters
streamIndexThe index of the stream, from 0 to GetNumberOfStreams()-1.
Returns
The horizontal size.

◆ GetPixelSizeY()

virtual UInt32 Murl::Resource::IImage::GetPixelSizeY ( UInt32  streamIndex) const
pure virtual

Get the image's vertical size in pixels, at the base MIP level.

Parameters
streamIndexThe index of the stream, from 0 to GetNumberOfStreams()-1.
Returns
The vertical size.

◆ GetNativePixelFormat()

virtual IEnums::PixelFormat Murl::Resource::IImage::GetNativePixelFormat ( UInt32  streamIndex) const
pure virtual

Get the image's native pixel format.

Parameters
streamIndexThe index of the stream, from 0 to GetNumberOfStreams()-1.
Returns
The native pixel format.

◆ GetPreferredPixelFormat()

virtual IEnums::PixelFormat Murl::Resource::IImage::GetPreferredPixelFormat ( UInt32  streamIndex) const
pure virtual

Get the image's preferred pixel format.

If the given image has no actual preference for the format used, this method returns IEnums::PIXEL_FORMAT_UNDEFINED. Otherwise, a specific format is returned.

Parameters
streamIndexThe index of the stream, from 0 to GetNumberOfStreams()-1.
Returns
The preferred pixel format.

◆ GetForcedPixelFormat()

virtual IEnums::PixelFormat Murl::Resource::IImage::GetForcedPixelFormat ( UInt32  streamIndex) const
pure virtual

Get the image's forced pixel format, when no conversion is available.

If a pixel format converter is available that can convert the image's native format to some other format, this method should return IEnums::PIXEL_FORMAT_UNDEFINED. Otherwise, a specific format is returned. This is usually the case for images using some compressed format like ETC1, PVRTC or similar.

Parameters
streamIndexThe index of the stream, from 0 to GetNumberOfStreams()-1.
Returns
The forced pixel format.

◆ GetVideoStreamFormat()

virtual IEnums::VideoStreamFormat Murl::Resource::IImage::GetVideoStreamFormat ( UInt32  streamIndex) const
pure virtual

Get the image's actual format.

Parameters
streamIndexThe index of the stream, from 0 to GetNumberOfStreams()-1.
Returns
The stream format.

◆ CreateStream() [1/2]

virtual IVideoStream* Murl::Resource::IImage::CreateStream ( UInt32  streamIndex,
IEnums::MipMapGenerationMode  mipMapGen 
) const
pure virtual

Create an IVideoStream object from the resource, with default pixel format and size.

Parameters
streamIndexThe index of the stream, from 0 to GetNumberOfStreams()-1.
mipMapGenThe MIP map generation mode.
Returns
The newly created stream object, or null if failed.

◆ CreateStream() [2/2]

virtual IVideoStream* Murl::Resource::IImage::CreateStream ( UInt32  streamIndex,
IEnums::PixelFormat  pixelFormat,
UInt32  pixelSizeX,
UInt32  pixelSizeY,
UInt32  divisor,
IEnums::MipMapGenerationMode  mipMapGen 
) const
pure virtual

Create an IVideoStream object from the resource, with custom pixel format and size.

Parameters
streamIndexThe index of the stream, from 0 to GetNumberOfStreams()-1.
pixelFormatThe desired pixel format.
pixelSizeXThe horizontal size of the stream in pixels, at the base MIP level.
pixelSizeYThe vertical size of the stream in pixels, at the base MIP level.
divisorAn optional power-of-two prescale factor (use 1 for a 1:1 image).
mipMapGenThe MIP map generation mode.
Returns
The newly created stream object, or null if failed.

◆ CreateDefaultBinary()

virtual Bool Murl::Resource::IImage::CreateDefaultBinary ( Data data) const
pure virtual

Create a default binary encoded image.

Parameters
dataThe Data object to receive the encoded image.
Returns
true if successful.

◆ CreateBinary()

virtual Bool Murl::Resource::IImage::CreateBinary ( Data data,
IEnums::VideoStreamFormat  streamFormat,
IEnums::PixelFormat  pixelFormat,
UInt32  sizeX,
UInt32  sizeY 
) const
pure virtual

Create a binary encoded image, explicit stream and pixel formats and size.

Parameters
dataThe Data object to receive the encoded image.
streamFormatThe stream format to use.
pixelFormatThe pixel format to use.
sizeXThe width in pixels, or 0 to encode the image using its original width.
sizeYThe height in pixels, or 0 to encode the image using its original height.
Returns
true if successful.

The documentation for this interface was generated from the following file:
  • murl_resource_i_image.h


Copyright © 2011-2024 Spraylight GmbH.