Files
rawTherapee/internal/libraw_cxx_defs.h
Lawrence Lee 16e502f1c5 Squashed 'rtengine/libraw/' changes from 12b0e5d60..8afe44cd0
8afe44cd0 Snapshot 202502
29d9785c2 Do not apply canon metadata crop to DNG files
015b27fff Changelog updated
d1a27c26e Merge branch 'master' of git.lexa.ru:LibRaw
ca1368d8e check split_col/split_row values in phase_one_correct
fb23332a9 UINT32=>unsigned as defined in structure declaration
354bc2907 Revert "build: add handling of openmp library"
797ac1934 Merge pull request #680 from ssssota/remove-duplicated-camera
52421b19e fix: remove duplicated supported camera
ca57a1103 Merge pull request #679 from dlemstra/fix-profile-length
25bb86fe7 Merge pull request #678 from clan/openmp
591239482 Changelog updated
42fce9f8e Make sure the profile_length is the same size as the allocated memory.
f767a2fbe prevent OOB reads in phase_one_correct
638154a5b build: add handling of openmp library
bdd9e3436 Prevent out-of-bounds read in fuji 0xf00c tag parser
59cfa8b8a Prevent out-of-bounds read in fuji 0xf00c tag parser
3240fb21f Merge pull request #677 from ssssota/windows-makefile-invalid-indent
416912f43 build: fix indentation (8 spaces -> tab)
bf7a0346d Merge pull request #676 from lance5/master
6a0ef2483 [fix] use LIBRAW_OWN_SWAB control swab
816ab359b [feature] support android NDK 21
cc118c1c1 H265 and JPEG-XL thumbnails support for dcraw_make_mem_thumb
9bcb8a1d9 LIBRAW_CALLOC_RAWSTORE; replace for w/ memmove in dng_sdk glue
bf1a9140e panasonic decoder: limit load_flags to 0x4000
77a46b319 panasonic loader: zero buf to avoid uninitalized data leak
4f5a4cfb3 null-terminate xmp block
f9bb7d126 small allocations: replace malloc with calloc
70f511871 define NOMINMAX before including winsock2 in public header file => do not provide min/max maco
3772d1be2 Merge pull request #661 from nekopsykose/end
f2d1070f7 fix endian detection for ppc64le
47c7a2394 Ignore vendor crops for Fuji S6000/6500
17f16837e Prevent Sony-LJPEG decoder buffer overrun
9c9c04b44 Ensure SR2 block is fully read from file
d3cbbd0e9 4-component DNG-JPEG support
891630152 additional check for imgdata.color.WB_Coeffs index range
54c6af90b prevent possible imgdata.color.WBCT_Coeffs overrun
158e635e5 X100V color updated w/ actual data; X-T4 and X-Pro3 typo fixed
393dc925d Fuji X-T3x colormatrix: fixed typo
66a81c333 removed extra Pentax KP colordata
6475fd04b pass all images with wrong bayer filter data to vng_interpolate
fe2a7e2b7 Refuse images with colors==2
c2e8a908d additional offset checks in Sony metadata parser
c9facb4b7 Clean wrong aber values; allocate extra data to image to avoid overrun on specially crafted test images
83bf3ad5e Merge pull request #640 from Calandracas606/fix-clback-docs
c294e7075 fix the docs to properly reflect the size of cblack[LIBRAW_CBLACK_SIZE]
072eeaeb4 fixed integer overflow in largest frame selection code
e58e8e43a additional checked_buffer_t offset checks
73d6daa05 Check for negatife offset checked_buffer_t
0d011198b Oops. Forgot to increase version
a625a7d53 Merge pull request #633 from thesamesam/openmp
b396d92d8 README.md: removed unprintable symbols
9893eb825 README.md: update policy actualized to match libraw.org site
54fbe8f47 libraw_adjust_to_raw_inset_crop
2f75ef793 m4: update ax_openmp.m4 from autoconf-archive (8->14)

git-subtree-dir: rtengine/libraw
git-subtree-split: 8afe44cd0e96611ba3cb73779b83ad05e945634c
2025-03-23 15:05:07 -07:00

