PageRenderTime 89ms CodeModel.GetById 50ms app.highlight 34ms RepoModel.GetById 2ms app.codeStats 0ms

/src/FreeImage/Source/LibRawLite/internal/libraw_internal_funcs.h

https://bitbucket.org/cabalistic/ogredeps/
C++ Header | 241 lines | 172 code | 26 blank | 43 comment | 0 complexity | dafc9c1fa570ad5b8a0eb01184cbf876 MD5 | raw file
  1/* -*- C++ -*-
  2 * File: libraw_internal_funcs.h
  3 * Copyright 2008-2009 LibRaw LLC (info@libraw.org)
  4 * Created: Sat Mar  14, 2008
  5
  6LibRaw is free software; you can redistribute it and/or modify
  7it under the terms of the one of three licenses as you choose:
  8
  91. GNU LESSER GENERAL PUBLIC LICENSE version 2.1
 10   (See file LICENSE.LGPL provided in LibRaw distribution archive for details).
 11
 122. COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
 13   (See file LICENSE.CDDL provided in LibRaw distribution archive for details).
 14
 153. LibRaw Software License 27032010
 16   (See file LICENSE.LibRaw.pdf provided in LibRaw distribution archive for details).
 17
 18 */
 19
 20#ifndef _LIBRAW_INTERNAL_FUNCS_H
 21#define _LIBRAW_INTERNAL_FUNCS_H
 22
 23#ifndef LIBRAW_LIBRARY_BUILD
 24#error "This file should be used only for libraw library build"
 25#else
 26// inline functions
 27    ushort      sget2 (uchar *s);
 28    ushort      get2();
 29    unsigned    sget4 (uchar *s);
 30    unsigned    getint (int type);
 31    float       int_to_float (int i);
 32    double      getreal (int type);
 33    void        read_shorts (ushort *pixel, int count);
 34
 35// Canon P&S cameras
 36    void        canon_600_fixed_wb (int temp);
 37    int         canon_600_color (int ratio[2], int mar);
 38    void        canon_600_auto_wb();
 39    void        canon_600_coeff();
 40    void        canon_600_load_raw();
 41    int         canon_s2is();
 42    void        parse_ciff (int offset, int length);
 43    void        ciff_block_1030();
 44
 45// LJPEG decoder
 46    unsigned    getbithuff (int nbits, ushort *huff);
 47    ushort*     make_decoder_ref (const uchar **source);
 48    ushort*     make_decoder (const uchar *source);
 49    int         ljpeg_start (struct jhead *jh, int info_only);
 50    void        ljpeg_end(struct jhead *jh);
 51    int         ljpeg_diff (ushort *huff); 
 52    int         ljpeg_diff_new (LibRaw_bit_buffer& bits, LibRaw_byte_buffer* buf,ushort *huff);
 53    int         ljpeg_diff_pef (LibRaw_bit_buffer& bits, LibRaw_byte_buffer* buf,ushort *huff);
 54    ushort *    ljpeg_row (int jrow, struct jhead *jh);
 55    ushort *    ljpeg_row_new (int jrow, struct jhead *jh, LibRaw_bit_buffer& bits,LibRaw_byte_buffer* bytes);
 56
 57    unsigned    ph1_bithuff (int nbits, ushort *huff);
 58
 59// Canon DSLRs
 60void        crw_init_tables (unsigned table, ushort *huff[2]);
 61    int         canon_has_lowbits();
 62    void        canon_compressed_load_raw();
 63    void        lossless_jpeg_load_raw();
 64    void        canon_sraw_load_raw();
 65// Adobe DNG
 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();
 69
 70// Pentax
 71    void        pentax_load_raw();
 72    void        pentax_tree();
 73
 74// Nikon (and Minolta Z2)
 75    void        nikon_compressed_load_raw();
 76    void        nikon_load_raw();
 77    int         nikon_is_compressed();
 78    int         nikon_e995();
 79    int         nikon_e2100();
 80    void        nikon_3700();
 81    int         minolta_z2();
 82    void        nikon_e2100_load_raw();
 83
 84// Fuji
 85    void        fuji_load_raw();
 86    void        parse_fuji (int offset);
 87
 88// RedCine
 89    void        parse_redcine();
 90    void        redcine_load_raw();
 91
 92// Rollei
 93    void        rollei_load_raw();
 94    void        parse_rollei();
 95
 96// MF backs
 97    int         bayer (unsigned row, unsigned col);
 98    void        phase_one_flat_field (int is_float, int nc);
 99    void        phase_one_correct();
