1
/* Copyright 2010-2011 Yorba Foundation
3
* This software is licensed under the GNU Lesser General Public License
4
* (version 2.1 or later). See the COPYING file in this distribution.
7
[CCode (cprefix="libraw_", cheader_filename="libraw/libraw.h")]
10
[CCode (cname="LIBRAW_CHECK_VERSION")]
11
public bool check_version(int major, int minor, int patch);
13
public unowned string version();
15
public unowned string versionNumber();
17
[CCode (cname="enum libraw_Filtering", cprefix="LIBRAW_FILTERING_")]
18
public enum Filtering {
29
[CCode (cname="libraw_imgother_t")]
30
public struct ImageOther {
31
public float iso_speed;
33
public float aperture;
34
public float focal_len;
35
public time_t timestamp;
36
public uint shot_order;
37
public uint gpsdata[32];
38
public char desc[512];
39
public char artist[64];
43
[CCode (cname="libraw_iparams_t")]
44
public struct ImageParams {
45
public uint raw_count;
46
public uint dng_version;
47
public bool is_foveon;
55
public string get_make() {
56
return build_string(make, 64);
59
public string get_model() {
60
return build_string(model, 64);
63
public string get_cdesc() {
64
return build_string(cdesc, 5);
67
private static string build_string(char *array, int len) {
68
GLib.StringBuilder builder = new GLib.StringBuilder();
69
for (int ctr = 0; ctr < len; ctr++) {
70
if (array[ctr] != '\0')
71
builder.append_c(array[ctr]);
81
[CCode (cname="libraw_image_sizes_t")]
82
public struct ImageSizes {
83
public ushort raw_height;
84
public ushort raw_width;
87
public ushort top_margin;
88
public ushort left_margin;
89
public ushort iheight;
91
public double pixel_aspect;
93
public ushort right_margin;
94
public ushort bottom_margin;
97
[CCode (cname="enum LibRaw_constructor_flags", cprefix="LIBRAW_OPIONS_")]
99
[CCode (cname="LIBRAW_OPTIONS_NONE")]
106
[CCode (cname="libraw_output_params_t")]
107
public struct OutputParams {
108
public uint greybox[4];
109
public double aber[4];
110
public double gamm[6];
111
public float user_mul[4];
112
public uint shot_select;
113
public uint multi_out;
115
public float threshold;
116
public bool half_size;
117
public bool four_color_rgb;
118
public int document_mode;
119
public int highlight;
120
public bool use_auto_wb;
121
public bool use_camera_wb;
122
public bool use_camera_matrix;
123
public int output_color;
124
public Filtering filtering_mode;
125
public int output_bps;
126
public bool output_tiff;
127
public int user_flip;
128
public int user_qual;
129
public int user_black;
131
public int med_passes;
132
public bool no_auto_bright;
133
public float auto_bright_thr;
134
public int use_fuji_rotate;
136
public void set_chromatic_aberrations(double red_multiplier, double green_multiplier) {
137
aber[0] = red_multiplier;
138
aber[2] = green_multiplier;
141
public void set_gamma_curve(double power, double slope) {
148
[CCode (cname="libraw_processed_image_t", free_function="free")]
149
public class ProcessedImage {
150
public ushort height;
152
public ushort colors;
154
public uint data_size;
155
[CCode (array_length=false)]
160
[CCode (cname="libraw_data_t", cprefix="libraw_", free_function="libraw_close")]
161
public class Processor {
162
public OutputParams params;
164
private Progress progress_flags;
165
private Warnings process_warnings;
166
private ImageParams idata;
167
private ImageSizes sizes;
168
private ImageOther other;
169
private Thumbnail thumbnail;
171
[CCode (cname="libraw_init")]
172
public Processor(Options flags = Options.NONE);
174
public void add_masked_borders_to_bitmap();
175
public Result adjust_sizes_info_only();
176
[CCode (cname="libraw_dcraw_document_mode_processing")]
177
public Result document_mode_processing();
178
public unowned ImageOther get_image_other() { return other; }
179
public unowned ImageParams get_image_params() { return idata; }
180
public Progress get_progress_flags() { return progress_flags; }
181
public Warnings get_process_warnings() { return process_warnings; }
182
public unowned ImageSizes get_sizes() { return sizes; }
183
public unowned Thumbnail get_thumbnail() { return thumbnail; }
184
[CCode (cname="libraw_dcraw_make_mem_image")]
185
public ProcessedImage make_mem_image(ref Result result);
186
[CCode (cname="libraw_dcraw_make_mem_thumb")]
187
public ProcessedImage make_mem_thumb(ref Result result);
188
public Result open_buffer(uint8[] buffer);
189
public Result open_file(string filename);
190
[CCode (cname="libraw_dcraw_process")]
191
public Result process();
192
[CCode (cname="libraw_dcraw_ppm_tiff_writer")]
193
public Result ppm_tiff_writer(string outfile);
194
public void recycle();
195
public Result rotate_fuji_raw();
196
[CCode (cname="libraw_dcraw_thumb_writer")]
197
public Result thumb_writer(string outfile);
198
public Result unpack();
199
public Result unpack_thumb();
202
[CCode (cname="enum LibRaw_progress", cprefix="LIBRAW_PROGRESS_")]
203
public enum Progress {
206
[CCode (cname="libraw_strprogress")]
207
public unowned string to_string();
210
[CCode (cname="enum LibRaw_errors", cprefix="LIBRAW_")]
215
REQUEST_FOR_NONEXISTENT_IMAGE,
218
UNSUPPORTED_THUMBNAIL,
223
CANCELLED_BY_CALLBACK;
225
[CCode (cname="LIBRAW_FATAL_ERROR")]
226
public bool is_fatal_error();
228
[CCode (cname="libraw_strerror")]
229
public unowned string to_string();
233
[CCode (cname="libraw_thumbnail_t")]
234
public struct Thumbnail {
235
public ThumbnailFormat tformat;
236
public ushort twidth;
237
public ushort theight;
243
[CCode (cname="enum LibRaw_thumbnail_formats", cprefix="LIBRAW_THUMBNAIL_")]
244
public enum ThumbnailFormat {
252
[CCode (cname="enum LibRaw_warnings", cprefix="LIBRAW_WARN_")]
253
public enum Warnings {