![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
TIFF sidecar I/O API for drawlayer layers. More...
#include <glib.h>#include <limits.h>#include <stddef.h>#include <stdint.h>
Include dependency graph for io.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Data Structures | |
| struct | dt_drawlayer_io_patch_t |
| Raw float RGBA patch used by drawlayer I/O routines. More... | |
| struct | dt_drawlayer_io_layer_info_t |
| Metadata returned when probing one layer directory in sidecar TIFF. More... | |
| struct | dt_drawlayer_io_background_job_params_t |
| Parameters owned by the async "create background from input" job. More... | |
| struct | dt_drawlayer_io_background_job_result_t |
| Result posted back to the UI after background-layer creation. More... | |
Macros | |
| #define | DT_DRAWLAYER_IO_NAME_SIZE 64 |
| #define | DT_DRAWLAYER_IO_PROFILE_SIZE 256 |
Typedefs | |
| typedef struct dt_drawlayer_io_patch_t | dt_drawlayer_io_patch_t |
| Raw float RGBA patch used by drawlayer I/O routines. | |
| typedef struct dt_drawlayer_io_layer_info_t | dt_drawlayer_io_layer_info_t |
| Metadata returned when probing one layer directory in sidecar TIFF. | |
| typedef struct _dt_job_t | dt_job_t |
| typedef struct dt_drawlayer_io_background_job_params_t | dt_drawlayer_io_background_job_params_t |
| Parameters owned by the async "create background from input" job. | |
| typedef struct dt_drawlayer_io_background_job_result_t | dt_drawlayer_io_background_job_result_t |
| Result posted back to the UI after background-layer creation. | |
Functions | |
| gboolean | dt_drawlayer_io_sidecar_path (int32_t imgid, char *path, size_t path_size) |
| Build absolute sidecar TIFF path from image id. | |
| gboolean | dt_drawlayer_io_find_layer (const char *path, const char *target_name, int target_order, dt_drawlayer_io_layer_info_t *info) |
| Lookup layer by name/order and return directory metadata. | |
| gboolean | dt_drawlayer_io_load_layer (const char *path, const char *target_name, int target_order, int raw_width, int raw_height, dt_drawlayer_io_patch_t *patch) |
| Load one layer from TIFF sidecar into float RGBA patch. | |
| gboolean | dt_drawlayer_io_store_layer (const char *path, const char *target_name, int target_order, const char *work_profile, const dt_drawlayer_io_patch_t *patch, int raw_width, int raw_height, gboolean delete_target, int *final_order) |
| Store or replace one layer page in sidecar TIFF. | |
| gboolean | dt_drawlayer_io_insert_layer (const char *path, const char *target_name, int insert_after_order, const char *work_profile, const dt_drawlayer_io_patch_t *patch, int raw_width, int raw_height, int *final_order) |
| Insert new layer after target order in sidecar TIFF. | |
| gboolean | dt_drawlayer_io_load_flat_rgba (const char *path, float **pixels, int *width, int *height) |
| Load full TIFF page as flat RGBA float image. | |
| gboolean | dt_drawlayer_io_layer_name_exists (const char *path, const char *candidate, int ignore_index) |
| Check whether candidate layer name already exists. | |
| void | dt_drawlayer_io_make_unique_name (const char *path, const char *requested, const char *fallback_name, char *name, size_t name_size) |
| Build unique layer name with fallback and numeric suffixing. | |
| void | dt_drawlayer_io_make_unique_name_plain (const char *path, const char *requested, char *name, size_t name_size) |
| Build unique layer name without fallback override. | |
| gboolean | dt_drawlayer_io_list_layer_names (const char *path, char ***names, int *count) |
| List all layer names from sidecar TIFF. | |
| void | dt_drawlayer_io_free_layer_names (char ***names, int *count) |
Free name list returned by dt_drawlayer_io_list_layer_names. | |
| int32_t | dt_drawlayer_io_background_layer_job_run (dt_job_t *job) |
| Worker entrypoint for async "create background from input" sidecar jobs. | |
TIFF sidecar I/O API for drawlayer layers.
| #define DT_DRAWLAYER_IO_NAME_SIZE 64 |
| #define DT_DRAWLAYER_IO_PROFILE_SIZE 256 |
Parameters owned by the async "create background from input" job.
Result posted back to the UI after background-layer creation.
| typedef struct dt_drawlayer_io_layer_info_t dt_drawlayer_io_layer_info_t |
Metadata returned when probing one layer directory in sidecar TIFF.
| typedef struct dt_drawlayer_io_patch_t dt_drawlayer_io_patch_t |
Raw float RGBA patch used by drawlayer I/O routines.
| int32_t dt_drawlayer_io_background_layer_job_run | ( | dt_job_t * | job | ) |
Worker entrypoint for async "create background from input" sidecar jobs.
References _export_pre_module_fullres_to_tiff(), _layer_name_non_empty(), _sidecar_timestamp_from_path(), dt_drawlayer_io_background_job_result_t::created_bg_name, dt_control_job_get_params(), dt_drawlayer_cache_alloc_temp_buffer(), dt_drawlayer_cache_clear_transparent_float(), dt_drawlayer_cache_free_temp_buffer(), dt_drawlayer_io_find_layer(), dt_drawlayer_io_insert_layer(), dt_drawlayer_io_load_flat_rgba(), dt_drawlayer_io_make_unique_name_plain(), DT_DRAWLAYER_IO_NAME_SIZE, dt_free, dt_drawlayer_io_patch_t::height, dt_drawlayer_io_background_job_result_t::imgid, dt_drawlayer_io_background_job_result_t::initiator_layer_name, dt_drawlayer_io_background_job_result_t::initiator_layer_order, MAX, dt_drawlayer_io_background_job_result_t::message, MIN, dt_drawlayer_io_patch_t::pixels, dt_drawlayer_io_background_job_result_t::sidecar_timestamp, dt_drawlayer_io_background_job_result_t::success, TRUE, dt_drawlayer_io_patch_t::width, dt_drawlayer_io_patch_t::x, and dt_drawlayer_io_patch_t::y.
Referenced by _create_background_layer_from_input().
| gboolean dt_drawlayer_io_find_layer | ( | const char * | path, |
| const char * | target_name, | ||
| const int | target_order, | ||
| dt_drawlayer_io_layer_info_t * | info | ||
| ) |
Lookup layer by name/order and return directory metadata.
Lookup layer by name/order and return directory metadata.
References _scan_directories(), FALSE, and dt_drawlayer_io_layer_info_t::found.
Referenced by _create_background_layer_from_input(), _current_layer_missing_in_sidecar(), _delete_current_layer(), _refresh_piece_base_cache(), _rename_current_layer_from_gui(), dt_drawlayer_ensure_layer_cache(), and dt_drawlayer_io_background_layer_job_run().
| void dt_drawlayer_io_free_layer_names | ( | char *** | names, |
| int * | count | ||
| ) |
Free name list returned by dt_drawlayer_io_list_layer_names.
Free name list returned by dt_drawlayer_io_list_layer_names.
Referenced by _populate_layer_list().
| gboolean dt_drawlayer_io_insert_layer | ( | const char * | path, |
| const char * | target_name, | ||
| const int | insert_after_order, | ||
| const char * | work_profile, | ||
| const dt_drawlayer_io_patch_t * | patch, | ||
| const int | raw_width, | ||
| const int | raw_height, | ||
| int * | final_order | ||
| ) |
Insert new layer after target order in sidecar TIFF.
Insert new layer after target order in sidecar TIFF.
References _rewrite_sidecar(), and FALSE.
Referenced by dt_drawlayer_io_background_layer_job_run().
| gboolean dt_drawlayer_io_layer_name_exists | ( | const char * | path, |
| const char * | candidate, | ||
| const int | ignore_index | ||
| ) |
Check whether candidate layer name already exists.
Check whether candidate layer name already exists.
Referenced by _rename_current_layer_from_gui(), dt_drawlayer_io_make_unique_name(), and dt_drawlayer_io_make_unique_name_plain().
| gboolean dt_drawlayer_io_list_layer_names | ( | const char * | path, |
| char *** | names, | ||
| int * | count | ||
| ) |
List all layer names from sidecar TIFF.
List all layer names from sidecar TIFF.
References FALSE, i, out, and TRUE.
Referenced by _populate_layer_list().
| gboolean dt_drawlayer_io_load_flat_rgba | ( | const char * | path, |
| float ** | pixels, | ||
| int * | width, | ||
| int * | height | ||
| ) |
Load full TIFF page as flat RGBA float image.
Load full TIFF page as flat RGBA float image.
References _clamp01(), _half_to_float(), a, b, bpp, dt_drawlayer_cache_clear_transparent_float(), dt_free, FALSE, g, h, height, out, r, row, TRUE, width, and x.
Referenced by dt_drawlayer_io_background_layer_job_run().
| gboolean dt_drawlayer_io_load_layer | ( | const char * | path, |
| const char * | target_name, | ||
| const int | target_order, | ||
| const int | raw_width, | ||
| const int | raw_height, | ||
| dt_drawlayer_io_patch_t * | patch | ||
| ) |
Load one layer from TIFF sidecar into float RGBA patch.
Load one layer from TIFF sidecar into float RGBA patch.
References _load_half_pixel_rgba(), _read_scanline_rgba(), _scan_directories(), dt_drawlayer_cache_clear_transparent_float(), dt_free, FALSE, dt_drawlayer_io_layer_info_t::found, dt_drawlayer_io_patch_t::height, dt_drawlayer_io_layer_info_t::height, dt_drawlayer_io_layer_info_t::index, dt_drawlayer_io_patch_t::pixels, row, TRUE, dt_drawlayer_io_patch_t::width, dt_drawlayer_io_layer_info_t::width, dt_drawlayer_io_patch_t::x, and dt_drawlayer_io_patch_t::y.
Referenced by _refresh_piece_base_cache(), and dt_drawlayer_ensure_layer_cache().
| void dt_drawlayer_io_make_unique_name | ( | const char * | path, |
| const char * | requested, | ||
| const char * | fallback_name, | ||
| char * | name, | ||
| const size_t | name_size | ||
| ) |
Build unique layer name with fallback and numeric suffixing.
Build unique layer name with fallback and numeric suffixing.
References _sanitize_requested_layer_name(), dt_drawlayer_io_layer_name_exists(), DT_DRAWLAYER_IO_NAME_SIZE, MAX, and name.
Referenced by dt_drawlayer_ensure_layer_cache().
| void dt_drawlayer_io_make_unique_name_plain | ( | const char * | path, |
| const char * | requested, | ||
| char * | name, | ||
| const size_t | name_size | ||
| ) |
Build unique layer name without fallback override.
Build unique layer name without fallback override.
References dt_drawlayer_io_layer_name_exists(), DT_DRAWLAYER_IO_NAME_SIZE, MAX, and name.
Referenced by dt_drawlayer_io_background_layer_job_run().
| gboolean dt_drawlayer_io_sidecar_path | ( | const int32_t | imgid, |
| char * | path, | ||
| const size_t | path_size | ||
| ) |
Build absolute sidecar TIFF path from image id.
Build absolute sidecar TIFF path from image id.
References dt_image_full_path(), FALSE, and TRUE.
Referenced by _create_background_layer_from_input(), _current_layer_missing_in_sidecar(), _delete_current_layer(), _populate_layer_list(), _refresh_piece_base_cache(), _rename_current_layer_from_gui(), dt_drawlayer_ensure_layer_cache(), and dt_drawlayer_flush_layer_cache().
| gboolean dt_drawlayer_io_store_layer | ( | const char * | path, |
| const char * | target_name, | ||
| const int | target_order, | ||
| const char * | work_profile, | ||
| const dt_drawlayer_io_patch_t * | patch, | ||
| const int | raw_width, | ||
| const int | raw_height, | ||
| const gboolean | delete_target, | ||
| int * | final_order | ||
| ) |
Store or replace one layer page in sidecar TIFF.
Store or replace one layer page in sidecar TIFF.
References _rewrite_sidecar(), and FALSE.
Referenced by _delete_current_layer(), _rename_current_layer_from_gui(), dt_drawlayer_ensure_layer_cache(), and dt_drawlayer_flush_layer_cache().