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

#include <asset/YiImageAssetLoadParams.h>

Inheritance diagram for CYIImageAssetLoadParams:

Public Types

enum  LoadColorMode {

Public Member Functions

 CYIImageAssetLoadParams ()
virtual ~CYIImageAssetLoadParams ()
void SetScaling (int32_t width, int32_t height)
void SetScalingWidth (int32_t width)
void SetScalingHeight (int32_t height)
int32_t GetScalingWidth () const
int32_t GetScalingHeight () const
void SetTargetBitmap (CYIBitmap *pBitmap)
CYIBitmapGetTargetBitmap () const
bool IsNPatch () const
void SetNPatch (bool isNPatch)
void SetLoadColorMode (LoadColorMode loadColorMode)
LoadColorMode GetLoadColorMode () const
- Public Member Functions inherited from CYIAssetLoadParams
 CYIAssetLoadParams ()
virtual ~CYIAssetLoadParams ()

Static Public Member Functions

static LoadColorMode GetEffectiveColorMode (LoadColorMode loadColorMode, int32_t width, int32_t height)

Member Enumeration Documentation

◆ LoadColorMode

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


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


Uses color mode CYIBitmap::ColorMode::RGBA8888 with no dithering.


Uses color mode CYIBitmap::ColorMode::RGBA4444 with no dithering.


Uses color mode CYIBitmap::ColorMode::RGBA4444 with dithering CYIBitmap::DitheringMode::FloydSteinberg.


Uses color mode CYIBitmap::ColorMode::RGB565 with no dithering.


Uses color mode CYIBitmap::ColorMode::RGB565 with dithering CYIBitmap::DitheringMode::FloydSteinberg.

Constructor & Destructor Documentation

◆ CYIImageAssetLoadParams()

CYIImageAssetLoadParams::CYIImageAssetLoadParams ( )

◆ ~CYIImageAssetLoadParams()

virtual CYIImageAssetLoadParams::~CYIImageAssetLoadParams ( )

Member Function Documentation

◆ GetEffectiveColorMode()

static LoadColorMode CYIImageAssetLoadParams::GetEffectiveColorMode ( LoadColorMode  loadColorMode,
int32_t  width,
int32_t  height 

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

◆ GetLoadColorMode()

LoadColorMode CYIImageAssetLoadParams::GetLoadColorMode ( ) const

◆ GetScalingHeight()

int32_t CYIImageAssetLoadParams::GetScalingHeight ( ) const

◆ GetScalingWidth()

int32_t CYIImageAssetLoadParams::GetScalingWidth ( ) const

◆ GetTargetBitmap()

CYIBitmap* CYIImageAssetLoadParams::GetTargetBitmap ( ) const

◆ IsNPatch()

bool CYIImageAssetLoadParams::IsNPatch ( ) const

Returns true if the asset being loaded is a NPatch image.

◆ SetLoadColorMode()

void CYIImageAssetLoadParams::SetLoadColorMode ( LoadColorMode  loadColorMode)

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

◆ SetNPatch()

void CYIImageAssetLoadParams::SetNPatch ( bool  isNPatch)

Set if the asset being loaded is a NPatch image.

◆ SetScaling()

void CYIImageAssetLoadParams::SetScaling ( int32_t  width,
int32_t  height 

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

◆ SetScalingHeight()

void CYIImageAssetLoadParams::SetScalingHeight ( int32_t  height)

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

◆ SetScalingWidth()

void CYIImageAssetLoadParams::SetScalingWidth ( int32_t  width)

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

◆ SetTargetBitmap()

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.

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

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