ConvertTextureResourceToNativeFormat

nn::gd::CTR::Resource::Helper::ConvertTextureResourceToNativeFormat Member Function

Syntax

static nnResult ConvertTextureResourceToNativeFormat(
     Format format,
     u32 width,
     u32 height,
     const u8 * dataSrc,
     u8 * dataDst,
     NativeFormat * pnativeFormat = NULL
);

Parameters

Name Description
in format Specifies the pixel format of dataSrc. The formats that can be specified are mentioned elsewhere in this section.
in width Specifies the data width.
in height Specifies the data height.
in dataSrc Specifies the address of the source data for the conversion.
in dataDst Specifies the destination address for the converted data.
in pnativeFormat Specifies the address that will store the native format value received after conversion. This will not be used if NULL is specified.

Return Values

Returns the result of the operation.
Value Description
Result::IsSuccess Process was successful.
ResultNullParameter NULL was specified for either dataSrc or dataDst.
ResultInvalidTextureResolution Either 0 was specified for width or height, or the size is not a multiple of 8. This result will also be returned if format is invalid.
ResultOutOfMemory Could not obtain memory.
ResultInvalidTextureFormat Invalid pixel format.

Description

Converts the texture data into a native format.

You can specify the following pixel formats in format.

Resource::FORMAT_RGBA_8888
Resource::FORMAT_RGB_888
Resource::FORMAT_RGBA_5551
Resource::FORMAT_RGB_565
Resource::FORMAT_RGBA_4444
Resource::FORMAT_LUMINANCE_ALPHA_88
Resource::FORMAT_HILO_88
Resource::FORMAT_LUMINANCE_8
Resource::FORMAT_ALPHA_8
Resource::FORMAT_LUMINANCE_ALPHA_44
Resource::FORMAT_LUMINANCE_4
Resource::FORMAT_ALPHA_4

Revision History

2011/02/17
Initial version.

CONFIDENTIAL