Choco OS  V.0.16.9.0
Join to the chocolate world
oc_colormap.h
Go to the documentation of this file.
1 
28 #ifndef SYSTEM_CORE_INC_GUI_OC_COLORMAP_H_
29 #define SYSTEM_CORE_INC_GUI_OC_COLORMAP_H_
30 
31 #include <oc_color.h>
32 #include <oc_pixel.h>
33 #include <oc_stdtypes.h>
34 #include <oc_assert.h>
35 #include <oc_stdlib.h>
36 #include <oc_font.h>
37 
43 #define _________________________________________DEFINITIONS_SECTION________________________________________________________________________
44 
45 #define oC_ColorMap_MagicNumber 0xFEADBABA
46 
47 #undef _________________________________________DEFINITIONS_SECTION________________________________________________________________________
48 
49 
55 #define _________________________________________TYPES_SECTION______________________________________________________________________________
56 
57 typedef struct
58 {
59  union
60  {
61  const void * Map;
62  const uint8_t * ReadMap;
63  uint8_t * WriteMap;
64  void * GenericWriteMap;
65  };
66  oC_Pixel_ResolutionUInt_t Width;
67  oC_Pixel_ResolutionUInt_t Height;
68  oC_ColorFormat_t ColorFormat;
69  uint32_t MagicNumber;
70  uint32_t FormatSize;
72 
73 #undef _________________________________________TYPES_SECTION______________________________________________________________________________
74 
80 #define _________________________________________MACROS_SECTION_____________________________________________________________________________
81 
82 #define oC_ColorMap_Define( ColorMapName , COLORS_ARRAY , WIDTH , HEIGHT , COLOR_FORMAT ) \
83  oC_COMPILE_ASSERT( sizeof(COLORS_ARRAY) >= (WIDTH * HEIGHT * oC_Color_FormatSize(COLOR_FORMAT)) , #ColorMapName " array size is too small! (Required " #WIDTH "*" #HEIGHT ")");\
84  oC_ColorMap_t ColorMapName = { \
85  .Map = COLORS_ARRAY , \
86  .Width = WIDTH , \
87  .Height = HEIGHT , \
88  .ColorFormat = COLOR_FORMAT , \
89  .MagicNumber = oC_ColorMap_MagicNumber , \
90  }
91 
92 
93 #undef _________________________________________MACROS_SECTION_____________________________________________________________________________
94 
100 #define _________________________________________INTERFACE_PROTOTYPES_SECTION_______________________________________________________________
101 
102 extern oC_ColorMap_t * oC_ColorMap_New ( Allocator_t Allocator , AllocationFlags_t AllocationFlags , oC_Pixel_ResolutionUInt_t Width , oC_Pixel_ResolutionUInt_t Height , oC_ColorFormat_t ColorFormat );
103 extern bool oC_ColorMap_Delete ( oC_ColorMap_t * ColorMap , AllocationFlags_t AllocationFlags );
104 extern oC_Color_t oC_ColorMap_GetColor ( const oC_ColorMap_t * ColorMap , oC_Pixel_Position_t Position , oC_ColorFormat_t ColorFormat );
105 extern bool oC_ColorMap_SetColor ( oC_ColorMap_t * ColorMap , oC_Pixel_Position_t Position , oC_Color_t Color , oC_ColorFormat_t ColorFormat );
106 extern bool oC_ColorMap_DrawChar ( oC_ColorMap_t * ColorMap , oC_Pixel_Position_t Position , oC_Color_t Color , oC_ColorFormat_t ColorFormat , uint16_t C , oC_Font_t Font );
107 extern bool oC_ColorMap_IsCorrect ( const oC_ColorMap_t * ColorMap );
108 extern bool oC_ColorMap_IsPositionCorrect( const oC_ColorMap_t * ColorMap , oC_Pixel_Position_t Position );
109 
110 #undef _________________________________________INTERFACE_PROTOTYPES_SECTION_______________________________________________________________
111 
112 
113 #endif /* SYSTEM_CORE_INC_GUI_OC_COLORMAP_H_ */
identifier for allocations
Definition: oc_stdlib.h:159
The file with interface for the color library.
The file with interface for the GPIO driver.
The file with interface for the GPIO driver.
FILE__DESCRIPTION
static const oC_Allocator_t Allocator
Definition: oc_eth.c:152
FILE__DESCRIPTION