2 * File: libraw_internal_funcs.h
3 * Copyright 2008 Alex Tutubalin <lexa@lexa.ru>
4 * Created: Sat Mar 14, 2008
6 * LibRaw internal data structures (not visible outside)
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2, or (at your option)
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
24 #ifndef _LIBRAW_INTERNAL_FUNCS_H
25 #define _LIBRAW_INTERNAL_FUNCS_H
27 #ifndef LIBRAW_LIBRARY_BUILD
28 #error "This file should be used only for libraw library build"
31 ushort
sget2 (uchar
*s
);
33 unsigned sget4 (uchar
*s
);
34 unsigned getint (int type
);
35 float int_to_float (int i
);
36 double getreal (int type
);
37 void read_shorts (ushort
*pixel
, int count
);
40 void canon_600_fixed_wb (int temp
);
41 int canon_600_color (int ratio
[2], int mar
);
42 void canon_600_auto_wb();
43 void canon_600_coeff();
44 void canon_600_load_raw();
46 void canon_a5_load_raw();
47 void parse_ciff (int offset
, int length
);
48 void ciff_block_1030();
51 unsigned getbits (int nbits
);
53 uchar
* make_decoder (const uchar
*source
, int level
);
54 int ljpeg_start (struct jhead
*jh
, int info_only
);
55 int ljpeg_diff (struct decode
*dindex
);
56 ushort
* ljpeg_row (int jrow
, struct jhead
*jh
);
59 void crw_init_tables (unsigned table
);
60 int canon_has_lowbits();
61 void canon_compressed_load_raw();
62 void lossless_jpeg_load_raw();
63 void canon_sraw_load_raw();
64 void canon_black(double *);
66 void adobe_copy_pixel (int row
, int col
, ushort
**rp
);
67 void adobe_dng_load_raw_lj();
68 void adobe_dng_load_raw_nc();
71 void pentax_k10_load_raw();
73 // Nikon (and Minolta Z2)
74 void nikon_compressed_load_raw();
75 void nikon_load_raw();
76 int nikon_is_compressed();
81 void nikon_e900_load_raw();
82 void nikon_e2100_load_raw();
86 void parse_fuji (int offset
);
92 void rollei_load_raw();
96 int bayer (unsigned row
, unsigned col
);
97 void phase_one_flat_field (int is_float
, int nc
);
98 void phase_one_correct();
99 void phase_one_load_raw();
100 unsigned ph1_bits (int nbits
);
101 void phase_one_load_raw_c();
102 void hasselblad_load_raw();
103 void leaf_hdr_load_raw();
104 void sinar_4shot_load_raw();
105 void imacon_full_load_raw();
106 void packed_12_load_raw();
107 void unpacked_load_raw();
108 void parse_sinar_ia();
109 void parse_phase_one (int base
);
112 void nokia_load_raw();
113 unsigned pana_bits (int nbits
);
114 void panasonic_load_raw();
115 void olympus_e300_load_raw();
116 void olympus_e410_load_raw();
117 void olympus_cseries_load_raw();
118 void minolta_rd175_load_raw();
119 void casio_qv5700_load_raw();
120 void quicktake_100_load_raw();
121 const int* make_decoder_int (const int *source
, int level
);
122 int radc_token (int tree
);
123 void kodak_radc_load_raw();
124 void kodak_jpeg_load_raw();
125 void kodak_dc120_load_raw();
126 void eight_bit_load_raw();
127 void smal_decode_segment (unsigned seg
[2][2], int holes
);
128 void smal_v6_load_raw();
129 int median4 (int *p
);
130 void fill_holes (int holes
);
131 void smal_v9_load_raw();
134 void parse_smal (int offset
, int fsize
);
135 int parse_jpeg (int offset
);
138 void kodak_262_load_raw();
139 int kodak_65000_decode (short *out
, int bsize
);
140 void kodak_65000_load_raw();
141 void kodak_rgb_load_raw();
142 void kodak_yrgb_load_raw();
144 // It's a Sony (and K&M)
145 void sony_decrypt (unsigned *data
, int len
, int start
, int key
);
146 void sony_load_raw();
147 void sony_arw_load_raw();
148 void sony_arw2_load_raw();
149 void parse_minolta (int base
);
153 void foveon_load_camf();
154 void foveon_load_raw();
155 const char* foveon_camf_param (const char *block
, const char *param
);
156 void * foveon_camf_matrix (unsigned dim
[3], const char *name
);
157 int foveon_fixed (void *ptr
, int size
, const char *name
);
158 float foveon_avg (short *pix
, int range
[2], float cfilt
);
159 short * foveon_make_curve (double max
, double mul
, double filt
);
160 void foveon_make_curves(short **curvep
, float dq
[3], float div
[3], float filt
);
161 int foveon_apply_curve (short *curve
, int i
);
162 void foveon_interpolate();
163 char * foveon_gets (int offset
, char *str
, int len
);
169 void pseudoinverse (double (*in
)[3], double (*out
)[3], int size
);
170 void cam_xyz_coeff (double cam_xyz
[4][3]);
171 void adobe_coeff (const char *, const char *);
172 void simple_coeff (int index
);
176 void tiff_get (unsigned base
,unsigned *tag
, unsigned *type
, unsigned *len
, unsigned *save
);
177 void parse_thumb_note (int base
, unsigned toff
, unsigned tlen
);
178 void parse_makernote (int base
, int uptag
);
179 void parse_exif (int base
);
180 void linear_table (unsigned len
);
181 void parse_kodak_ifd (int base
);
182 int parse_tiff_ifd (int base
);
183 void parse_tiff (int base
);
184 void parse_gps (int base
);
185 void romm_coeff (float romm_cam
[3][3]);
186 void parse_mos (int offset
);
187 void get_timestamp (int reversed
);
189 // External JPEGs, what cameras uses it ?
190 void parse_external_jpeg();
193 short guess_byte_order (int words
);
196 void tiff_set (ushort
*ntag
, ushort tag
, ushort type
, int count
, int val
);
197 void tiff_head (struct tiff_hdr
*th
, int full
);