/src/libraw/internal/dcraw_defs.h
Line | Count | Source |
1 | | /* -*- C++ -*- |
2 | | * Copyright 2019-2025 LibRaw LLC (info@libraw.org) |
3 | | * |
4 | | |
5 | | LibRaw is free software; you can redistribute it and/or modify |
6 | | it under the terms of the one of two licenses as you choose: |
7 | | |
8 | | 1. GNU LESSER GENERAL PUBLIC LICENSE version 2.1 |
9 | | (See file LICENSE.LGPL provided in LibRaw distribution archive for details). |
10 | | |
11 | | 2. COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 |
12 | | (See file LICENSE.CDDL provided in LibRaw distribution archive for details). |
13 | | |
14 | | */ |
15 | | |
16 | | #ifndef DCRAW_DEFS_H |
17 | | #define DCRAW_DEFS_H |
18 | | |
19 | | #include <math.h> |
20 | | #define LIBRAW_LIBRARY_BUILD |
21 | | #define LIBRAW_IO_REDEFINED |
22 | | #include "libraw/libraw.h" |
23 | | #include "libraw/libraw_types.h" |
24 | | #include "internal/defines.h" |
25 | | #include "internal/var_defines.h" |
26 | | |
27 | 76.6k | #define stmread(buf, maxlen, fp) stread(buf, MIN(maxlen, sizeof(buf)), fp) |
28 | 40.5k | #define strbuflen(buf) strnlen(buf, sizeof(buf) - 1) |
29 | 1.01M | #define makeIs(idx) (maker_index == idx) |
30 | | #define strnXcat(buf, string) \ |
31 | 19.1k | strncat(buf, string, LIM(sizeof(buf) - strbuflen(buf) - 1, 0, sizeof(buf))) |
32 | | |
33 | | // DNG was written by: |
34 | 18.0M | #define nonDNG 0 |
35 | 804k | #define CameraDNG 1 |
36 | 1.58M | #define AdobeDNG 2 |
37 | | |
38 | | // Makernote tag type: |
39 | 19.7k | #define is_0x927c 0 /* most cameras */ |
40 | 223 | #define is_0xc634 2 /* Adobe DNG, Sony SR2, Pentax */ |
41 | | |
42 | | // abbreviations |
43 | 2.76M | #define ilm imgdata.lens.makernotes |
44 | 3.09M | #define icWBC imgdata.color.WB_Coeffs |
45 | 2.04M | #define icWBCCTC imgdata.color.WBCT_Coeffs |
46 | 1.50M | #define imCanon imgdata.makernotes.canon |
47 | 1.35M | #define imFuji imgdata.makernotes.fuji |
48 | 98.3k | #define imHassy imgdata.makernotes.hasselblad |
49 | 15.1M | #define imKodak imgdata.makernotes.kodak |
50 | 343k | #define imNikon imgdata.makernotes.nikon |
51 | 374k | #define imOly imgdata.makernotes.olympus |
52 | 14.4k | #define imPana imgdata.makernotes.panasonic |
53 | 59.7k | #define imPentax imgdata.makernotes.pentax |
54 | 2.25k | #define imPhaseOne imgdata.makernotes.phaseone |
55 | 17.1k | #define imRicoh imgdata.makernotes.ricoh |
56 | 48.8k | #define imSamsung imgdata.makernotes.samsung |
57 | 1.77M | #define imSony imgdata.makernotes.sony |
58 | 1.92M | #define imCommon imgdata.makernotes.common |
59 | | |
60 | | |
61 | 241M | #define ph1_bits(n) ph1_bithuff(n, 0) |
62 | 107M | #define ph1_huff(h) ph1_bithuff(*h, h + 1) |
63 | 293M | #define getbits(n) getbithuff(n, 0) |
64 | 293M | #define gethuff(h) getbithuff(*h, h + 1) |
65 | | |
66 | | #endif |