You.i Engine
CYIImageAssetLoadParams Class Reference

Detailed Description

Asset loading parameters which are specific to image asset decoding.

This is a container class for parameters which are specific to image asset decoding done by CYIAssetDecoderImage. The class contains scaling properties required for decoding an image asset into a CYIBitmap. CYIAssetDecoderImage only supports this type of CYIAssetLoadParams.

See also
CYIAssetDecoderImage::SupportsParams

#include <asset/YiImageAssetLoadParams.h>

Inheritance diagram for CYIImageAssetLoadParams:

Public Types

enum  LOAD_COLOR_MODE {
  LOAD_COLOR_MODE_DEFAULT,
  LOAD_COLOR_MODE_RGBA8888,
  LOAD_COLOR_MODE_RGBA4444,
  LOAD_COLOR_MODE_RGBA4444_FS_DITHERED,
  LOAD_COLOR_MODE_RGB565,
  LOAD_COLOR_MODE_RGB565_FS_DITHERED
}
 

Public Member Functions

 CYIImageAssetLoadParams ()
 
virtual ~CYIImageAssetLoadParams ()
 
void SetScaling (int32_t nWidth, int32_t nHeight)
 
void SetScalingWidth (int32_t nWidth)
 
void SetScalingHeight (int32_t nHeight)
 
int32_t GetScalingWidth () const
 
int32_t GetScalingHeight () const
 
void SetTargetBitmap (CYIBitmap *pBitmap)
 
CYIBitmapGetTargetBitmap () const
 
void SetLoadColorMode (LOAD_COLOR_MODE eLoadColorMode)
 
LOAD_COLOR_MODE GetLoadColorMode () const
 
- Public Member Functions inherited from CYIAssetLoadParams
 CYIAssetLoadParams ()
 
virtual ~CYIAssetLoadParams ()
 

Static Public Member Functions

static LOAD_COLOR_MODE GetEffectiveColorMode (LOAD_COLOR_MODE eLoadColorMode, int32_t nWidth, int32_t nHeight)
 

Member Enumeration Documentation

The color mode (and dithering mode) with which to load the image.

Enumerator
LOAD_COLOR_MODE_DEFAULT 

Uses the default load color mode for the current build configuration. This is usually CYIBitmap::COLOR_MODE_RGBA8888.

LOAD_COLOR_MODE_RGBA8888 

Uses color mode CYIBitmap::COLOR_MODE_RGBA8888 with no dithering.

LOAD_COLOR_MODE_RGBA4444 

Uses color mode CYIBitmap::COLOR_MODE_RGBA4444 with no dithering.

LOAD_COLOR_MODE_RGBA4444_FS_DITHERED 

Uses color mode CYIBitmap::COLOR_MODE_RGBA4444 with dithering CYIBitmap::DITHERING_FLOYD_STEINBERG.

LOAD_COLOR_MODE_RGB565 

Uses color mode CYIBitmap::COLOR_MODE_RGB565 with no dithering.

LOAD_COLOR_MODE_RGB565_FS_DITHERED 

Uses color mode CYIBitmap::COLOR_MODE_RGB565 with dithering CYIBitmap::DITHERING_FLOYD_STEINBERG.

Constructor & Destructor Documentation

CYIImageAssetLoadParams::CYIImageAssetLoadParams ( )
virtual CYIImageAssetLoadParams::~CYIImageAssetLoadParams ( )
virtual

Member Function Documentation

static LOAD_COLOR_MODE CYIImageAssetLoadParams::GetEffectiveColorMode ( LOAD_COLOR_MODE  eLoadColorMode,
int32_t  nWidth,
int32_t  nHeight 
)
static

Determines and returns a color mode to load with, given a color mode value and a bitmap width and height. If eLoadColorMode is not LOAD_COLOR_MODE_DEFAULT, the provided color mode is returned directly. If eLoadColorMode is LOAD_COLOR_MODE_DEFAULT, the returned color mode depends on the build settings, on the current platform and one the bitmap width and height.

LOAD_COLOR_MODE CYIImageAssetLoadParams::GetLoadColorMode ( ) const
int32_t CYIImageAssetLoadParams::GetScalingHeight ( ) const
int32_t CYIImageAssetLoadParams::GetScalingWidth ( ) const
CYIBitmap* CYIImageAssetLoadParams::GetTargetBitmap ( ) const
void CYIImageAssetLoadParams::SetLoadColorMode ( LOAD_COLOR_MODE  eLoadColorMode)

Sets the color mode used when loading the asset. The resulting bitmap will have this color mode.

void CYIImageAssetLoadParams::SetScaling ( int32_t  nWidth,
int32_t  nHeight 
)

Sets the width and height of the image, in pixels. If -1 is provided for the width or height, no scaling is performed.

void CYIImageAssetLoadParams::SetScalingHeight ( int32_t  nHeight)

Sets the scaling height of the image, in pixels. If -1 is provided, no scaling is performed.

void CYIImageAssetLoadParams::SetScalingWidth ( int32_t  nWidth)

Sets the scaling width of the image, in pixels. If -1 is provided, no scaling is performed.

void CYIImageAssetLoadParams::SetTargetBitmap ( CYIBitmap pBitmap)

Sets the target bitmap into which the asset will be loaded. If null, the asset will be loaded into a new bitmap object.

Note
This class does not take ownership of the provided bitmap object.

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