120 lines
4.8 KiB
C++

/* -*- C++ -*-
* File: internal/libraw_cxx_defs.h
* Copyright 2008-2024 LibRaw LLC (info@libraw.org)
* Created: Sat Aug 17, 2020
LibRaw is free software; you can redistribute it and/or modify
it under the terms of the one of two licenses as you choose:
1. GNU LESSER GENERAL PUBLIC LICENSE version 2.1
(See file LICENSE.LGPL provided in LibRaw distribution archive for details).
2. COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
(See file LICENSE.CDDL provided in LibRaw distribution archive for details).
*/
#ifndef _LIBRAW_CXX_DEFS_H
#define _LIBRAW_CXX_DEFS_H
#include <math.h>
#include <errno.h>
#include <float.h>
#include <new>
#include <exception>
#include <sys/types.h>
#include <sys/stat.h>
#define LIBRAW_LIBRARY_BUILD
#include "libraw/libraw.h"
#include "internal/defines.h"
#ifdef USE_ZLIB
#include <zlib.h>
#endif
#ifndef LIBRAW_WIN32_CALLS
#include <netinet/in.h>
#else
#ifndef LIBRAW_NO_WINSOCK2
#include <winsock2.h>
#endif
#include <io.h>
#endif
#ifdef USE_RAWSPEED
void *make_camera_metadata();
void clear_camera_metadata(void*);
void clear_rawspeed_decoder(void*);
#endif
#ifdef USE_DNGSDK
void clear_dng_negative(void *);
void clear_dng_image(void*);
#endif
#define P1 imgdata.idata
#define S imgdata.sizes
#ifndef LIBRAW_DNGSDK_CONFLICT
#define O imgdata.params
#define C imgdata.color
#define T imgdata.thumbnail
#define MN imgdata.makernotes
#ifndef LIBRAW_EXPAT_CONFLICT
#define IO libraw_internal_data.internal_output_params
#define ID libraw_internal_data.internal_data
#endif
#endif
#define makeIs(idx) (imgdata.idata.maker_index == idx)
#define mnCamID imgdata.lens.makernotes.CamID
#define EXCEPTION_HANDLER(e) \
do \
{ \
switch (e) \
{ \
case LIBRAW_EXCEPTION_MEMPOOL: \
recycle(); \
return LIBRAW_MEMPOOL_OVERFLOW; \
case LIBRAW_EXCEPTION_ALLOC: \
recycle(); \
return LIBRAW_UNSUFFICIENT_MEMORY; \
case LIBRAW_EXCEPTION_TOOBIG: \
recycle(); \
return LIBRAW_TOO_BIG; \
case LIBRAW_EXCEPTION_DECODE_RAW: \
case LIBRAW_EXCEPTION_DECODE_JPEG: \
recycle(); \
return LIBRAW_DATA_ERROR; \
case LIBRAW_EXCEPTION_DECODE_JPEG2000: \
recycle(); \
return LIBRAW_DATA_ERROR; \
case LIBRAW_EXCEPTION_IO_EOF: \
case LIBRAW_EXCEPTION_IO_CORRUPT: \
recycle(); \
return LIBRAW_IO_ERROR; \
case LIBRAW_EXCEPTION_CANCELLED_BY_CALLBACK: \
recycle(); \
return LIBRAW_CANCELLED_BY_CALLBACK; \
case LIBRAW_EXCEPTION_BAD_CROP: \
recycle(); \
return LIBRAW_BAD_CROP; \
case LIBRAW_EXCEPTION_UNSUPPORTED_FORMAT: \
recycle(); \
return LIBRAW_FILE_UNSUPPORTED; \
default: \
return LIBRAW_UNSPECIFIED_ERROR; \
} \
} while (0)
// copy-n-paste from image pipe
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define LIM(x, min, max) MAX(min, MIN(x, max))
#ifndef CLIP
#define CLIP(x) LIM(x, 0, 65535)
#endif
#define THUMB_READ_BEYOND 16384
#define ZERO(a) memset(&a, 0, sizeof(a))
#endif