dcraw_defs.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /* -*- C++ -*-
  2. * Copyright 2019-2021 LibRaw LLC ([email protected])
  3. *
  4. LibRaw is free software; you can redistribute it and/or modify
  5. it under the terms of the one of two licenses as you choose:
  6. 1. GNU LESSER GENERAL PUBLIC LICENSE version 2.1
  7. (See file LICENSE.LGPL provided in LibRaw distribution archive for details).
  8. 2. COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
  9. (See file LICENSE.CDDL provided in LibRaw distribution archive for details).
  10. */
  11. #ifndef DCRAW_DEFS_H
  12. #define DCRAW_DEFS_H
  13. #include <math.h>
  14. #define LIBRAW_LIBRARY_BUILD
  15. #define LIBRAW_IO_REDEFINED
  16. #include "libraw/libraw.h"
  17. #include "libraw/libraw_types.h"
  18. #include "internal/defines.h"
  19. #include "internal/var_defines.h"
  20. #define stmread(buf, maxlen, fp) stread(buf, MIN(maxlen, sizeof(buf)), fp)
  21. #define strbuflen(buf) strnlen(buf, sizeof(buf) - 1)
  22. #define makeIs(idx) (maker_index == idx)
  23. #define strnXcat(buf, string) \
  24. strncat(buf, string, LIM(sizeof(buf) - strbuflen(buf) - 1, 0, sizeof(buf)))
  25. // DNG was written by:
  26. #define nonDNG 0
  27. #define CameraDNG 1
  28. #define AdobeDNG 2
  29. // Makernote tag type:
  30. #define is_0x927c 0 /* most cameras */
  31. #define is_0xc634 2 /* Adobe DNG, Sony SR2, Pentax */
  32. // abbreviations
  33. #define ilm imgdata.lens.makernotes
  34. #define icWBC imgdata.color.WB_Coeffs
  35. #define icWBCCTC imgdata.color.WBCT_Coeffs
  36. #define imCanon imgdata.makernotes.canon
  37. #define imFuji imgdata.makernotes.fuji
  38. #define imHassy imgdata.makernotes.hasselblad
  39. #define imKodak imgdata.makernotes.kodak
  40. #define imNikon imgdata.makernotes.nikon
  41. #define imOly imgdata.makernotes.olympus
  42. #define imPana imgdata.makernotes.panasonic
  43. #define imPentax imgdata.makernotes.pentax
  44. #define imPhaseOne imgdata.makernotes.phaseone
  45. #define imRicoh imgdata.makernotes.ricoh
  46. #define imSamsung imgdata.makernotes.samsung
  47. #define imSony imgdata.makernotes.sony
  48. #define imCommon imgdata.makernotes.common
  49. #define ph1_bits(n) ph1_bithuff(n, 0)
  50. #define ph1_huff(h) ph1_bithuff(*h, h + 1)
  51. #define getbits(n) getbithuff(n, 0)
  52. #define gethuff(h) getbithuff(*h, h + 1)
  53. #endif