Frame Modes

Frame Modes — Graphics memory layouts

Functions

Types and Values

Includes

#include <grx-3.0.h>

Description

Frame modes describe how graphics are stored in memory.

Functions

grx_frame_mode_get_current ()

GrxFrameMode
grx_frame_mode_get_current (void);

Get the frame mode of the current context.

Returns

the frame mode.


grx_frame_mode_get_screen ()

GrxFrameMode
grx_frame_mode_get_screen (void);

Get the frame mode of the screen.

Returns

the frame mode.


grx_frame_mode_get_screen_core ()

GrxFrameMode
grx_frame_mode_get_screen_core (void);

Get the compatible RAM frame mode of the screen.

Returns

the frame mode.


grx_frame_mode_get_bpp ()

gint
grx_frame_mode_get_bpp (GrxFrameMode mode);

Gets the color depth of the frame mode in bits per pixel.

Parameters

mode

a GrxFrameMode

 

Returns

the color depth or -1 if the frame mode was not valid


grx_frame_mode_get_n_planes ()

gint
grx_frame_mode_get_n_planes (GrxFrameMode mode);

Gets the number of planes for a frame mode.

Parameters

mode

a GrxFrameMode

 

Returns

The number of planes.


grx_frame_mode_get_line_offset ()

gint
grx_frame_mode_get_line_offset (GrxFrameMode mode,
                                gint width);

Gets the offset in bytes for a row of width pixels.

Parameters

mode

a GrxFrameMode

 

width

the width in pixels

 

Returns

the number of bytes per row.


grx_frame_mode_get_plane_size ()

gint
grx_frame_mode_get_plane_size (GrxFrameMode mode,
                               gint width,
                               gint height);

Gets the plane size in bytes required to store an image of width x height for this frame mode.

Parameters

mode

a GrxFrameMode

 

width

the width in pixels

 

height

the height in pixels

 

Returns

the size in bytes.


grx_frame_mode_get_context_size ()

gint
grx_frame_mode_get_context_size (GrxFrameMode mode,
                                 gint width,
                                 gint height);

Gets the total size in bytes required to store an image of width x height for this frame mode.

Parameters

mode

a GrxFrameMode

 

width

the width in pixels

 

height

the height in pixels

 

Returns

the size in bytes.


grx_screen_get_n_planes ()

gint
grx_screen_get_n_planes (void);

Gets the number of planes for the screen's RAM frame mode.

Returns

The number of planes.


grx_screen_get_line_offset ()

gint
grx_screen_get_line_offset (gint width);

Gets the offset in bytes for a row of width pixels on the screen.

Parameters

width

the width in pixels

 

Returns

the number of bytes per row.


grx_screen_get_plane_size ()

gint
grx_screen_get_plane_size (gint width,
                           gint height);

Gets the plane size in bytes required to store an image of width x height for the screen.

Parameters

width

the width in pixels

 

height

the height in pixels

 

Returns

the size in bytes.


grx_screen_get_context_size ()

gint
grx_screen_get_context_size (gint width,
                             gint height);

Gets the total size in bytes required to store an image of width x height for the screen.

Parameters

width

the width in pixels

 

height

the height in pixels

 

Returns

the size in bytes.

Types and Values

enum GrxFrameMode

Available frame modes (video memory layouts)

Members

GRX_FRAME_MODE_UNDEFINED

Undefined

 

GRX_FRAME_MODE_TEXT

Text mode

 

GRX_FRAME_MODE_LFB_MONO01

Linear frame buffer, 1bpp, 0 = white, 1 = black

 

GRX_FRAME_MODE_LFB_MONO10

Linear frame buffer, 1bpp, 0 = black, 1 = white

 

GRX_FRAME_MODE_LFB_2BPP

Linear frame buffer, 2bpp, 4 color

 

GRX_FRAME_MODE_LFB_8BPP

Linear frame buffer, 8bpp, 256 color

 

GRX_FRAME_MODE_LFB_16BPP

Linear frame buffer, 16bpp, 32768/65536 color

 

GRX_FRAME_MODE_LFB_24BPP

Linear frame buffer, 24bpp, 16M color

 

GRX_FRAME_MODE_LFB_32BPP_LOW

Linear frame buffer, 32bpp, 16M color using lower 24 bits

 

GRX_FRAME_MODE_LFB_32BPP_HIGH

Linear frame buffer, 32bpp, 16M color using upper 24 bits

 

GRX_FRAME_MODE_RAM_1BPP

RAM frame buffer, 1bpp, monochome

 

GRX_FRAME_MODE_RAM_2BPP

RAM frame buffer, 2bpp, 4 color

 

GRX_FRAME_MODE_RAM_4X1BPP

RAM frame buffer, 4bpp, 16 color planar

 

GRX_FRAME_MODE_RAM_8BPP

RAM frame buffer, 8bpp, 256 color

 

GRX_FRAME_MODE_RAM_16BPP

RAM frame buffer, 16bpp, 32768/65536 color

 

GRX_FRAME_MODE_RAM_24BPP

RAM frame buffer, 24bpp, 16M color

 

GRX_FRAME_MODE_RAM_32BPP_LOW

RAM frame buffer, 32bpp, 16M color using lower 24 bits

 

GRX_FRAME_MODE_RAM_32BPP_HIGH

RAM frame buffer, 32bpp, 16M color using upper 24 bits

 

GRX_FRAME_MODE_RAM_3X8BPP

RAM frame buffer, 3x8bpp, 16M color in 3 planes

 

GRX_FRAME_MODE_FIRST_TEXT

The first text mode

 

GRX_FRAME_MODE_LAST_TEXT

The last text mode

 

GRX_FRAME_MODE_FIRST_GRAPHICS

The first graphics mode

 

GRX_FRAME_MODE_LAST_GRAPHICS

The last graphics mode

 

GRX_FRAME_MODE_FIRST_RAM

The first RAM mode

 

GRX_FRAME_MODE_LAST_RAM

The last RAM mode