1 /* Character Code Encoding: "WHITE SQUARE" is
\81 */
\r
3 extern "C" { /* Start of C Symbol */
\r
9 * @typedef ARGB8888Type
\r
10 * @brief ARGB8888
\83s
\83N
\83Z
\83\8b \83t
\83H
\81[
\83}
\83b
\83g
\r
12 * @par
\83\81\83\93\83o
\81[
\95Ï
\90\94\r
13 * - Value - Blue + Green + Red + Alpha
\r
20 #define ARGB8888Type ARGB8888Type
\r
21 typedef union _ARGB8888Type ARGB8888Type;
\r
22 union _ARGB8888Type {
\r
23 uint32_t Value; /* CPU Endian. Not frame buffer endian */
\r
25 #if BYTE_ENDIAN == BYTE_LITTLE_ENDIAN
\r
26 uint8_t Blue; /* Blue is Value & 0x000000FF */
\r
34 uint8_t Blue; /* Blue is Value & 0x000000FF */
\r
42 * @typedef XRGB8888Type
\r
43 * @brief XRGB8888
\83s
\83N
\83Z
\83\8b \83t
\83H
\81[
\83}
\83b
\83g
\r
45 * @par
\83\81\83\93\83o
\81[
\95Ï
\90\94\r
46 * - Value - Blue + Green + Red + Alpha
\r
53 #define XRGB8888Type XRGB8888Type
\r
54 typedef union _XRGB8888Type XRGB8888Type;
\r
55 union _XRGB8888Type {
\r
56 uint32_t Value; /* CPU Endian[X8|R8|G8|B8]. Not frame buffer endian */
\r
58 #if BYTE_ENDIAN == BYTE_LITTLE_ENDIAN
\r
59 uint8_t Blue; /* offsetof == 0, Blue is Value & 0x000000FF */
\r
60 uint8_t Green; /* offsetof == 1 */
\r
61 uint8_t Red; /* offsetof == 2 */
\r
62 uint8_t X; /* offsetof == 3, zero */
\r
63 #elif BYTE_ENDIAN == BYTE_BIG_ENDIAN
\r
64 uint8_t X; /* offsetof == 0, zero */
\r
65 uint8_t Red; /* offsetof == 1 */
\r
66 uint8_t Green; /* offsetof == 2 */
\r
67 uint8_t Blue; /* offsetof == 3, Blue is Value & 0x000000FF */
\r
76 /***********************************************************************
\r
77 <<< [ARGB8888Type_to_XRGB8888Type] >>>
\r
78 ************************************************************************/
\r
79 inline XRGB8888Type ARGB8888Type_to_XRGB8888Type( ARGB8888Type color )
\r
83 ret.Value = color.Value;
\r
91 * @typedef BmpFile2Class
\r
92 * @brief
\83r
\83b
\83g
\83}
\83b
\83v
\83t
\83@
\83C
\83\8b\r
95 typedef struct _BmpFile2Class BmpFile2Class;
\r
96 struct _BmpFile2Class {
\r
97 BITMAPINFOHEADER Info;
\r
99 // start of enabled if Info.biCompression == BI_BITFIELDS
\r
100 uint32_t RedMask; // These must be just after Info member variable
\r
101 uint32_t GreenMask;
\r
103 uint32_t AlphaMask;
\r
108 unsigned Alignment_bfOffBits;
\r
111 int_fast32_t PaletteColorCount;
\r
114 typedef struct _RGB888Type RGB888Type;
\r
115 struct _RGB888Type {
\r
121 void BmpFile2Class_initConst( BmpFile2Class* self );
\r
122 errnum_t BmpFile2Class_init( BmpFile2Class* self );
\r
123 errnum_t BmpFile2Class_loadBMP( BmpFile2Class* self, const TCHAR* Path );
\r
124 errnum_t BmpFile2Class_saveBMP( BmpFile2Class* self, const TCHAR* Path );
\r
125 errnum_t BmpFile2Class_finish( BmpFile2Class* self, int e );
\r
128 /*[BmpFile2Class_initConst]*/
\r
129 inline void BmpFile2Class_initConst( BmpFile2Class* self )
\r
131 self->Pixels = NULL;
\r
132 self->Palette = NULL;
\r
135 /*[BmpFile2Class_init]*/
\r
136 inline errnum_t BmpFile2Class_init( BmpFile2Class* self )
\r
138 self->Pixels = NULL;
\r
139 self->Alignment_bfOffBits = 1;
\r
140 self->Palette = NULL;
\r
146 errnum_t BmpFile2Class_loadRawRGB565( BmpFile2Class* self, TCHAR* Path, int Stride );
\r
147 errnum_t BmpFile2Class_loadRawARGB8888( BmpFile2Class* self, TCHAR* Path, int Stride );
\r
148 errnum_t BmpFile2Class_loadRawARGB1555( BmpFile2Class* self, TCHAR* Path, int Stride );
\r
149 errnum_t BmpFile2Class_loadRawARGB4444( BmpFile2Class* self, TCHAR* Path, int Stride );
\r
152 errnum_t BmpFile2Class_loadPNG( BmpFile2Class* self, const TCHAR* Path );
\r
154 errnum_t BmpFile2Class_loadJPEG( BmpFile2Class* self, const TCHAR* Path );
\r
156 errnum_t BmpFile2Class_addAlphaChannel( BmpFile2Class* self, uint8_t AlphaValue );
\r
158 inline errnum_t BmpFile2Class_setAlignmentBMP_bfOffBits( BmpFile2Class* self, int AlignSize )
\r
159 { self->Alignment_bfOffBits = AlignSize; return 0; }
\r
161 errnum_t BmpFile2Class_convertToRGB565Format( BmpFile2Class* self );
\r
163 errnum_t BmpFile2Class_convertToARGB1555Format( BmpFile2Class* self );
\r
165 errnum_t BmpFile2Class_convertToARGB4444Format( BmpFile2Class* self );
\r
167 errnum_t BmpFile2Class_convertToA4Format( BmpFile2Class* self );
\r
169 errnum_t BmpFile2Class_convertToA1Format( BmpFile2Class* self );
\r
171 errnum_t BmpFile2Class_trimming( BmpFile2Class* self, int LeftX, int TopY, int Width, int Height );
\r
174 } /* End of C Symbol */
\r