KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
Accessors

Macros for accessing kos_image_t::fmt More...

Macros

#define KOS_IMG_FMT_I(x)   ((x) & 0xffff)
 Read the platform-independent half of the format.
 
#define KOS_IMG_FMT_D(x)   (((x) >> 16) & 0xffff)
 Read the platform-specific half of the format.
 
#define KOS_IMG_FMT(i, d)   ( ((i) & 0xffff) | (((d) & 0xffff) << 16) )
 Build a format value from a platform-independent half and a platform-specific half of the value.
 

Detailed Description

Macros for accessing kos_image_t::fmt

These macros provide easy access to the fmt field of a kos_img_t object.

Macro Definition Documentation

◆ KOS_IMG_FMT

#define KOS_IMG_FMT ( i,
d )   ( ((i) & 0xffff) | (((d) & 0xffff) << 16) )

Build a format value from a platform-independent half and a platform-specific half of the value.

This macro combines the platform-independent and platform-specific portions of an image format into a value suitable for storing as the fmt field of a kos_img_t object.

Parameters
iThe platform-independent half of the format.
dThe platform-specific half of the format. This should not be pre-shifted.
Returns
A complete image format value, suitable for placing in the fmt variable of a kos_img_t.

◆ KOS_IMG_FMT_D

#define KOS_IMG_FMT_D ( x)    (((x) >> 16) & 0xffff)

Read the platform-specific half of the format.

This macro masks the format of a kos_img_t to give you just the upper half of the value, which contains the platform-specific half of the format.

Parameters
xAn image format (fmt field of a kos_img_t).
Returns
The platform-specific half of the format.

◆ KOS_IMG_FMT_I

#define KOS_IMG_FMT_I ( x)    ((x) & 0xffff)

Read the platform-independent half of the format.

This macro masks the format of a kos_img_t to give you just the lower half of the value, which contains the platform-independent half of the format.

Parameters
xAn image format (fmt field of a kos_img_t).
Returns
The platform-independent half of the format.