il_states.h
Upload User: wmy0603
Upload Date: 2022-05-02
Package Size: 1808k
Code Size: 6k
Development Platform:

Visual C++

  1. //-----------------------------------------------------------------------------
  2. //
  3. // ImageLib Sources
  4. // Copyright (C) 2000-2008 by Denton Woods
  5. // Last modified: 11/07/2008
  6. //
  7. // Filename: src-IL/src/il_states.h
  8. //
  9. // Description: State machine
  10. //
  11. //-----------------------------------------------------------------------------
  12. #ifndef STATES_H
  13. #define STATES_H
  14. #include "il_internal.h"
  15. ILboolean ilAble(ILenum Mode, ILboolean Flag);
  16. #define IL_ATTRIB_STACK_MAX 32
  17. ILuint ilCurrentPos = 0;  // Which position on the stack
  18. //
  19. // Various states
  20. //
  21. typedef struct IL_STATES
  22. {
  23. // Origin states
  24. ILboolean ilOriginSet;
  25. ILenum ilOriginMode;
  26. // Format and type states
  27. ILboolean ilFormatSet;
  28. ILboolean ilTypeSet;
  29. ILenum ilFormatMode;
  30. ILenum ilTypeMode;
  31. // File mode states
  32. ILboolean ilOverWriteFiles;
  33. // Palette states
  34. ILboolean ilAutoConvPal;
  35. // Load fail states
  36. ILboolean ilDefaultOnFail;
  37. // Key colour states
  38. ILboolean ilUseKeyColour;
  39. // Alpha blend states
  40. ILboolean ilBlitBlend;
  41. // Compression states
  42. ILenum ilCompression;
  43. // Interlace states
  44. ILenum ilInterlace;
  45. // Quantization states
  46. ILenum ilQuantMode;
  47. ILuint ilNeuSample;
  48. ILuint ilQuantMaxIndexs;
  49. // DXTC states
  50. ILboolean ilKeepDxtcData;
  51. ILboolean ilUseNVidiaDXT;
  52. ILboolean ilUseSquishDXT;
  53. //
  54. // Format-specific states
  55. //
  56. ILboolean ilTgaCreateStamp;
  57. ILuint ilJpgQuality;
  58. ILboolean ilPngInterlace;
  59. ILboolean ilTgaRle;
  60. ILboolean ilBmpRle;
  61. ILboolean ilSgiRle;
  62. ILenum ilJpgFormat;
  63. ILboolean ilJpgProgressive;
  64. ILenum ilDxtcFormat;
  65. ILenum ilPcdPicNum;
  66. ILint ilPngAlphaIndex; // this index should be treated as an alpha key (most formats use this rather than having alpha in the palette), -1 for none
  67. // currently only used when writing out .png files and should obviously be set to -1 most of the time
  68. //
  69. // Format-specific strings
  70. //
  71. char* ilTgaId;
  72. char* ilTgaAuthName;
  73. char* ilTgaAuthComment;
  74. char* ilPngAuthName;
  75. char* ilPngTitle;
  76. char* ilPngDescription;
  77. char* ilTifDescription;
  78. char* ilTifHostComputer;
  79. char* ilTifDocumentName;
  80. char* ilTifAuthName;
  81. char* ilCHeader;
  82. } IL_STATES;
  83. IL_STATES ilStates[IL_ATTRIB_STACK_MAX];
  84. typedef struct IL_HINTS
  85. {
  86. // Memory vs. Speed trade-off
  87. ILenum MemVsSpeedHint;
  88. // Compression hints
  89. ILenum CompressHint;
  90. } IL_HINTS;
  91. IL_HINTS ilHints;
  92. #ifndef IL_NO_BLP
  93. #define IL_BLP_EXT "blp "
  94. #else
  95. #define IL_BLP_EXT ""
  96. #endif
  97. #ifndef IL_NO_BMP
  98. #define IL_BMP_EXT "bmp dib "
  99. #else
  100. #define IL_BMP_EXT ""
  101. #endif
  102. #ifndef IL_NO_CHEAD
  103. #define IL_CHEAD_EXT "h "
  104. #else
  105. #define IL_CHEAD_EXT ""
  106. #endif
  107. #ifndef IL_NO_CUT
  108. #define IL_CUT_EXT "cut "
  109. #else
  110. #define IL_CUT_EXT ""
  111. #endif
  112. #ifndef IL_NO_DCX
  113. #define IL_DCX_EXT "dcx "
  114. #else
  115. #define IL_DCX_EXT ""
  116. #endif
  117. #ifndef IL_NO_DCM
  118. #define IL_DCM_EXT "dicom dcm"
  119. #else
  120. #define IL_DCM_EXT ""
  121. #endif
  122. #ifndef IL_NO_DDS
  123. #define IL_DDS_EXT "dds "
  124. #else
  125. #define IL_DDS_EXT ""
  126. #endif
  127. #ifndef IL_NO_DPX
  128. #define IL_DPX_EXT "dds "
  129. #else
  130. #define IL_DPX_EXT ""
  131. #endif
  132. #ifndef IL_NO_EXR
  133. #define IL_EXR_EXT "exr "
  134. #else
  135. #define IL_EXR_EXT ""
  136. #endif
  137. #ifndef IL_NO_FITS
  138. #define IL_FITS_EXT "fit fits "
  139. #else
  140. #define IL_FITS_EXT ""
  141. #endif
  142. #ifndef IL_NO_FTX
  143. #define IL_FTX_EXT "ftx "
  144. #else
  145. #define IL_FTX_EXT ""
  146. #endif
  147. #ifndef IL_NO_GIF
  148. #define IL_GIF_EXT "gif "
  149. #else
  150. #define IL_GIF_EXT ""
  151. #endif
  152. #ifndef IL_NO_HDR
  153. #define IL_HDR_EXT "hdr "
  154. #else
  155. #define IL_HDR_EXT ""
  156. #endif
  157. #ifndef IL_NO_ICNS
  158. #define IL_ICNS_EXT "icns "
  159. #else
  160. #define IL_ICNS_EXT ""
  161. #endif
  162. #ifndef IL_NO_ICO
  163. #define IL_ICO_EXT "ico cur "
  164. #else
  165. #define IL_ICO_EXT ""
  166. #endif
  167. #ifndef IL_NO_IFF
  168. #define IL_IFF_EXT "iff "
  169. #else
  170. #define IL_IFF_EXT ""
  171. #endif
  172. #ifndef IL_NO_IWI
  173. #define IL_IWI_EXT "iwi "
  174. #else
  175. #define IL_IWI_EXT ""
  176. #endif
  177. #ifndef IL_NO_JP2
  178. #define IL_JP2_EXT "jp2 "
  179. #else
  180. #define IL_JP2_EXT ""
  181. #endif
  182. #ifndef IL_NO_JPG
  183. #define IL_JPG_EXT "jpg jpe jpeg "
  184. #else
  185. #define IL_JPG_EXT ""
  186. #endif
  187. #ifndef IL_NO_LIF
  188. #define IL_LIF_EXT "lif "
  189. #else
  190. #define IL_LIF_EXT ""
  191. #endif
  192. #ifndef IL_NO_MDL
  193. #define IL_MDL_EXT "mdl "
  194. #else
  195. #define IL_MDL_EXT ""
  196. #endif
  197. #ifndef IL_NO_MNG
  198. #define IL_MNG_EXT "mng jng "
  199. #else
  200. #define IL_MNG_EXT ""
  201. #endif
  202. #ifndef IL_NO_MP3
  203. #define IL_MP3_EXT "mp3 "
  204. #else
  205. #define IL_MP3_EXT ""
  206. #endif
  207. #ifndef IL_NO_PCD
  208. #define IL_PCD_EXT "pcd "
  209. #else
  210. #define IL_PCD_EXT ""
  211. #endif
  212. #ifndef IL_NO_PCX
  213. #define IL_PCX_EXT "pcx "
  214. #else
  215. #define IL_PCX_EXT ""
  216. #endif
  217. #ifndef IL_NO_PIC
  218. #define IL_PIC_EXT "pic "
  219. #else
  220. #define IL_PIC_EXT ""
  221. #endif
  222. #ifndef IL_NO_PIX
  223. #define IL_PIX_EXT "pix "
  224. #else
  225. #define IL_PIX_EXT ""
  226. #endif
  227. #ifndef IL_NO_PNG
  228. #define IL_PNG_EXT "png "
  229. #else
  230. #define IL_PNG_EXT ""
  231. #endif
  232. #ifndef IL_NO_PNM
  233. #define IL_PNM_EXT "pbm pgm pnm ppm "
  234. #else
  235. #define IL_PNM_EXT ""
  236. #endif
  237. #ifndef IL_NO_PSD
  238. #define IL_PSD_EXT "psd pdd "
  239. #else
  240. #define IL_PSD_EXT ""
  241. #endif
  242. #ifndef IL_NO_PSP
  243. #define IL_PSP_EXT "psp "
  244. #else
  245. #define IL_PSP_EXT ""
  246. #endif
  247. #ifndef IL_NO_PXR
  248. #define IL_PXR_EXT "pxr "
  249. #else
  250. #define IL_PXR_EXT ""
  251. #endif
  252. #ifndef IL_NO_RAW
  253. #define IL_RAW_EXT "raw "
  254. #else
  255. #define IL_RAW_EXT ""
  256. #endif
  257. #ifndef IL_NO_ROT
  258. #define IL_ROT_EXT "rot "
  259. #else
  260. #define IL_ROT_EXT ""
  261. #endif
  262. #ifndef IL_NO_SGI
  263. #define IL_SGI_EXT "sgi bw rgb rgba "
  264. #else
  265. #define IL_SGI_EXT ""
  266. #endif
  267. #ifndef IL_NO_SUN
  268. #define IL_SUN_EXT "sun ras rs im1 im8 im24 im32 "
  269. #else
  270. #define IL_SUN_EXT ""
  271. #endif
  272. #ifndef IL_NO_TEXTURE
  273. #define IL_TEX_EXT "texture "
  274. #else
  275. #define IL_TEX_EXT ""
  276. #endif
  277. #ifndef IL_NO_TGA
  278. #define IL_TGA_EXT "tga vda icb vst "
  279. #else
  280. #define IL_TGA_EXT ""
  281. #endif
  282. #ifndef IL_NO_TIF
  283. #define IL_TIFF_EXT "tif tiff "
  284. #else
  285. #define IL_TIFF_EXT ""
  286. #endif
  287. #ifndef IL_NO_TPL
  288. #define IL_TPL_EXT "tpl "
  289. #else
  290. #define IL_TPL_EXT ""
  291. #endif
  292. #ifndef IL_NO_UTX
  293. #define IL_UTX_EXT "utx "
  294. #else
  295. #define IL_UTX_EXT ""
  296. #endif
  297. #ifndef IL_NO_VTF
  298. #define IL_VTF_EXT "vtf "
  299. #else
  300. #define IL_VTF_EXT ""
  301. #endif
  302. #ifndef IL_NO_WAL
  303. #define IL_WAL_EXT "wal "
  304. #else
  305. #define IL_WAL_EXT ""
  306. #endif
  307. #ifndef IL_NO_WBMP
  308. #define IL_WBMP_EXT "wbmp "
  309. #else
  310. #define IL_WBMP_EXT ""
  311. #endif
  312. #ifndef IL_NO_WDP
  313. #define IL_WDP_EXT "wdp "
  314. #else
  315. #define IL_WDP_EXT ""
  316. #endif
  317. #ifndef IL_NO_XPM
  318. #define IL_XPM_EXT "xpm "
  319. #else
  320. #define IL_XPM_EXT ""
  321. #endif
  322. #endif//STATES_H