![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "common/paths.h"#include "pixel/format.h"#include "lensserious_vendor.h"#include <glib.h>#include <glib/gi18n.h>#include <inttypes.h>
Include dependency graph for image.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Data Structures | |
| struct | dt_image_raw_parameters_t |
| struct | dt_image_geoloc_t |
| struct | dt_image_t |
Macros | |
| #define | UNKNOWN_IMAGE -1 |
| #define | DT_IMAGE_DBLOCKS 64 |
Typedefs | |
| typedef float | dt_boundingbox_t[4] |
| typedef enum dt_imageio_retval_t | dt_imageio_retval_t |
| typedef enum dt_image_pipe_class_t | dt_image_pipe_class_t |
| Mutually-exclusive classification of an image by the early-pipeline processing it requires. This is the single source of truth used to auto-enable/disable and auto-configure the decoding modules (basebuffer, rawprepare, demosaic, temperature, colorin, ...). | |
| typedef enum dt_image_colorspace_t | dt_image_colorspace_t |
| typedef struct dt_image_raw_parameters_t | dt_image_raw_parameters_t |
| typedef enum dt_exif_image_orientation_t | dt_exif_image_orientation_t |
| typedef enum dt_image_orientation_t | dt_image_orientation_t |
| typedef enum dt_image_transform_t | dt_image_transform_t |
| An orientation change the user asks for, in the coordinates they are looking at. | |
| typedef enum dt_image_usercrop_status_t | dt_image_usercrop_status_t |
| typedef enum dt_image_loader_t | dt_image_loader_t |
| typedef enum dt_image_path_source_t | dt_image_path_source_t |
| typedef struct dt_image_geoloc_t | dt_image_geoloc_t |
| typedef enum dt_view_image_over_t | dt_view_image_over_t |
| What a thumbnail shows over an image: its rating, or one of the badge states. | |
| typedef struct dt_image_t | dt_image_t |
| typedef enum dt_image_write_sidecar_result_t | dt_image_write_sidecar_result_t |
Functions | |
| void | dt_image_init (dt_image_t *img) |
| void | dt_image_refresh_makermodel (dt_image_t *img) |
| gboolean | dt_image_is_raw (const dt_image_t *img) |
| gboolean | dt_image_is_ldr (const dt_image_t *img) |
| gboolean | dt_image_is_hdr (const dt_image_t *img) |
| dt_image_pipe_class_t | dt_image_pipe_class (const dt_image_t *img) |
| gboolean | dt_image_pipe_class_is_provisional (const dt_image_t *img) |
| const char * | dt_image_pipe_class_name (const dt_image_pipe_class_t klass) |
| gboolean | dt_image_needs_rawprepare (const dt_image_t *img) |
| gboolean | dt_image_needs_demosaic (const dt_image_t *img) |
| gboolean | dt_image_is_mosaiced (const dt_image_t *img) |
| gboolean | dt_image_is_sraw (const dt_image_t *img) |
| void | dt_image_buffer_resolve_flags (dt_image_t *img) |
| void | dt_image_set_provisional_dsc (dt_image_t *img) |
| void | dt_image_set_monochrome_flag (const int32_t imgid, gboolean monochrome) |
| gboolean | dt_image_is_monochrome (const dt_image_t *img) |
| gboolean | dt_image_is_matrix_correction_supported (const dt_image_t *img) |
| int | dt_image_monochrome_flags (const dt_image_t *img) |
| gboolean | dt_image_use_monochrome_workflow (const dt_image_t *img) |
| void | dt_image_print_debug_info (const dt_image_t *img, const char *context) |
| 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_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_image_path_source_t | dt_image_choose_input_path (const dt_image_t *img, char *pathname, size_t pathname_len, gboolean force_cache) |
| void | dt_image_film_roll_directory (const dt_image_t *img, char *pathname, size_t pathname_len) |
| const char * | dt_image_film_roll_name (const char *path) |
| void | dt_image_film_roll (const dt_image_t *img, char *pathname, size_t pathname_len) |
| void | dt_image_path_append_version_no_db (int version, char *pathname, size_t pathname_len) |
| void | dt_image_path_append_version (const int32_t imgid, char *pathname, size_t pathname_len) |
| void | dt_image_print_exif (const dt_image_t *img, char *line, size_t line_len) |
| void | dt_image_set_xmp_rating (dt_image_t *img, const int rating) |
| int | dt_image_get_xmp_rating (const dt_image_t *img) |
| int | dt_image_get_xmp_rating_from_flags (const int flags) |
| GList * | dt_image_find_xmps (const char *filename) |
| int32_t | dt_image_get_id_full_path (const gchar *filename) |
| int32_t | dt_image_get_id (int32_t film_id, const gchar *filename) |
| dt_image_flags_t | dt_image_flags_from_extension (const char *extension) |
| int32_t | dt_image_import (int32_t film_id, const char *filename, gboolean raise_signals) |
| int32_t | dt_image_import_lua (int32_t film_id, const char *filename) |
| void | dt_image_remove (const int32_t imgid) |
| void | dt_image_remove_undoable (const int32_t imgid) |
| Same as dt_image_remove(), and records the removal on the undo stack. | |
| int32_t | dt_image_duplicate_with_version (const int32_t imgid, const int32_t newversion) |
| int32_t | dt_image_duplicate (const int32_t imgid) |
| int32_t | dt_image_duplicate_no_reload (const int32_t imgid) |
| void | dt_image_history_changed (const int32_t imgid, const gboolean refresh_filmstrip) |
| 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_flip (const int32_t imgid, const dt_image_orientation_t user_flip) |
| dt_image_orientation_t | dt_image_get_orientation (const int32_t imgid) |
| 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_set_locations (const GList *img, const dt_image_geoloc_t *geoloc, const gboolean undo_on) |
| void | dt_image_set_images_locations (const GList *imgs, const GArray *gloc, const gboolean undo_on) |
| void | dt_image_get_location (const int32_t imgid, dt_image_geoloc_t *geoloc) |
| uint32_t | dt_image_altered (const int32_t imgid) |
| dt_image_orientation_t | dt_image_get_effective_orientation (const dt_image_t *img) |
| void | dt_image_orient_boundingbox (const dt_boundingbox_t in, const dt_image_orientation_t orientation, dt_boundingbox_t out) |
| gboolean | dt_image_get_usercrop (const dt_image_t *img, dt_boundingbox_t box) |
| gboolean | dt_image_resolve_usercrop (const int32_t imgid, dt_boundingbox_t box) |
| gboolean | dt_image_get_usercrop_oriented (const dt_image_t *img, const dt_image_orientation_t orientation, dt_boundingbox_t box) |
| static dt_image_orientation_t | dt_image_orientation (const dt_image_t *img) |
| static dt_image_orientation_t | dt_image_orientation_to_flip_bits (const int orient) |
| int32_t | dt_image_move (const int32_t imgid, const int32_t filmid) |
| int32_t | dt_image_rename (const int32_t imgid, const int32_t filmid, const gchar *newname) |
| int32_t | dt_image_copy (const int32_t imgid, const int32_t filmid) |
| int32_t | dt_image_copy_rename (const int32_t imgid, const int32_t filmid, const gchar *newname) |
| int | dt_image_local_copy_set (const int32_t imgid) |
| int | dt_image_local_copy_reset (const int32_t imgid) |
| gboolean | dt_image_safe_remove (const int32_t imgid) |
| void | dt_image_local_copy_synch () |
| dt_image_write_sidecar_result_t | dt_image_write_sidecar_file (const int32_t imgid) |
| dt_image_write_sidecar_result_t | dt_image_write_sidecar_file_forced (const int32_t imgid) |
| void | dt_image_synch_xmp (const int selected) |
| void | dt_image_synch_xmps (const GList *img) |
| void | dt_image_synch_all_xmp (const gchar *pathname) |
| gboolean | dt_image_get_xmp_mode () |
| void | dt_image_xmp_mode_refresh_from_conf (void) |
| void | dt_image_set_datetime (const GList *imgs, const char *datetime, const gboolean undo_on) |
| void | dt_image_set_datetimes (const GList *imgs, const GArray *dtime, const gboolean undo_on) |
| void | dt_image_get_datetime (const int32_t imgid, char *datetime) |
| char * | dt_image_get_audio_path (const int32_t imgid) |
| char * | dt_image_get_audio_path_from_path (const char *image_path) |
| char * | dt_image_get_text_path (const int32_t imgid) |
| char * | dt_image_get_text_path_from_path (const char *image_path) |
| char * | dt_image_build_text_path_from_path (const char *image_path) |
| float | dt_image_get_exposure_bias (const struct dt_image_t *image_storage) |
| char * | dt_image_camera_missing_sample_message (const struct dt_image_t *img, gboolean logmsg) |
| void | dt_image_check_camera_missing_sample (const struct dt_image_t *img) |
| void | dt_get_dirname_from_imgid (gchar *dir, const int32_t imgid) |
| int | dt_image_read_duplicates (const uint32_t id, const char *filename, const gboolean clear_selection) |
Variables | ||
| struct { | ||
| const char * tooltip | ||
| const char flag | ||
| } | loaders_info [LOADER_COUNT] | |
| typedef enum dt_exif_image_orientation_t dt_exif_image_orientation_t |
| typedef enum dt_image_colorspace_t dt_image_colorspace_t |
| typedef struct dt_image_geoloc_t dt_image_geoloc_t |
| typedef enum dt_image_loader_t dt_image_loader_t |
| typedef enum dt_image_orientation_t dt_image_orientation_t |
| typedef enum dt_image_path_source_t dt_image_path_source_t |
| typedef enum dt_image_pipe_class_t dt_image_pipe_class_t |
Mutually-exclusive classification of an image by the early-pipeline processing it requires. This is the single source of truth used to auto-enable/disable and auto-configure the decoding modules (basebuffer, rawprepare, demosaic, temperature, colorin, ...).
Unlike the historical overloaded "raw" notion, the class cleanly separates the two independent axes that issue #77 identified: whether the buffer is mosaiced (needs demosaic) and whether it carries raw colorimetry (needs rawprepare + a camera input profile). A DNG (issue #849) can land in any of these classes.
The class is computed purely from img->flags, so it is available even for images that have never been decoded (remote/unplugged storage). Before the first decode the class is a provisional guess from the file extension; see dt_image_pipe_class_is_provisional().
| typedef struct dt_image_raw_parameters_t dt_image_raw_parameters_t |
| typedef struct dt_image_t dt_image_t |
| typedef enum dt_image_transform_t dt_image_transform_t |
An orientation change the user asks for, in the coordinates they are looking at.
dt_image_orientation_t describes where an image ENDED UP; this describes what to DO to it. The two are not interchangeable, because the same request composes differently depending on the orientation already in force: once ORIENTATION_SWAP_XY is set, the axis the user calls "horizontal" is the stored FLIP_Y bit, not FLIP_X.
The numeric values are the ones dt_image_flip()'s ‘cw’ argument used to carry, so callers that still pass 0, 1 or 2 keep working – but nothing should: ‘cw’ meant clockwise, and by the time it also meant counter-clockwise, reset, and two mirrors, the name was a lie.
| typedef enum dt_image_usercrop_status_t dt_image_usercrop_status_t |
Outcome of parsing the DNG DefaultUserCrop tag (51125 / 0xC7B5) for an image.
ABSENT and IDENTITY are normal, silent conditions: the file simply declares no camera framing. MALFORMED and CONFLICT are failures — the tag exists but cannot be trusted, so no framing is applied and the reason stays inspectable instead of being folded into ABSENT.
UNKNOWN is the zero value and means "this file has not been looked at yet", which is not the same as "it has no tag": the parsed crop is runtime-only state, so a freshly cached image starts here until something reads its metadata. Consumers that must work without a raw decode (embedded-preview thumbnails) use it to know they still have to ask the file.
why dt_image_write_sidecar_file() did not write a sidecar. Distinct causes get distinct values so callers can report something more useful than a generic "storage unavailable" – DISABLED and CACHE_BUSY in particular are not I/O problems at all.
| typedef enum dt_imageio_retval_t dt_imageio_retval_t |
return value of image io functions.
| typedef enum dt_view_image_over_t dt_view_image_over_t |
What a thumbnail shows over an image: its rating, or one of the badge states.
Stored in dt_image_t::rating – 0..5 stars, or DT_VIEW_REJECT for rejected – which is why it lives here rather than in views/view.h where it was defined. It was read 8 times from common/, 3 from caches/ and 5 from gui/, against a single use in views/ itself: an enum declared at the top layer and consumed from the bottom, which is what made common/ratings.c and caches/image_cache.c include the view layer for one constant.
| enum dt_image_flags_t |
| enum dt_image_loader_t |
Mutually-exclusive classification of an image by the early-pipeline processing it requires. This is the single source of truth used to auto-enable/disable and auto-configure the decoding modules (basebuffer, rawprepare, demosaic, temperature, colorin, ...).
Unlike the historical overloaded "raw" notion, the class cleanly separates the two independent axes that issue #77 identified: whether the buffer is mosaiced (needs demosaic) and whether it carries raw colorimetry (needs rawprepare + a camera input profile). A DNG (issue #849) can land in any of these classes.
The class is computed purely from img->flags, so it is available even for images that have never been decoded (remote/unplugged storage). Before the first decode the class is a provisional guess from the file extension; see dt_image_pipe_class_is_provisional().
| Enumerator | |
|---|---|
| DT_IMAGE_PIPE_UNKNOWN | |
| DT_IMAGE_PIPE_MOSAIC_RAW | |
| DT_IMAGE_PIPE_LINEAR_RAW | |
| DT_IMAGE_PIPE_RGB_LDR | |
| DT_IMAGE_PIPE_RGB_HDR | |
| enum dt_image_transform_t |
An orientation change the user asks for, in the coordinates they are looking at.
dt_image_orientation_t describes where an image ENDED UP; this describes what to DO to it. The two are not interchangeable, because the same request composes differently depending on the orientation already in force: once ORIENTATION_SWAP_XY is set, the axis the user calls "horizontal" is the stored FLIP_Y bit, not FLIP_X.
The numeric values are the ones dt_image_flip()'s ‘cw’ argument used to carry, so callers that still pass 0, 1 or 2 keep working – but nothing should: ‘cw’ meant clockwise, and by the time it also meant counter-clockwise, reset, and two mirrors, the name was a lie.
Outcome of parsing the DNG DefaultUserCrop tag (51125 / 0xC7B5) for an image.
ABSENT and IDENTITY are normal, silent conditions: the file simply declares no camera framing. MALFORMED and CONFLICT are failures — the tag exists but cannot be trusted, so no framing is applied and the reason stays inspectable instead of being folded into ABSENT.
UNKNOWN is the zero value and means "this file has not been looked at yet", which is not the same as "it has no tag": the parsed crop is runtime-only state, so a freshly cached image starts here until something reads its metadata. Consumers that must work without a raw decode (embedded-preview thumbnails) use it to know they still have to ask the file.
| Enumerator | |
|---|---|
| DT_IMAGE_USERCROP_UNKNOWN | |
| DT_IMAGE_USERCROP_ABSENT | |
| DT_IMAGE_USERCROP_IDENTITY | |
| DT_IMAGE_USERCROP_VALID | |
| DT_IMAGE_USERCROP_MALFORMED | |
| DT_IMAGE_USERCROP_CONFLICT | |
why dt_image_write_sidecar_file() did not write a sidecar. Distinct causes get distinct values so callers can report something more useful than a generic "storage unavailable" – DISABLED and CACHE_BUSY in particular are not I/O problems at all.
| Enumerator | |
|---|---|
| DT_IMAGE_WRITE_SIDECAR_OK | |
| DT_IMAGE_WRITE_SIDECAR_DISABLED | |
| DT_IMAGE_WRITE_SIDECAR_CACHE_BUSY | |
| DT_IMAGE_WRITE_SIDECAR_NO_SOURCE_PATH | |
| DT_IMAGE_WRITE_SIDECAR_IO_ERROR | |
| enum dt_imageio_retval_t |
| enum dt_view_image_over_t |
What a thumbnail shows over an image: its rating, or one of the badge states.
Stored in dt_image_t::rating – 0..5 stars, or DT_VIEW_REJECT for rejected – which is why it lives here rather than in views/view.h where it was defined. It was read 8 times from common/, 3 from caches/ and 5 from gui/, against a single use in views/ itself: an enum declared at the top layer and consumed from the bottom, which is what made common/ratings.c and caches/image_cache.c include the view layer for one constant.
| Enumerator | |
|---|---|
| DT_VIEW_ERR | |
| DT_VIEW_DESERT | |
| DT_VIEW_STAR_1 | |
| DT_VIEW_STAR_2 | |
| DT_VIEW_STAR_3 | |
| DT_VIEW_STAR_4 | |
| DT_VIEW_STAR_5 | |
| DT_VIEW_REJECT | |
| DT_VIEW_GROUP | |
| DT_VIEW_AUDIO | |
| DT_VIEW_ALTERED | |
| DT_VIEW_END | |
| void dt_get_dirname_from_imgid | ( | gchar * | dir, |
| const int32_t | imgid | ||
| ) |
get dirname from imgid
Definition at line 2940 of file common/image.c.
References dt_free, dt_image_full_path(), DT_PATH_MAX, FALSE, and folder.
Referenced by dt_collection_load_filmroll(), and dt_collection_notify_imported().
| uint32_t dt_image_altered | ( | const int32_t | imgid | ) |
returns the number of history entries in library for this image
Definition at line 1511 of file common/image.c.
References dt_history_repository_count_items().
| void dt_image_buffer_resolve_flags | ( | dt_image_t * | img | ) |
Finalize the buffer-derived type flags right after a codec has populated img->dsc: sets/clears DT_IMAGE_MOSAIC from dsc.filters and sets DT_IMAGE_BUFFER_RESOLVED. This is the single place where the dsc->flags type mapping is decided; the result is persisted to the database through the regular image-cache writeback.
Definition at line 369 of file common/image.c.
References dt_iop_buffer_dsc_t::datatype, dt_image_t::dsc, DT_IMAGE_BUFFER_RESOLVED, DT_IMAGE_HDR, DT_IMAGE_LDR, DT_IMAGE_MOSAIC, dt_image_needs_rawprepare(), dt_iop_buffer_dsc_t::filters, dt_image_t::flags, IS_NULL_PTR, and TYPE_FLOAT.
Referenced by dt_imageio_open().
| char * dt_image_build_text_path_from_path | ( | const char * | image_path | ) |
Definition at line 2801 of file common/image.c.
References _text_path_legacy_build(), and IS_NULL_PTR.
Referenced by _import_copy_txt(), and _text_sidecar_save_path().
| char * dt_image_camera_missing_sample_message | ( | const struct dt_image_t * | img, |
| gboolean | logmsg | ||
| ) |
handle message for missing camera samples reported by rawspeed
Definition at line 2903 of file common/image.c.
References dt_image_t::camera_maker, dt_image_t::camera_model, dt_free, and dt_util_str_replace().
Referenced by dt_image_check_camera_missing_sample().
| void dt_image_check_camera_missing_sample | ( | const struct dt_image_t * | img | ) |
Definition at line 2930 of file common/image.c.
References dt_image_t::camera_missing_sample, dt_control_log(), dt_free, dt_image_camera_missing_sample_message(), and TRUE.
Referenced by _darkroom_image_loaded_callback().
| dt_image_path_source_t dt_image_choose_input_path | ( | const dt_image_t * | img, |
| char * | pathname, | ||
| size_t | pathname_len, | ||
| gboolean | force_cache | ||
| ) |
test local copies and original files to find an image buffer
Definition at line 659 of file common/image.c.
References DT_IMAGE_LOCAL_COPY, DT_IMAGE_PATH_LOCAL_COPY, DT_IMAGE_PATH_LOCAL_COPY_LEGACY, DT_IMAGE_PATH_NONE, DT_IMAGE_PATH_ORIGINAL, dt_image_t::flags, dt_image_t::fullpath, IS_NULL_PTR, dt_image_t::local_copy_legacy_path, and dt_image_t::local_copy_path.
Referenced by _generate_blocking(), _init_f(), _write_mipmap_to_disk(), _write_sidecar_file_from_image_locked(), dt_image_full_path(), dt_image_local_copy_reset(), dt_image_local_copy_set(), dt_image_rename(), and dt_image_resolve_usercrop().
| int32_t dt_image_copy | ( | const int32_t | imgid, |
| const int32_t | filmid | ||
| ) |
physically copy image to the folder of the film roll with filmid and duplicate update database entries.
Definition at line 2293 of file common/image.c.
References dt_image_copy_rename().
Referenced by dt_control_copy_images_job_run().
| int32_t dt_image_copy_rename | ( | const int32_t | imgid, |
| const int32_t | filmid, | ||
| const gchar * | newname | ||
| ) |
physically copy image to the folder of the film roll with filmid and the name given by newname, and duplicate update database entries.
Definition at line 2204 of file common/image.c.
References _copy_text_sidecar_if_present(), DT_COLLECTION_CHANGE_RELOAD, dt_collection_get_global(), DT_COLLECTION_PROP_UNDEF, dt_collection_update_query(), dt_film_repository_get_folder(), dt_free, dt_history_copy_and_paste_on_image(), DT_HISTORY_MERGE_REPLACE, dt_image_full_path(), dt_image_repository_copy_to_film(), dt_mipmap_cache_copy_thumbnails(), DT_PATH_MAX, FALSE, and TRUE.
Referenced by dt_image_copy().
| int32_t dt_image_duplicate | ( | const int32_t | imgid | ) |
duplicates the given image in the database.
Definition at line 1385 of file common/image.c.
References dt_image_duplicate_with_version().
| int32_t dt_image_duplicate_no_reload | ( | const int32_t | imgid | ) |
Same as dt_image_duplicate(), but does NOT reload the collection query, so the new image is not yet exposed to the lighttable grid / thumbnail generation. Use when the caller still has to populate the duplicate's history before it can be rendered meaningfully (e.g. copying the source's history onto it): the caller MUST trigger a collection reload itself (dt_collection_update_query(..., DT_COLLECTION_CHANGE_RELOAD, ...)) once that is done. Skipping this and letting the plain reload happen mid-copy lets the grid generate and cache a thumbnail from the still-historyless row before the copy lands.
Definition at line 1433 of file common/image.c.
References _image_duplicate_with_version(), FALSE, and TRUE.
Referenced by _history_style_apply(), and dt_control_duplicate_images_job_run().
| int32_t dt_image_duplicate_with_version | ( | const int32_t | imgid, |
| const int32_t | newversion | ||
| ) |
duplicates the given image in the database with the duplicate getting the supplied version number. if that version already exists just return the imgid without producing new duplicate. called with newversion -1 a new duplicate is produced with the next free version number.
Definition at line 1428 of file common/image.c.
References _image_duplicate_with_version(), and TRUE.
Referenced by dt_image_duplicate().
| void dt_image_film_roll | ( | const dt_image_t * | img, |
| char * | pathname, | ||
| size_t | pathname_len | ||
| ) |
returns the film roll name, i.e. without the path.
Definition at line 571 of file common/image.c.
References dt_film_repository_get_folder(), dt_free, dt_image_film_roll_name(), dt_image_t::film_id, and folder.
| void dt_image_film_roll_directory | ( | const dt_image_t * | img, |
| char * | pathname, | ||
| size_t | pathname_len | ||
| ) |
returns the full directory of the associated film roll.
Definition at line 560 of file common/image.c.
References dt_film_repository_get_folder(), dt_free, dt_image_t::film_id, and folder.
Referenced by _jump_to(), load_xmp_callback(), and update_preview_cb().
| const char * dt_image_film_roll_name | ( | const char * | path | ) |
returns the portion of the path used for the film roll name.
Definition at line 535 of file common/image.c.
References CLAMPS, dt_conf_get_int(), and folder.
Referenced by _populate_list(), dt_image_cache_write_release(), dt_image_film_roll(), dt_image_from_stmt(), and pretty_print_collection().
| GList * dt_image_find_xmps | ( | const char * | filename | ) |
finds all xmp duplicates for the given image in the database.
Definition at line 1533 of file common/image.c.
References DT_PATH_MAX, dt_util_test_image_file(), i, IS_NULL_PTR, and win_image_find_duplicates().
Referenced by _import_copy_xmp(), dt_control_delete_images_job_run(), and dt_image_read_duplicates().
| dt_image_flags_t dt_image_flags_from_extension | ( | const char * | extension | ) |
imports a new image from raw/etc file and adds it to the data base and image cache. Use from threads other than lua. Guess DT_IMAGE_RAW / _HDR / _LDR from a filename extension, with or without its leading dot. Returns 0 when the extension is ambiguous (a .dng may be either) or unknown – the answer then only comes from decoding the file.
Definition at line 1895 of file common/image.c.
References dt_image_ext_is_ambiguous(), dt_image_ext_is_hdr(), dt_image_ext_is_ldr(), dt_image_ext_is_raw(), DT_IMAGE_HDR, DT_IMAGE_LDR, DT_IMAGE_RAW, and extension().
Referenced by _image_import_internal(), _import_get_thumbnail(), _upgrade_library_schema_step(), dt_exif_read(), dt_image_derive_fields(), and update_preview_cb().
| 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.
Definition at line 1337 of file common/image.c.
References _orientation_mirror_horizontally(), _orientation_mirror_vertically(), dt_undo_lt_history_t::after, dt_undo_lt_history_t::after_history_end, dt_undo_lt_history_t::before, dt_undo_lt_history_t::before_history_end, dt_dev_get_global(), dt_history_snapshot_item_init(), dt_history_snapshot_undo_create(), dt_history_snapshot_undo_lt_history_data_free(), dt_history_snapshot_undo_pop(), dt_image_get_orientation(), dt_image_set_flip(), DT_IMAGE_TRANSFORM_FLIP_HORIZONTALLY, DT_IMAGE_TRANSFORM_FLIP_VERTICALLY, DT_IMAGE_TRANSFORM_RESET, DT_IMAGE_TRANSFORM_ROTATE_CCW, DT_IMAGE_TRANSFORM_ROTATE_CW, dt_undo_get_global(), DT_UNDO_LT_HISTORY, dt_undo_record(), DT_VIEW_DARKROOM, dt_view_manager_get_current_view(), dt_view_manager_get_global(), dt_undo_lt_history_t::imgid, ORIENTATION_NULL, ORIENTATION_SWAP_XY, and transform().
Referenced by dt_control_flip_images_job_run().
| 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.
returns the full path name where the image was imported from. from_cache=TRUE check and return local cached filename if any.
| imgid | The image ID. |
| pathname | A pointer storing the returned value from the sql request. |
| pathname_len | Number of characters of the path set outside the function. |
| from_cache | Boolean, false returns the original file (file system), true prefers a local copy when available. |
| calling_func | Pass FUNCTION for identifcation of callers of this function. |
Definition at line 718 of file common/image.c.
References dt_image_cache_get(), dt_image_cache_read_release(), dt_image_choose_input_path(), DT_IMAGE_PATH_LOCAL_COPY, DT_IMAGE_PATH_LOCAL_COPY_LEGACY, DT_IMAGE_PATH_NONE, FALSE, and TRUE.
Referenced by _event_dnd_get(), _export_list_build(), _set_image_paths(), _update_preview(), _view_map_dnd_get_callback(), _watermark_get_svgdoc(), dt_control_delete_images_job_run(), dt_control_export_job_run(), dt_control_merge_hdr_job_run(), dt_control_refresh_exif_run(), dt_drawlayer_io_sidecar_path(), dt_exif_xmp_attach_export(), dt_exif_xmp_read_string(), dt_get_dirname_from_imgid(), dt_get_lightroom_xmp(), dt_image_copy_rename(), dt_image_find_best_color_profile(), dt_image_get_audio_path(), dt_image_get_text_path(), dt_image_local_copy_reset(), dt_image_local_copy_synch(), dt_image_rename(), dt_image_safe_remove(), dt_imageio_export_with_flags(), dt_view_image_info_update(), store(), store(), try_enter(), and write_image().
| char * dt_image_get_audio_path | ( | const int32_t | imgid | ) |
helper function to get the audio file filename that is accompanying the image. g_free() after use
Definition at line 2748 of file common/image.c.
References dt_image_full_path(), dt_image_get_audio_path_from_path(), DT_PATH_MAX, and FALSE.
Referenced by dt_view_audio_start().
| char * dt_image_get_audio_path_from_path | ( | const char * | image_path | ) |
Definition at line 2725 of file common/image.c.
References dt_free.
Referenced by _image_import_internal(), and dt_image_get_audio_path().
| void dt_image_get_datetime | ( | const int32_t | imgid, |
| char * | datetime | ||
| ) |
Definition at line 2625 of file common/image.c.
References dt_datetime_img_to_exif(), DT_DATETIME_LENGTH, dt_image_cache_get(), dt_image_cache_read_release(), and IS_NULL_PTR.
Referenced by _get_image_datetime(), _image_set_datetime(), _image_set_datetimes(), and dt_control_datetime_job_run().
| dt_image_orientation_t dt_image_get_effective_orientation | ( | const dt_image_t * | img | ) |
Orientation every module after flip sees, for an image we already hold.
Same answer as dt_image_get_orientation(imgid) – the flip module's committed history, else the EXIF orientation – but without re-entering the image cache, so it is safe to call from contexts that already hold (or are held by) an image-cache lock, e.g. reload_defaults().
Definition at line 1289 of file common/image.c.
References _image_get_history_orientation(), dt_image_orientation(), dt_image_t::id, IS_NULL_PTR, ORIENTATION_NONE, and ORIENTATION_NULL.
Referenced by _ashift_orientation_swaps_axes(), _orient_scope_buf(), and reload_defaults().
| float dt_image_get_exposure_bias | ( | const struct dt_image_t * | image_storage | ) |
Definition at line 2887 of file common/image.c.
References dt_image_t::exif_exposure_bias.
Referenced by reload_defaults().
| int32_t dt_image_get_id | ( | int32_t | film_id, |
| const gchar * | filename | ||
| ) |
get image id by film_id and filename
Definition at line 1884 of file common/image.c.
References dt_image_repository_find_by_film_and_filename().
Referenced by _image_import_internal(), and _is_in_library_by_path().
| int32_t dt_image_get_id_full_path | ( | const gchar * | filename | ) |
get image id by filename
Definition at line 1873 of file common/image.c.
References dt_free, and dt_image_repository_find_by_folder_and_filename().
Referenced by _resync_xmp_duplicates(), and dt_image_synch_all_xmp().
| void dt_image_get_location | ( | const int32_t | imgid, |
| dt_image_geoloc_t * | geoloc | ||
| ) |
get image location lon/lat/ele
Definition at line 843 of file common/image.c.
References dt_image_cache_get(), dt_image_cache_read_release(), dt_image_geoloc_t::elevation, dt_image_t::geoloc, dt_image_geoloc_t::latitude, and dt_image_geoloc_t::longitude.
Referenced by _image_set_images_locations(), _image_set_location(), _view_map_center_on_image(), and _view_map_display_selected().
| dt_image_orientation_t dt_image_get_orientation | ( | const int32_t | imgid | ) |
Definition at line 1297 of file common/image.c.
References _image_get_history_orientation(), dt_image_cache_get(), dt_image_cache_read_release(), dt_image_orientation(), IS_NULL_PTR, ORIENTATION_NONE, and ORIENTATION_NULL.
Referenced by dt_image_flip().
| char * dt_image_get_text_path | ( | const int32_t | imgid | ) |
helper function to get the text file filename that is accompanying the image. g_free() after use
Definition at line 2868 of file common/image.c.
References dt_image_full_path(), dt_image_get_text_path_from_path(), DT_PATH_MAX, FALSE, and TRUE.
Referenced by _expand_geometry_and_misc().
| char * dt_image_get_text_path_from_path | ( | const char * | image_path | ) |
Definition at line 2794 of file common/image.c.
References _text_path_legacy_if_exists(), and IS_NULL_PTR.
Referenced by _copy_text_sidecar_if_present(), _image_import_internal(), _import_copy_txt(), _move_text_sidecar_if_present(), and dt_image_get_text_path().
| gboolean dt_image_get_usercrop | ( | const dt_image_t * | img, |
| dt_boundingbox_t | box | ||
| ) |
Camera framing of img in the raw's own, un-oriented frame.
Writes the canonical (top, left, bottom, right) box into box and returns TRUE only when the image carries a valid, non-identity DNG DefaultUserCrop; otherwise box is left at identity. Use this for buffers still in sensor orientation (embedded previews before the EXIF rotation is applied); everything downstream of flip wants dt_image_get_usercrop_oriented() instead.
Definition at line 1173 of file common/image.c.
References DT_IMAGE_USERCROP_VALID, FALSE, i, IS_NULL_PTR, TRUE, dt_image_t::usercrop, and dt_image_t::usercrop_status.
Referenced by _import_get_thumbnail(), dt_image_get_usercrop_oriented(), and dt_image_resolve_usercrop().
| gboolean dt_image_get_usercrop_oriented | ( | const dt_image_t * | img, |
| const dt_image_orientation_t | orientation, | ||
| dt_boundingbox_t | box | ||
| ) |
Resolve the camera framing of img into the given orientation.
Writes the oriented (top, left, bottom, right) box into box and returns TRUE only when the image carries a valid, non-identity DNG DefaultUserCrop. Otherwise box is left at identity and FALSE is returned, so callers can assign it unconditionally.
Definition at line 1240 of file common/image.c.
References dt_image_get_usercrop(), dt_image_orient_boundingbox(), FALSE, and TRUE.
Referenced by reload_defaults().
| gboolean dt_image_get_xmp_mode | ( | ) |
get the mode xmp sidecars are written. Lock-free: reads a cached value, refreshed only at startup and on DT_SIGNAL_PREFERENCES_CHANGE.
Definition at line 603 of file common/image.c.
References _xmp_mode_cache, and dt_atomic_get_int().
Referenced by _image_import_internal(), _resync_xmp_duplicates(), dt_control_save_xmps_job_run(), dt_exif_decode_xmp_data(), dt_image_cache_write_release(), dt_image_safe_remove(), dt_image_synch_all_xmp(), dt_image_synch_xmps(), dt_image_write_sidecar_file(), and dt_metadata_set_import().
| int dt_image_get_xmp_rating | ( | const dt_image_t * | img | ) |
Definition at line 819 of file common/image.c.
References dt_image_get_xmp_rating_from_flags(), and dt_image_t::flags.
| int dt_image_get_xmp_rating_from_flags | ( | const int | flags | ) |
Definition at line 812 of file common/image.c.
References DT_IMAGE_REJECTED, DT_VIEW_RATINGS_MASK, and flags.
Referenced by _exif_xmp_read_data(), _exif_xmp_read_data_export(), dt_image_cache_write_release(), dt_image_derive_fields(), and dt_image_get_xmp_rating().
| void dt_image_history_changed | ( | const int32_t | imgid, |
| const gboolean | refresh_filmstrip | ||
| ) |
Notify the caches and GUI that an image's development history changed. Reloads the cached image metadata from the DB (so history_items, the "altered" flag that the thumbnail regeneration uses to pick raw processing over the embedded JPEG, is correct), drops the stale rendered thumbnail and requests a refresh. Callers MUST have already persisted the new history to the DB. Pass refresh_filmstrip = FALSE from darkroom write paths: the filmstrip is best-effort and must not steal pipeline resources from the realtime main preview.
Definition at line 1093 of file common/image.c.
References dt_image_cache_get_reload(), DT_IMAGE_CACHE_RELAXED, dt_image_cache_write_release(), dt_mipmap_cache_remove(), dt_thumbnail_notify_image_changed(), and TRUE.
Referenced by _history_load_and_apply_apply(), _import_image(), _pop_undo(), _studio_style_apply_callback(), dt_dev_history_notify_change(), and dt_image_set_flip().
| int32_t dt_image_import | ( | int32_t | film_id, |
| const char * | filename, | ||
| gboolean | raise_signals | ||
| ) |
Definition at line 1905 of file common/image.c.
References _image_import_internal(), and TRUE.
Referenced by _film_import1(), _import_job(), create_test_image(), dt_control_merge_hdr_job_run(), dt_image_import_job_run(), dt_load_from_string(), and main().
| int32_t dt_image_import_lua | ( | int32_t | film_id, |
| const char * | filename | ||
| ) |
imports a new image from raw/etc file and adds it to the data base and image cache. Use from lua thread.
Definition at line 1910 of file common/image.c.
References _image_import_internal(), FALSE, and TRUE.
| void dt_image_init | ( | dt_image_t * | img | ) |
inits basic values to sensible defaults.
Definition at line 1915 of file common/image.c.
References dt_image_t::adobe_XYZ_to_CAM, dt_image_t::cache_entry, dt_image_t::camera_alias, dt_image_t::camera_legacy_makermodel, dt_image_t::camera_maker, dt_image_t::camera_makermodel, dt_image_t::camera_missing_sample, dt_image_t::camera_model, dt_image_t::change_timestamp, dt_iop_buffer_dsc_t::channels, dt_image_t::color_labels, dt_image_t::colorspace, dt_image_t::crop_height, dt_image_t::crop_width, dt_image_t::crop_x, dt_image_t::crop_y, dt_image_t::d65_color_matrix, dt_image_t::datetime, dt_image_t::dng_gain_maps, dt_image_t::dsc, dt_datetime_exif_to_img(), DT_IMAGE_COLORSPACE_NONE, DT_IMAGE_USERCROP_UNKNOWN, dt_image_geoloc_t::elevation, dt_image_t::embedded_profile, dt_image_t::exif_aperture, dt_image_t::exif_crop, dt_image_t::exif_exposure, dt_image_t::exif_exposure_bias, dt_image_t::exif_focal_length, dt_image_t::exif_focus_distance, dt_image_t::exif_inited, dt_image_t::exif_iso, dt_image_t::exif_lens, dt_image_t::exif_maker, dt_image_t::exif_model, dt_image_t::export_timestamp, FALSE, dt_image_t::filename, dt_image_t::film_id, dt_image_t::filmroll, dt_image_t::flags, dt_image_t::folder, dt_image_t::fuji_rotation_pos, dt_image_t::fullpath, dt_image_t::geoloc, dt_image_t::group_id, dt_image_t::group_members, dt_image_t::has_audio, dt_image_t::has_localcopy, dt_image_t::height, dt_image_t::history_hash, dt_image_t::history_items, i, dt_image_t::id, dt_image_t::import_timestamp, dt_image_t::is_bw, dt_image_t::is_bw_flow, dt_image_t::is_hdr, k, dt_image_geoloc_t::latitude, dt_image_raw_parameters_t::legacy, dt_image_t::legacy_flip, dt_image_t::loader, LOADER_UNKNOWN, dt_image_t::local_copy_legacy_path, dt_image_t::local_copy_path, dt_image_geoloc_t::longitude, dt_image_t::mipmap_hash, dt_image_t::orientation, ORIENTATION_NULL, dt_image_t::p_height, dt_image_t::p_width, dt_image_t::pixel_aspect_ratio, dt_image_t::print_timestamp, dt_image_t::profile, dt_image_t::profile_size, dt_image_t::rating, dt_image_t::raw_black_level, dt_image_t::raw_black_level_separate, dt_image_t::raw_white_point, dt_image_t::self_hash, TYPE_UNKNOWN, UNKNOWN_IMAGE, dt_image_raw_parameters_t::user_flip, dt_image_t::usercrop, dt_image_t::usercrop_status, dt_image_t::version, dt_image_t::wb_coeffs, and dt_image_t::width.
Referenced by _import_copy_file(), _set_test_path(), dt_dev_init(), dt_folder_survey_destination_preview(), dt_image_cache_allocate(), dt_image_repository_foreach_collected(), dt_image_resolve_usercrop(), and update_preview_cb().
| gboolean dt_image_is_hdr | ( | const dt_image_t * | img | ) |
returns non-zero if the image holds high-dynamic-range (floating-point) data. Flag-only test of DT_IMAGE_HDR — set from the decoded buffer datatype (16- or 32-bit float), see dt_image_buffer_resolve_flags(). Use this instead of testing the flag by hand.
Definition at line 192 of file common/image.c.
References DT_IMAGE_HDR, and dt_image_t::flags.
Referenced by _dev_auto_apply_presets(), _gui_presets_popup_menu_show_internal(), _import_get_thumbnail(), _metadata_get_flags(), commit_params(), dt_gui_presets_autoapply_for_module(), dt_image_cache_write_release(), dt_image_derive_fields(), dt_image_pipe_class(), dt_image_print_debug_info(), and image_is_normalized().
| gboolean dt_image_is_ldr | ( | const dt_image_t * | img | ) |
returns non-zero if the image holds low-dynamic-range (integer, display-referred) data. Flag-only test of DT_IMAGE_LDR — set from the decoded buffer datatype, see dt_image_buffer_resolve_flags(). Use this instead of testing the flag by hand.
Definition at line 187 of file common/image.c.
References DT_IMAGE_LDR, and dt_image_t::flags.
Referenced by _metadata_get_flags(), dt_image_pipe_class(), and dt_image_print_debug_info().
| gboolean dt_image_is_matrix_correction_supported | ( | const dt_image_t * | img | ) |
returns non-zero if the image supports a color correction matrix
Definition at line 267 of file common/image.c.
References _image_matrix_has_data(), dt_image_t::adobe_XYZ_to_CAM, dt_image_t::d65_color_matrix, DT_IMAGE_MONOCHROME, DT_IMAGE_RAW, DT_IMAGE_S_RAW, FALSE, dt_image_t::flags, and TRUE.
Referenced by _custom_wb_from_coeffs(), _dev_auto_apply_presets(), _insert_default_modules(), calculate_bogus_daylight_wb(), commit_params(), dt_colorspaces_get_input_profile_from_image(), dt_gui_presets_autoapply_for_module(), dt_image_find_best_color_profile(), dt_image_print_debug_info(), find_temperature_from_raw_coeffs(), gui_update(), process(), process_cl(), reload_defaults(), and update_profile_list().
| gboolean dt_image_is_monochrome | ( | const dt_image_t * | img | ) |
returns non-zero if this image was taken using a monochrome camera
Definition at line 197 of file common/image.c.
References DT_IMAGE_MONOCHROME, DT_IMAGE_MONOCHROME_BAYER, FALSE, dt_image_t::flags, and TRUE.
Referenced by _cacorrect_supported(), _highlights_image_supported(), _hotpixels_supported(), _lens_build_data(), _lens_corrections_available(), _lens_rebuild_axis_row(), _lens_used_mask(), colorpicker_callback(), distort_backtransform(), distort_transform(), dt_image_find_best_color_profile(), dt_image_print_debug_info(), enable(), force_enable(), gui_update(), gui_update(), process(), process_cl(), and reload_defaults().
| gboolean dt_image_is_mosaiced | ( | const dt_image_t * | img | ) |
TRUE if the image has been imported/flagged as carrying a CFA mosaic (DT_IMAGE_MOSAIC). Only authoritative once dt_image_pipe_class_is_provisional() is FALSE.
Definition at line 310 of file common/image.c.
References DT_IMAGE_MOSAIC, and dt_image_t::flags.
Referenced by _highlights_image_supported(), and dt_image_print_debug_info().
| gboolean dt_image_is_raw | ( | const dt_image_t * | img | ) |
returns non-zero if the image is flagged as raw (mosaic-capable) sensor data.
Definition at line 177 of file common/image.c.
References DT_IMAGE_RAW, and dt_image_t::flags.
Referenced by _exif_decode_exif_data(), _insert_default_modules(), _metadata_get_flags(), default_input_format(), default_output_format(), dt_image_print_debug_info(), dt_lightroom_import(), force_enable(), and reload_defaults().
| gboolean dt_image_is_sraw | ( | const dt_image_t * | img | ) |
TRUE if the image was decoded as already-demosaiced raw (sRAW / linear DNG).
Definition at line 305 of file common/image.c.
References DT_IMAGE_S_RAW, and dt_image_t::flags.
Referenced by dt_image_print_debug_info().
| 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 | ||
| ) |
pregenerate modern and legacy pathes to local copies from full path
Definition at line 748 of file common/image.c.
References dt_free, dt_loc_get_user_cache_dir(), DT_PATH_MAX, and IS_NULL_PTR.
Referenced by dt_image_cache_write_release(), and dt_image_from_stmt().
| int dt_image_local_copy_reset | ( | const int32_t | imgid | ) |
Definition at line 2368 of file common/image.c.
References _move_text_sidecar_if_present(), _nb_other_local_copy_for(), dt_control_log(), dt_control_queue_redraw_center(), dt_control_save_xmp(), dt_image_cache_get(), dt_image_cache_read_release(), DT_IMAGE_CACHE_RELAXED, dt_image_cache_write_release(), dt_image_choose_input_path(), dt_image_full_path(), DT_IMAGE_LOCAL_COPY, dt_image_path_append_version(), dt_loc_get_user_cache_dir(), DT_PATH_MAX, FALSE, dt_image_t::flags, and TRUE.
Referenced by _image_remove(), dt_control_delete_images_job_run(), dt_control_local_copy_images_job_run(), and dt_film_remove().
| int dt_image_local_copy_set | ( | const int32_t | imgid | ) |
Definition at line 2298 of file common/image.c.
References _copy_text_sidecar_if_present(), dt_control_log(), dt_control_queue_redraw_center(), dt_image_cache_get(), dt_image_cache_read_release(), DT_IMAGE_CACHE_RELAXED, dt_image_cache_write_release(), dt_image_choose_input_path(), DT_IMAGE_LOCAL_COPY, DT_IMAGE_PATH_LOCAL_COPY, DT_IMAGE_PATH_LOCAL_COPY_LEGACY, DT_IMAGE_PATH_NONE, DT_PATH_MAX, dt_image_t::flags, dt_image_t::fullpath, dt_image_t::local_copy_legacy_path, dt_image_t::local_copy_path, and TRUE.
Referenced by dt_control_local_copy_images_job_run().
| void dt_image_local_copy_synch | ( | ) |
Definition at line 2594 of file common/image.c.
References dt_control_log(), dt_control_save_xmps_forced(), dt_image_full_path(), DT_IMAGE_LOCAL_COPY, dt_image_repository_get_ids_with_flag(), DT_PATH_MAX, and FALSE.
Referenced by append_run().
| int dt_image_monochrome_flags | ( | const dt_image_t * | img | ) |
returns the bitmask containing info about monochrome images
Definition at line 290 of file common/image.c.
References DT_IMAGE_MONOCHROME, DT_IMAGE_MONOCHROME_BAYER, DT_IMAGE_MONOCHROME_PREVIEW, and dt_image_t::flags.
Referenced by _dev_auto_apply_presets(), _gui_presets_popup_menu_show_internal(), _image_set_monochrome_flag(), _metadata_get_flags(), dt_gui_presets_autoapply_for_module(), dt_image_cache_write_release(), dt_image_derive_fields(), and dt_image_print_debug_info().
| int32_t dt_image_move | ( | const int32_t | imgid, |
| const int32_t | filmid | ||
| ) |
physically move image with imgid and its duplicates to the film roll given by filmid. returns -1 on error, 0 on success.
Definition at line 2199 of file common/image.c.
References dt_image_rename().
Referenced by _drop_move_to_folder(), and dt_control_move_images_job_run().
| gboolean dt_image_needs_demosaic | ( | const dt_image_t * | img | ) |
TRUE if the buffer carries a CFA mosaic and therefore needs demosaicing.
Definition at line 351 of file common/image.c.
References dt_image_pipe_class(), and DT_IMAGE_PIPE_MOSAIC_RAW.
Referenced by _cacorrect_supported(), _hotpixels_supported(), _rawdenoise_supported(), _rawdenoiseai_supported(), dt_image_print_debug_info(), force_enable(), and reload_defaults().
| gboolean dt_image_needs_rawprepare | ( | const dt_image_t * | img | ) |
TRUE if the buffer carries raw sensor colorimetry (mosaiced raw or already-demosaiced sRAW/linear DNG), i.e. it needs the rawprepare stage and a camera input profile.
Definition at line 315 of file common/image.c.
References DT_IMAGE_RAW, DT_IMAGE_S_RAW, and dt_image_t::flags.
Referenced by _dev_auto_apply_presets(), _get_structure(), _gui_presets_popup_menu_show_internal(), commit_params(), commit_params(), dt_gui_presets_autoapply_for_module(), dt_image_buffer_resolve_flags(), dt_image_print_debug_info(), dt_ioppr_get_iop_order_list(), dt_ioppr_get_iop_order_version(), dt_ioppr_set_default_iop_order(), enable(), enable(), gui_changed(), gui_update(), prepare_matrices(), and reload_defaults().
| void dt_image_orient_boundingbox | ( | const dt_boundingbox_t | in, |
| const dt_image_orientation_t | orientation, | ||
| dt_boundingbox_t | out | ||
| ) |
Map a normalized (top, left, bottom, right) box through an orientation.
Pure helper: in and out may alias. orientation uses the internal flip bits (ORIENTATION_FLIP_X/Y, ORIENTATION_SWAP_XY), applied in the same order as iop/flip.c's own coordinate transform, so the result lands in the frame every module after flip sees.
Definition at line 1132 of file common/image.c.
References ORIENTATION_FLIP_X, ORIENTATION_FLIP_Y, ORIENTATION_SWAP_XY, out, and top.
Referenced by dt_image_get_usercrop_oriented().
|
inlinestatic |
returns the orientation bits of the image from exif.
Definition at line 692 of file image.h.
References dt_image_t::orientation, ORIENTATION_NONE, and ORIENTATION_NULL.
Referenced by _flip_h(), _flip_resolve(), _flip_v(), do_rotate(), dt_image_get_effective_orientation(), dt_image_get_orientation(), dt_masks_legacy_params_v1_to_v2(), legacy_params(), and reload_defaults().
|
inlinestatic |
return the raw orientation, from jpg orientation.
Definition at line 702 of file image.h.
References EXIF_ORIENTATION_FLIP_HORIZONTALLY, EXIF_ORIENTATION_FLIP_VERTICALLY, EXIF_ORIENTATION_NONE, EXIF_ORIENTATION_ROTATE_180_DEG, EXIF_ORIENTATION_ROTATE_CCW_90_DEG, EXIF_ORIENTATION_ROTATE_CW_90_DEG, EXIF_ORIENTATION_TRANSPOSE, EXIF_ORIENTATION_TRANSVERSE, ORIENTATION_FLIP_HORIZONTALLY, ORIENTATION_FLIP_VERTICALLY, ORIENTATION_NONE, ORIENTATION_ROTATE_180_DEG, ORIENTATION_ROTATE_CCW_90_DEG, ORIENTATION_ROTATE_CW_90_DEG, ORIENTATION_TRANSPOSE, and ORIENTATION_TRANSVERSE.
Referenced by _exif_decode_exif_data(), and dt_lightroom_import().
| void dt_image_path_append_version | ( | const int32_t | imgid, |
| char * | pathname, | ||
| size_t | pathname_len | ||
| ) |
appends version numbering for duplicated images.
Definition at line 794 of file common/image.c.
References dt_image_path_append_version_no_db(), and dt_image_repository_get_version().
Referenced by _write_sidecar_file_from_image_locked(), dt_control_delete_images_job_run(), dt_exif_xmp_attach_export(), dt_exif_xmp_read_string(), dt_image_local_copy_reset(), dt_image_rename(), and store().
| void dt_image_path_append_version_no_db | ( | int | version, |
| char * | pathname, | ||
| size_t | pathname_len | ||
| ) |
appends version numbering for duplicated images without querying the db.
Definition at line 775 of file common/image.c.
Referenced by _crawl_image(), and dt_image_path_append_version().
| dt_image_pipe_class_t dt_image_pipe_class | ( | const dt_image_t * | img | ) |
returns the mutually-exclusive pipeline class of the image (from flags only, works on undecoded images). Before the first decode the result is provisional; see dt_image_pipe_class_is_provisional().
Definition at line 321 of file common/image.c.
References DT_IMAGE_BUFFER_RESOLVED, dt_image_is_hdr(), dt_image_is_ldr(), DT_IMAGE_MOSAIC, DT_IMAGE_PIPE_LINEAR_RAW, DT_IMAGE_PIPE_MOSAIC_RAW, DT_IMAGE_PIPE_RGB_HDR, DT_IMAGE_PIPE_RGB_LDR, DT_IMAGE_PIPE_UNKNOWN, DT_IMAGE_RAW, DT_IMAGE_S_RAW, and dt_image_t::flags.
Referenced by _custom_wb_from_coeffs(), _get_structure(), commit_params(), commit_params(), commit_params(), dt_image_needs_demosaic(), dt_image_print_debug_info(), dt_image_set_provisional_dsc(), force_enable(), and reload_defaults().
| gboolean dt_image_pipe_class_is_provisional | ( | const dt_image_t * | img | ) |
TRUE while the class is only a provisional guess from the file extension, i.e. the codec has not decoded the buffer yet (DT_IMAGE_BUFFER_RESOLVED not set).
Definition at line 300 of file common/image.c.
References DT_IMAGE_BUFFER_RESOLVED, and dt_image_t::flags.
Referenced by dt_image_print_debug_info().
| const char * dt_image_pipe_class_name | ( | const dt_image_pipe_class_t | klass | ) |
untranslated, stable identifier for a pipeline class (for logs/debug).
Definition at line 356 of file common/image.c.
References DT_IMAGE_PIPE_LINEAR_RAW, DT_IMAGE_PIPE_MOSAIC_RAW, DT_IMAGE_PIPE_RGB_HDR, DT_IMAGE_PIPE_RGB_LDR, and DT_IMAGE_PIPE_UNKNOWN.
Referenced by _custom_wb_from_coeffs(), _get_structure(), commit_params(), commit_params(), commit_params(), dt_image_print_debug_info(), force_enable(), and reload_defaults().
| void dt_image_print_debug_info | ( | const dt_image_t * | img, |
| const char * | context | ||
| ) |
debug helper: dump image flags and buffer details (DT_DEBUG_IMAGEIO)
Definition at line 453 of file common/image.c.
References _image_buf_type_to_string(), _image_colorspace_to_string(), bit_depth, bpp, dt_iop_buffer_dsc_t::bpp, dt_iop_buffer_dsc_t::channels, dt_image_t::colorspace, dt_image_t::crop_height, dt_image_t::crop_width, dt_image_t::crop_x, dt_image_t::crop_y, dt_iop_buffer_dsc_t::cst, dt_image_t::d65_color_matrix, dt_iop_buffer_dsc_t::datatype, dt_image_t::dsc, DT_DEBUG_IMAGEIO, DT_IMAGE_4BAYER, DT_IMAGE_AUTO_PRESETS_APPLIED, DT_IMAGE_HAS_ADDITIONAL_DNG_TAGS, DT_IMAGE_HAS_TXT, DT_IMAGE_HAS_WAV, dt_image_is_hdr(), dt_image_is_ldr(), dt_image_is_matrix_correction_supported(), dt_image_is_monochrome(), dt_image_is_mosaiced(), dt_image_is_raw(), dt_image_is_sraw(), DT_IMAGE_LOCAL_COPY, DT_IMAGE_MONOCHROME_BAYER, dt_image_monochrome_flags(), DT_IMAGE_MONOCHROME_PREVIEW, dt_image_needs_demosaic(), dt_image_needs_rawprepare(), DT_IMAGE_NO_LEGACY_PRESETS, dt_image_pipe_class(), dt_image_pipe_class_is_provisional(), dt_image_pipe_class_name(), DT_IMAGE_REJECTED, DT_IMAGE_REMOVE, DT_IMAGE_S_RAW, dt_image_use_monochrome_workflow(), dt_print(), dt_image_t::filename, dt_iop_buffer_dsc_t::filters, flags, dt_image_t::flags, dt_image_t::fullpath, dt_image_t::has_audio, dt_image_t::has_localcopy, dt_image_t::height, dt_image_t::id, dt_image_t::is_bw, dt_image_t::is_bw_flow, dt_image_t::is_hdr, IS_NULL_PTR, dt_image_t::orientation, dt_image_t::p_height, dt_image_t::p_width, dt_image_t::pixel_aspect_ratio, dt_iop_buffer_dsc_t::processed_maximum, dt_image_t::raw_black_level, dt_iop_buffer_dsc_t::raw_black_level, dt_image_t::raw_black_level_separate, dt_image_t::raw_white_point, dt_iop_buffer_dsc_t::raw_white_point, dt_iop_buffer_dsc_t::rawprepare, TYPE_FLOAT, TYPE_UINT16, TYPE_UINT8, TYPE_UNKNOWN, and dt_image_t::width.
Referenced by reload_defaults().
| void dt_image_print_exif | ( | const dt_image_t * | img, |
| char * | line, | ||
| size_t | line_len | ||
| ) |
prints a one-line exif information string.
Definition at line 802 of file common/image.c.
References dt_free, dt_util_format_exposure(), dt_image_t::exif_aperture, dt_image_t::exif_exposure, dt_image_t::exif_focal_length, and dt_image_t::exif_iso.
Referenced by _expand_image_and_version(), and finalize_store().
| int dt_image_read_duplicates | ( | const uint32_t | id, |
| const char * | filename, | ||
| const gboolean | clear_selection | ||
| ) |
Definition at line 1595 of file common/image.c.
References c3, DT_COLLECTION_CHANGE_RELOAD, dt_collection_get_global(), DT_COLLECTION_PROP_UNDEF, dt_collection_update_query(), dt_exif_xmp_read(), dt_free, dt_free_gpointer(), dt_grouping_add_to_group(), dt_image_cache_get(), dt_image_cache_read_release(), DT_IMAGE_CACHE_RELAXED, dt_image_cache_write_release(), dt_image_find_xmps(), dt_image_repository_duplicate(), dt_image_repository_set_version(), DT_PATH_MAX, dt_selection_clear(), dt_selection_get_global(), dt_image_t::group_id, IS_NULL_PTR, dt_image_t::version, and void().
Referenced by _image_import_internal(), and _import_image().
| void dt_image_refresh_makermodel | ( | dt_image_t * | img | ) |
Refresh makermodel from the raw and exif values
Definition at line 2001 of file common/image.c.
References dt_image_t::camera_alias, dt_image_t::camera_maker, dt_image_t::camera_makermodel, dt_image_t::camera_model, dt_imageio_lookup_makermodel(), dt_image_t::exif_maker, and dt_image_t::exif_model.
Referenced by _exif_decode_exif_data(), dt_image_derive_fields(), and dt_imageio_open_rawspeed().
| void dt_image_remove | ( | const int32_t | imgid | ) |
removes the given image from the database.
Definition at line 1501 of file common/image.c.
References _image_remove(), and FALSE.
Referenced by _pop_undo(), and dt_control_delete_images_job_run().
| void dt_image_remove_undoable | ( | const int32_t | imgid | ) |
Same as dt_image_remove(), and records the removal on the undo stack.
The rows are staged in memory.removed_* before they are deleted (see database/removed_image_repository.h) and copied back if the user undoes, so this is for "remove from library", where the file survives on disk and only the database entry is being thrown away. Deleting the file itself has nothing to undo and stays on dt_image_remove(). The snapshot is dropped, and the removal made permanent, when the undo record is discarded – which the lighttable does on every view entry.
Definition at line 1506 of file common/image.c.
References _image_remove(), and TRUE.
Referenced by dt_control_remove_images_job_run().
| int32_t dt_image_rename | ( | const int32_t | imgid, |
| const int32_t | filmid, | ||
| const gchar * | newname | ||
| ) |
physically move image with imgid and its duplicates to the film roll given by filmid and the name given by newname. returns -1 on error, 0 on success.
Definition at line 2019 of file common/image.c.
References _move_text_sidecar_if_present(), dt_control_log(), dt_film_repository_get_folder(), dt_free, dt_image_cache_get(), dt_image_cache_read_release(), DT_IMAGE_CACHE_SAFE, dt_image_cache_write_release(), dt_image_choose_input_path(), dt_image_full_path(), dt_image_path_append_version(), dt_image_repository_get_duplicate_ids(), DT_MAX_FILENAME_LEN, DT_PATH_MAX, FALSE, dt_image_t::filename, dt_image_t::film_id, and TRUE.
Referenced by dt_image_move().
| gboolean dt_image_resolve_usercrop | ( | const int32_t | imgid, |
| dt_boundingbox_t | box | ||
| ) |
Camera framing for an image id, reading the file once if we have not yet.
Same result as dt_image_get_usercrop(), for callers that only hold an image id and cannot rely on a prior raw decode to have populated the runtime state – notably embedded-preview thumbnails, which never decode the raw. The answer is memoized in the image cache. Takes image-cache locks internally: never call it while already holding one.
Definition at line 1184 of file common/image.c.
References dt_exif_read_usercrop(), dt_image_cache_get(), dt_image_cache_is_ready(), dt_image_cache_read_release(), DT_IMAGE_CACHE_RELAXED, dt_image_cache_write_release(), dt_image_choose_input_path(), dt_image_get_usercrop(), DT_IMAGE_HAS_ADDITIONAL_DNG_TAGS, dt_image_init(), DT_IMAGE_PATH_NONE, DT_IMAGE_USERCROP_UNKNOWN, DT_PATH_MAX, FALSE, dt_image_t::flags, i, dt_image_t::id, IS_NULL_PTR, dt_image_t::usercrop, and dt_image_t::usercrop_status.
Referenced by _init_8().
| gboolean dt_image_safe_remove | ( | const int32_t | imgid | ) |
Definition at line 636 of file common/image.c.
References dt_image_full_path(), dt_image_get_xmp_mode(), DT_PATH_MAX, and TRUE.
Referenced by dt_control_remove_images_job_run(), and dt_film_remove().
| void dt_image_set_datetime | ( | const GList * | imgs, |
| const char * | datetime, | ||
| const gboolean | undo_on | ||
| ) |
Definition at line 2709 of file common/image.c.
References _datetime_undo_data_free(), _image_set_datetime(), _pop_undo(), DT_UNDO_DATETIME, dt_undo_end_group(), dt_undo_get_global(), dt_undo_record(), dt_undo_start_group(), and IS_NULL_PTR.
Referenced by dt_control_datetime_job_run().
| void dt_image_set_datetimes | ( | const GList * | imgs, |
| const GArray * | dtime, | ||
| const gboolean | undo_on | ||
| ) |
Definition at line 2672 of file common/image.c.
References _datetime_undo_data_free(), _image_set_datetimes(), _pop_undo(), DT_UNDO_DATETIME, dt_undo_end_group(), dt_undo_get_global(), dt_undo_record(), dt_undo_start_group(), and IS_NULL_PTR.
Referenced by dt_control_datetime_job_run().
| void dt_image_set_flip | ( | const int32_t | imgid, |
| const dt_image_orientation_t | user_flip | ||
| ) |
Definition at line 1116 of file common/image.c.
References dt_control_save_xmp(), dt_history_repository_get_next_num(), dt_history_repository_set_end(), dt_history_repository_write_item(), dt_image_history_changed(), and TRUE.
Referenced by dt_image_flip().
| void dt_image_set_images_locations | ( | const GList * | imgs, |
| const GArray * | gloc, | ||
| const gboolean | undo_on | ||
| ) |
set images locations lon/lat/ele
Definition at line 1077 of file common/image.c.
References _geotag_undo_data_free(), _image_set_images_locations(), _pop_undo(), dt_undo_end_group(), DT_UNDO_GEOTAG, dt_undo_get_global(), dt_undo_record(), dt_undo_start_group(), and IS_NULL_PTR.
Referenced by dt_control_gpx_apply_job_run().
| void dt_image_set_location | ( | const int32_t | imgid, |
| const dt_image_geoloc_t * | geoloc, | ||
| const gboolean | undo_on, | ||
| const gboolean | group_on | ||
| ) |
set image location lon/lat/ele
Definition at line 1040 of file common/image.c.
References dt_act_on_get_images(), dt_grouping_add_grouped_images(), dt_image_set_locations(), and UNKNOWN_IMAGE.
Referenced by dt_lightroom_import().
| void dt_image_set_locations | ( | const GList * | img, |
| const dt_image_geoloc_t * | geoloc, | ||
| const gboolean | undo_on | ||
| ) |
set images location lon/lat/ele
Definition at line 1023 of file common/image.c.
References _geotag_undo_data_free(), _image_set_location(), _pop_undo(), dt_undo_end_group(), DT_UNDO_GEOTAG, dt_undo_get_global(), dt_undo_record(), and dt_undo_start_group().
Referenced by _drag_and_drop_received(), and dt_image_set_location().
| void dt_image_set_monochrome_flag | ( | const int32_t | imgid, |
| gboolean | monochrome | ||
| ) |
set the monochrome flags if monochrome is TRUE and clear it otherwise
Definition at line 246 of file common/image.c.
References _image_set_monochrome_flag(), and TRUE.
Referenced by dt_control_monochrome_images_job_run().
| void dt_image_set_provisional_dsc | ( | dt_image_t * | img | ) |
Seed a provisional img->dsc descriptor from the (extension-derived) pipeline class so the first pipeline stage has a usable contract before the file is decoded. No-op once the buffer has been resolved (DT_IMAGE_BUFFER_RESOLVED).
Definition at line 394 of file common/image.c.
References dt_iop_buffer_dsc_t::channels, dt_iop_buffer_dsc_t::cst, dt_iop_buffer_dsc_t::datatype, dt_image_t::dsc, DT_IMAGE_BUFFER_RESOLVED, dt_image_pipe_class(), DT_IMAGE_PIPE_LINEAR_RAW, DT_IMAGE_PIPE_MOSAIC_RAW, DT_IMAGE_PIPE_RGB_HDR, DT_IMAGE_PIPE_RGB_LDR, DT_IMAGE_PIPE_UNKNOWN, dt_iop_buffer_dsc_update_bpp(), dt_iop_buffer_dsc_t::filters, dt_image_t::flags, IOP_CS_RAW, IOP_CS_RGB, IS_NULL_PTR, TYPE_FLOAT, TYPE_UINT16, and TYPE_UINT8.
Referenced by dt_image_from_stmt().
| void dt_image_set_xmp_rating | ( | dt_image_t * | img, |
| const int | rating | ||
| ) |
Definition at line 824 of file common/image.c.
References DT_IMAGE_REJECTED, DT_VIEW_RATINGS_MASK, and dt_image_t::flags.
Referenced by _exif_decode_exif_data(), and dt_exif_decode_xmp_data().
| void dt_image_synch_all_xmp | ( | const gchar * | pathname | ) |
Definition at line 2579 of file common/image.c.
References dt_control_save_xmps(), dt_image_get_id_full_path(), dt_image_get_xmp_mode(), FALSE, and UNKNOWN_IMAGE.
Referenced by _image_import_internal().
| void dt_image_synch_xmp | ( | const int | selected | ) |
Definition at line 2561 of file common/image.c.
References dt_act_on_get_images(), dt_control_save_xmps(), dt_image_synch_xmps(), FALSE, and selected.
Referenced by _drop_attach_tag(), _event_dnd_received(), _pop_menu_attached_attach_to_all(), dt_lightroom_import(), and set_params().
| void dt_image_synch_xmps | ( | const GList * | img | ) |
Definition at line 2552 of file common/image.c.
References dt_control_save_xmps(), dt_image_get_xmp_mode(), FALSE, and IS_NULL_PTR.
Referenced by _apply_rename_path(), _create_tag_from_entry(), _delete_tagids(), _detach_tagids(), _lib_tagging_tag_key_press(), _lib_tagging_tag_redo_accel(), _pop_menu_dictionary_delete_node(), _pop_menu_dictionary_edit_tag(), _undo_do_undo_redo(), _write_metadata(), dt_image_synch_xmp(), and set_params().
| gboolean dt_image_use_monochrome_workflow | ( | const dt_image_t * | img | ) |
returns true if the image has been tested to be monochrome and the image wants monochrome workflow
Definition at line 284 of file common/image.c.
References DT_IMAGE_MONOCHROME, DT_IMAGE_MONOCHROME_BAYER, DT_IMAGE_MONOCHROME_PREVIEW, DT_IMAGE_MONOCHROME_WORKFLOW, and dt_image_t::flags.
Referenced by dt_image_cache_write_release(), dt_image_derive_fields(), and dt_image_print_debug_info().
| dt_image_write_sidecar_result_t dt_image_write_sidecar_file | ( | const int32_t | imgid | ) |
Definition at line 2514 of file common/image.c.
References _write_sidecar_file_from_image_locked(), DT_DEBUG_CONTROL, dt_image_cache_get(), DT_IMAGE_CACHE_MINIMAL, dt_image_cache_write_release(), dt_image_get_xmp_mode(), DT_IMAGE_WRITE_SIDECAR_CACHE_BUSY, DT_IMAGE_WRITE_SIDECAR_DISABLED, dt_print(), FALSE, IS_NULL_PTR, and res.
Referenced by dt_control_save_xmps_job_run().
| dt_image_write_sidecar_result_t dt_image_write_sidecar_file_forced | ( | const int32_t | imgid | ) |
write a sidecar for imgid unconditionally, bypassing the write_sidecar_files preference and the up-to-date timestamp check. Use only from explicit user-initiated sync commands (menu "Synchronize developments from database to XMP", crawler keep-db, local-copy resynch).
Definition at line 2533 of file common/image.c.
References _write_sidecar_file_from_image_locked(), DT_DEBUG_CONTROL, dt_image_cache_get(), DT_IMAGE_CACHE_MINIMAL, dt_image_cache_write_release(), DT_IMAGE_WRITE_SIDECAR_CACHE_BUSY, DT_IMAGE_WRITE_SIDECAR_DISABLED, dt_print(), IS_NULL_PTR, res, and TRUE.
Referenced by dt_control_save_xmps_job_run(), sync_db_to_xmp(), sync_newest_to_oldest(), and sync_oldest_to_newest().
re-read the "write_sidecar_files" preference from conf and update the cache dt_image_get_xmp_mode() reads. Call once at startup, and wire to DT_SIGNAL_PREFERENCES_CHANGE – never call from a hot path.
Definition at line 608 of file common/image.c.
References _xmp_mode_cache, dt_atomic_set_int(), dt_conf_get_string(), dt_conf_set_string(), dt_free, FALSE, IS_NULL_PTR, res, and TRUE.
Referenced by _xmp_mode_preferences_changed(), and dt_init().
| const char flag |
Definition at line 311 of file image.h.
Referenced by _change_pipe(), _coverage_runs(), _flood_component(), _menuitem_preferences(), _row_has(), _set_flag(), _xmp_append_metadata(), dsvd(), dt_control_generic_image_job_create(), dt_control_generic_images_job_create(), dt_image_repository_clear_flag_among(), dt_image_repository_count_others_with_flag(), dt_image_repository_get_ids_with_flag(), dt_image_repository_get_ids_with_flag_among(), dt_image_repository_set_flag_among(), dt_metadata_init(), dt_preset_repository_update_flag(), and dual_demosaic_cl().
| const struct { ... } loaders_info[LOADER_COUNT] |
Referenced by _metadata_get_flags().
| const char* tooltip |
Definition at line 310 of file image.h.
Referenced by _altered_enter(), _blendop_masks_create_scroll_grid(), _blendop_masks_group_query_tooltip(), _build_softproof_gamut_popover(), _changes_tooltip_callback(), _combobox_new_from_list(), _create_one_button(), _gui_off_callback(), _gui_styles_update_view(), _iop_tooltip_callback(), _lens_add_axis_combobox(), _lib_history_view_query_tooltip(), _lib_metadata_refill_grid(), _mask_indicator_tooltip(), _metadata_get_flags(), _metadata_update_tooltip(), _metadata_update_value(), _refresh_track_list(), _row_tooltip_setup(), _row_tooltip_setup(), _sample_tooltip_callback(), _show_gpx_tracks(), _studio_style_pool_query_tooltip(), _studio_style_styles_query_tooltip(), _styles_add_menu_entry(), _styles_build_tooltip(), _tree_button_tooltip(), _tree_query_tooltip(), append_styles(), checker_motion_notify(), dt_action_button_new(), dt_bauhaus_combobox_add_with_tooltip(), dt_bauhaus_combobox_from_conf(), dt_gui_doc_screenshot_window_show(), dt_iop_togglebutton_new(), dt_iop_togglebutton_new_no_register(), dt_ui_notebook_page(), dtgtk_resize_handle_new(), gui_init(), gui_init(), and new_combobox_entry().