Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
image.h
Go to the documentation of this file.
1/*
2 This file is part of darktable,
3 Copyright (C) 2009-2014 johannes hanika.
4 Copyright (C) 2010 Bruce Guenter.
5 Copyright (C) 2010-2011 Henrik Andersson.
6 Copyright (C) 2010-2012, 2014, 2016, 2018-2019 Tobias Ellinghaus.
7 Copyright (C) 2011 José Carlos García Sogo.
8 Copyright (C) 2011-2012, 2014 Jérémy Rosen.
9 Copyright (C) 2011 Robert Bieber.
10 Copyright (C) 2012 Christian Tellefsen.
11 Copyright (C) 2012 marcel.
12 Copyright (C) 2012 Richard Wonka.
13 Copyright (C) 2013 Jean-Sébastien Pédron.
14 Copyright (C) 2013, 2015, 2018-2022 Pascal Obry.
15 Copyright (C) 2013-2017 Roman Lebedev.
16 Copyright (C) 2013 Ulrich Pegelow.
17 Copyright (C) 2014 Dan Torop.
18 Copyright (C) 2014 Edouard Gomez.
19 Copyright (C) 2014 Pascal de Bruijn.
20 Copyright (C) 2014-2016 Pedro Côrte-Real.
21 Copyright (C) 2017 Žilvinas Žaltiena.
22 Copyright (C) 2018 Kelvie Wong.
23 Copyright (C) 2019-2021 Aldric Renaudin.
24 Copyright (C) 2019 Andreas Schneider.
25 Copyright (C) 2019 August Schwerdfeger.
26 Copyright (C) 2019 Bill Ferguson.
27 Copyright (C) 2019-2022 Hanno Schwalm.
28 Copyright (C) 2019 Jacques Le Clerc.
29 Copyright (C) 2019 luzpaz.
30 Copyright (C) 2019-2022 Philippe Weyland.
31 Copyright (C) 2020-2021, 2023, 2025-2026 Aurélien PIERRE.
32 Copyright (C) 2020 Chris Elston.
33 Copyright (C) 2020 JP Verrue.
34 Copyright (C) 2020 Matthieu Volat.
35 Copyright (C) 2020 U-DESKTOP-HQME86J\marco.
36 Copyright (C) 2021 Daniel Vogelbacher.
37 Copyright (C) 2021 Miloš Komarčević.
38 Copyright (C) 2021 Ralf Brown.
39 Copyright (C) 2022 HansBull.
40 Copyright (C) 2022 Martin Bařinka.
41 Copyright (C) 2022 paolodepetrillo.
42 Copyright (C) 2023, 2025 Alynx Zhou.
43 Copyright (C) 2023 Ricky Moon.
44 Copyright (C) 2024-2025 Guillaume Stutin.
45
46 darktable is free software: you can redistribute it and/or modify
47 it under the terms of the GNU General Public License as published by
48 the Free Software Foundation, either version 3 of the License, or
49 (at your option) any later version.
50
51 darktable is distributed in the hope that it will be useful,
52 but WITHOUT ANY WARRANTY; without even the implied warranty of
53 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
54 GNU General Public License for more details.
55
56 You should have received a copy of the GNU General Public License
57 along with darktable. If not, see <http://www.gnu.org/licenses/>.
58*/
59
60#ifndef DT_COMMON_IMAGE_H
61#define DT_COMMON_IMAGE_H
62
63#ifdef HAVE_CONFIG_H
64#include "config.h"
65
66// Opaque here: only a pointer is stored. colorprofiles owns the definition.
68#endif
69
70#include "common/paths.h"
71#include "pixel/format.h"
72#include "lensserious_vendor.h"
73#include <glib.h>
74#include <glib/gi18n.h>
75#include <inttypes.h>
76
77// Default code for imgid meaning the picture is unknown or invalid
78#define UNKNOWN_IMAGE -1
79
80// Number of database blocks per image
81#define DT_IMAGE_DBLOCKS 64
82
83typedef float dt_boundingbox_t[4]; //(x,y) of upperleft, then (x,y) of lowerright
84
85#ifdef __cplusplus
86extern "C" {
87#endif
88
91{
92 DT_IMAGEIO_OK = 0, // all good :)
93 DT_IMAGEIO_FILE_NOT_FOUND, // file has been lost
94 DT_IMAGEIO_FILE_CORRUPTED, // file contains garbage
95 DT_IMAGEIO_CACHE_FULL, // dt's caches are full :(
96 DT_IMAGEIO_UNSUPPORTED_FORMAT, // file format not supported by loader
97 DT_IMAGEIO_UNSUPPORTED_FEATURE, // format supported but uses unsupported feature
98 DT_IMAGEIO_UNSUPPORTED_CAMERA, // camera model not supported by loader
99 DT_IMAGEIO_LOAD_FAILED, // internal loader failure
100 DT_IMAGEIO_IOERROR // I/O error while reading file
102
103typedef enum
104{
105 // the first 0x7 in flags are reserved for star ratings.
106 // see view.h:
107 // DT_VIEW_DESERT = 0,
108 // DT_VIEW_STAR_1 = 1,
109 // DT_VIEW_STAR_2 = 2,
110 // DT_VIEW_STAR_3 = 3,
111 // DT_VIEW_STAR_4 = 4,
112 // DT_VIEW_STAR_5 = 5,
114
115 // next field unused, but it used to be.
116 // old DB entries might have it set.
117 // To reuse : force to 0 in DB loading and force to 0 in DB saving
118 // Use it to store a state that doesn't need to go in DB
120 // set during import if the image is low-dynamic range, i.e. doesn't need demosaic, wb, highlight clipping
121 // etc.
122 DT_IMAGE_LDR = 1 << 5,
123 // set during import if the image is raw data, i.e. it needs demosaicing.
124 DT_IMAGE_RAW = 1 << 6,
125 // set during import if images is a high-dynamic range image..
126 DT_IMAGE_HDR = 1 << 7,
127 // set when marked for deletion
129 // set when auto-applying presets have been applied to this image.
131 // legacy flag. is set for all new images. i hate to waste a bit on this :(
133 // local copy status
135 // image has an associated .txt file for overlay
137 // image has an associated wav file
139 // image is a bayer pattern with 4 colors (e.g., CYGM or RGBE)
141 // image was detected as monochrome
143 // DNG image has exif tags which are not cached in the database but must be read and stored in dt_image_t
144 // when the image is loaded.
146 // image is an sraw
147 DT_IMAGE_S_RAW = 1 << 17,
148 // image has a monochrome preview tested
150 // image has been set to monochrome via demosaic module
152 // image has a flag set to use the monochrome workflow in the modules supporting it
154 // the decoded buffer carries a CFA mosaic (dsc.filters != 0), i.e. it still needs
155 // demosaicing. Set/cleared by dt_image_buffer_resolve_flags() from the decoded buffer
156 // descriptor. This is the bit that separates a mosaiced raw from an already-demosaiced
157 // raw (sRAW / linear DNG), a distinction that otherwise only lives in the dsc.filters
158 // field which is never stored in the database. Persisted to DB through the image cache.
160 // the codec has decoded the file at least once, so the buffer-derived classification
161 // (DT_IMAGE_MOSAIC and the dsc descriptor) is authoritative. Until this bit is set the
162 // pipeline class is only a provisional guess inferred from the filename extension at
163 // import time. Persisted to DB through the image cache.
166
182{
183 DT_IMAGE_PIPE_UNKNOWN = 0, // not yet resolved and the extension gave no hint
184 DT_IMAGE_PIPE_MOSAIC_RAW, // raw colorimetry + CFA mosaic: needs rawprepare AND demosaic
185 DT_IMAGE_PIPE_LINEAR_RAW, // raw colorimetry, already demosaiced (sRAW / linear DNG): rawprepare, no demosaic
186 DT_IMAGE_PIPE_RGB_LDR, // display-referred integer RGB (jpg/png/tiff8...)
187 DT_IMAGE_PIPE_RGB_HDR, // scene/linear float RGB (exr/pfm/hdr/float-tiff)
189
196
198{
199 unsigned legacy : 24;
200 unsigned user_flip : 8; // +8 = 32 bits.
202
214
232
252
265{
266 DT_IMAGE_USERCROP_UNKNOWN = 0, // not parsed yet -- says nothing about what the file contains
267 DT_IMAGE_USERCROP_ABSENT, // no DefaultUserCrop tag in any candidate IFD
268 DT_IMAGE_USERCROP_IDENTITY, // tag present and equal to (0, 0, 1, 1): no framing recorded
269 DT_IMAGE_USERCROP_VALID, // tag present, well-formed and non-identity
270 DT_IMAGE_USERCROP_MALFORMED, // tag present but violating the DNG type/count/bounds contract
271 DT_IMAGE_USERCROP_CONFLICT // two candidate IFDs hold valid but materially different values
273
274/* Lens-correction data embedded in a raw file's own metadata (maker notes / DNG
275 * OpcodeList3), as opposed to a lens-database lookup. The per-vendor layouts and their
276 * decoding belong to LensSerious (lensserious_vendor.h) -- extraction fills the struct
277 * with the values exiv2 decoded, and iop/lens.c resolves it with ls_vendor_resolve()
278 * without knowing which maker wrote it. LS_VENDOR_NONE == 0, so a zero-initialised
279 * dt_image_t safely means "no data". */
280
299
307
308static const struct
309{
310 const char *tooltip;
311 const char flag;
313{
314 { N_("unknown"), '.'}, // EMPTY_FIELD
315 { N_("tiff"), 't'},
316 { N_("png"), 'p'},
317 { N_("j2k"), 'J'},
318 { N_("jpeg"), 'j'},
319 { N_("exr"), 'e'},
320 { N_("rgbe"), 'R'},
321 { N_("pfm"), 'P'},
322 { N_("rawspeed"), 'r'},
323 { N_("netpnm"), 'n'},
324 { N_("avif"), 'a'},
325 { N_("heif"), 'h'},
326 { N_("libraw"), 'l'},
327 { N_("webp"), 'w'}
329
334
335struct dt_cache_entry_t;
336
361
362typedef struct dt_image_t
363{
364 // minimal exif data here (all in multiples of 4-byte to interface nicely with c++):
365 int32_t exif_inited;
370 float exif_iso;
374 char exif_maker[64];
375 char exif_model[64];
376 char exif_lens[128];
378
379 char camera_maker[64];
380 char camera_model[64];
381 char camera_alias[64];
385
392 char datetime[200];
393
394 // common stuff
395
396 // to understand this, look at comment for dt_histogram_roi_t
399
400 // used by library
405
406 // mipmap_hash is stored in database as an attempt to record the validity
407 // of thumbnails stored on the disk cache. But it is actually unusable until we
408 // have one hash per mipmap size. So it's not implemented anywhere for now.
409 // Saving all hashes for all mipmap sizes will change the database structure and
410 // loose compatibility.
413
414 //timestamps
416
418
420
421 float d65_color_matrix[9]; // the 3x3 matrix embedded in some DNGs
422 uint8_t *profile; // embedded profile, for example from JPEGs
423 uint32_t profile_size;
424 /* The parsed form of the bytes above, built on demand by the export path and owned by THIS
425 * image -- not by the application-wide profile list, which is built at init and read-only
426 * thereafter. NULL until something asks for it; freed with the image. Guarded by the image
427 * cache entry's own lock, like every other member here. */
429 dt_image_colorspace_t colorspace; // the colorspace that is specified in exif. mostly used for jpeg files
430
431 dt_image_raw_parameters_t legacy_flip; // unfortunately needed to convert old bits to new flip module.
432
433 /* gps coords */
435
436 /* needed in exposure iop for Deflicker */
440
441 /* needed to fix some manufacturers madness */
444
445 /* White balance coeffs from the raw */
447
448 /* Adobe coeffs from the raw */
449 float adobe_XYZ_to_CAM[4][3];
450
451 /* DNG DefaultUserCrop: the framing the camera recorded, as normalized edge coordinates
452 * (top, left, bottom, right) relative to the DefaultCropOrigin/DefaultCropSize rectangle —
453 * which is exactly the frame RawSpeed hands downstream, so these numbers need no pixel
454 * arithmetic to reach the crop module, only an orientation mapping.
455 *
456 * Canonical and un-oriented: never overwrite it with display-oriented or module coordinates.
457 * Only meaningful when `usercrop_status == DT_IMAGE_USERCROP_VALID`; identity otherwise.
458 * Runtime-only (not persisted): repopulated by the decoder/EXIF read, which always runs
459 * before default history is initialized. Read it through dt_image_get_usercrop_oriented(). */
462
463 /* GainMaps from DNG OpcodeList2 exif tag */
465
466 /* Lens correction embedded in the file's own metadata (DNG OpcodeList3, maker
467 * notes), as opposed to a Lensfun database lookup. Transient: re-derived on
468 * every decode, never persisted, excluded from _image_cache_self_hash(). */
469 ls_vendor_data_t exif_correction;
470
471 /* Color labels */
474
476 gboolean has_audio;
477 gboolean is_bw;
478 gboolean is_bw_flow;
479 gboolean is_hdr;
480
481 /* convenience pointer back into the image cache, so we can return dt_image_t* there directly. */
484
485// image buffer operations:
487void dt_image_init(dt_image_t *img);
491gboolean dt_image_is_raw(const dt_image_t *img);
495gboolean dt_image_is_ldr(const dt_image_t *img);
499gboolean dt_image_is_hdr(const dt_image_t *img);
500
501/* ------------------------------------------------------------------------------------------
502 * Canonical image-type API.
503 *
504 * Each predicate below tests exactly ONE independent fact about img->flags (no overlapping
505 * conditions, no filename-extension sniffing). The mutually-exclusive classification is
506 * dt_image_pipe_class(); the orthogonal predicates answer the individual "does this image
507 * need stage X" questions used by module auto-enable logic. See src/doc/image-type-detection.md.
508 * ------------------------------------------------------------------------------------------ */
509
518const char *dt_image_pipe_class_name(const dt_image_pipe_class_t klass);
519
522gboolean dt_image_needs_rawprepare(const dt_image_t *img);
524gboolean dt_image_needs_demosaic(const dt_image_t *img);
527gboolean dt_image_is_mosaiced(const dt_image_t *img);
529gboolean dt_image_is_sraw(const dt_image_t *img);
530
541void dt_image_set_monochrome_flag(const int32_t imgid, gboolean monochrome);
543gboolean dt_image_is_monochrome(const dt_image_t *img);
551void dt_image_print_debug_info(const dt_image_t *img, const char *context);
554void dt_image_full_path(const int32_t imgid, char *pathname, size_t pathname_len, gboolean *from_cache, const char *calling_func);
556void dt_image_local_copy_paths_from_fullpath(const char *fullpath, int32_t imgid, char *local_copy_path,
557 size_t local_copy_len, char *local_copy_legacy_path,
558 size_t local_copy_legacy_len);
561 size_t pathname_len, gboolean force_cache);
563void dt_image_film_roll_directory(const dt_image_t *img, char *pathname, size_t pathname_len);
565const char *dt_image_film_roll_name(const char *path);
567void dt_image_film_roll(const dt_image_t *img, char *pathname, size_t pathname_len);
569void dt_image_path_append_version_no_db(int version, char *pathname, size_t pathname_len);
571void dt_image_path_append_version(const int32_t imgid, char *pathname, size_t pathname_len);
573void dt_image_print_exif(const dt_image_t *img, char *line, size_t line_len);
574/* set rating to img flags */
575void dt_image_set_xmp_rating(dt_image_t *img, const int rating);
576/* get rating from img flags */
577int dt_image_get_xmp_rating(const dt_image_t *img);
580GList* dt_image_find_xmps(const char* filename);
582int32_t dt_image_get_id_full_path(const gchar *filename);
584int32_t dt_image_get_id(int32_t film_id, const gchar *filename);
590
591int32_t dt_image_import(int32_t film_id, const char *filename, gboolean raise_signals);
593int32_t dt_image_import_lua(int32_t film_id, const char *filename);
595void dt_image_remove(const int32_t imgid);
604void dt_image_remove_undoable(const int32_t imgid);
608int32_t dt_image_duplicate_with_version(const int32_t imgid, const int32_t newversion);
610int32_t dt_image_duplicate(const int32_t imgid);
618int32_t dt_image_duplicate_no_reload(const int32_t imgid);
625void dt_image_history_changed(const int32_t imgid, const gboolean refresh_filmstrip);
627void dt_image_flip(const int32_t imgid, const dt_image_transform_t transform);
628void dt_image_set_flip(const int32_t imgid, const dt_image_orientation_t user_flip);
631void dt_image_set_location(const int32_t imgid, const dt_image_geoloc_t *geoloc,
632 const gboolean undo_on, const gboolean group_on);
634void dt_image_set_locations(const GList *img, const dt_image_geoloc_t *geoloc,
635 const gboolean undo_on);
637void dt_image_set_images_locations(const GList *imgs, const GArray *gloc,
638 const gboolean undo_on);
640void dt_image_get_location(const int32_t imgid, dt_image_geoloc_t *geoloc);
642uint32_t dt_image_altered(const int32_t imgid);
643
651
660
668gboolean dt_image_get_usercrop(const dt_image_t *img, dt_boundingbox_t box);
669
677gboolean dt_image_resolve_usercrop(const int32_t imgid, dt_boundingbox_t box);
678
685gboolean dt_image_get_usercrop_oriented(const dt_image_t *img, const dt_image_orientation_t orientation,
686 dt_boundingbox_t box);
687
689#ifdef __cplusplus
690static inline auto dt_image_orientation(const dt_image_t *img) -> dt_image_orientation_t
691#else
693#endif
694{
696}
697
699#ifdef __cplusplus
700static inline auto dt_image_orientation_to_flip_bits(const int orient) -> dt_image_orientation_t
701#else
727
730int32_t dt_image_move(const int32_t imgid, const int32_t filmid);
734int32_t dt_image_rename(const int32_t imgid, const int32_t filmid, const gchar *newname);
737int32_t dt_image_copy(const int32_t imgid, const int32_t filmid);
740int32_t dt_image_copy_rename(const int32_t imgid, const int32_t filmid, const gchar *newname);
741int dt_image_local_copy_set(const int32_t imgid);
742int dt_image_local_copy_reset(const int32_t imgid);
743/* check whether it is safe to remove a file */
744gboolean dt_image_safe_remove(const int32_t imgid);
745/* try to sync .xmp for all local copies */
747// xmp functions:
752{
754 DT_IMAGE_WRITE_SIDECAR_DISABLED, // xmp writing is off (or an invalid imgid was passed)
755 DT_IMAGE_WRITE_SIDECAR_CACHE_BUSY, // could not acquire the image cache entry
756 DT_IMAGE_WRITE_SIDECAR_NO_SOURCE_PATH, // the original file / local copy could not be located
757 DT_IMAGE_WRITE_SIDECAR_IO_ERROR, // the write to storage itself failed
764void dt_image_synch_xmp(const int selected);
765void dt_image_synch_xmps(const GList *img);
766void dt_image_synch_all_xmp(const gchar *pathname);
769gboolean dt_image_get_xmp_mode();
773
774// set datetime to exif_datetime_taken field
775void dt_image_set_datetime(const GList *imgs, const char *datetime, const gboolean undo_on);
776// set datetimeS to exif_datetime_taken field
777void dt_image_set_datetimes(const GList *imgs, const GArray *dtime, const gboolean undo_on);
778// return image datetime string into the given buffer (size = DT_DATETIME_LENGTH)
779void dt_image_get_datetime(const int32_t imgid, char *datetime);
780
782char *dt_image_get_audio_path(const int32_t imgid);
783char *dt_image_get_audio_path_from_path(const char *image_path);
785char *dt_image_get_text_path(const int32_t imgid);
786char *dt_image_get_text_path_from_path(const char *image_path);
787char *dt_image_build_text_path_from_path(const char *image_path);
788
789float dt_image_get_exposure_bias(const struct dt_image_t *image_storage);
790
792char *dt_image_camera_missing_sample_message(const struct dt_image_t *img, gboolean logmsg);
795void dt_get_dirname_from_imgid(gchar *dir, const int32_t imgid);
796// Search for duplicate's sidecar files and import them if found and not in DB yet
797int dt_image_read_duplicates(const uint32_t id, const char *filename, const gboolean clear_selection);
798
799#ifdef __cplusplus
800}
801#endif
802
803#endif // DT_COMMON_IMAGE_H
804
805// clang-format off
806// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
807// vim: shiftwidth=2 expandtab tabstop=2 cindent
808// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
809// clang-format on
const char * extension(dt_imageio_module_data_t *data)
Definition avif.c:651
static void transform(float *x, float *o, const float *m, const float t_h, const float t_v)
Definition clipping.c:487
const dt_colormatrix_t dt_aligned_pixel_t out
GHashTable * selected
set of checked row labels, mirrored to conf on every change
gboolean dt_image_is_matrix_correction_supported(const dt_image_t *img)
int32_t dt_image_copy_rename(const int32_t imgid, const int32_t filmid, const gchar *newname)
dt_image_colorspace_t
Definition image.h:191
@ DT_IMAGE_COLORSPACE_NONE
Definition image.h:192
@ DT_IMAGE_COLORSPACE_ADOBE_RGB
Definition image.h:194
@ DT_IMAGE_COLORSPACE_SRGB
Definition image.h:193
int32_t dt_image_move(const int32_t imgid, const int32_t filmid)
void dt_image_synch_xmps(const GList *img)
char * dt_image_get_audio_path(const int32_t imgid)
gboolean dt_image_is_raw(const dt_image_t *img)
dt_image_pipe_class_t dt_image_pipe_class(const dt_image_t *img)
dt_image_path_source_t
Definition image.h:301
@ DT_IMAGE_PATH_NONE
Definition image.h:302
@ DT_IMAGE_PATH_LOCAL_COPY_LEGACY
Definition image.h:304
@ DT_IMAGE_PATH_ORIGINAL
Definition image.h:305
@ DT_IMAGE_PATH_LOCAL_COPY
Definition image.h:303
static dt_image_orientation_t dt_image_orientation_to_flip_bits(const int orient)
Definition image.h:702
int dt_image_get_xmp_rating(const dt_image_t *img)
static const struct @4 loaders_info[LOADER_COUNT]
void dt_image_set_flip(const int32_t imgid, const dt_image_orientation_t user_flip)
void dt_image_check_camera_missing_sample(const struct dt_image_t *img)
dt_image_orientation_t dt_image_get_orientation(const int32_t imgid)
dt_image_flags_t dt_image_flags_from_extension(const char *extension)
void dt_image_path_append_version(const int32_t imgid, char *pathname, size_t pathname_len)
int32_t dt_image_get_id(int32_t film_id, const gchar *filename)
int32_t dt_image_copy(const int32_t imgid, const int32_t filmid)
void dt_image_refresh_makermodel(dt_image_t *img)
int32_t dt_image_duplicate_no_reload(const int32_t imgid)
int dt_image_monochrome_flags(const dt_image_t *img)
uint32_t dt_image_altered(const int32_t imgid)
void dt_image_get_datetime(const int32_t imgid, char *datetime)
const char * dt_image_pipe_class_name(const dt_image_pipe_class_t klass)
float dt_boundingbox_t[4]
Definition image.h:83
char * dt_image_get_text_path_from_path(const char *image_path)
void dt_image_set_location(const int32_t imgid, const dt_image_geoloc_t *geoloc, const gboolean undo_on, const gboolean group_on)
void dt_image_film_roll(const dt_image_t *img, char *pathname, size_t pathname_len)
dt_image_orientation_t
Definition image.h:216
@ ORIENTATION_TRANSVERSE
Definition image.h:230
@ ORIENTATION_SWAP_XY
Definition image.h:221
@ ORIENTATION_FLIP_Y
Definition image.h:219
@ ORIENTATION_ROTATE_CCW_90_DEG
Definition image.h:228
@ ORIENTATION_NULL
Definition image.h:217
@ ORIENTATION_ROTATE_CW_90_DEG
Definition image.h:229
@ ORIENTATION_NONE
Definition image.h:218
@ ORIENTATION_FLIP_X
Definition image.h:220
@ ORIENTATION_TRANSPOSE
Definition image.h:227
@ ORIENTATION_ROTATE_180_DEG
Definition image.h:226
@ ORIENTATION_FLIP_VERTICALLY
Definition image.h:225
@ ORIENTATION_FLIP_HORIZONTALLY
Definition image.h:224
void dt_image_print_exif(const dt_image_t *img, char *line, size_t line_len)
void dt_image_synch_all_xmp(const gchar *pathname)
void dt_image_get_location(const int32_t imgid, dt_image_geoloc_t *geoloc)
gboolean dt_image_is_hdr(const dt_image_t *img)
const char flag
Definition image.h:311
int32_t dt_image_duplicate_with_version(const int32_t imgid, const int32_t newversion)
gboolean dt_image_is_monochrome(const dt_image_t *img)
dt_imageio_retval_t
Definition image.h:91
@ DT_IMAGEIO_LOAD_FAILED
Definition image.h:99
@ DT_IMAGEIO_OK
Definition image.h:92
@ DT_IMAGEIO_CACHE_FULL
Definition image.h:95
@ DT_IMAGEIO_UNSUPPORTED_FEATURE
Definition image.h:97
@ DT_IMAGEIO_FILE_CORRUPTED
Definition image.h:94
@ DT_IMAGEIO_UNSUPPORTED_FORMAT
Definition image.h:96
@ DT_IMAGEIO_IOERROR
Definition image.h:100
@ DT_IMAGEIO_FILE_NOT_FOUND
Definition image.h:93
@ DT_IMAGEIO_UNSUPPORTED_CAMERA
Definition image.h:98
void dt_image_print_debug_info(const dt_image_t *img, const char *context)
const char * tooltip
Definition image.h:310
void dt_image_init(dt_image_t *img)
void dt_image_buffer_resolve_flags(dt_image_t *img)
int32_t dt_image_import(int32_t film_id, const char *filename, gboolean raise_signals)
void dt_image_set_datetimes(const GList *imgs, const GArray *dtime, const gboolean undo_on)
const char * dt_image_film_roll_name(const char *path)
float dt_image_get_exposure_bias(const struct dt_image_t *image_storage)
GList * dt_image_find_xmps(const char *filename)
void dt_image_flip(const int32_t imgid, const dt_image_transform_t transform)
Apply an orientation change to one image, on top of the orientation it already has.
void dt_image_set_datetime(const GList *imgs, const char *datetime, const gboolean undo_on)
gboolean dt_image_is_ldr(const dt_image_t *img)
dt_exif_image_orientation_t
Definition image.h:204
@ EXIF_ORIENTATION_NONE
Definition image.h:205
@ EXIF_ORIENTATION_TRANSPOSE
Definition image.h:209
@ EXIF_ORIENTATION_ROTATE_180_DEG
Definition image.h:208
@ EXIF_ORIENTATION_FLIP_VERTICALLY
Definition image.h:207
@ EXIF_ORIENTATION_ROTATE_CW_90_DEG
Definition image.h:211
@ EXIF_ORIENTATION_TRANSVERSE
Definition image.h:212
@ EXIF_ORIENTATION_ROTATE_CCW_90_DEG
Definition image.h:210
@ EXIF_ORIENTATION_FLIP_HORIZONTALLY
Definition image.h:206
dt_image_flags_t
Definition image.h:104
@ DT_IMAGE_NO_LEGACY_PRESETS
Definition image.h:132
@ DT_IMAGE_HAS_ADDITIONAL_DNG_TAGS
Definition image.h:145
@ DT_IMAGE_HAS_WAV
Definition image.h:138
@ DT_IMAGE_AUTO_PRESETS_APPLIED
Definition image.h:130
@ DT_IMAGE_S_RAW
Definition image.h:147
@ DT_IMAGE_REMOVE
Definition image.h:128
@ DT_IMAGE_MOSAIC
Definition image.h:159
@ DT_IMAGE_MONOCHROME_BAYER
Definition image.h:151
@ DT_IMAGE_LOCAL_COPY
Definition image.h:134
@ DT_IMAGE_BUFFER_RESOLVED
Definition image.h:164
@ DT_IMAGE_RAW
Definition image.h:124
@ DT_IMAGE_REJECTED
Definition image.h:113
@ DT_IMAGE_4BAYER
Definition image.h:140
@ DT_IMAGE_MONOCHROME_WORKFLOW
Definition image.h:153
@ DT_IMAGE_THUMBNAIL_DEPRECATED
Definition image.h:119
@ DT_IMAGE_HAS_TXT
Definition image.h:136
@ DT_IMAGE_MONOCHROME
Definition image.h:142
@ DT_IMAGE_HDR
Definition image.h:126
@ DT_IMAGE_LDR
Definition image.h:122
@ DT_IMAGE_MONOCHROME_PREVIEW
Definition image.h:149
gboolean dt_image_pipe_class_is_provisional(const dt_image_t *img)
void dt_image_path_append_version_no_db(int version, char *pathname, size_t pathname_len)
gboolean dt_image_needs_rawprepare(const dt_image_t *img)
void dt_image_set_monochrome_flag(const int32_t imgid, gboolean monochrome)
void dt_image_set_images_locations(const GList *imgs, const GArray *gloc, const gboolean undo_on)
char * dt_image_get_audio_path_from_path(const char *image_path)
void dt_image_remove_undoable(const int32_t imgid)
Same as dt_image_remove(), and records the removal on the undo stack.
gboolean dt_image_use_monochrome_workflow(const dt_image_t *img)
int dt_image_local_copy_set(const int32_t imgid)
void dt_image_film_roll_directory(const dt_image_t *img, char *pathname, size_t pathname_len)
dt_image_write_sidecar_result_t
Definition image.h:752
@ DT_IMAGE_WRITE_SIDECAR_OK
Definition image.h:753
@ DT_IMAGE_WRITE_SIDECAR_IO_ERROR
Definition image.h:757
@ DT_IMAGE_WRITE_SIDECAR_CACHE_BUSY
Definition image.h:755
@ DT_IMAGE_WRITE_SIDECAR_NO_SOURCE_PATH
Definition image.h:756
@ DT_IMAGE_WRITE_SIDECAR_DISABLED
Definition image.h:754
gboolean dt_image_get_usercrop_oriented(const dt_image_t *img, const dt_image_orientation_t orientation, dt_boundingbox_t box)
dt_image_path_source_t dt_image_choose_input_path(const dt_image_t *img, char *pathname, size_t pathname_len, gboolean force_cache)
dt_image_transform_t
An orientation change the user asks for, in the coordinates they are looking at.
Definition image.h:245
@ DT_IMAGE_TRANSFORM_FLIP_VERTICALLY
mirror top <-> bottom, as displayed
Definition image.h:250
@ DT_IMAGE_TRANSFORM_ROTATE_CW
quarter turn clockwise
Definition image.h:246
@ DT_IMAGE_TRANSFORM_RESET
back to ORIENTATION_NULL, i.e. what EXIF says
Definition image.h:248
@ DT_IMAGE_TRANSFORM_FLIP_HORIZONTALLY
mirror left <-> right, as displayed
Definition image.h:249
@ DT_IMAGE_TRANSFORM_ROTATE_CCW
quarter turn counter-clockwise
Definition image.h:247
dt_image_write_sidecar_result_t dt_image_write_sidecar_file(const int32_t imgid)
void dt_image_xmp_mode_refresh_from_conf(void)
dt_image_orientation_t dt_image_get_effective_orientation(const dt_image_t *img)
void dt_image_remove(const int32_t imgid)
gboolean dt_image_is_sraw(const dt_image_t *img)
dt_image_pipe_class_t
Mutually-exclusive classification of an image by the early-pipeline processing it requires....
Definition image.h:182
@ DT_IMAGE_PIPE_MOSAIC_RAW
Definition image.h:184
@ DT_IMAGE_PIPE_LINEAR_RAW
Definition image.h:185
@ DT_IMAGE_PIPE_RGB_LDR
Definition image.h:186
@ DT_IMAGE_PIPE_RGB_HDR
Definition image.h:187
@ DT_IMAGE_PIPE_UNKNOWN
Definition image.h:183
gboolean dt_image_is_mosaiced(const dt_image_t *img)
char * dt_image_camera_missing_sample_message(const struct dt_image_t *img, gboolean logmsg)
int dt_image_get_xmp_rating_from_flags(const int flags)
int32_t dt_image_import_lua(int32_t film_id, const char *filename)
int dt_image_read_duplicates(const uint32_t id, const char *filename, const gboolean clear_selection)
void dt_image_orient_boundingbox(const dt_boundingbox_t in, const dt_image_orientation_t orientation, dt_boundingbox_t out)
static dt_image_orientation_t dt_image_orientation(const dt_image_t *img)
Definition image.h:692
dt_view_image_over_t
What a thumbnail shows over an image: its rating, or one of the badge states.
Definition image.h:347
@ DT_VIEW_STAR_4
Definition image.h:353
@ DT_VIEW_GROUP
Definition image.h:356
@ DT_VIEW_REJECT
Definition image.h:355
@ DT_VIEW_AUDIO
Definition image.h:357
@ DT_VIEW_STAR_5
Definition image.h:354
@ DT_VIEW_ERR
Definition image.h:348
@ DT_VIEW_STAR_3
Definition image.h:352
@ DT_VIEW_STAR_1
Definition image.h:350
@ DT_VIEW_STAR_2
Definition image.h:351
@ DT_VIEW_END
Definition image.h:359
@ DT_VIEW_ALTERED
Definition image.h:358
@ DT_VIEW_DESERT
Definition image.h:349
gboolean dt_image_resolve_usercrop(const int32_t imgid, dt_boundingbox_t box)
void dt_image_set_locations(const GList *img, const dt_image_geoloc_t *geoloc, const gboolean undo_on)
dt_image_usercrop_status_t
Definition image.h:265
@ DT_IMAGE_USERCROP_UNKNOWN
Definition image.h:266
@ DT_IMAGE_USERCROP_IDENTITY
Definition image.h:268
@ DT_IMAGE_USERCROP_MALFORMED
Definition image.h:270
@ DT_IMAGE_USERCROP_CONFLICT
Definition image.h:271
@ DT_IMAGE_USERCROP_ABSENT
Definition image.h:267
@ DT_IMAGE_USERCROP_VALID
Definition image.h:269
int dt_image_local_copy_reset(const int32_t imgid)
gboolean dt_image_get_xmp_mode()
char * dt_image_get_text_path(const int32_t imgid)
int32_t dt_image_get_id_full_path(const gchar *filename)
gboolean dt_image_safe_remove(const int32_t imgid)
void dt_image_set_xmp_rating(dt_image_t *img, const int rating)
dt_image_loader_t
Definition image.h:282
@ LOADER_PFM
Definition image.h:290
@ LOADER_AVIF
Definition image.h:293
@ LOADER_J2K
Definition image.h:286
@ LOADER_PNG
Definition image.h:285
@ LOADER_EXR
Definition image.h:288
@ LOADER_TIFF
Definition image.h:284
@ LOADER_JPEG
Definition image.h:287
@ LOADER_WEBP
Definition image.h:296
@ LOADER_HEIF
Definition image.h:294
@ LOADER_RAWSPEED
Definition image.h:291
@ LOADER_PNM
Definition image.h:292
@ LOADER_RGBE
Definition image.h:289
@ LOADER_LIBRAW
Definition image.h:295
@ LOADER_UNKNOWN
Definition image.h:283
@ LOADER_COUNT
Definition image.h:297
char * dt_image_build_text_path_from_path(const char *image_path)
dt_image_write_sidecar_result_t dt_image_write_sidecar_file_forced(const int32_t imgid)
int32_t dt_image_duplicate(const int32_t imgid)
gboolean dt_image_get_usercrop(const dt_image_t *img, dt_boundingbox_t box)
void dt_image_local_copy_synch()
int32_t dt_image_rename(const int32_t imgid, const int32_t filmid, const gchar *newname)
void dt_image_synch_xmp(const int selected)
void dt_get_dirname_from_imgid(gchar *dir, const int32_t imgid)
void dt_image_full_path(const int32_t imgid, char *pathname, size_t pathname_len, gboolean *from_cache, const char *calling_func)
Get the full path of an image out of the database.
void dt_image_history_changed(const int32_t imgid, const gboolean refresh_filmstrip)
gboolean dt_image_needs_demosaic(const dt_image_t *img)
void dt_image_set_provisional_dsc(dt_image_t *img)
void dt_image_local_copy_paths_from_fullpath(const char *fullpath, int32_t imgid, char *local_copy_path, size_t local_copy_len, char *local_copy_legacy_path, size_t local_copy_legacy_len)
dt_mipmap_buffer_dsc_flags flags
Definition mipmap_cache.c:4
#define DT_PATH_MAX
Buffer size for a filesystem path anywhere in Ansel.
Definition paths.h:57
#define DT_MAX_FILENAME_LEN
Definition paths.h:35
DT_ALIGNED_PIXEL float dt_aligned_pixel_t[4]
Definition simd.h:53
unsigned __int64 uint64_t
Definition strptime.c:75
One registered profile: its identity, its LCMS handle, and where it sits in each combo box.
double latitude
Definition image.h:332
double elevation
Definition image.h:332
double longitude
Definition image.h:332
gboolean has_audio
Definition image.h:476
gboolean is_hdr
Definition image.h:479
float exif_exposure
Definition image.h:367
float pixel_aspect_ratio
Definition image.h:443
int32_t height
Definition image.h:397
gboolean camera_missing_sample
Definition image.h:384
GTimeSpan export_timestamp
Definition image.h:415
uint64_t history_hash
Definition image.h:404
char camera_model[64]
Definition image.h:380
float exif_focus_distance
Definition image.h:372
dt_boundingbox_t usercrop
Definition image.h:460
GTimeSpan import_timestamp
Definition image.h:415
gboolean is_bw
Definition image.h:477
int32_t group_id
Definition image.h:401
char camera_makermodel[128]
Definition image.h:382
float exif_exposure_bias
Definition image.h:368
uint16_t raw_black_level
Definition image.h:437
ls_vendor_data_t exif_correction
Definition image.h:469
float exif_iso
Definition image.h:370
GList * dng_gain_maps
Definition image.h:464
dt_image_loader_t loader
Definition image.h:417
char camera_maker[64]
Definition image.h:379
uint32_t raw_white_point
Definition image.h:439
int32_t exif_inited
Definition image.h:365
float exif_aperture
Definition image.h:369
char local_copy_path[DT_PATH_MAX]
Definition image.h:388
int32_t version
Definition image.h:401
int32_t crop_height
Definition image.h:398
uint64_t mipmap_hash
Definition image.h:411
dt_image_geoloc_t geoloc
Definition image.h:434
char camera_legacy_makermodel[128]
Definition image.h:383
dt_image_usercrop_status_t usercrop_status
Definition image.h:461
int32_t flags
Definition image.h:401
dt_image_orientation_t orientation
Definition image.h:366
int32_t width
Definition image.h:397
float exif_focal_length
Definition image.h:371
char exif_maker[64]
Definition image.h:374
GTimeSpan change_timestamp
Definition image.h:415
uint32_t profile_size
Definition image.h:423
int32_t crop_y
Definition image.h:398
uint32_t history_items
Definition image.h:403
int rating
Definition image.h:473
gboolean has_localcopy
Definition image.h:475
int32_t num
Definition image.h:401
char camera_alias[64]
Definition image.h:381
char exif_lens[128]
Definition image.h:376
GTimeSpan print_timestamp
Definition image.h:415
int32_t film_id
Definition image.h:401
char folder[DT_PATH_MAX]
Definition image.h:390
GTimeSpan exif_datetime_taken
Definition image.h:377
int32_t crop_x
Definition image.h:398
int color_labels
Definition image.h:472
float d65_color_matrix[9]
Definition image.h:421
int32_t p_height
Definition image.h:397
dt_iop_buffer_dsc_t dsc
Definition image.h:419
int32_t p_width
Definition image.h:397
char filmroll[DT_PATH_MAX]
Definition image.h:391
char exif_model[64]
Definition image.h:375
dt_image_colorspace_t colorspace
Definition image.h:429
float adobe_XYZ_to_CAM[4][3]
Definition image.h:449
struct dt_colorspaces_color_profile_t * embedded_profile
Definition image.h:428
uint8_t * profile
Definition image.h:422
char datetime[200]
Definition image.h:392
struct dt_cache_entry_t * cache_entry
Definition image.h:482
int32_t crop_width
Definition image.h:398
uint32_t group_members
Definition image.h:402
char local_copy_legacy_path[DT_PATH_MAX]
Definition image.h:389
dt_image_raw_parameters_t legacy_flip
Definition image.h:431
char filename[DT_MAX_FILENAME_LEN]
Definition image.h:386
int32_t id
Definition image.h:401
uint16_t raw_black_level_separate[4]
Definition image.h:438
uint64_t self_hash
Definition image.h:412
dt_aligned_pixel_t wb_coeffs
Definition image.h:446
float exif_crop
Definition image.h:373
char fullpath[DT_PATH_MAX]
Definition image.h:387
uint32_t fuji_rotation_pos
Definition image.h:442
gboolean is_bw_flow
Definition image.h:478