1 /* -*- C++ -*-
2  * File: libraw_types.h
3  * Copyright 2008-2018 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 two 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  */
19 
20 #ifndef _LIBRAW_TYPES_H
21 #define _LIBRAW_TYPES_H
22 
23 #include <sys/types.h>
24 #ifndef WIN32
25 #include <sys/time.h>
26 #endif
27 
28 #include <stdio.h>
29 
30 #if defined(_WIN32)
31 #if defined(_MSC_VER) && (_MSC_VER <= 1500)
32 typedef signed __int8 int8_t;
33 typedef unsigned __int8 uint8_t;
34 typedef signed __int16 int16_t;
35 typedef unsigned __int16 uint16_t;
36 typedef signed __int32 int32_t;
37 typedef unsigned __int32 uint32_t;
38 typedef signed __int64 int64_t;
39 typedef unsigned __int64 uint64_t;
40 #else
41 #include <stdint.h>
42 #endif /* _WIN32 */
43 #include <sys/types.h>
44 #else
45 #include <inttypes.h>
46 #endif
47 
48 #if defined(_OPENMP)
49 
50 #if defined(WIN32)
51 #if defined(_MSC_VER) && (_MSC_VER >= 1600 || (_MSC_VER == 1500 && _MSC_FULL_VER >= 150030729))
52 /* VS2010+ : OpenMP works OK, VS2008: have tested by cgilles */
53 #define LIBRAW_USE_OPENMP
54 #elif defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 910)
55 /*  Have not tested on 9.x and 10.x, but Intel documentation claims OpenMP 2.5 support in 9.1 */
56 #define LIBRAW_USE_OPENMP
57 #else
58 #undef LIBRAW_USE_OPENMP
59 #endif
60 /* Not Win32 */
61 #elif (defined(__APPLE__) || defined(__MACOSX__)) && defined(_REENTRANT)
62 #undef LIBRAW_USE_OPENMP
63 #else
64 #define LIBRAW_USE_OPENMP
65 #endif
66 #endif
67 
68 #ifdef LIBRAW_USE_OPENMP
69 #include <omp.h>
70 #endif
71 
72 #ifdef __cplusplus
73 extern "C"
74 {
75 #endif
76 
77 #if defined(USE_LCMS)
78 #include <lcms.h>
79 #elif defined(USE_LCMS2)
80 #include <lcms2.h>
81 #else
82 #define NO_LCMS
83 #endif
84 
85 #include "libraw_const.h"
86 #include "libraw_version.h"
87 
88 #ifdef WIN32
89 	typedef __int64 INT64;
90 	typedef unsigned __int64 UINT64;
91 #else
92 #include <stdint.h>
93 	typedef int64_t INT64;
94 	typedef uint64_t UINT64;
95 #endif
96 
97   typedef unsigned char uchar;
98   typedef unsigned short ushort;
99 
100 #ifdef WIN32
101 #ifdef LIBRAW_NODLL
102 #define DllDef
103 #else
104 #ifdef LIBRAW_BUILDLIB
105 #define DllDef __declspec(dllexport)
106 #else
107 #define DllDef __declspec(dllimport)
108 #endif
109 #endif
110 #else
111 #define DllDef
112 #endif
113 
114   typedef struct
115   {
116     const char *decoder_name;
117     unsigned decoder_flags;
118   } libraw_decoder_info_t;
119 
120   typedef struct
121   {
122     unsigned mix_green;
123     unsigned raw_color;
124     unsigned zero_is_bad;
125     ushort shrink;
126     ushort fuji_width;
127   } libraw_internal_output_params_t;
128 
129   typedef void (*memory_callback)(void *data, const char *file, const char *where);
130   typedef void (*exif_parser_callback)(void *context, int tag, int type, int len, unsigned int ord, void *ifp);
131 
132   DllDef void default_memory_callback(void *data, const char *file, const char *where);
133 
134   typedef void (*data_callback)(void *data, const char *file, const int offset);
135 
136   DllDef void default_data_callback(void *data, const char *file, const int offset);
137 
138   typedef int (*progress_callback)(void *data, enum LibRaw_progress stage, int iteration, int expected);
139   typedef int (*pre_identify_callback)(void *ctx);
140   typedef void (*post_identify_callback)(void *ctx);
141   typedef void (*process_step_callback)(void *ctx);
142 
143   typedef struct
144   {
145     memory_callback mem_cb;
146     void *memcb_data;
147 
148     data_callback data_cb;
149     void *datacb_data;
150 
151     progress_callback progress_cb;
152     void *progresscb_data;
153 
154     exif_parser_callback exif_cb;
155     void *exifparser_data;
156     pre_identify_callback pre_identify_cb;
157     post_identify_callback post_identify_cb;
158     process_step_callback pre_subtractblack_cb, pre_scalecolors_cb, pre_preinterpolate_cb, pre_interpolate_cb,
159 			interpolate_bayer_cb, interpolate_xtrans_cb,
160 		     	post_interpolate_cb, pre_converttorgb_cb, post_converttorgb_cb;
161   } libraw_callbacks_t;
162 
163   typedef struct
164   {
165     enum LibRaw_image_formats type;
166     ushort height, width, colors, bits;
167     unsigned int data_size;
168     unsigned char data[1];
169   } libraw_processed_image_t;
170 
171   typedef struct
172   {
173     char guard[4];
174     char make[64];
175     char model[64];
176     char software[64];
177     unsigned raw_count;
178     unsigned dng_version;
179     unsigned is_foveon;
180     int colors;
181     unsigned filters;
182     char xtrans[6][6];
183     char xtrans_abs[6][6];
184     char cdesc[5];
185     unsigned xmplen;
186     char *xmpdata;
187 
188   } libraw_iparams_t;
189 
190   typedef struct
191   {
192     ushort cleft, ctop, cwidth, cheight;
193   } libraw_raw_crop_t;
194 
195   typedef struct
196   {
197     ushort raw_height, raw_width, height, width, top_margin, left_margin;
198     ushort iheight, iwidth;
199     unsigned raw_pitch;
200     double pixel_aspect;
201     int flip;
202     int mask[8][4];
203     libraw_raw_crop_t raw_crop;
204   } libraw_image_sizes_t;
205 
206   struct ph1_t
207   {
208     int format, key_off, tag_21a;
209     int t_black, split_col, black_col, split_row, black_row;
210     float tag_210;
211   };
212 
213   typedef struct
214   {
215     unsigned parsedfields;
216     ushort illuminant;
217     float calibration[4][4];
218     float colormatrix[4][3];
219     float forwardmatrix[3][4];
220   } libraw_dng_color_t;
221 
222   typedef struct
223   {
224     unsigned parsedfields;
225     unsigned dng_cblack[4102];
226     unsigned dng_black;
227     unsigned dng_whitelevel[4];
228     unsigned default_crop[4]; /* Origin and size */
229     unsigned preview_colorspace;
230     float analogbalance[4];
231   } libraw_dng_levels_t;
232 
233   typedef struct
234   {
235     float romm_cam[9];
236   } libraw_P1_color_t;
237 
238   typedef struct
239   {
240     int CanonColorDataVer;
241     int CanonColorDataSubVer;
242     int SpecularWhiteLevel;
243     int NormalWhiteLevel;
244     int ChannelBlackLevel[4];
245     int AverageBlackLevel;
246     /* multishot */
247     unsigned int multishot[4];
248     /* metering */
249     short MeteringMode;
250     short SpotMeteringMode;
251     uchar FlashMeteringMode;
252     short FlashExposureLock;
253     short ExposureMode;
254     short AESetting;
255     uchar HighlightTonePriority;
256     /* stabilization */
257     short ImageStabilization;
258     /* focus */
259     short FocusMode;
260     short AFPoint;
261     short FocusContinuous;
262     short AFPointsInFocus30D;
263     uchar AFPointsInFocus1D[8];
264     ushort AFPointsInFocus5D; /* bytes in reverse*/
265                               /* AFInfo */
266     ushort AFAreaMode;
267     ushort NumAFPoints;
268     ushort ValidAFPoints;
269     ushort AFImageWidth;
270     ushort AFImageHeight;
271     short AFAreaWidths[61];     /* cycle to NumAFPoints */
272     short AFAreaHeights[61];    /* --''--               */
273     short AFAreaXPositions[61]; /* --''--               */
274     short AFAreaYPositions[61]; /* --''--               */
275     short AFPointsInFocus[4];   /* cycle to floor((NumAFPoints+15)/16) */
276     short AFPointsSelected[4];  /* --''--               */
277     ushort PrimaryAFPoint;
278     /* flash */
279     short FlashMode;
280     short FlashActivity;
281     short FlashBits;
282     short ManualFlashOutput;
283     short FlashOutput;
284     short FlashGuideNumber;
285     /* drive */
286     short ContinuousDrive;
287     /* sensor */
288     short SensorWidth;
289     short SensorHeight;
290     short SensorLeftBorder;
291     short SensorTopBorder;
292     short SensorRightBorder;
293     short SensorBottomBorder;
294     short BlackMaskLeftBorder;
295     short BlackMaskTopBorder;
296     short BlackMaskRightBorder;
297     short BlackMaskBottomBorder;
298     int AFMicroAdjMode;
299     float AFMicroAdjValue;
300 
301   } libraw_canon_makernotes_t;
302 
303   typedef struct
304   {
305     int BaseISO;
306     double Gain;
307   } libraw_hasselblad_makernotes_t;
308 
309   typedef struct
310   {
311     float FujiExpoMidPointShift;
312     ushort FujiDynamicRange;
313     ushort FujiFilmMode;
314     ushort FujiDynamicRangeSetting;
315     ushort FujiDevelopmentDynamicRange;
316     ushort FujiAutoDynamicRange;
317     ushort FocusMode;
318     ushort AFMode;
319     ushort FocusPixel[2];
320     ushort ImageStabilization[3];
321     ushort FlashMode;
322     ushort WB_Preset;
323     ushort ShutterType;
324     ushort ExrMode;
325     ushort Macro;
326     unsigned Rating;
327     ushort FrameRate;
328     ushort FrameWidth;
329     ushort FrameHeight;
330   } libraw_fuji_info_t;
331 
332   typedef struct
333   {
334 
335     double ExposureBracketValue;
336     ushort ActiveDLighting;
337     ushort ShootingMode;
338     /* stabilization */
339     uchar ImageStabilization[7];
340     uchar VibrationReduction;
341     uchar VRMode;
342     /* focus */
343     char FocusMode[7];
344     uchar AFPoint;
345     ushort AFPointsInFocus;
346     uchar ContrastDetectAF;
347     uchar AFAreaMode;
348     uchar PhaseDetectAF;
349     uchar PrimaryAFPoint;
350     uchar AFPointsUsed[29];
351     ushort AFImageWidth;
352     ushort AFImageHeight;
353     ushort AFAreaXPposition;
354     ushort AFAreaYPosition;
355     ushort AFAreaWidth;
356     ushort AFAreaHeight;
357     uchar ContrastDetectAFInFocus;
358     /* flash */
359     char FlashSetting[13];
360     char FlashType[20];
361     uchar FlashExposureCompensation[4];
362     uchar ExternalFlashExposureComp[4];
363     uchar FlashExposureBracketValue[4];
364     uchar FlashMode;
365     signed char FlashExposureCompensation2;
366     signed char FlashExposureCompensation3;
367     signed char FlashExposureCompensation4;
368     uchar FlashSource;
369     uchar FlashFirmware[2];
370     uchar ExternalFlashFlags;
371     uchar FlashControlCommanderMode;
372     uchar FlashOutputAndCompensation;
373     uchar FlashFocalLength;
374     uchar FlashGNDistance;
375     uchar FlashGroupControlMode[4];
376     uchar FlashGroupOutputAndCompensation[4];
377     uchar FlashColorFilter;
378     ushort NEFCompression;
379     int ExposureMode;
380     int nMEshots;
381     int MEgainOn;
382     double ME_WB[4];
383     uchar AFFineTune;
384     uchar AFFineTuneIndex;
385     int8_t AFFineTuneAdj;
386   } libraw_nikon_makernotes_t;
387 
388   typedef struct
389   {
390     int OlympusCropID;
391     ushort OlympusFrame[4]; /* upper left XY, lower right XY */
392     int OlympusSensorCalibration[2];
393     ushort FocusMode[2];
394     ushort AutoFocus;
395     ushort AFPoint;
396     unsigned AFAreas[64];
397     double AFPointSelected[5];
398     ushort AFResult;
399     unsigned ImageStabilization;
400     ushort ColorSpace;
401     uchar AFFineTune;
402     short AFFineTuneAdj[3];
403   } libraw_olympus_makernotes_t;
404 
405   typedef struct
406   {
407 /* Compression:
408  34826 (Panasonic RAW 2): LEICA DIGILUX 2;
409  34828 (Panasonic RAW 3): LEICA D-LUX 3; LEICA V-LUX 1; Panasonic DMC-LX1; Panasonic DMC-LX2; Panasonic DMC-FZ30; Panasonic DMC-FZ50;
410  34830 (not in exiftool): LEICA DIGILUX 3; Panasonic DMC-L1;
411  34316 (Panasonic RAW 1): others (LEICA, Panasonic, YUNEEC);
412 */
413     ushort Compression;
414     ushort BlackLevelDim;
415     float BlackLevel[8];
416   } libraw_panasonic_makernotes_t;
417 
418   typedef struct
419   {
420     ushort FocusMode;
421     ushort AFPointSelected;
422     unsigned AFPointsInFocus;
423     ushort FocusPosition;
424     uchar DriveMode[4];
425     short AFAdjustment;
426     /*    uchar AFPointMode;     */
427     /*    uchar SRResult;        */
428     /*    uchar ShakeReduction;  */
429   } libraw_pentax_makernotes_t;
430 
431   typedef struct
432   {
433     ushort BlackLevelTop;
434     ushort BlackLevelBottom;
435     short offset_left, offset_top; /* KDC files, negative values or zeros */
436     ushort clipBlack, clipWhite;   /* valid for P712, P850, P880 */
437     float romm_camDaylight[3][3];
438     float romm_camTungsten[3][3];
439     float romm_camFluorescent[3][3];
440     float romm_camFlash[3][3];
441     float romm_camCustom[3][3];
442     float romm_camAuto[3][3];
443   } libraw_kodak_makernotes_t;
444 
445   typedef struct
446   {
447     ushort SonyCameraType;
448     uchar Sony0x9400_version; /* 0 if not found/deciphered, 0xa, 0xb, 0xc following exiftool convention */
449     uchar Sony0x9400_ReleaseMode2;
450     unsigned Sony0x9400_SequenceImageNumber;
451     uchar Sony0x9400_SequenceLength1;
452     unsigned Sony0x9400_SequenceFileNumber;
453     uchar Sony0x9400_SequenceLength2;
454     libraw_raw_crop_t raw_crop;
455     int8_t AFMicroAdjValue;
456     int8_t AFMicroAdjOn;
457     uchar AFMicroAdjRegisteredLenses;
458     ushort group2010;
459     ushort real_iso_offset;
460     float firmware;
461     ushort ImageCount3_offset;
462     unsigned ImageCount3;
463     unsigned ElectronicFrontCurtainShutter;
464     ushort MeteringMode2;
465     char SonyDateTime[20];
466     uchar TimeStamp[6];
467     unsigned ShotNumberSincePowerUp;
468   } libraw_sony_info_t;
469 
470   typedef struct
471   {
472     ushort curve[0x10000];
473     unsigned cblack[4102];
474     unsigned black;
475     unsigned data_maximum;
476     unsigned maximum;
477     long linear_max[4];
478     float fmaximum;
479     float fnorm;
480     ushort white[8][8];
481     float cam_mul[4];
482     float pre_mul[4];
483     float cmatrix[3][4];
484     float ccm[3][4];
485     float rgb_cam[3][4];
486     float cam_xyz[4][3];
487     struct ph1_t phase_one_data;
488     float flash_used;
489     float canon_ev;
490     char model2[64];
491     char UniqueCameraModel[64];
492     char LocalizedCameraModel[64];
493     void *profile;
494     unsigned profile_length;
495     unsigned black_stat[8];
496     libraw_dng_color_t dng_color[2];
497     libraw_dng_levels_t dng_levels;
498     float baseline_exposure;
499     int WB_Coeffs[256][4];    /* R, G1, B, G2 coeffs */
500     float WBCT_Coeffs[64][5]; /* CCT, than R, G1, B, G2 coeffs */
501     libraw_P1_color_t P1_color[2];
502   } libraw_colordata_t;
503 
504   typedef struct
505   {
506     enum LibRaw_thumbnail_formats tformat;
507     ushort twidth, theight;
508     unsigned tlength;
509     int tcolors;
510     char *thumb;
511   } libraw_thumbnail_t;
512 
513   typedef struct
514   {
515     float latitude[3];     /* Deg,min,sec */
516     float longtitude[3];   /* Deg,min,sec */
517     float gpstimestamp[3]; /* Deg,min,sec */
518     float altitude;
519     char altref, latref, longref, gpsstatus;
520     char gpsparsed;
521   } libraw_gps_info_t;
522 
523   typedef struct
524   {
525     float iso_speed;
526     float shutter;
527     float aperture;
528     float focal_len;
529     time_t timestamp;
530     unsigned shot_order;
531     unsigned gpsdata[32];
532     libraw_gps_info_t parsed_gps;
533     char desc[512], artist[64];
534     float FlashEC;
535     float FlashGN;
536     float CameraTemperature;
537     float SensorTemperature;
538     float SensorTemperature2;
539     float LensTemperature;
540     float AmbientTemperature;
541     float BatteryTemperature;
542     float exifAmbientTemperature;
543     float exifHumidity;
544     float exifPressure;
545     float exifWaterDepth;
546     float exifAcceleration;
547     float exifCameraElevationAngle;
548     float real_ISO;
549   } libraw_imgother_t;
550 
551   typedef struct
552   {
553     unsigned greybox[4];   /* -A  x1 y1 x2 y2 */
554     unsigned cropbox[4];   /* -B x1 y1 x2 y2 */
555     double aber[4];        /* -C */
556     double gamm[6];        /* -g */
557     float user_mul[4];     /* -r mul0 mul1 mul2 mul3 */
558     unsigned shot_select;  /* -s */
559     float bright;          /* -b */
560     float threshold;       /*  -n */
561     int half_size;         /* -h */
562     int four_color_rgb;    /* -f */
563     int highlight;         /* -H */
564     int use_auto_wb;       /* -a */
565     int use_camera_wb;     /* -w */
566     int use_camera_matrix; /* +M/-M */
567     int output_color;      /* -o */
568     char *output_profile;  /* -o */
569     char *camera_profile;  /* -p */
570     char *bad_pixels;      /* -P */
571     char *dark_frame;      /* -K */
572     int output_bps;        /* -4 */
573     int output_tiff;       /* -T */
574     int user_flip;         /* -t */
575     int user_qual;         /* -q */
576     int user_black;        /* -k */
577     int user_cblack[4];
578     int user_sat; /* -S */
579 
580     int med_passes; /* -m */
581     float auto_bright_thr;
582     float adjust_maximum_thr;
583     int no_auto_bright;  /* -W */
584     int use_fuji_rotate; /* -j */
585     int green_matching;
586     /* DCB parameters */
587     int dcb_iterations;
588     int dcb_enhance_fl;
589     int fbdd_noiserd;
590     int exp_correc;
591     float exp_shift;
592     float exp_preser;
593     /* Raw speed */
594     int use_rawspeed;
595     /* DNG SDK */
596     int use_dngsdk;
597     /* Disable Auto-scale */
598     int no_auto_scale;
599     /* Disable intepolation */
600     int no_interpolation;
601     /*  int x3f_flags; */
602     /* Sony ARW2 digging mode */
603     /* int sony_arw2_options; */
604     unsigned raw_processing_options;
605     int sony_arw2_posterization_thr;
606     /* Nikon Coolscan */
607     float coolscan_nef_gamma;
608     char p4shot_order[5];
609     /* Custom camera list */
610     char **custom_camera_strings;
611   } libraw_output_params_t;
612 
613   typedef struct
614   {
615     /* really allocated bitmap */
616     void *raw_alloc;
617     /* alias to single_channel variant */
618     ushort *raw_image;
619     /* alias to 4-channel variant */
620     ushort (*color4_image)[4];
621     /* alias to 3-color variand decoded by RawSpeed */
622     ushort (*color3_image)[3];
623     /* float bayer */
624     float *float_image;
625     /* float 3-component */
626     float (*float3_image)[3];
627     /* float 4-component */
628     float (*float4_image)[4];
629 
630     /* Phase One black level data; */
631     short (*ph1_cblack)[2];
632     short (*ph1_rblack)[2];
633     /* save color and sizes here, too.... */
634     libraw_iparams_t iparams;
635     libraw_image_sizes_t sizes;
636     libraw_internal_output_params_t ioparams;
637     libraw_colordata_t color;
638   } libraw_rawdata_t;
639 
640   typedef struct
641   {
642     unsigned long long LensID;
643     char Lens[128];
644     ushort LensFormat; /* to characterize the image circle the lens covers */
645     ushort LensMount;  /* 'male', lens itself */
646     unsigned long long CamID;
647     ushort CameraFormat; /* some of the sensor formats */
648     ushort CameraMount;  /* 'female', body throat */
649     char body[64];
650     short FocalType; /* -1/0 is unknown; 1 is fixed focal; 2 is zoom */
651     char LensFeatures_pre[16], LensFeatures_suf[16];
652     float MinFocal, MaxFocal;
653     float MaxAp4MinFocal, MaxAp4MaxFocal, MinAp4MinFocal, MinAp4MaxFocal;
654     float MaxAp, MinAp;
655     float CurFocal, CurAp;
656     float MaxAp4CurFocal, MinAp4CurFocal;
657     float MinFocusDistance;
658     float FocusRangeIndex;
659     float LensFStops;
660     unsigned long long TeleconverterID;
661     char Teleconverter[128];
662     unsigned long long AdapterID;
663     char Adapter[128];
664     unsigned long long AttachmentID;
665     char Attachment[128];
666     ushort CanonFocalUnits;
667     float FocalLengthIn35mmFormat;
668   } libraw_makernotes_lens_t;
669 
670   typedef struct
671   {
672     float NikonEffectiveMaxAp;
673     uchar NikonLensIDNumber, NikonLensFStops, NikonMCUVersion, NikonLensType;
674   } libraw_nikonlens_t;
675 
676   typedef struct
677   {
678     float MinFocal, MaxFocal, MaxAp4MinFocal, MaxAp4MaxFocal;
679   } libraw_dnglens_t;
680 
681   typedef struct
682   {
683     float MinFocal, MaxFocal, MaxAp4MinFocal, MaxAp4MaxFocal, EXIF_MaxAp;
684     char LensMake[128], Lens[128], LensSerial[128], InternalLensSerial[128];
685     ushort FocalLengthIn35mmFormat;
686     libraw_nikonlens_t nikon;
687     libraw_dnglens_t dng;
688     libraw_makernotes_lens_t makernotes;
689   } libraw_lensinfo_t;
690 
691   typedef struct
692   {
693     libraw_canon_makernotes_t canon;
694     libraw_nikon_makernotes_t nikon;
695     libraw_hasselblad_makernotes_t hasselblad;
696     libraw_fuji_info_t fuji;
697     libraw_olympus_makernotes_t olympus;
698     libraw_sony_info_t sony;
699     libraw_kodak_makernotes_t kodak;
700     libraw_panasonic_makernotes_t panasonic;
701     libraw_pentax_makernotes_t pentax;
702   } libraw_makernotes_t;
703 
704   typedef struct
705   {
706     short DriveMode;
707     short FocusMode;
708     short MeteringMode;
709     short AFPoint;
710     short ExposureMode;
711     short ImageStabilization;
712     char BodySerial[64];
713     char InternalBodySerial[64]; /* this may be PCB or sensor serial, depends on make/model*/
714   } libraw_shootinginfo_t;
715 
716   typedef struct
717   {
718     unsigned fsize;
719     ushort rw, rh;
720     uchar lm, tm, rm, bm, lf, cf, max, flags;
721     char t_make[10], t_model[20];
722     ushort offset;
723   } libraw_custom_camera_t;
724 
725   typedef struct
726   {
727     ushort (*image)[4];
728     libraw_image_sizes_t sizes;
729     libraw_iparams_t idata;
730     libraw_lensinfo_t lens;
731     libraw_makernotes_t makernotes;
732     libraw_shootinginfo_t shootinginfo;
733     libraw_output_params_t params;
734     unsigned int progress_flags;
735     unsigned int process_warnings;
736     libraw_colordata_t color;
737     libraw_imgother_t other;
738     libraw_thumbnail_t thumbnail;
739     libraw_rawdata_t rawdata;
740     void *parent_class;
741   } libraw_data_t;
742 
743   struct fuji_compressed_params
744   {
745     int8_t *q_table; /* quantization table */
746     int q_point[5];  /* quantization points */
747     int max_bits;
748     int min_value;
749     int raw_bits;
750     int total_values;
751     int maxDiff;
752     ushort line_width;
753   };
754 
755 #ifdef __cplusplus
756 }
757 #endif
758 
759 /* Byte order */
760 #if defined(__POWERPC__)
761 #define LibRawBigEndian 1
762 
763 #elif defined(__INTEL__)
764 #define LibRawBigEndian 0
765 
766 #elif defined(_M_IX86) || defined(__i386__)
767 #define LibRawBigEndian 0
768 
769 #elif defined(_M_X64) || defined(__amd64__) || defined(__x86_64__)
770 #define LibRawBigEndian 0
771 
772 #elif defined(__LITTLE_ENDIAN__)
773 #define LibRawBigEndian 0
774 
775 #elif defined(__BIG_ENDIAN__)
776 #define LibRawBigEndian 1
777 #elif defined(_ARM_)
778 #define LibRawBigEndian 0
779 
780 #elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
781 #define LibRawBigEndian 0
782 
783 #elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
784 #define LibRawBigEndian 1
785 #else
786 #ifndef qXCodeRez
787 #error Unable to figure out byte order.
788 #endif
789 #endif
790 
791 #endif
792