/src/FreeImage/Source/LibRawLite/libraw/libraw_types.h

https://bitbucket.org/cabalistic/ogredeps/ · C++ Header · 349 lines · 268 code · 48 blank · 33 comment · 9 complexity · a1abaf0e7064d1e72ee00bedb96b031f MD5 · raw file

  1. /* -*- C++ -*-
  2. * File: libraw_types.h
  3. * Copyright 2008-2010 LibRaw LLC (info@libraw.org)
  4. * Created: Sat Mar 8 , 2008
  5. *
  6. * LibRaw C data structures
  7. *
  8. LibRaw is free software; you can redistribute it and/or modify
  9. it under the terms of the one of three licenses as you choose:
  10. 1. GNU LESSER GENERAL PUBLIC LICENSE version 2.1
  11. (See file LICENSE.LGPL provided in LibRaw distribution archive for details).
  12. 2. COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
  13. (See file LICENSE.CDDL provided in LibRaw distribution archive for details).
  14. 3. LibRaw Software License 27032010
  15. (See file LICENSE.LibRaw.pdf provided in LibRaw distribution archive for details).
  16. */
  17. #ifndef _LIBRAW_TYPES_H
  18. #define _LIBRAW_TYPES_H
  19. #include <sys/types.h>
  20. #ifndef WIN32
  21. #include <sys/time.h>
  22. #endif
  23. #include <stdio.h>
  24. #if defined (_OPENMP)
  25. #if defined(WIN32)
  26. # if defined (_MSC_VER) && (_MSC_VER >= 1600 || (_MSC_VER == 1500 && _MSC_FULL_VER >= 150030729) )
  27. /* VS2010+ : OpenMP works OK, VS2008: have tested by cgilles */
  28. # define LIBRAW_USE_OPENMP
  29. #elif defined (__INTEL_COMPILER) && (__INTEL_COMPILER >=910)
  30. /* Have not tested on 9.x and 10.x, but Intel documentation claims OpenMP 2.5 support in 9.1 */
  31. # define LIBRAW_USE_OPENMP
  32. #else
  33. # undef LIBRAW_USE_OPENMP
  34. #endif
  35. /* Not Win32 */
  36. # elif (defined(__APPLE__) || defined(__MACOSX__)) && defined(_REENTRANT)
  37. # undef LIBRAW_USE_OPENMP
  38. # else
  39. # define LIBRAW_USE_OPENMP
  40. # endif
  41. #endif
  42. #ifdef LIBRAW_USE_OPENMP
  43. #include <omp.h>
  44. #endif
  45. #ifdef __cplusplus
  46. extern "C" {
  47. #endif
  48. #if defined(USE_LCMS)
  49. #include <lcms.h>
  50. #elif defined(USE_LCMS2)
  51. #include <lcms2.h>
  52. #else
  53. #define NO_LCMS
  54. #endif
  55. #include "libraw_const.h"
  56. #include "libraw_version.h"
  57. #ifdef WIN32
  58. typedef __int64 INT64;
  59. typedef unsigned __int64 UINT64;
  60. #else
  61. typedef long long INT64;
  62. typedef unsigned long long UINT64;
  63. #endif
  64. typedef unsigned char uchar;
  65. typedef unsigned short ushort;
  66. #ifdef WIN32
  67. #ifdef LIBRAW_NODLL
  68. # define DllDef
  69. #else
  70. # ifdef LIBRAW_BUILDLIB
  71. # define DllDef __declspec( dllexport )
  72. # else
  73. # define DllDef __declspec( dllimport )
  74. # endif
  75. #endif
  76. #else
  77. # define DllDef
  78. #endif
  79. typedef struct
  80. {
  81. const char *decoder_name;
  82. unsigned decoder_flags;
  83. }libraw_decoder_info_t;
  84. typedef struct
  85. {
  86. unsigned mix_green;
  87. unsigned raw_color;
  88. unsigned zero_is_bad;
  89. ushort shrink;
  90. ushort fuji_width;
  91. ushort fwidth,fheight;
  92. } libraw_internal_output_params_t;
  93. typedef void (* memory_callback)(void * data, const char *file, const char *where);
  94. DllDef void default_memory_callback(void *data,const char *file, const char *where);
  95. typedef void (*data_callback)(void *data,const char *file, const int offset);
  96. DllDef void default_data_callback(void *data,const char *file, const int offset);
  97. typedef int (* progress_callback) (void *data,enum LibRaw_progress stage, int iteration,int expected);
  98. typedef struct
  99. {
  100. memory_callback mem_cb;
  101. void* memcb_data;
  102. data_callback data_cb;
  103. void* datacb_data;
  104. progress_callback progress_cb;
  105. void *progresscb_data;
  106. } libraw_callbacks_t;
  107. typedef struct
  108. {
  109. enum LibRaw_image_formats type;
  110. ushort height,
  111. width,
  112. colors,
  113. bits;
  114. unsigned int data_size;
  115. unsigned char data[1];
  116. }libraw_processed_image_t;
  117. typedef struct
  118. {
  119. char make[64];
  120. char model[64];
  121. unsigned raw_count;
  122. unsigned dng_version;
  123. unsigned is_foveon;
  124. int colors;
  125. unsigned filters;
  126. char cdesc[5];
  127. }libraw_iparams_t;
  128. typedef struct
  129. {
  130. ushort raw_height,
  131. raw_width,
  132. height,
  133. width,
  134. top_margin,
  135. left_margin;
  136. ushort iheight,
  137. iwidth;
  138. double pixel_aspect;
  139. int flip;
  140. } libraw_image_sizes_t;
  141. struct ph1_t
  142. {
  143. int format, key_off, t_black, black_off, split_col, tag_21a;
  144. float tag_210;
  145. };
  146. typedef struct
  147. {
  148. unsigned curve_state : 3;
  149. unsigned rgb_cam_state : 3;
  150. unsigned cmatrix_state : 3;
  151. unsigned pre_mul_state : 3;
  152. unsigned cam_mul_state : 3;
  153. unsigned filler : 17;
  154. } color_data_state_t;
  155. typedef struct
  156. {
  157. color_data_state_t color_flags;
  158. ushort white[8][8];
  159. float cam_mul[4];
  160. float pre_mul[4];
  161. float cmatrix[3][4];
  162. float rgb_cam[3][4];
  163. float cam_xyz[4][3];
  164. ushort curve[0x10000];
  165. unsigned black;
  166. unsigned cblack[8];
  167. unsigned maximum;
  168. unsigned channel_maximum[4];
  169. struct ph1_t phase_one_data;
  170. float flash_used;
  171. float canon_ev;
  172. char model2[64];
  173. void *profile;
  174. unsigned profile_length;
  175. short (*ph1_black)[2];
  176. }libraw_colordata_t;
  177. typedef struct
  178. {
  179. enum LibRaw_thumbnail_formats tformat;
  180. ushort twidth,
  181. theight;
  182. unsigned tlength;
  183. int tcolors;
  184. char *thumb;
  185. }libraw_thumbnail_t;
  186. typedef struct
  187. {
  188. float iso_speed;
  189. float shutter;
  190. float aperture;
  191. float focal_len;
  192. time_t timestamp;
  193. unsigned shot_order;
  194. unsigned gpsdata[32];
  195. char desc[512],
  196. artist[64];
  197. } libraw_imgother_t;
  198. typedef struct
  199. {
  200. unsigned greybox[4]; /* -A x1 y1 x2 y2 */
  201. unsigned cropbox[4]; /* -B x1 y1 x2 y2 */
  202. double aber[4]; /* -C */
  203. double gamm[6]; /* -g */
  204. float user_mul[4]; /* -r mul0 mul1 mul2 mul3 */
  205. unsigned shot_select; /* -s */
  206. float bright; /* -b */
  207. float threshold; /* -n */
  208. int half_size; /* -h */
  209. int four_color_rgb; /* -f */
  210. int document_mode; /* -d/-D */
  211. int highlight; /* -H */
  212. int use_auto_wb; /* -a */
  213. int use_camera_wb; /* -w */
  214. int use_camera_matrix; /* +M/-M */
  215. int output_color; /* -o */
  216. char *output_profile; /* -o */
  217. char *camera_profile; /* -p */
  218. char *bad_pixels; /* -P */
  219. char *dark_frame; /* -K */
  220. int output_bps; /* -4 */
  221. int output_tiff; /* -T */
  222. int user_flip; /* -t */
  223. int user_qual; /* -q */
  224. int user_black; /* -k */
  225. int user_sat; /* -S */
  226. int med_passes; /* -m */
  227. float auto_bright_thr;
  228. float adjust_maximum_thr;
  229. int no_auto_bright; /* -W */
  230. int use_fuji_rotate;/* -j */
  231. int green_matching;
  232. #if 0
  233. /* AFD noise suppression parameters, disabled for now */
  234. int afd_noise_att;
  235. int afd_noise_thres;
  236. int afd_luminance_passes;
  237. int afd_chrominance_method;
  238. int afd_luminance_only;
  239. #endif
  240. /* DCB parameters */
  241. int dcb_iterations;
  242. int dcb_enhance_fl;
  243. int fbdd_noiserd;
  244. /* VCD parameters */
  245. int eeci_refine;
  246. int es_med_passes;
  247. /* AMaZE*/
  248. int ca_correc;
  249. float cared;
  250. float cablue;
  251. int cfaline;
  252. float linenoise;
  253. int cfa_clean;
  254. float lclean;
  255. float cclean;
  256. int cfa_green;
  257. float green_thresh;
  258. int exp_correc;
  259. float exp_shift;
  260. float exp_preser;
  261. }libraw_output_params_t;
  262. typedef struct
  263. {
  264. /* really allocated bitmap */
  265. void *raw_alloc;
  266. /* alias to single_channel variant */
  267. ushort *raw_image;
  268. /* alias to 4-channel variant */
  269. ushort (*color_image)[4] ;
  270. /* Phase One black level data; */
  271. short (*ph1_black)[2];
  272. int use_ph1_correct;
  273. /* save color and sizes here, too.... */
  274. libraw_iparams_t iparams;
  275. libraw_image_sizes_t sizes;
  276. libraw_internal_output_params_t ioparams;
  277. libraw_colordata_t color;
  278. } libraw_rawdata_t;
  279. typedef struct
  280. {
  281. unsigned int progress_flags;
  282. unsigned int process_warnings;
  283. libraw_iparams_t idata;
  284. libraw_image_sizes_t sizes;
  285. libraw_colordata_t color;
  286. libraw_imgother_t other;
  287. libraw_thumbnail_t thumbnail;
  288. libraw_rawdata_t rawdata;
  289. ushort (*image)[4] ;
  290. libraw_output_params_t params;
  291. void *parent_class;
  292. } libraw_data_t;
  293. #ifdef __cplusplus
  294. }
  295. #endif
  296. #endif