100    void        phase_one_load_raw();
101    unsigned    ph1_bits (int nbits);
102    void        phase_one_load_raw_c();
103    void        hasselblad_load_raw();
104    void        leaf_hdr_load_raw();
105    void        sinar_4shot_load_raw();
106    void        imacon_full_load_raw();
107    void        packed_load_raw();
108    float	find_green(int,int,int,int);
109    void        unpacked_load_raw();
110    void        parse_sinar_ia();
111    void        parse_phase_one (int base);
112
113// Misc P&S cameras
114    void        nokia_load_raw();
115    unsigned    pana_bits (int nbits);
116    void        panasonic_load_raw();
117    void        olympus_load_raw();
118    void        olympus_cseries_load_raw();
119    void        minolta_rd175_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();
132    void        parse_riff();
133    void        parse_cine();
134    void        parse_smal (int offset, int fsize);
135    int         parse_jpeg (int offset);
136
137// Kodak
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();
143    void        kodak_ycbcr_load_raw();
144    void        kodak_rgb_load_thumb();
145    void        kodak_ycbcr_load_thumb();
146
147// It's a Sony (and K&M)
148    void        sony_decrypt (unsigned *data, int len, int start, int key);
149    void        sony_load_raw();
150    void        sony_arw_load_raw();
151    void        sony_arw2_load_raw();
152    void        parse_minolta (int base);
153
154// Foveon/Sigma
155    void        foveon_load_camf();
156    void        foveon_load_raw();
157    const char* foveon_camf_param (const char *block, const char *param);
158    void *      foveon_camf_matrix (unsigned dim[3], const char *name);
159    int         foveon_fixed (void *ptr, int size, const char *name);
160    float       foveon_avg (short *pix, int range[2], float cfilt);
161    short *     foveon_make_curve (double max, double mul, double filt);
162    void        foveon_make_curves(short **curvep, float dq[3], float div[3], float filt);
163    int         foveon_apply_curve (short *curve, int i);
164    void        foveon_interpolate();
165    char *      foveon_gets (int offset, char *str, int len);
166    void        parse_foveon();
167
168// CAM/RGB
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);
173
174
175// Tiff/Exif parsers
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    int         parse_tiff (int base);
184    void        apply_tiff(void);
185    void        parse_gps (int base);
186    void        romm_coeff (float romm_cam[3][3]);
187    void        parse_mos (int offset);
188    void        get_timestamp (int reversed);
189
190// External JPEGs, what cameras uses it ?
191    void        parse_external_jpeg();
192
193// The identify
194    short       guess_byte_order (int words);
195
196// Tiff writer
197    void        tiff_set (ushort *ntag, ushort tag, ushort type, int count, int val);
198    void        tiff_head (struct tiff_hdr *th, int full);
199
200// splitted AHD code
201#define TS 256
202    void        ahd_interpolate_green_h_and_v(int top, int left, ushort (*out_rgb)[TS][TS][3]);
203    void ahd_interpolate_r_and_b_in_rgb_and_convert_to_cielab(int top, int left, ushort (*inout_rgb)[TS][3], short (*out_lab)[TS][3], const float (&xyz_cam)[3][4]);
204    void ahd_interpolate_r_and_b_and_convert_to_cielab(int top, int left, ushort (*inout_rgb)[TS][TS][3], short (*out_lab)[TS][TS][3], const float (&xyz_cam)[3][4]);
205    void ahd_interpolate_build_homogeneity_map(int top, int left, short (*lab)[TS][TS][3], char (*out_homogeneity_map)[TS][2]);
206    void ahd_interpolate_combine_homogeneous_pixels(int top, int left, ushort (*rgb)[TS][TS][3], char (*homogeneity_map)[TS][2]);
207
208#undef TS
209
210// LibRaw demosaic packs  functions
211// AMaZe
212    int         LinEqSolve(int,  float*, float*, float*);
213// DCB
214    void        dcb_pp();
215    void        dcb_copy_to_buffer(float (*image2)[3]);
216    void        dcb_restore_from_buffer(float (*image2)[3]);
217    void        dcb_color();
218    void        dcb_color_full();
219    void        dcb_map();
220    void        dcb_correction();
221    void        dcb_correction2();
222    void        dcb_refinement();
223    void        rgb_to_lch(double (*image3)[3]);
224    void        lch_to_rgb(double (*image3)[3]);
225    void        fbdd_correction();
226    void        fbdd_correction2(double (*image3)[3]);
227    void        fbdd_green();
228    void  	dcb_ver(float (*image3)[3]);
229    void 	dcb_hor(float (*image2)[3]);
230    void 	dcb_color2(float (*image2)[3]);
231    void 	dcb_color3(float (*image3)[3]);
232    void 	dcb_decide(float (*image2)[3], float (*image3)[3]);
233    void 	dcb_nyquist();
234// VCD/modified dcraw
235    void        refinement();
236    void        ahd_partial_interpolate(int threshold_value);
237    void        es_median_filter();
238    void        median_filter_new();
239#endif
240
241#endif