File indexing completed on 2025-01-05 03:56:45
0001 /* -*- C++ -*- 0002 * Copyright 2019-2021 LibRaw LLC (info@libraw.org) 0003 * 0004 0005 LibRaw is free software; you can redistribute it and/or modify 0006 it under the terms of the one of two licenses as you choose: 0007 0008 1. GNU LESSER GENERAL PUBLIC LICENSE version 2.1 0009 (See file LICENSE.LGPL provided in LibRaw distribution archive for details). 0010 0011 2. COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 0012 (See file LICENSE.CDDL provided in LibRaw distribution archive for details). 0013 0014 */ 0015 0016 #ifndef DCRAW_DEFS_H 0017 #define DCRAW_DEFS_H 0018 0019 #include <math.h> 0020 #define LIBRAW_LIBRARY_BUILD 0021 #define LIBRAW_IO_REDEFINED 0022 #include "libraw/libraw.h" 0023 #include "libraw/libraw_types.h" 0024 #include "internal/defines.h" 0025 #include "internal/var_defines.h" 0026 0027 #define stmread(buf, maxlen, fp) stread(buf, MIN(maxlen, sizeof(buf)), fp) 0028 #define strbuflen(buf) strnlen(buf, sizeof(buf) - 1) 0029 #define makeIs(idx) (maker_index == idx) 0030 #define strnXcat(buf, string) \ 0031 strncat(buf, string, LIM(sizeof(buf) - strbuflen(buf) - 1, 0, sizeof(buf))) 0032 0033 // DNG was written by: 0034 #define nonDNG 0 0035 #define CameraDNG 1 0036 #define AdobeDNG 2 0037 0038 // Makernote tag type: 0039 #define is_0x927c 0 /* most cameras */ 0040 #define is_0xc634 2 /* Adobe DNG, Sony SR2, Pentax */ 0041 0042 // abbreviations 0043 #define ilm imgdata.lens.makernotes 0044 #define icWBC imgdata.color.WB_Coeffs 0045 #define icWBCCTC imgdata.color.WBCT_Coeffs 0046 #define imCanon imgdata.makernotes.canon 0047 #define imFuji imgdata.makernotes.fuji 0048 #define imHassy imgdata.makernotes.hasselblad 0049 #define imKodak imgdata.makernotes.kodak 0050 #define imNikon imgdata.makernotes.nikon 0051 #define imOly imgdata.makernotes.olympus 0052 #define imPana imgdata.makernotes.panasonic 0053 #define imPentax imgdata.makernotes.pentax 0054 #define imPhaseOne imgdata.makernotes.phaseone 0055 #define imRicoh imgdata.makernotes.ricoh 0056 #define imSamsung imgdata.makernotes.samsung 0057 #define imSony imgdata.makernotes.sony 0058 #define imCommon imgdata.makernotes.common 0059 0060 0061 #define ph1_bits(n) ph1_bithuff(n, 0) 0062 #define ph1_huff(h) ph1_bithuff(*h, h + 1) 0063 #define getbits(n) getbithuff(n, 0) 0064 #define gethuff(h) getbithuff(*h, h + 1) 0065 0066 #endif