"Fossies" - the Fresh Open Source Software Archive

Member "digikam-6.3.0/core/libs/rawengine/libraw/libraw/libraw_const.h" (4 Sep 2019, 10533 Bytes) of package /linux/misc/digikam-6.3.0.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "libraw_const.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 6.2.0_vs_6.3.0.

    1 /* -*- C++ -*-
    2  * File: libraw_const.h
    3  * Copyright 2008-2019 LibRaw LLC (info@libraw.org)
    4  * Created: Sat Mar  8 , 2008
    5  * LibRaw error codes
    6 LibRaw is free software; you can redistribute it and/or modify
    7 it under the terms of the one of two licenses as you choose:
    8 
    9 1. GNU LESSER GENERAL PUBLIC LICENSE version 2.1
   10    (See file LICENSE.LGPL provided in LibRaw distribution archive for details).
   11 
   12 2. COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
   13    (See file LICENSE.CDDL provided in LibRaw distribution archive for details).
   14 
   15  */
   16 
   17 #ifndef _LIBRAW_ERRORS_H
   18 #define _LIBRAW_ERRORS_H
   19 
   20 #define LIBRAW_DEFAULT_ADJUST_MAXIMUM_THRESHOLD 0.75
   21 #define LIBRAW_DEFAULT_AUTO_BRIGHTNESS_THRESHOLD 0.01
   22 /* limit allocation size, default is 2Gb */
   23 #ifndef LIBRAW_MAX_ALLOC_MB
   24 #define LIBRAW_MAX_ALLOC_MB 2048L
   25 #endif
   26 
   27 /* Change to non-zero to allow (broken) CRW (and other) files metadata 
   28    loop prevention */
   29 #ifndef LIBRAW_METADATA_LOOP_PREVENTION
   30 #define LIBRAW_METADATA_LOOP_PREVENTION 0
   31 #endif
   32 
   33 /* Check if enough file space exists before tag read */
   34 #ifndef LIBRAW_NO_IOSPACE_CHECK
   35 #define LIBRAW_IOSPACE_CHECK
   36 #endif
   37 /* LibRaw uses own memory pool management, with LIBRAW_MSIZE (512)
   38 entries. It is enough for parsing/decoding non-damaged files, but
   39 may overflow on specially crafted files (eg. with many string values
   40 like XMP blocks.
   41 LIBRAW_MEMPOOL_CHECK define will result in error on pool overflow */
   42 #ifndef LIBRAW_NO_MEMPOOL_CHECK
   43 #define LIBRAW_MEMPOOL_CHECK
   44 #endif
   45 
   46 #define LIBRAW_IFD_MAXCOUNT 10
   47 #define LIBRAW_MAX_METADATA_BLOCKS 1024
   48 
   49 enum LibRaw_openbayer_patterns
   50 {
   51   LIBRAW_OPENBAYER_RGGB = 0x94,
   52   LIBRAW_OPENBAYER_BGGR = 0x16,
   53   LIBRAW_OPENBAYER_GRBG = 0x61,
   54   LIBRAW_OPENBAYER_GBRG = 0x49
   55 };
   56 
   57 enum LibRaw_dngfields_marks
   58 {
   59   LIBRAW_DNGFM_FORWARDMATRIX = 1,
   60   LIBRAW_DNGFM_ILLUMINANT = 2,
   61   LIBRAW_DNGFM_COLORMATRIX = 4,
   62   LIBRAW_DNGFM_CALIBRATION = 8,
   63   LIBRAW_DNGFM_ANALOGBALANCE = 16,
   64   LIBRAW_DNGFM_BLACK = 32,
   65   LIBRAW_DNGFM_WHITE = 64,
   66   LIBRAW_DNGFM_OPCODE2 = 128,
   67   LIBRAW_DNGFM_LINTABLE = 256,
   68   LIBRAW_DNGFM_CROPORIGIN = 512,
   69   LIBRAW_DNGFM_CROPSIZE = 1024,
   70   LIBRAW_DNGFM_PREVIEWCS = 2048
   71 };
   72 
   73 enum LibRaw_whitebalance_code
   74 {
   75   /*
   76       EXIF light sources
   77       12 = FL-D; Daylight fluorescent (D 5700K – 7100K) (F1,F5)
   78       13 = FL-N; Day white fluorescent (N 4600K – 5400K) (F7,F8)
   79       14 = FL-W; Cool white fluorescent (W 3900K – 4500K) (F2,F6, office, store, warehouse)
   80       15 = FL-WW; White fluorescent (WW 3200K – 3700K) (F3, residential)
   81       16 = FL-L; Soft/Warm white fluorescent (L 2600K - 3250K) (F4, kitchen, bath)
   82   */
   83   LIBRAW_WBI_Unknown = 0,
   84   LIBRAW_WBI_Daylight = 1,
   85   LIBRAW_WBI_Fluorescent = 2,
   86   LIBRAW_WBI_Tungsten = 3,
   87   LIBRAW_WBI_Flash = 4,
   88   LIBRAW_WBI_FineWeather = 9,
   89   LIBRAW_WBI_Cloudy = 10,
   90   LIBRAW_WBI_Shade = 11,
   91   LIBRAW_WBI_FL_D = 12,
   92   LIBRAW_WBI_FL_N = 13,
   93   LIBRAW_WBI_FL_W = 14,
   94   LIBRAW_WBI_FL_WW = 15,
   95   LIBRAW_WBI_FL_L = 16,
   96   LIBRAW_WBI_Ill_A = 17,
   97   LIBRAW_WBI_Ill_B = 18,
   98   LIBRAW_WBI_Ill_C = 19,
   99   LIBRAW_WBI_D55 = 20,
  100   LIBRAW_WBI_D65 = 21,
  101   LIBRAW_WBI_D75 = 22,
  102   LIBRAW_WBI_D50 = 23,
  103   LIBRAW_WBI_StudioTungsten = 24,
  104   LIBRAW_WBI_Sunset = 64,
  105   LIBRAW_WBI_Auto = 82,
  106   LIBRAW_WBI_Custom = 83,
  107   LIBRAW_WBI_Auto1 = 85,
  108   LIBRAW_WBI_Auto2 = 86,
  109   LIBRAW_WBI_Auto3 = 87,
  110   LIBRAW_WBI_Auto4 = 88,
  111   LIBRAW_WBI_Custom1 = 90,
  112   LIBRAW_WBI_Custom2 = 91,
  113   LIBRAW_WBI_Custom3 = 92,
  114   LIBRAW_WBI_Custom4 = 93,
  115   LIBRAW_WBI_Custom5 = 94,
  116   LIBRAW_WBI_Custom6 = 95,
  117   LIBRAW_WBI_Measured = 100,
  118   LIBRAW_WBI_Underwater = 120,
  119   LIBRAW_WBI_Other = 255
  120 };
  121 
  122 enum LibRaw_MultiExposure_related
  123 {
  124   LIBRAW_ME_NONE = 0,
  125   LIBRAW_ME_SIMPLE = 1,
  126   LIBRAW_ME_OVERLAY = 2,
  127   LIBRAW_ME_HDR = 3
  128 };
  129 
  130 enum LibRaw_dng_processing
  131 {
  132   LIBRAW_DNG_NONE = 0,
  133   LIBRAW_DNG_FLOAT = 1,
  134   LIBRAW_DNG_LINEAR = 2,
  135   LIBRAW_DNG_DEFLATE = 4,
  136   LIBRAW_DNG_XTRANS = 8,
  137   LIBRAW_DNG_OTHER = 16,
  138   LIBRAW_DNG_8BIT = 32,
  139   /*LIBRAW_DNG_LARGERANGE=64,*/ /* more than 16 bit integer */
  140   LIBRAW_DNG_ALL = LIBRAW_DNG_FLOAT | LIBRAW_DNG_LINEAR | LIBRAW_DNG_XTRANS | LIBRAW_DNG_8BIT |
  141                    LIBRAW_DNG_OTHER /* |LIBRAW_DNG_LARGERANGE */,
  142   LIBRAW_DNG_DEFAULT = LIBRAW_DNG_FLOAT | LIBRAW_DNG_LINEAR | LIBRAW_DNG_DEFLATE | LIBRAW_DNG_8BIT
  143 };
  144 
  145 enum LibRaw_runtime_capabilities
  146 {
  147   LIBRAW_CAPS_RAWSPEED = 1,
  148   LIBRAW_CAPS_DNGSDK = 2
  149 };
  150 
  151 enum LibRaw_camera_mounts
  152 {
  153   LIBRAW_MOUNT_Unknown = 0,
  154   LIBRAW_MOUNT_Minolta_A = 1,
  155   LIBRAW_MOUNT_Sony_E = 2,
  156   LIBRAW_MOUNT_Canon_EF = 3,
  157   LIBRAW_MOUNT_Canon_EF_S = 4,
  158   LIBRAW_MOUNT_Canon_EF_M = 5,
  159   LIBRAW_MOUNT_Nikon_F = 6,
  160   LIBRAW_MOUNT_Nikon_CX = 7, /* used in Nikon 1 series */
  161   LIBRAW_MOUNT_FT = 8,       /* original 4/3 */
  162   LIBRAW_MOUNT_mFT = 9,      /* micro 4/3 */
  163   LIBRAW_MOUNT_Pentax_K = 10,
  164   LIBRAW_MOUNT_Pentax_Q = 11,
  165   LIBRAW_MOUNT_Pentax_645 = 12,
  166   LIBRAW_MOUNT_Fuji_X = 13,
  167   LIBRAW_MOUNT_Leica_M = 14,
  168   LIBRAW_MOUNT_Leica_R = 15,
  169   LIBRAW_MOUNT_Leica_S = 16,
  170   LIBRAW_MOUNT_Samsung_NX = 17,
  171   LIBRAW_MOUNT_RicohModule = 18,
  172   LIBRAW_MOUNT_Samsung_NX_M = 19,
  173   LIBRAW_MOUNT_Leica_T = 20,
  174   LIBRAW_MOUNT_Contax_N = 21,
  175   LIBRAW_MOUNT_Sigma_X3F = 22,
  176   LIBRAW_MOUNT_Leica_SL = 23,
  177   LIBRAW_MOUNT_FixedLens = 99
  178 };
  179 
  180 enum LibRaw_camera_formats
  181 {
  182   LIBRAW_FORMAT_APSC = 1,
  183   LIBRAW_FORMAT_FF = 2,
  184   LIBRAW_FORMAT_MF = 3,
  185   LIBRAW_FORMAT_APSH = 4,
  186   LIBRAW_FORMAT_1INCH = 5,
  187   LIBRAW_FORMAT_FT = 8
  188 };
  189 
  190 enum LibRaw_sony_cameratypes
  191 {
  192   LIBRAW_SONY_DSC = 1,
  193   LIBRAW_SONY_DSLR = 2,
  194   LIBRAW_SONY_NEX = 3,
  195   LIBRAW_SONY_SLT = 4,
  196   LIBRAW_SONY_ILCE = 5,
  197   LIBRAW_SONY_ILCA = 6
  198 };
  199 
  200 enum LibRaw_processing_options
  201 {
  202   LIBRAW_PROCESSING_SONYARW2_NONE = 0,
  203   LIBRAW_PROCESSING_SONYARW2_BASEONLY = 1,
  204   LIBRAW_PROCESSING_SONYARW2_DELTAONLY = 1 << 1,
  205   LIBRAW_PROCESSING_SONYARW2_DELTAZEROBASE = 1 << 2,
  206   LIBRAW_PROCESSING_SONYARW2_DELTATOVALUE = 1 << 3,
  207   LIBRAW_PROCESSING_SONYARW2_ALLFLAGS = LIBRAW_PROCESSING_SONYARW2_BASEONLY + LIBRAW_PROCESSING_SONYARW2_DELTAONLY +
  208                                         LIBRAW_PROCESSING_SONYARW2_DELTAZEROBASE +
  209                                         LIBRAW_PROCESSING_SONYARW2_DELTATOVALUE,
  210   LIBRAW_PROCESSING_DP2Q_INTERPOLATERG = 1 << 4,
  211   LIBRAW_PROCESSING_DP2Q_INTERPOLATEAF = 1 << 5,
  212   LIBRAW_PROCESSING_PENTAX_PS_ALLFRAMES = 1 << 6,
  213   LIBRAW_PROCESSING_CONVERTFLOAT_TO_INT = 1 << 7,
  214   LIBRAW_PROCESSING_SRAW_NO_RGB = 1 << 8,
  215   LIBRAW_PROCESSING_SRAW_NO_INTERPOLATE = 1 << 9,
  216   LIBRAW_PROCESSING_NO_ROTATE_FOR_KODAK_THUMBNAILS = 1 << 11,
  217   LIBRAW_PROCESSING_USE_DNG_DEFAULT_CROP = 1 << 12,
  218   LIBRAW_PROCESSING_USE_PPM16_THUMBS = 1 << 13,
  219   LIBRAW_PROCESSING_CHECK_DNG_ILLUMINANT = 1 << 15
  220 };
  221 
  222 enum LibRaw_decoder_flags
  223 {
  224   LIBRAW_DECODER_HASCURVE = 1 << 4,
  225   LIBRAW_DECODER_SONYARW2 = 1 << 5,
  226   LIBRAW_DECODER_TRYRAWSPEED = 1 << 6,
  227   LIBRAW_DECODER_OWNALLOC = 1 << 7,
  228   LIBRAW_DECODER_FIXEDMAXC = 1 << 8,
  229   LIBRAW_DECODER_ADOBECOPYPIXEL = 1 << 9,
  230   LIBRAW_DECODER_LEGACY_WITH_MARGINS = 1 << 10,
  231   LIBRAW_DECODER_3CHANNEL = 1 << 11,
  232   LIBRAW_DECODER_SINAR4SHOT = 1 << 11,
  233   LIBRAW_DECODER_NOTSET = 1 << 15
  234 };
  235 
  236 #define LIBRAW_XTRANS 9
  237 
  238 enum LibRaw_constructor_flags
  239 {
  240   LIBRAW_OPTIONS_NONE = 0,
  241   LIBRAW_OPIONS_NO_MEMERR_CALLBACK = 1,
  242   LIBRAW_OPIONS_NO_DATAERR_CALLBACK = 1 << 1
  243 };
  244 
  245 enum LibRaw_warnings
  246 {
  247   LIBRAW_WARN_NONE = 0,
  248   LIBRAW_WARN_BAD_CAMERA_WB = 1 << 2,
  249   LIBRAW_WARN_NO_METADATA = 1 << 3,
  250   LIBRAW_WARN_NO_JPEGLIB = 1 << 4,
  251   LIBRAW_WARN_NO_EMBEDDED_PROFILE = 1 << 5,
  252   LIBRAW_WARN_NO_INPUT_PROFILE = 1 << 6,
  253   LIBRAW_WARN_BAD_OUTPUT_PROFILE = 1 << 7,
  254   LIBRAW_WARN_NO_BADPIXELMAP = 1 << 8,
  255   LIBRAW_WARN_BAD_DARKFRAME_FILE = 1 << 9,
  256   LIBRAW_WARN_BAD_DARKFRAME_DIM = 1 << 10,
  257   LIBRAW_WARN_NO_JASPER = 1 << 11,
  258   LIBRAW_WARN_RAWSPEED_PROBLEM = 1 << 12,
  259   LIBRAW_WARN_RAWSPEED_UNSUPPORTED = 1 << 13,
  260   LIBRAW_WARN_RAWSPEED_PROCESSED = 1 << 14,
  261   LIBRAW_WARN_FALLBACK_TO_AHD = 1 << 15,
  262   LIBRAW_WARN_PARSEFUJI_PROCESSED = 1 << 16
  263 };
  264 
  265 enum LibRaw_exceptions
  266 {
  267   LIBRAW_EXCEPTION_NONE = 0,
  268   LIBRAW_EXCEPTION_ALLOC = 1,
  269   LIBRAW_EXCEPTION_DECODE_RAW = 2,
  270   LIBRAW_EXCEPTION_DECODE_JPEG = 3,
  271   LIBRAW_EXCEPTION_IO_EOF = 4,
  272   LIBRAW_EXCEPTION_IO_CORRUPT = 5,
  273   LIBRAW_EXCEPTION_CANCELLED_BY_CALLBACK = 6,
  274   LIBRAW_EXCEPTION_BAD_CROP = 7,
  275   LIBRAW_EXCEPTION_IO_BADFILE = 8,
  276   LIBRAW_EXCEPTION_DECODE_JPEG2000 = 9,
  277   LIBRAW_EXCEPTION_TOOBIG = 10,
  278   LIBRAW_EXCEPTION_MEMPOOL = 11
  279 };
  280 
  281 enum LibRaw_progress
  282 {
  283   LIBRAW_PROGRESS_START = 0,
  284   LIBRAW_PROGRESS_OPEN = 1,
  285   LIBRAW_PROGRESS_IDENTIFY = 1 << 1,
  286   LIBRAW_PROGRESS_SIZE_ADJUST = 1 << 2,
  287   LIBRAW_PROGRESS_LOAD_RAW = 1 << 3,
  288   LIBRAW_PROGRESS_RAW2_IMAGE = 1 << 4,
  289   LIBRAW_PROGRESS_REMOVE_ZEROES = 1 << 5,
  290   LIBRAW_PROGRESS_BAD_PIXELS = 1 << 6,
  291   LIBRAW_PROGRESS_DARK_FRAME = 1 << 7,
  292   LIBRAW_PROGRESS_FOVEON_INTERPOLATE = 1 << 8,
  293   LIBRAW_PROGRESS_SCALE_COLORS = 1 << 9,
  294   LIBRAW_PROGRESS_PRE_INTERPOLATE = 1 << 10,
  295   LIBRAW_PROGRESS_INTERPOLATE = 1 << 11,
  296   LIBRAW_PROGRESS_MIX_GREEN = 1 << 12,
  297   LIBRAW_PROGRESS_MEDIAN_FILTER = 1 << 13,
  298   LIBRAW_PROGRESS_HIGHLIGHTS = 1 << 14,
  299   LIBRAW_PROGRESS_FUJI_ROTATE = 1 << 15,
  300   LIBRAW_PROGRESS_FLIP = 1 << 16,
  301   LIBRAW_PROGRESS_APPLY_PROFILE = 1 << 17,
  302   LIBRAW_PROGRESS_CONVERT_RGB = 1 << 18,
  303   LIBRAW_PROGRESS_STRETCH = 1 << 19,
  304   /* reserved */
  305   LIBRAW_PROGRESS_STAGE20 = 1 << 20,
  306   LIBRAW_PROGRESS_STAGE21 = 1 << 21,
  307   LIBRAW_PROGRESS_STAGE22 = 1 << 22,
  308   LIBRAW_PROGRESS_STAGE23 = 1 << 23,
  309   LIBRAW_PROGRESS_STAGE24 = 1 << 24,
  310   LIBRAW_PROGRESS_STAGE25 = 1 << 25,
  311   LIBRAW_PROGRESS_STAGE26 = 1 << 26,
  312   LIBRAW_PROGRESS_STAGE27 = 1 << 27,
  313 
  314   LIBRAW_PROGRESS_THUMB_LOAD = 1 << 28,
  315   LIBRAW_PROGRESS_TRESERVED1 = 1 << 29,
  316   LIBRAW_PROGRESS_TRESERVED2 = 1 << 30,
  317   LIBRAW_PROGRESS_TRESERVED3 = 1 << 31
  318 };
  319 #define LIBRAW_PROGRESS_THUMB_MASK 0x0fffffff
  320 
  321 enum LibRaw_errors
  322 {
  323   LIBRAW_SUCCESS = 0,
  324   LIBRAW_UNSPECIFIED_ERROR = -1,
  325   LIBRAW_FILE_UNSUPPORTED = -2,
  326   LIBRAW_REQUEST_FOR_NONEXISTENT_IMAGE = -3,
  327   LIBRAW_OUT_OF_ORDER_CALL = -4,
  328   LIBRAW_NO_THUMBNAIL = -5,
  329   LIBRAW_UNSUPPORTED_THUMBNAIL = -6,
  330   LIBRAW_INPUT_CLOSED = -7,
  331   LIBRAW_NOT_IMPLEMENTED = -8,
  332   LIBRAW_UNSUFFICIENT_MEMORY = -100007,
  333   LIBRAW_DATA_ERROR = -100008,
  334   LIBRAW_IO_ERROR = -100009,
  335   LIBRAW_CANCELLED_BY_CALLBACK = -100010,
  336   LIBRAW_BAD_CROP = -100011,
  337   LIBRAW_TOO_BIG = -100012,
  338   LIBRAW_MEMPOOL_OVERFLOW = -100013
  339 };
  340 
  341 #define LIBRAW_FATAL_ERROR(ec) ((ec) < -100000)
  342 
  343 enum LibRaw_thumbnail_formats
  344 {
  345   LIBRAW_THUMBNAIL_UNKNOWN = 0,
  346   LIBRAW_THUMBNAIL_JPEG = 1,
  347   LIBRAW_THUMBNAIL_BITMAP = 2,
  348   LIBRAW_THUMBNAIL_BITMAP16 = 3,
  349   LIBRAW_THUMBNAIL_LAYER = 4,
  350   LIBRAW_THUMBNAIL_ROLLEI = 5
  351 };
  352 
  353 enum LibRaw_image_formats
  354 {
  355   LIBRAW_IMAGE_JPEG = 1,
  356   LIBRAW_IMAGE_BITMAP = 2
  357 };
  358 
  359 #endif