Muteki
EABI code execution on Besta® RTOS devices.
Loading...
Searching...
No Matches
surface.h File Reference

Surface type definitions. More...

#include "../../common.h"

Go to the source code of this file.

Data Structures

struct  lcd_surface_s
 Descriptor of an LCD drawing surface or hardware framebuffer. More...

Typedefs

typedef struct lcd_surface_s lcd_surface_t
 Descriptor of an LCD drawing surface or hardware framebuffer.

Enumerations

enum  lcd_surface_blit_flag_e {
  LCD_SURFACE_BLIT_NONE = 0 , LCD_SURFACE_BLIT_AND = 0x2 , LCD_SURFACE_BLIT_OR = 0x3 , LCD_SURFACE_BLIT_XOR = 0x4 ,
  LCD_SURFACE_BLIT_TRANSPARENT = 0xe , LCD_SURFACE_BLIT_ALPHA_BLENDING = 0xf , LCD_SURFACE_BLIT_ALPHA_BLENDING_FAST = 0x10
}
 Process flags for blit operations. More...
enum  lcd_surface_pixfmt_e {
  LCD_SURFACE_PIXFMT_L1 = 1 , LCD_SURFACE_PIXFMT_L4 = 4 , LCD_SURFACE_PIXFMT_L8 = 8 , LCD_SURFACE_PIXFMT_RGB444 = 12 ,
  LCD_SURFACE_PIXFMT_RGB565 = 16 , LCD_SURFACE_PIXFMT_RGB = 24 , LCD_SURFACE_PIXFMT_XRGB = 32 , LCD_SURFACE_PIXFMT_ARGB = 32
}
 Valid pixel formats for LCD surfaces. More...
enum  lcd_surface_encoding_e { LCD_SURFACE_ENCODING_HCA = 1 , LCD_SURFACE_ENCODING_RAW = 2 }
 Valid pixel buffer encoding for LCD surfaces. More...

Detailed Description

Surface type definitions.

Typedef Documentation

◆ lcd_surface_t

typedef struct lcd_surface_s lcd_surface_t

Descriptor of an LCD drawing surface or hardware framebuffer.

This contains format description of the pixel/framebuffer and a pointer to the actual buffer.

Enumeration Type Documentation

◆ lcd_surface_blit_flag_e

Process flags for blit operations.

Warning
These are stand-alone and not stackable with bitwise-OR operations ('|').
Todo
Need to look into this further. 2 and 16 seem to draw the image verbatim like 0. Nothing is being drawn when setting any other flags. (Could it be related to some other properties on the surface descriptor such as transparent color?)
Enumerator
LCD_SURFACE_BLIT_NONE 

Nothing.

This just copies the pixels as-is.

LCD_SURFACE_BLIT_AND 

Perform AND operation between source line and destination line.

This effectively does a bit-wise color masking of the destination surface.

LCD_SURFACE_BLIT_OR 

Perform OR operation between source line and destination line.

This effectively does a bit-wise painting onto the destination surface. Colors will also be mixed in a bit-wise fashion.

LCD_SURFACE_BLIT_XOR 

Perform XOR operation between source line and destination line.

This effectively does a bit-wise color inversion of the destination surface.

LCD_SURFACE_BLIT_TRANSPARENT 

Honor transparent color settings on the current LCD canvas.

This copies the pixels when it's not exactly the same as the transparent color of the current LCD canvas.

LCD_SURFACE_BLIT_ALPHA_BLENDING 

Perform alpha blending (when supported).

This is done without gamma correction.

LCD_SURFACE_BLIT_ALPHA_BLENDING_FAST 

Perform alpha blending (when supported).

This is similar to #BLIT_ALPHA_BLENDING but instead of using alpha values per-pixel, it uses only the alpha value of the first pixel for the entire surface. This makes the process slightly faster if the entire image has the same alpha values for every pixel.

◆ lcd_surface_encoding_e

Valid pixel buffer encoding for LCD surfaces.

Enumerator
LCD_SURFACE_ENCODING_HCA 

Pixel buffer is contained in HCA container.

LCD_SURFACE_ENCODING_RAW 

Pixel buffer is in raw format.

◆ lcd_surface_pixfmt_e

Valid pixel formats for LCD surfaces.

All color values are assumed to be little endian.

Enumerator
LCD_SURFACE_PIXFMT_L1 

1-bit index color.

LCD_SURFACE_PIXFMT_L4 

4-bit index color.

LCD_SURFACE_PIXFMT_L8 

8-bit index color.

LCD_SURFACE_PIXFMT_RGB444 

12-bit RGB444.

LCD_SURFACE_PIXFMT_RGB565 

16-bit RGB565.

LCD_SURFACE_PIXFMT_RGB 

24-bit RGB.

LCD_SURFACE_PIXFMT_XRGB 

32-bit XRGB.

LCD_SURFACE_PIXFMT_ARGB 

32-bit ARGB (alias of LCD_SURFACE_PIXFMT_XRGB).