~ubuntu-branches/ubuntu/precise/libraw/precise-security

« back to all changes in this revision

Viewing changes to libraw/libraw_types.h

  • Committer: Bazaar Package Importer
  • Author(s): Robert Ancell
  • Date: 2010-05-12 12:32:57 UTC
  • Revision ID: james.westby@ubuntu.com-20100512123257-ad0i3rgnpg8vg1ib
Tags: upstream-0.9.0
ImportĀ upstreamĀ versionĀ 0.9.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
 
9
LibRaw is free software; you can redistribute it and/or modify
 
10
it under the terms of the one of three licenses as you choose:
 
11
 
 
12
1. GNU LESSER GENERAL PUBLIC LICENSE version 2.1
 
13
   (See file LICENSE.LGPL provided in LibRaw distribution archive for details).
 
14
 
 
15
2. COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
 
16
   (See file LICENSE.CDDL provided in LibRaw distribution archive for details).
 
17
 
 
18
3. 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
#ifdef _OPENMP
 
32
#ifdef _MSC_VER
 
33
#error OpenMP is not supported under MS Visual Studio
 
34
#endif
 
35
#include <omp.h>
 
36
#endif
 
37
 
 
38
 
 
39
#ifdef __cplusplus
 
40
extern "C" {
 
41
#endif
 
42
 
 
43
#ifndef USE_LCMS
 
44
#define NO_LCMS
 
45
#endif
 
46
 
 
47
#include "libraw_const.h"
 
48
#include "libraw_version.h"
 
49
 
 
50
#ifdef WIN32
 
51
typedef __int64 INT64;
 
52
typedef unsigned __int64 UINT64;
 
53
#else
 
54
typedef long long INT64;
 
55
typedef unsigned long long UINT64;
 
56
#endif
 
57
 
 
58
typedef unsigned char uchar;
 
59
typedef unsigned short ushort;
 
60
 
 
61
#ifdef WIN32
 
62
#ifdef LIBRAW_NODLL
 
63
# define DllDef
 
64
#else
 
65
# ifdef LIBRAW_BUILDLIB
 
66
#    define DllDef   __declspec( dllexport )
 
67
# else
 
68
#    define DllDef   __declspec( dllimport )
 
69
# endif
 
70
#endif
 
71
#else
 
72
#  define DllDef
 
73
#endif
 
74
 
 
75
 
 
76
 
 
77
typedef void (* memory_callback)(void * data, const char *file, const char *where);
 
78
 
 
79
DllDef void default_memory_callback(void *data,const char *file, const char *where);
 
80
 
 
81
typedef void (*data_callback)(void *data,const char *file, const int offset);
 
82
 
 
83
DllDef void default_data_callback(void *data,const char *file, const int offset);
 
84
 
 
85
typedef int (* progress_callback) (void *data,enum LibRaw_progress stage, int iteration,int expected);
 
86
 
 
87
typedef struct
 
88
{
 
89
    memory_callback mem_cb;
 
90
    void*  memcb_data;
 
91
 
 
92
    data_callback data_cb;
 
93
    void*       datacb_data;
 
94
 
 
95
    progress_callback progress_cb;
 
96
    void *progresscb_data;
 
97
} libraw_callbacks_t;
 
98
 
 
99
 
 
100
typedef struct
 
101
{
 
102
    enum LibRaw_image_formats type; 
 
103
    ushort      height,
 
104
                width,
 
105
                colors,
 
106
                bits;
 
107
#ifdef LIBRAW_LIBRARY_BUILD
 
108
#ifdef _OPENMP
 
109
#pragma omp firstprivate(colors,height,width)
 
110
#endif
 
111
#endif
 
112
    unsigned int  data_size; 
 
113
    unsigned char data[1]; 
 
114
}libraw_processed_image_t;
 
115
 
 
116
 
 
117
typedef struct
 
118
{
 
119
    char        make[64];
 
120
    char        model[64];
 
121
 
 
122
    unsigned    raw_count;
 
123
    unsigned    dng_version;
 
124
    int         colors;
 
125
 
 
126
    unsigned    filters; 
 
127
    char        cdesc[5];
 
128
 
 
129
}libraw_iparams_t;
 
130
 
 
131
typedef struct
 
132
{
 
133
    ushort      raw_height, 
 
134
                raw_width, 
 
135
                height, 
 
136
                width, 
 
137
                top_margin, 
 
138
                left_margin;
 
139
    ushort      iheight,
 
140
                iwidth;
 
141
#ifdef LIBRAW_LIBRARY_BUILD
 
142
#ifdef _OPENMP
 
143
#pragma omp firstprivate(iheight,iwidth)
 
144
#endif
 
145
#endif
 
146
    double      pixel_aspect;
 
147
    int         flip;
 
148
 
 
149
    ushort      right_margin,bottom_margin; 
 
150
 
 
151
} libraw_image_sizes_t;
 
152
 
 
153
struct ph1_t
 
154
{
 
155
    int format, key_off, t_black, black_off, split_col, tag_21a;
 
156
    float tag_210;
 
157
};
 
158
 
 
159
 
 
160
typedef struct
 
161
{
 
162
    unsigned curve_state        : 3;
 
163
    unsigned rgb_cam_state      : 3;
 
164
    unsigned cmatrix_state      : 3;
 
165
    unsigned pre_mul_state      : 3;
 
166
    unsigned cam_mul_state      : 3;
 
167
    unsigned filler             : 17;
 
168
} color_data_state_t;
 
169
 
 
170
typedef struct
 
171
{
 
172
    color_data_state_t   color_flags;
 
173
    ushort      white[8][8];  
 
174
    float       cam_mul[4]; 
 
175
    float       pre_mul[4]; 
 
176
    float       cmatrix[3][4]; 
 
177
    float       rgb_cam[3][4]; 
 
178
    float       cam_xyz[4][3]; 
 
179
    ushort      curve[0x10000]; 
 
180
    unsigned    black;
 
181
    unsigned    maximum;
 
182
    unsigned    channel_maximum[4];
 
183
    struct ph1_t       phase_one_data;
 
184
    float       flash_used; 
 
185
    float       canon_ev; 
 
186
    char        model2[64];
 
187
    void        *profile;
 
188
    unsigned    profile_length;
 
189
}libraw_colordata_t;
 
190
 
 
191
typedef struct
 
192
{
 
193
    enum LibRaw_thumbnail_formats tformat;
 
194
    ushort      twidth, 
 
195
                theight;
 
196
    unsigned    tlength;
 
197
    int         tcolors;
 
198
    
 
199
    char       *thumb;
 
200
}libraw_thumbnail_t;
 
201
 
 
202
typedef struct
 
203
{
 
204
    float       iso_speed; 
 
205
    float       shutter;
 
206
    float       aperture;
 
207
    float       focal_len;
 
208
    time_t      timestamp; 
 
209
    unsigned    shot_order;
 
210
    unsigned    gpsdata[32];
 
211
    char        desc[512],
 
212
                artist[64];
 
213
} libraw_imgother_t;
 
214
 
 
215
typedef struct
 
216
{
 
217
    unsigned    greybox[4];     /* -A  x1 y1 x2 y2 */
 
218
    double      aber[4];        /* -C */
 
219
    double      gamm[6];        /* -g */
 
220
    float       user_mul[4];    /* -r mul0 mul1 mul2 mul3 */
 
221
    unsigned    shot_select;    /* -s */
 
222
    float       bright;         /* -b */
 
223
    float       threshold;      /*  -n */
 
224
#ifdef LIBRAW_LIBRARY_BUILD
 
225
#ifdef _OPENMP
 
226
#pragma omp firstprivate(threshold)
 
227
#endif
 
228
#endif
 
229
    int         half_size;      /* -h */
 
230
    int         four_color_rgb; /* -f */
 
231
    int         document_mode;  /* -d/-D */
 
232
    int         highlight;      /* -H */
 
233
    int         use_auto_wb;    /* -a */
 
234
    int         use_camera_wb;  /* -w */
 
235
    int         use_camera_matrix; /* +M/-M */
 
236
    int         output_color;   /* -o */
 
237
    char        *output_profile; /* -o */
 
238
    char        *camera_profile; /* -p */
 
239
    char        *bad_pixels;    /* -P */
 
240
    char        *dark_frame;    /* -K */
 
241
    int         output_bps;     /* -4 */
 
242
    int         output_tiff;    /* -T */
 
243
    int         user_flip;      /* -t */
 
244
    int         user_qual;      /* -q */
 
245
    int         user_black;     /* -k */
 
246
    int         user_sat;       /* -S */
 
247
 
 
248
    int         med_passes;     /* -m */
 
249
    float       auto_bright_thr; 
 
250
    float       adjust_maximum_thr;
 
251
    int         no_auto_bright; /* -W */
 
252
    int         use_fuji_rotate;/* -j */
 
253
    enum LibRaw_filtering    filtering_mode; 
 
254
}libraw_output_params_t;
 
255
 
 
256
typedef struct
 
257
{
 
258
    ushort  *buffer; 
 
259
    ushort  *tl;     
 
260
    ushort  *top;    
 
261
    ushort  *tr;    
 
262
    ushort  *left;  
 
263
    ushort  *right; 
 
264
    ushort  *bl;     
 
265
    ushort  *bottom; 
 
266
    ushort  *br;     
 
267
    ushort  (*ph1_black)[2]; 
 
268
}libraw_masked_t;
 
269
 
 
270
typedef struct
 
271
{
 
272
    unsigned int                progress_flags;
 
273
    unsigned int                process_warnings;
 
274
    libraw_iparams_t            idata;
 
275
    libraw_image_sizes_t        sizes;
 
276
    libraw_colordata_t          color;
 
277
    libraw_imgother_t           other;
 
278
    libraw_thumbnail_t          thumbnail;
 
279
    libraw_masked_t             masked_pixels;
 
280
    ushort                      (*image)[4] ;
 
281
#ifdef LIBRAW_LIBRARY_BUILD
 
282
#ifdef _OPENMP
 
283
#pragma omp shared(image)
 
284
#endif
 
285
#endif
 
286
    libraw_output_params_t     params;
 
287
    void                *parent_class;      
 
288
} libraw_data_t;
 
289
 
 
290
 
 
291
#ifdef __cplusplus
 
292
}
 
293
#endif
 
294
 
 
295
#endif