eGUI alias D4D  Release 3.0
Reference Manual
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
d4d_imgdec_d4dint.h
Go to the documentation of this file.
1 /**************************************************************************
2 *
3 * Copyright 2014 by Petr Gargulak. eGUI Community.
4 * Copyright 2009-2013 by Petr Gargulak. Freescale Semiconductor, Inc.
5 *
6 ***************************************************************************
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License Version 3
9 * or later (the "LGPL").
10 *
11 * As a special exception, the copyright holders of the eGUI project give you
12 * permission to link the eGUI sources with independent modules to produce an
13 * executable, regardless of the license terms of these independent modules,
14 * and to copy and distribute the resulting executable under terms of your
15 * choice, provided that you also meet, for each linked independent module,
16 * the terms and conditions of the license of that module.
17 * An independent module is a module which is not derived from or based
18 * on this library.
19 * If you modify the eGUI sources, you may extend this exception
20 * to your version of the eGUI sources, but you are not obligated
21 * to do so. If you do not wish to do so, delete this
22 * exception statement from your version.
23 *
24 * This program is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
27 *
28 * You should have received a copy of the GNU General Public License
29 * and the GNU Lesser General Public License along with this program.
30 * If not, see <http://www.gnu.org/licenses/>.
31 *
32 ***************************************************************************/
46 #ifndef __D4D_IMGDEC_D4DINT_H
47 #define __D4D_IMGDEC_D4DINT_H
48 
49 
50 
51 
52 #define GET_DATA_BYTE(pBmp_dec, inc) ((GET_DATA_BYTE_FUNC)pBmp_dec->GetDataFunc)(pBmp_dec, inc)
53 #define GET_DATA_WORD(pBmp_dec, inc) ((GET_DATA_WORD_FUNC)pBmp_dec->GetDataFunc)(pBmp_dec, inc)
54 #define GET_DATA_LONG(pBmp_dec, inc) ((GET_DATA_LONG_FUNC)pBmp_dec->GetDataFunc)(pBmp_dec, inc)
55 
56 // the unique ID to recognize new header of internal bitmaps
57 #define D4D_IMG_HEADER_2_KEY_D4DINT 0x50455452
58 
59 
60 #define D4D_BMP_COMPRESS_MASK 0x00000001
61 
62 #define D4D_BMP_COMPRESSED 0x00000001
63 #define D4D_BMP_UNCOMPRESSED 0x00000000
64 
65 #define D4D_BMP_TYPE_MASK 0x0000001E
66 
67 #define D4D_BMP_16MNOPAL 0x00000014
68 #define D4D_BMP_256KNOPAL 0x00000012
69 #define D4D_BMP_65536NOPAL 0x00000000
70 #define D4D_BMP_4096NOPAL 0x00000002
71 #define D4D_BMP_256NOPAL 0x00000004
72 
73 
74 #define D4D_BMP_PAL256_32 0x00000006
75 #define D4D_BMP_PAL16_8 0x00000008
76 #define D4D_BMP_PAL4 0x0000000A
77 #define D4D_BMP_PAL2 0x0000000C
78 #define D4D_BMP_MON_VER 0x00000010
79 
80 #define D4D_BMP_CLR_DEPTH_MASK 0x00000700
81 
82 #define D4D_BMP_CLR_DEPTH256 0x00000000
83 #define D4D_BMP_CLR_DEPTH128 0x00000100
84 #define D4D_BMP_CLR_DEPTH64 0x00000200
85 #define D4D_BMP_CLR_DEPTH32 0x00000300
86 #define D4D_BMP_CLR_DEPTH16 0x00000400
87 #define D4D_BMP_CLR_DEPTH8 0x00000500
88 #define D4D_BMP_CLR_DEPTH4 0x00000600
89 #define D4D_BMP_CLR_DEPTH2 0x00000700
90 
91 #define D4D_BMP_ENDIAN_FLAG 0x00008000
92 
93 #define D4D_BMP_PAL_256 (D4D_BMP_PAL256_32 | D4D_BMP_CLR_DEPTH256)
94 #define D4D_BMP_PAL_16 (D4D_BMP_PAL16_8 | D4D_BMP_CLR_DEPTH16)
95 #define D4D_BMP_PAL_2 (D4D_BMP_PAL2 | D4D_BMP_CLR_DEPTH2)
96 
97 
98 #ifndef D4D_BMP_16MNOPAL_ENABLE
99  #define D4D_BMP_16MNOPAL_ENABLE D4D_FALSE
100 #endif
101 
102 #ifndef D4D_BMP_256KNOPAL_ENABLE
103  #define D4D_BMP_256KNOPAL_ENABLE D4D_FALSE
104 #endif
105 
106 #ifndef D4D_BMP_65536NOPAL_ENABLE
107  #define D4D_BMP_65536NOPAL_ENABLE D4D_FALSE
108 #endif
109 
110 #ifndef D4D_BMP_256NOPAL_ENABLE
111  #define D4D_BMP_256NOPAL_ENABLE D4D_FALSE
112 #endif
113 
114 #ifndef D4D_BMP_PAL_256_ENABLE
115  #define D4D_BMP_PAL_256_ENABLE D4D_FALSE
116 #endif
117 
118 #ifndef D4D_BMP_PAL_16_ENABLE
119  #define D4D_BMP_PAL_16_ENABLE D4D_FALSE
120 #endif
121 
122 #ifndef D4D_BMP_PAL_2_ENABLE
123  #define D4D_BMP_PAL_2_ENABLE D4D_FALSE
124 #endif
125 
126 
127 
128 
130 {
131  unsigned short width; // width of bitmap
132  unsigned short height; // height of bitmap
133  unsigned short colorMode; // color mode of stored bitmap
135 
137 {
138  unsigned long key; // unique key that points to new format of internal bitmaps
139  unsigned short width; // width of bitmap
140  unsigned short height; // height of bitmap
141  unsigned long colorMode; // color mode of stored bitmap
142  const void * pData; // pointer on picture data
144 
145 
146 /******************************************************************************
147 * Private Types
148 ******************************************************************************/
149 
150 typedef struct D4D_D4DBMP_DECODE_S
151 {
161  const void* pBmp;
162  const void* pPalette;
163  void* GetDataFunc;
165 
166 #if (D4D_BMP_EXTSRC_SUPPORT_D4D == D4D_TRUE) && (D4D_EXTSRC_FILE_ENABLE == D4D_TRUE)
170 #endif
172 
173 
174 typedef Byte (*GET_DATA_BYTE_FUNC)(D4D_D4DBMP_DECODE* pDecode, D4D_BOOL increment);
175 typedef Word (*GET_DATA_WORD_FUNC)(D4D_D4DBMP_DECODE* pDecode, D4D_BOOL increment);
176 typedef LWord (*GET_DATA_LONG_FUNC)(D4D_D4DBMP_DECODE* pDecode, D4D_BOOL increment);
177 
178 /**************************************************************************/
181 #define D4D_IMG_HEADER_D4DINT_SIZE sizeof(D4D_IMG_HEADER_D4DINT)
182 
183 /**************************************************************************/
186 #define D4D_IMG_HEADER_2_D4DINT_SIZE sizeof(D4D_IMG_HEADER_2_D4DINT)
187 
188 #define D4D_DECLARE_IMG_HEADER_2_D4DINT(name, size_x, size_y, c_mode, pData) \
189  const D4D_IMG_HEADER_2_D4DINT name = { \
190  D4D_IMG_HEADER_2_KEY_D4DINT, \
191  size_x, \
192  size_y, \
193  c_mode, \
194  &pData };
195 
196 
197 
198 /******************************************************************************
199 * Private Macro's
200 ******************************************************************************/
201 
202 #define D4D_GET_IMG_HEADER_2_FROM_FILENAME(file) ((D4D_IMG_HEADER_2_D4DINT*)(((D4D_BMP*)file)->pData))
203 
204 #define D4D_GET_IMG_HEADER_FROM_FILENAME(file) ((D4D_IMG_HEADER_D4DINT*)(((D4D_BMP*)file)->pData))
205 
206 /******************************************************************************
207 * Global D4D bitmap drawing level functions
208 ******************************************************************************/
209 
210 #if 1
211  void D4D_ImgDecIntD4DDraw(D4D_COOR x, D4D_COOR y, D4D_CHAR* pFileName, D4D_BOOL greyScale, D4D_COOR radius);
215  int D4D_ImgDecIntD4DGetHeader(D4D_CHAR* pFileName, void* pBuff, int max_size);
216 #else
217  #define D4D_ImgDecIntD4DDraw NULL
218  #define D4D_ImgDecIntD4DGetWidth NULL
219  #define D4D_ImgDecIntD4DGetHeight NULL
220  #define D4D_ImgDecIntD4DGetSize NULL
221  #define D4D_ImgDecIntD4DGetHeader NULL
222 #endif
223 
224 #endif /* __D4D_IMGDEC_D4DINT_H */
D4D_COOR D4D_ImgDecIntD4DGetHeight(D4D_CHAR *pFileName)
void D4D_ImgDecIntD4DDraw(D4D_COOR x, D4D_COOR y, D4D_CHAR *pFileName, D4D_BOOL greyScale, D4D_COOR radius)
struct D4D_IMG_HEADER_2_D4DINT_S D4D_IMG_HEADER_2_D4DINT
D4D_COOR D4D_ImgDecIntD4DGetWidth(D4D_CHAR *pFileName)
struct D4D_D4DBMP_DECODE_S D4D_D4DBMP_DECODE
Word(* GET_DATA_WORD_FUNC)(D4D_D4DBMP_DECODE *pDecode, D4D_BOOL increment)
Byte D4D_COOR
Type definition of eGUI coordination variables.
Definition: d4d_types.h:219
unsigned char Byte
Type definition of Byte (unsigned 8-bit).
Definition: d4d_types.h:151
Byte(* GET_DATA_BYTE_FUNC)(D4D_D4DBMP_DECODE *pDecode, D4D_BOOL increment)
D4D_SIZE D4D_ImgDecIntD4DGetSize(D4D_CHAR *pFileName)
unsigned long LWord
Type definition of LWord (unsigned 32-bit).
Definition: d4d_types.h:167
int D4D_ImgDecIntD4DGetHeader(D4D_CHAR *pFileName, void *pBuff, int max_size)
LWord D4D_BOOL
Type definition of eGUI boolean.
Definition: d4d_types.h:204
char D4D_CHAR
Type definition of eGUI ASCII character.
Definition: d4d_types.h:280
Type definition of eGUI size structure.
Definition: d4d_types.h:230
LWord D4D_COLOR
Type definition of eGUI color variables.
Definition: d4d_types.h:262
struct D4D_IMG_HEADER_D4DINT_S D4D_IMG_HEADER_D4DINT
unsigned short Word
Type definition of Word (unsigned 16-bit).
Definition: d4d_types.h:159
void * D4D_FILEPTR
Type definition of eGUI file pointer.
Definition: d4d_types.h:298
D4D_COLOR(* GetPxlDecoder)(struct D4D_D4DBMP_DECODE_S *pDecode)
LWord(* GET_DATA_LONG_FUNC)(D4D_D4DBMP_DECODE *pDecode, D4D_BOOL increment)