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
97{
98 DT_IMAGEIO_OK = 0, // all good :)
99 DT_IMAGEIO_FILE_NOT_FOUND, // file has been lost
100 DT_IMAGEIO_FILE_CORRUPTED, // file contains garbage
101 DT_IMAGEIO_CACHE_FULL, // dt's caches are full :(
102 DT_IMAGEIO_UNSUPPORTED_FORMAT, // file format not supported by loader
103 DT_IMAGEIO_UNSUPPORTED_FEATURE, // format supported but uses unsupported feature
104 DT_IMAGEIO_UNSUPPORTED_CAMERA, // camera model not supported by loader
105 DT_IMAGEIO_LOAD_FAILED, // internal loader failure
106 DT_IMAGEIO_IOERROR, // I/O error while reading or writing a file
107 DT_IMAGEIO_NO_EMBEDDED_THUMBNAIL, // only the embedded thumbnail may be used, and none could be read
108 DT_IMAGEIO_PROCESSING_FAILED, // the pixelpipe produced no output
109 DT_IMAGEIO_ABORTED // the pixelpipe was stopped before it produced an output
111
112typedef enum
113{
114 // the first 0x7 in flags are reserved for star ratings.
115 // see view.h:
116 // DT_VIEW_DESERT = 0,
117 // DT_VIEW_STAR_1 = 1,
118 // DT_VIEW_STAR_2 = 2,
119 // DT_VIEW_STAR_3 = 3,
120 // DT_VIEW_STAR_4 = 4,
121 // DT_VIEW_STAR_5 = 5,
123
124 // next field unused, but it used to be.
125 // old DB entries might have it set.
126 // To reuse : force to 0 in DB loading and force to 0 in DB saving
127 // Use it to store a state that doesn't need to go in DB
129 // set during import if the image is low-dynamic range, i.e. doesn't need demosaic, wb, highlight clipping
130 // etc.
131 DT_IMAGE_LDR = 1 << 5,
132 // set during import if the image is raw data, i.e. it needs demosaicing.
133 DT_IMAGE_RAW = 1 << 6,
134 // set during import if images is a high-dynamic range image..
135 DT_IMAGE_HDR = 1 << 7,
136 // set when marked for deletion
138 // set when auto-applying presets have been applied to this image.
140 // legacy flag. is set for all new images. i hate to waste a bit on this :(
142 // local copy status
144 // image has an associated .txt file for overlay
146 // image has an associated wav file
148 // image is a bayer pattern with 4 colors (e.g., CYGM or RGBE)
150 // image was detected as monochrome
152 // DNG image has exif tags which are not cached in the database but must be read and stored in dt_image_t
153 // when the image is loaded.
155 // image is an sraw
156 DT_IMAGE_S_RAW = 1 << 17,
157 // image has a monochrome preview tested
159 // image has been set to monochrome via demosaic module
161 // image has a flag set to use the monochrome workflow in the modules supporting it
163 // the decoded buffer carries a CFA mosaic (dsc.filters != 0), i.e. it still needs
164 // demosaicing. Set/cleared by dt_image_buffer_resolve_flags() from the decoded buffer
165 // descriptor. This is the bit that separates a mosaiced raw from an already-demosaiced
166 // raw (sRAW / linear DNG), a distinction that otherwise only lives in the dsc.filters
167 // field which is never stored in the database. Persisted to DB through the image cache.
169 // the codec has decoded the file at least once, so the buffer-derived classification
170 // (DT_IMAGE_MOSAIC and the dsc descriptor) is authoritative. Until this bit is set the
171 // pipeline class is only a provisional guess inferred from the filename extension at
172 // import time. Persisted to DB through the image cache.
175
191{
192 DT_IMAGE_PIPE_UNKNOWN = 0, // not yet resolved and the extension gave no hint
193 DT_IMAGE_PIPE_MOSAIC_RAW, // raw colorimetry + CFA mosaic: needs rawprepare AND demosaic
194 DT_IMAGE_PIPE_LINEAR_RAW, // raw colorimetry, already demosaiced (sRAW / linear DNG): rawprepare, no demosaic
195 DT_IMAGE_PIPE_RGB_LDR, // display-referred integer RGB (jpg/png/tiff8...)
196 DT_IMAGE_PIPE_RGB_HDR, // scene/linear float RGB (exr/pfm/hdr/float-tiff)
198
205
207{
208 unsigned legacy : 24;
209 unsigned user_flip : 8; // +8 = 32 bits.
211
223
241
261
274{
275 DT_IMAGE_USERCROP_UNKNOWN = 0, // not parsed yet -- says nothing about what the file contains
276 DT_IMAGE_USERCROP_ABSENT, // no DefaultUserCrop tag in any candidate IFD
277 DT_IMAGE_USERCROP_IDENTITY, // tag present and equal to (0, 0, 1, 1): no framing recorded
278 DT_IMAGE_USERCROP_VALID, // tag present, well-formed and non-identity
279 DT_IMAGE_USERCROP_MALFORMED, // tag present but violating the DNG type/count/bounds contract
280 DT_IMAGE_USERCROP_CONFLICT // two candidate IFDs hold valid but materially different values
282
283/* Lens-correction data embedded in a raw file's own metadata (maker notes / DNG
284 * OpcodeList3), as opposed to a lens-database lookup. The per-vendor layouts and their
285 * decoding belong to LensSerious (lensserious_vendor.h) -- extraction fills the struct
286 * with the values exiv2 decoded, and iop/lens.c resolves it with ls_vendor_resolve()
287 * without knowing which maker wrote it. LS_VENDOR_NONE == 0, so a zero-initialised
288 * dt_image_t safely means "no data". */
289
308
316
317static const struct
318{
319 const char *tooltip;
320 const char flag;
322{
323 { N_("unknown"), '.'}, // EMPTY_FIELD
324 { N_("tiff"), 't'},
325 { N_("png"), 'p'},
326 { N_("j2k"), 'J'},
327 { N_("jpeg"), 'j'},
328 { N_("exr"), 'e'},
329 { N_("rgbe"), 'R'},
330 { N_("pfm"), 'P'},
331 { N_("rawspeed"), 'r'},
332 { N_("netpnm"), 'n'},
333 { N_("avif"), 'a'},
334 { N_("heif"), 'h'},
335 { N_("libraw"), 'l'},
336 { N_("webp"), 'w'}
338
343
344struct dt_cache_entry_t;
345
370
371typedef struct dt_image_t
372{
373 // minimal exif data here (all in multiples of 4-byte to interface nicely with c++):
374 int32_t exif_inited;
379 float exif_iso;
383 char exif_maker[64];
384 char exif_model[64];
385 char exif_lens[128];
387
388 char camera_maker[64];
389 char camera_model[64];
390 char camera_alias[64];
394
401 char datetime[200];
402
403 // common stuff
404
405 // to understand this, look at comment for dt_histogram_roi_t
408
409 // used by library
414
415 // mipmap_hash is stored in database as an attempt to record the validity
416 // of thumbnails stored on the disk cache. But it is actually unusable until we
417 // have one hash per mipmap size. So it's not implemented anywhere for now.
418 // Saving all hashes for all mipmap sizes will change the database structure and
419 // loose compatibility.
422
423 //timestamps
425
427
429
430 float d65_color_matrix[9]; // the 3x3 matrix embedded in some DNGs
431 uint8_t *profile; // embedded profile, for example from JPEGs
432 uint32_t profile_size;
433 /* The parsed form of the bytes above, built on demand by the export path and owned by THIS
434 * image -- not by the application-wide profile list, which is built at init and read-only
435 * thereafter. NULL until something asks for it; freed with the image. Guarded by the image
436 * cache entry's own lock, like every other member here. */
438 dt_image_colorspace_t colorspace; // the colorspace that is specified in exif. mostly used for jpeg files
439
440 dt_image_raw_parameters_t legacy_flip; // unfortunately needed to convert old bits to new flip module.
441
442 /* gps coords */
444
445 /* needed in exposure iop for Deflicker */
449
450 /* needed to fix some manufacturers madness */
453
454 /* White balance coeffs from the raw */
456
457 /* Adobe coeffs from the raw */
458 float adobe_XYZ_to_CAM[4][3];
459
460 /* DNG DefaultUserCrop: the framing the camera recorded, as normalized edge coordinates
461 * (top, left, bottom, right) relative to the DefaultCropOrigin/DefaultCropSize rectangle —
462 * which is exactly the frame RawSpeed hands downstream, so these numbers need no pixel
463 * arithmetic to reach the crop module, only an orientation mapping.
464 *
465 * Canonical and un-oriented: never overwrite it with display-oriented or module coordinates.
466 * Only meaningful when `usercrop_status == DT_IMAGE_USERCROP_VALID`; identity otherwise.
467 * Runtime-only (not persisted): repopulated by the decoder/EXIF read, which always runs
468 * before default history is initialized. Read it through dt_image_get_usercrop_oriented(). */
471
472 /* GainMaps from DNG OpcodeList2 exif tag */
474
475 /* Lens correction embedded in the file's own metadata (DNG OpcodeList3, maker
476 * notes), as opposed to a Lensfun database lookup. Transient: re-derived on
477 * every decode, never persisted, excluded from _image_cache_self_hash(). */
478 ls_vendor_data_t exif_correction;
479
480 /* Color labels */
483
485 gboolean has_audio;
486 gboolean is_bw;
487 gboolean is_bw_flow;
488 gboolean is_hdr;
489
490 /* convenience pointer back into the image cache, so we can return dt_image_t* there directly. */
493
494// image buffer operations:
496void dt_image_init(dt_image_t *img);
500gboolean dt_image_is_raw(const dt_image_t *img);
504gboolean dt_image_is_ldr(const dt_image_t *img);
508gboolean dt_image_is_hdr(const dt_image_t *img);
509
510/* ------------------------------------------------------------------------------------------
511 * Canonical image-type API.
512 *
513 * Each predicate below tests exactly ONE independent fact about img->flags (no overlapping
514 * conditions, no filename-extension sniffing). The mutually-exclusive classification is
515 * dt_image_pipe_class(); the orthogonal predicates answer the individual "does this image
516 * need stage X" questions used by module auto-enable logic. See src/doc/image-type-detection.md.
517 * ------------------------------------------------------------------------------------------ */
518
527const char *dt_image_pipe_class_name(const dt_image_pipe_class_t klass);
528
531gboolean dt_image_needs_rawprepare(const dt_image_t *img);
533gboolean dt_image_needs_demosaic(const dt_image_t *img);
536gboolean dt_image_is_mosaiced(const dt_image_t *img);
538gboolean dt_image_is_sraw(const dt_image_t *img);
539
550void dt_image_set_monochrome_flag(const int32_t imgid, gboolean monochrome);
552gboolean dt_image_is_monochrome(const dt_image_t *img);
560void dt_image_print_debug_info(const dt_image_t *img, const char *context);
563void dt_image_full_path(const int32_t imgid, char *pathname, size_t pathname_len, gboolean *from_cache, const char *calling_func);
565void dt_image_local_copy_paths_from_fullpath(const char *fullpath, int32_t imgid, char *local_copy_path,
566 size_t local_copy_len, char *local_copy_legacy_path,
567 size_t local_copy_legacy_len);
570 size_t pathname_len, gboolean force_cache);
572void dt_image_film_roll_directory(const dt_image_t *img, char *pathname, size_t pathname_len);
574const char *dt_image_film_roll_name(const char *path);
576void dt_image_film_roll(const dt_image_t *img, char *pathname, size_t pathname_len);
578void dt_image_path_append_version_no_db(int version, char *pathname, size_t pathname_len);
580void dt_image_path_append_version(const int32_t imgid, char *pathname, size_t pathname_len);
582void dt_image_print_exif(const dt_image_t *img, char *line, size_t line_len);
583/* set rating to img flags */
584void dt_image_set_xmp_rating(dt_image_t *img, const int rating);
585/* get rating from img flags */
586int dt_image_get_xmp_rating(const dt_image_t *img);
589GList* dt_image_find_xmps(const char* filename);
591int32_t dt_image_get_id_full_path(const gchar *filename);
593int32_t dt_image_get_id(int32_t film_id, const gchar *filename);
599
600int32_t dt_image_import(int32_t film_id, const char *filename, gboolean raise_signals);
602int32_t dt_image_import_lua(int32_t film_id, const char *filename);
604void dt_image_remove(const int32_t imgid);
613void dt_image_remove_undoable(const int32_t imgid);
617int32_t dt_image_duplicate_with_version(const int32_t imgid, const int32_t newversion);
619int32_t dt_image_duplicate(const int32_t imgid);
627int32_t dt_image_duplicate_no_reload(const int32_t imgid);
634void dt_image_history_changed(const int32_t imgid, const gboolean refresh_filmstrip);
636void dt_image_flip(const int32_t imgid, const dt_image_transform_t transform);
637void dt_image_set_flip(const int32_t imgid, const dt_image_orientation_t user_flip);
640void dt_image_set_location(const int32_t imgid, const dt_image_geoloc_t *geoloc,
641 const gboolean undo_on, const gboolean group_on);
643void dt_image_set_locations(const GList *img, const dt_image_geoloc_t *geoloc,
644 const gboolean undo_on);
646void dt_image_set_images_locations(const GList *imgs, const GArray *gloc,
647 const gboolean undo_on);
649void dt_image_get_location(const int32_t imgid, dt_image_geoloc_t *geoloc);
651uint32_t dt_image_altered(const int32_t imgid);
652
660
669
677gboolean dt_image_get_usercrop(const dt_image_t *img, dt_boundingbox_t box);
678
686gboolean dt_image_resolve_usercrop(const int32_t imgid, dt_boundingbox_t box);
687
694gboolean dt_image_get_usercrop_oriented(const dt_image_t *img, const dt_image_orientation_t orientation,
695 dt_boundingbox_t box);
696
698#ifdef __cplusplus
699static inline auto dt_image_orientation(const dt_image_t *img) -> dt_image_orientation_t
700#else
702#endif
703{
705}
706
708#ifdef __cplusplus
709static inline auto dt_image_orientation_to_flip_bits(const int orient) -> dt_image_orientation_t
710#else
736
739int32_t dt_image_move(const int32_t imgid, const int32_t filmid);
743int32_t dt_image_rename(const int32_t imgid, const int32_t filmid, const gchar *newname);
746int32_t dt_image_copy(const int32_t imgid, const int32_t filmid);
749int32_t dt_image_copy_rename(const int32_t imgid, const int32_t filmid, const gchar *newname);
750int dt_image_local_copy_set(const int32_t imgid);
751int dt_image_local_copy_reset(const int32_t imgid);
752/* check whether it is safe to remove a file */
753gboolean dt_image_safe_remove(const int32_t imgid);
754/* try to sync .xmp for all local copies */
756// xmp functions:
761{
763 DT_IMAGE_WRITE_SIDECAR_DISABLED, // xmp writing is off (or an invalid imgid was passed)
764 DT_IMAGE_WRITE_SIDECAR_CACHE_BUSY, // could not acquire the image cache entry
765 DT_IMAGE_WRITE_SIDECAR_NO_SOURCE_PATH, // the original file / local copy could not be located
766 DT_IMAGE_WRITE_SIDECAR_IO_ERROR, // the write to storage itself failed
773void dt_image_synch_xmp(const int selected);
774void dt_image_synch_xmps(const GList *img);
775void dt_image_synch_all_xmp(const gchar *pathname);
778gboolean dt_image_get_xmp_mode();
782
783// set datetime to exif_datetime_taken field
784void dt_image_set_datetime(const GList *imgs, const char *datetime, const gboolean undo_on);
785// set datetimeS to exif_datetime_taken field
786void dt_image_set_datetimes(const GList *imgs, const GArray *dtime, const gboolean undo_on);
787// return image datetime string into the given buffer (size = DT_DATETIME_LENGTH)
788void dt_image_get_datetime(const int32_t imgid, char *datetime);
789
791char *dt_image_get_audio_path(const int32_t imgid);
792char *dt_image_get_audio_path_from_path(const char *image_path);
794char *dt_image_get_text_path(const int32_t imgid);
795char *dt_image_get_text_path_from_path(const char *image_path);
796char *dt_image_build_text_path_from_path(const char *image_path);
797
798float dt_image_get_exposure_bias(const struct dt_image_t *image_storage);
799
801char *dt_image_camera_missing_sample_message(const struct dt_image_t *img, gboolean logmsg);
804void dt_get_dirname_from_imgid(gchar *dir, const int32_t imgid);
805// Search for duplicate's sidecar files and import them if found and not in DB yet
806int dt_image_read_duplicates(const uint32_t id, const char *filename, const gboolean clear_selection);
807
808#ifdef __cplusplus
809}
810#endif
811
812#endif // DT_COMMON_IMAGE_H
813
814// clang-format off
815// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
816// vim: shiftwidth=2 expandtab tabstop=2 cindent
817// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
818// 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:200
@ DT_IMAGE_COLORSPACE_NONE
Definition image.h:201
@ DT_IMAGE_COLORSPACE_ADOBE_RGB
Definition image.h:203
@ DT_IMAGE_COLORSPACE_SRGB
Definition image.h:202
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:310
@ DT_IMAGE_PATH_NONE
Definition image.h:311
@ DT_IMAGE_PATH_LOCAL_COPY_LEGACY
Definition image.h:313
@ DT_IMAGE_PATH_ORIGINAL
Definition image.h:314
@ DT_IMAGE_PATH_LOCAL_COPY
Definition image.h:312
static dt_image_orientation_t dt_image_orientation_to_flip_bits(const int orient)
Definition image.h:711
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:225
@ ORIENTATION_TRANSVERSE
Definition image.h:239
@ ORIENTATION_SWAP_XY
Definition image.h:230
@ ORIENTATION_FLIP_Y
Definition image.h:228
@ ORIENTATION_ROTATE_CCW_90_DEG
Definition image.h:237
@ ORIENTATION_NULL
Definition image.h:226
@ ORIENTATION_ROTATE_CW_90_DEG
Definition image.h:238
@ ORIENTATION_NONE
Definition image.h:227
@ ORIENTATION_FLIP_X
Definition image.h:229
@ ORIENTATION_TRANSPOSE
Definition image.h:236
@ ORIENTATION_ROTATE_180_DEG
Definition image.h:235
@ ORIENTATION_FLIP_VERTICALLY
Definition image.h:234
@ ORIENTATION_FLIP_HORIZONTALLY
Definition image.h:233
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:320
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
Return value of image io functions: loading, exporting, and making a thumbnail.
Definition image.h:97
@ DT_IMAGEIO_LOAD_FAILED
Definition image.h:105
@ DT_IMAGEIO_ABORTED
Definition image.h:109
@ DT_IMAGEIO_OK
Definition image.h:98
@ DT_IMAGEIO_CACHE_FULL
Definition image.h:101
@ DT_IMAGEIO_UNSUPPORTED_FEATURE
Definition image.h:103
@ DT_IMAGEIO_FILE_CORRUPTED
Definition image.h:100
@ DT_IMAGEIO_PROCESSING_FAILED
Definition image.h:108
@ DT_IMAGEIO_NO_EMBEDDED_THUMBNAIL
Definition image.h:107
@ DT_IMAGEIO_UNSUPPORTED_FORMAT
Definition image.h:102
@ DT_IMAGEIO_IOERROR
Definition image.h:106
@ DT_IMAGEIO_FILE_NOT_FOUND
Definition image.h:99
@ DT_IMAGEIO_UNSUPPORTED_CAMERA
Definition image.h:104
void dt_image_print_debug_info(const dt_image_t *img, const char *context)
const char * tooltip
Definition image.h:319
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:213
@ EXIF_ORIENTATION_NONE
Definition image.h:214
@ EXIF_ORIENTATION_TRANSPOSE
Definition image.h:218
@ EXIF_ORIENTATION_ROTATE_180_DEG
Definition image.h:217
@ EXIF_ORIENTATION_FLIP_VERTICALLY
Definition image.h:216
@ EXIF_ORIENTATION_ROTATE_CW_90_DEG
Definition image.h:220
@ EXIF_ORIENTATION_TRANSVERSE
Definition image.h:221
@ EXIF_ORIENTATION_ROTATE_CCW_90_DEG
Definition image.h:219
@ EXIF_ORIENTATION_FLIP_HORIZONTALLY
Definition image.h:215
dt_image_flags_t
Definition image.h:113
@ DT_IMAGE_NO_LEGACY_PRESETS
Definition image.h:141
@ DT_IMAGE_HAS_ADDITIONAL_DNG_TAGS
Definition image.h:154
@ DT_IMAGE_HAS_WAV
Definition image.h:147
@ DT_IMAGE_AUTO_PRESETS_APPLIED
Definition image.h:139
@ DT_IMAGE_S_RAW
Definition image.h:156
@ DT_IMAGE_REMOVE
Definition image.h:137
@ DT_IMAGE_MOSAIC
Definition image.h:168
@ DT_IMAGE_MONOCHROME_BAYER
Definition image.h:160
@ DT_IMAGE_LOCAL_COPY
Definition image.h:143
@ DT_IMAGE_BUFFER_RESOLVED
Definition image.h:173
@ DT_IMAGE_RAW
Definition image.h:133
@ DT_IMAGE_REJECTED
Definition image.h:122
@ DT_IMAGE_4BAYER
Definition image.h:149
@ DT_IMAGE_MONOCHROME_WORKFLOW
Definition image.h:162
@ DT_IMAGE_THUMBNAIL_DEPRECATED
Definition image.h:128
@ DT_IMAGE_HAS_TXT
Definition image.h:145
@ DT_IMAGE_MONOCHROME
Definition image.h:151
@ DT_IMAGE_HDR
Definition image.h:135
@ DT_IMAGE_LDR
Definition image.h:131
@ DT_IMAGE_MONOCHROME_PREVIEW
Definition image.h:158
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:761
@ DT_IMAGE_WRITE_SIDECAR_OK
Definition image.h:762
@ DT_IMAGE_WRITE_SIDECAR_IO_ERROR
Definition image.h:766
@ DT_IMAGE_WRITE_SIDECAR_CACHE_BUSY
Definition image.h:764
@ DT_IMAGE_WRITE_SIDECAR_NO_SOURCE_PATH
Definition image.h:765
@ DT_IMAGE_WRITE_SIDECAR_DISABLED
Definition image.h:763
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:254
@ DT_IMAGE_TRANSFORM_FLIP_VERTICALLY
mirror top <-> bottom, as displayed
Definition image.h:259
@ DT_IMAGE_TRANSFORM_ROTATE_CW
quarter turn clockwise
Definition image.h:255
@ DT_IMAGE_TRANSFORM_RESET
back to ORIENTATION_NULL, i.e. what EXIF says
Definition image.h:257
@ DT_IMAGE_TRANSFORM_FLIP_HORIZONTALLY
mirror left <-> right, as displayed
Definition image.h:258
@ DT_IMAGE_TRANSFORM_ROTATE_CCW
quarter turn counter-clockwise
Definition image.h:256
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:191
@ DT_IMAGE_PIPE_MOSAIC_RAW
Definition image.h:193
@ DT_IMAGE_PIPE_LINEAR_RAW
Definition image.h:194
@ DT_IMAGE_PIPE_RGB_LDR
Definition image.h:195
@ DT_IMAGE_PIPE_RGB_HDR
Definition image.h:196
@ DT_IMAGE_PIPE_UNKNOWN
Definition image.h:192
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:701
dt_view_image_over_t
What a thumbnail shows over an image: its rating, or one of the badge states.
Definition image.h:356
@ DT_VIEW_STAR_4
Definition image.h:362
@ DT_VIEW_GROUP
Definition image.h:365
@ DT_VIEW_REJECT
Definition image.h:364
@ DT_VIEW_AUDIO
Definition image.h:366
@ DT_VIEW_STAR_5
Definition image.h:363
@ DT_VIEW_ERR
Definition image.h:357
@ DT_VIEW_STAR_3
Definition image.h:361
@ DT_VIEW_STAR_1
Definition image.h:359
@ DT_VIEW_STAR_2
Definition image.h:360
@ DT_VIEW_END
Definition image.h:368
@ DT_VIEW_ALTERED
Definition image.h:367
@ DT_VIEW_DESERT
Definition image.h:358
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:274
@ DT_IMAGE_USERCROP_UNKNOWN
Definition image.h:275
@ DT_IMAGE_USERCROP_IDENTITY
Definition image.h:277
@ DT_IMAGE_USERCROP_MALFORMED
Definition image.h:279
@ DT_IMAGE_USERCROP_CONFLICT
Definition image.h:280
@ DT_IMAGE_USERCROP_ABSENT
Definition image.h:276
@ DT_IMAGE_USERCROP_VALID
Definition image.h:278
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:291
@ LOADER_PFM
Definition image.h:299
@ LOADER_AVIF
Definition image.h:302
@ LOADER_J2K
Definition image.h:295
@ LOADER_PNG
Definition image.h:294
@ LOADER_EXR
Definition image.h:297
@ LOADER_TIFF
Definition image.h:293
@ LOADER_JPEG
Definition image.h:296
@ LOADER_WEBP
Definition image.h:305
@ LOADER_HEIF
Definition image.h:303
@ LOADER_RAWSPEED
Definition image.h:300
@ LOADER_PNM
Definition image.h:301
@ LOADER_RGBE
Definition image.h:298
@ LOADER_LIBRAW
Definition image.h:304
@ LOADER_UNKNOWN
Definition image.h:292
@ LOADER_COUNT
Definition image.h:306
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:341
double elevation
Definition image.h:341
double longitude
Definition image.h:341
gboolean has_audio
Definition image.h:485
gboolean is_hdr
Definition image.h:488
float exif_exposure
Definition image.h:376
float pixel_aspect_ratio
Definition image.h:452
int32_t height
Definition image.h:406
gboolean camera_missing_sample
Definition image.h:393
GTimeSpan export_timestamp
Definition image.h:424
uint64_t history_hash
Definition image.h:413
char camera_model[64]
Definition image.h:389
float exif_focus_distance
Definition image.h:381
dt_boundingbox_t usercrop
Definition image.h:469
GTimeSpan import_timestamp
Definition image.h:424
gboolean is_bw
Definition image.h:486
int32_t group_id
Definition image.h:410
char camera_makermodel[128]
Definition image.h:391
float exif_exposure_bias
Definition image.h:377
uint16_t raw_black_level
Definition image.h:446
ls_vendor_data_t exif_correction
Definition image.h:478
float exif_iso
Definition image.h:379
GList * dng_gain_maps
Definition image.h:473
dt_image_loader_t loader
Definition image.h:426
char camera_maker[64]
Definition image.h:388
uint32_t raw_white_point
Definition image.h:448
int32_t exif_inited
Definition image.h:374
float exif_aperture
Definition image.h:378
char local_copy_path[DT_PATH_MAX]
Definition image.h:397
int32_t version
Definition image.h:410
int32_t crop_height
Definition image.h:407
uint64_t mipmap_hash
Definition image.h:420
dt_image_geoloc_t geoloc
Definition image.h:443
char camera_legacy_makermodel[128]
Definition image.h:392
dt_image_usercrop_status_t usercrop_status
Definition image.h:470
int32_t flags
Definition image.h:410
dt_image_orientation_t orientation
Definition image.h:375
int32_t width
Definition image.h:406
float exif_focal_length
Definition image.h:380
char exif_maker[64]
Definition image.h:383
GTimeSpan change_timestamp
Definition image.h:424
uint32_t profile_size
Definition image.h:432
int32_t crop_y
Definition image.h:407
uint32_t history_items
Definition image.h:412
int rating
Definition image.h:482
gboolean has_localcopy
Definition image.h:484
int32_t num
Definition image.h:410
char camera_alias[64]
Definition image.h:390
char exif_lens[128]
Definition image.h:385
GTimeSpan print_timestamp
Definition image.h:424
int32_t film_id
Definition image.h:410
char folder[DT_PATH_MAX]
Definition image.h:399
GTimeSpan exif_datetime_taken
Definition image.h:386
int32_t crop_x
Definition image.h:407
int color_labels
Definition image.h:481
float d65_color_matrix[9]
Definition image.h:430
int32_t p_height
Definition image.h:406
dt_iop_buffer_dsc_t dsc
Definition image.h:428
int32_t p_width
Definition image.h:406
char filmroll[DT_PATH_MAX]
Definition image.h:400
char exif_model[64]
Definition image.h:384
dt_image_colorspace_t colorspace
Definition image.h:438
float adobe_XYZ_to_CAM[4][3]
Definition image.h:458
struct dt_colorspaces_color_profile_t * embedded_profile
Definition image.h:437
uint8_t * profile
Definition image.h:431
char datetime[200]
Definition image.h:401
struct dt_cache_entry_t * cache_entry
Definition image.h:491
int32_t crop_width
Definition image.h:407
uint32_t group_members
Definition image.h:411
char local_copy_legacy_path[DT_PATH_MAX]
Definition image.h:398
dt_image_raw_parameters_t legacy_flip
Definition image.h:440
char filename[DT_MAX_FILENAME_LEN]
Definition image.h:395
int32_t id
Definition image.h:410
uint16_t raw_black_level_separate[4]
Definition image.h:447
uint64_t self_hash
Definition image.h:421
dt_aligned_pixel_t wb_coeffs
Definition image.h:455
float exif_crop
Definition image.h:382
char fullpath[DT_PATH_MAX]
Definition image.h:396
uint32_t fuji_rotation_pos
Definition image.h:451
gboolean is_bw_flow
Definition image.h:487