libsf3
Loading...
Searching...
No Matches
Data Structures | Macros | Enumerations | Functions
sf3_image.h File Reference
#include "sf3_core.h"
Include dependency graph for sf3_image.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  sf3_image
 

Macros

#define SF3_FORMAT_ID_IMAGE   0x03
 The format_id for an image file.
 

Enumerations

enum  sf3_pixel_format {
  SF3_PIXEL_INT8 = 0x01 , SF3_PIXEL_INT16 = 0x02 , SF3_PIXEL_INT32 = 0x04 , SF3_PIXEL_INT64 = 0x08 ,
  SF3_PIXEL_UINT8 = 0x11 , SF3_PIXEL_UINT16 = 0x12 , SF3_PIXEL_UINT32 = 0x14 , SF3_PIXEL_UINT64 = 0x18 ,
  SF3_PIXEL_FLOAT16 = 0x22 , SF3_PIXEL_FLOAT32 = 0x24 , SF3_PIXEL_FLOAT64 = 0x28
}
 The possible pixel channel formats. More...
 
enum  sf3_channel_layout {
  SF3_PIXEL_V = 0x01 , SF3_PIXEL_VA = 0x02 , SF3_PIXEL_RGB = 0x03 , SF3_PIXEL_RGBA = 0x04 ,
  SF3_PIXEL_AV = 0x12 , SF3_PIXEL_BGR = 0x13 , SF3_PIXEL_ABGR = 0x14 , SF3_PIXEL_ARGB = 0x24 ,
  SF3_PIXEL_BGRA = 0x34 , SF3_PIXEL_CMYK = 0x44 , SF3_PIXEL_KYMC = 0x54
}
 The possible pixel channel layouts. More...
 

Functions

SF3_INLINE int sf3_image_channel_size (const struct sf3_image *image)
 Returns the number of bytes per channel.
 
SF3_INLINE int sf3_image_channel_count (const struct sf3_image *image)
 Returns the number of channels per pixel.
 
SF3_INLINE int sf3_image_pixel_stride (const struct sf3_image *image)
 Returns the number of bytes per pixel.
 
SF3_EXPORT char * sf3_image_pixel_format (enum sf3_pixel_format format)
 Returns a human-readable string representation of the format.
 
SF3_INLINE char * sf3_image_channel_layout (enum sf3_channel_layout format)
 Returns a human-readable string representation of the layout.
 
SF3_EXPORT size_t sf3_image_size (const struct sf3_image *image)
 Computes the size of the image file in bytes.
 

Macro Definition Documentation

◆ SF3_FORMAT_ID_IMAGE

#define SF3_FORMAT_ID_IMAGE   0x03

The format_id for an image file.

Definition at line 6 of file sf3_image.h.

Enumeration Type Documentation

◆ sf3_channel_layout

The possible pixel channel layouts.

Enumerator
SF3_PIXEL_V 

Each pixel consists of a (grayscale) value channel.

SF3_PIXEL_VA 

Each pixel consists of a (grayscale) value and an alpha channel.

SF3_PIXEL_RGB 

Each pixel consists of a (truecolor) red, green, and blue channel.

SF3_PIXEL_RGBA 

Each pixel consists of a (truecolor) red, green, blue, and alpha channel.

SF3_PIXEL_AV 

Each pixel consists of an alpha and a (grayscale) value channel.

SF3_PIXEL_BGR 

Each pixel consists of a (truecolor) blue, green, and red channel.

SF3_PIXEL_ABGR 

Each pixel consists of an alpha and a (truecolor) blue, green, and red channel.

SF3_PIXEL_ARGB 

Each pixel consists of an alpha and a (truecolor) red, green, and blue channel.

SF3_PIXEL_BGRA 

Each pixel consists of a (truecolor) blue, green, red, and alpha channel.

SF3_PIXEL_CMYK 

Each pixel consists of a cyan, magenta, yellow, and black channel.

SF3_PIXEL_KYMC 

Each pixel consists of a black, yellow, magenta, and cyan channel.

Definition at line 38 of file sf3_image.h.

◆ sf3_pixel_format

The possible pixel channel formats.

Enumerator
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_INT32 

The channel values are stored in 32-bit signed format.

SF3_PIXEL_INT64 

The channel values are stored in 64-bit signed format.

SF3_PIXEL_UINT8 

The channel values are stored in 8-bit unsigned format.

SF3_PIXEL_UINT16 

The channel values are stored in 16-bit unsigned format.

SF3_PIXEL_UINT32 

The channel values are stored in 32-bit unsigned format.

SF3_PIXEL_UINT64 

The channel values are stored in 64-bit unsigned format.

SF3_PIXEL_FLOAT16 

The channel values are stored in 16-bit IEEE half-precision float format.

SF3_PIXEL_FLOAT32 

The channel values are stored in 32-bit IEEE single-precision float format.

SF3_PIXEL_FLOAT64 

The channel values are stored in 64-bit IEEE double-precision float format.

Definition at line 9 of file sf3_image.h.

Function Documentation

◆ sf3_image_channel_count()

SF3_INLINE int sf3_image_channel_count ( const struct sf3_image image)

Returns the number of channels per pixel.

Definition at line 94 of file sf3_image.h.

◆ sf3_image_channel_layout()

SF3_INLINE char * sf3_image_channel_layout ( enum sf3_channel_layout  format)

Returns a human-readable string representation of the layout.

Definition at line 122 of file sf3_image.h.

◆ sf3_image_channel_size()

SF3_INLINE int sf3_image_channel_size ( const struct sf3_image image)

Returns the number of bytes per channel.

Definition at line 89 of file sf3_image.h.

◆ sf3_image_pixel_format()

SF3_EXPORT char * sf3_image_pixel_format ( enum sf3_pixel_format  format)

Returns a human-readable string representation of the format.

Definition at line 104 of file sf3_image.h.

◆ sf3_image_pixel_stride()

SF3_INLINE int sf3_image_pixel_stride ( const struct sf3_image image)

Returns the number of bytes per pixel.

Definition at line 99 of file sf3_image.h.

◆ sf3_image_size()

SF3_EXPORT size_t sf3_image_size ( const struct sf3_image image)

Computes the size of the image file in bytes.

Definition at line 140 of file sf3_image.h.