6#define SF3_FORMAT_ID_IMAGE 0x03
90 return image->
format & 0x0F;
135 default:
return "Unknown";
SF3_INLINE int sf3_image_pixel_stride(const struct sf3_image *image)
Returns the number of bytes per pixel.
sf3_channel_layout
The possible pixel channel layouts.
@ SF3_PIXEL_VA
Each pixel consists of a (grayscale) value and an alpha channel.
@ SF3_PIXEL_V
Each pixel consists of a (grayscale) value channel.
@ SF3_PIXEL_AV
Each pixel consists of an alpha and a (grayscale) value channel.
@ SF3_PIXEL_KYMC
Each pixel consists of a black, yellow, magenta, and cyan channel.
@ SF3_PIXEL_CMYK
Each pixel consists of a cyan, magenta, yellow, and black channel.
SF3_INLINE int sf3_image_channel_count(const struct sf3_image *image)
Returns the number of channels per pixel.
SF3_EXPORT size_t sf3_image_size(const struct sf3_image *image)
Computes the size of the image file in bytes.
SF3_INLINE char * sf3_image_channel_layout(enum sf3_channel_layout format)
Returns a human-readable string representation of the layout.
sf3_pixel_format
The possible pixel channel formats.
@ SF3_PIXEL_UINT32
The channel values are stored in 32-bit unsigned format.
@ SF3_PIXEL_INT32
The channel values are stored in 32-bit signed format.
@ SF3_PIXEL_UINT64
The channel values are stored in 64-bit unsigned format.
@ SF3_PIXEL_UINT16
The channel values are stored in 16-bit unsigned format.
@ SF3_PIXEL_INT64
The channel values are stored in 64-bit signed format.
@ SF3_PIXEL_INT8
The channel values are stored in 8-bit signed format.
@ SF3_PIXEL_INT16
The channel values are stored in 16-bit signed format.
@ SF3_PIXEL_UINT8
The channel values are stored in 8-bit unsigned format.
SF3_EXPORT char * sf3_image_pixel_format(enum sf3_pixel_format format)
Returns a human-readable string representation of the format.
SF3_INLINE int sf3_image_channel_size(const struct sf3_image *image)
Returns the number of bytes per channel.
The basic header structure of every SF3 file.
uint32_t height
The height of the image.
uint32_t width
The width of the image.
uint8_t channels
The channel layout of the pixels.
uint8_t format
The value format of the channels.
uint32_t depth
The depth (number of layers) of the image.