PageRenderTime 48ms CodeModel.GetById 1ms app.highlight 41ms RepoModel.GetById 1ms app.codeStats 0ms

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