/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. LibRaw is free software; you can redistribute it and/or modify
  6. it under the terms of the one of three licenses as you choose:
  7. 1. GNU LESSER GENERAL PUBLIC LICENSE version 2.1
  8. (See file LICENSE.LGPL provided in LibRaw distribution archive for details).
  9. 2. COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
  10. (See file LICENSE.CDDL provided in LibRaw distribution archive for details).
  11. 3. LibRaw Software License 27032010
  12. (See file LICENSE.LibRaw.pdf provided in LibRaw distribution archive for details).
  13. */
  14. #ifndef _LIBRAW_INTERNAL_FUNCS_H
  15. #define _LIBRAW_INTERNAL_FUNCS_H
  16. #ifndef LIBRAW_LIBRARY_BUILD
  17. #error "This file should be used only for libraw library build"
  18. #else
  19. // inline functions
  20. ushort sget2 (uchar *s);
  21. ushort get2();
  22. unsigned sget4 (uchar *s);
  23. unsigned getint (int type);
  24. float int_to_float (int i);
  25. double getreal (int type);
  26. void read_shorts (ushort *pixel, int count);
  27. // Canon P&S cameras
  28. void canon_600_fixed_wb (int temp);
  29. int canon_600_color (int ratio[2], int mar);
  30. void canon_600_auto_wb();
  31. void canon_600_coeff();
  32. void canon_600_load_raw();
  33. int canon_s2is();
  34. void parse_ciff (int offset, int length);
  35. void ciff_block_1030();
  36. // LJPEG decoder
  37. unsigned getbithuff (int nbits, ushort *huff);
  38. ushort* make_decoder_ref (const uchar **source);
  39. ushort* make_decoder (const uchar *source);
  40. int ljpeg_start (struct jhead *jh, int info_only);
  41. void ljpeg_end(struct jhead *jh);
  42. int ljpeg_diff (ushort *huff);
  43. int ljpeg_diff_new (LibRaw_bit_buffer& bits, LibRaw_byte_buffer* buf,ushort *huff);
  44. int ljpeg_diff_pef (LibRaw_bit_buffer& bits, LibRaw_byte_buffer* buf,ushort *huff);
  45. ushort * ljpeg_row (int jrow, struct jhead *jh);
  46. ushort * ljpeg_row_new (int jrow, struct jhead *jh, LibRaw_bit_buffer& bits,LibRaw_byte_buffer* bytes);
  47. unsigned ph1_bithuff (int nbits, ushort *huff);
  48. // Canon DSLRs
  49. void crw_init_tables (unsigned table, ushort *huff[2]);
  50. int canon_has_lowbits();
  51. void canon_compressed_load_raw();
  52. void lossless_jpeg_load_raw();
  53. void canon_sraw_load_raw();
  54. // Adobe DNG
  55. void adobe_copy_pixel (int row, int col, ushort **rp);
  56. void adobe_dng_load_raw_lj();
  57. void adobe_dng_load_raw_nc();
  58. // Pentax
  59. void pentax_load_raw();
  60. void pentax_tree();
  61. // Nikon (and Minolta Z2)
  62. void nikon_compressed_load_raw();
  63. void nikon_load_raw();
  64. int nikon_is_compressed();
  65. int nikon_e995();
  66. int nikon_e2100();
  67. void nikon_3700();
  68. int minolta_z2();
  69. void nikon_e2100_load_raw();
  70. // Fuji
  71. void fuji_load_raw();
  72. void parse_fuji (int offset);
  73. // RedCine
  74. void parse_redcine();
  75. void redcine_load_raw();
  76. // Rollei
  77. void rollei_load_raw();
  78. void parse_rollei();
  79. // MF backs
  80. int bayer (unsigned row, unsigned col);
  81. void phase_one_flat_field (int is_float, int nc);
  82. void phase_one_correct();
  83. void phase_one_load_raw();
  84. unsigned ph1_bits (int nbits);
  85. void phase_one_load_raw_c();
  86. void hasselblad_load_raw();
  87. void leaf_hdr_load_raw();
  88. void sinar_4shot_load_raw();
  89. void imacon_full_load_raw();
  90. void packed_load_raw();
  91. float find_green(int,int,int,int);
  92. void unpacked_load_raw();
  93. void parse_sinar_ia();
  94. void parse_phase_one (int base);
  95. // Misc P&S cameras
  96. void nokia_load_raw();
  97. unsigned pana_bits (int nbits);
  98. void panasonic_load_raw();
  99. void olympus_load_raw();
  100. void olympus_cseries_load_raw();
  101. void minolta_rd175_load_raw();
  102. void quicktake_100_load_raw();
  103. const int* make_decoder_int (const int *source, int level);
  104. int radc_token (int tree);
  105. void kodak_radc_load_raw();
  106. void kodak_jpeg_load_raw();
  107. void kodak_dc120_load_raw();
  108. void eight_bit_load_raw();
  109. void smal_decode_segment (unsigned seg[2][2], int holes);
  110. void smal_v6_load_raw();
  111. int median4 (int *p);
  112. void fill_holes (int holes);
  113. void smal_v9_load_raw();
  114. void parse_riff();
  115. void parse_cine();
  116. void parse_smal (int offset, int fsize);
  117. int parse_jpeg (int offset);
  118. // Kodak
  119. void kodak_262_load_raw();
  120. int kodak_65000_decode (short *out, int bsize);
  121. void kodak_65000_load_raw();
  122. void kodak_rgb_load_raw();
  123. void kodak_yrgb_load_raw();
  124. void kodak_ycbcr_load_raw();
  125. void kodak_rgb_load_thumb();
  126. void kodak_ycbcr_load_thumb();
  127. // It's a Sony (and K&M)
  128. void sony_decrypt (unsigned *data, int len, int start, int key);
  129. void sony_load_raw();
  130. void sony_arw_load_raw();
  131. void sony_arw2_load_raw();
  132. void parse_minolta (int base);
  133. // Foveon/Sigma
  134. void foveon_load_camf();
  135. void foveon_load_raw();
  136. const char* foveon_camf_param (const char *block, const char *param);
  137. void * foveon_camf_matrix (unsigned dim[3], const char *name);
  138. int foveon_fixed (void *ptr, int size, const char *name);
  139. float foveon_avg (short *pix, int range[2], float cfilt);
  140. short * foveon_make_curve (double max, double mul, double filt);
  141. void foveon_make_curves(short **curvep, float dq[3], float div[3], float filt);
  142. int foveon_apply_curve (short *curve, int i);
  143. void foveon_interpolate();
  144. char * foveon_gets (int offset, char *str, int len);
  145. void parse_foveon();
  146. // CAM/RGB
  147. void pseudoinverse (double (*in)[3], double (*out)[3], int size);
  148. void cam_xyz_coeff (double cam_xyz[4][3]);
  149. void adobe_coeff (const char *, const char *);
  150. void simple_coeff (int index);
  151. // Tiff/Exif parsers
  152. void tiff_get (unsigned base,unsigned *tag, unsigned *type, unsigned *len, unsigned *save);
  153. void parse_thumb_note (int base, unsigned toff, unsigned tlen);
  154. void parse_makernote (int base, int uptag);
  155. void parse_exif (int base);
  156. void linear_table (unsigned len);
  157. void parse_kodak_ifd (int base);
  158. int parse_tiff_ifd (int base);
  159. int parse_tiff (int base);
  160. void apply_tiff(void);
  161. void parse_gps (int base);
  162. void romm_coeff (float romm_cam[3][3]);
  163. void parse_mos (int offset);
  164. void get_timestamp (int reversed);
  165. // External JPEGs, what cameras uses it ?
  166. void parse_external_jpeg();
  167. // The identify
  168. short guess_byte_order (int words);
  169. // Tiff writer
  170. void tiff_set (ushort *ntag, ushort tag, ushort type, int count, int val);
  171. void tiff_head (struct tiff_hdr *th, int full);
  172. // splitted AHD code
  173. #define TS 256
  174. void ahd_interpolate_green_h_and_v(int top, int left, ushort (*out_rgb)[TS][TS][3]);
  175. 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]);
  176. 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]);
  177. void ahd_interpolate_build_homogeneity_map(int top, int left, short (*lab)[TS][TS][3], char (*out_homogeneity_map)[TS][2]);
  178. void ahd_interpolate_combine_homogeneous_pixels(int top, int left, ushort (*rgb)[TS][TS][3], char (*homogeneity_map)[TS][2]);
  179. #undef TS
  180. // LibRaw demosaic packs functions
  181. // AMaZe
  182. int LinEqSolve(int, float*, float*, float*);
  183. // DCB
  184. void dcb_pp();
  185. void dcb_copy_to_buffer(float (*image2)[3]);
  186. void dcb_restore_from_buffer(float (*image2)[3]);
  187. void dcb_color();
  188. void dcb_color_full();
  189. void dcb_map();
  190. void dcb_correction();
  191. void dcb_correction2();
  192. void dcb_refinement();
  193. void rgb_to_lch(double (*image3)[3]);
  194. void lch_to_rgb(double (*image3)[3]);
  195. void fbdd_correction();
  196. void fbdd_correction2(double (*image3)[3]);
  197. void fbdd_green();
  198. void dcb_ver(float (*image3)[3]);
  199. void dcb_hor(float (*image2)[3]);
  200. void dcb_color2(float (*image2)[3]);
  201. void dcb_color3(float (*image3)[3]);
  202. void dcb_decide(float (*image2)[3], float (*image3)[3]);
  203. void dcb_nyquist();
  204. // VCD/modified dcraw
  205. void refinement();
  206. void ahd_partial_interpolate(int threshold_value);
  207. void es_median_filter();
  208. void median_filter_new();
  209. #endif
  210. #endif