Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
io.h File Reference

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.
 

Detailed Description

TIFF sidecar I/O API for drawlayer layers.

Macro Definition Documentation

◆ DT_DRAWLAYER_IO_NAME_SIZE

#define DT_DRAWLAYER_IO_NAME_SIZE   64

◆ DT_DRAWLAYER_IO_PROFILE_SIZE

#define DT_DRAWLAYER_IO_PROFILE_SIZE   256

Typedef Documentation

◆ dt_drawlayer_io_background_job_params_t

Parameters owned by the async "create background from input" job.

◆ dt_drawlayer_io_background_job_result_t

Result posted back to the UI after background-layer creation.

◆ dt_drawlayer_io_layer_info_t

Metadata returned when probing one layer directory in sidecar TIFF.

◆ dt_drawlayer_io_patch_t

Raw float RGBA patch used by drawlayer I/O routines.

◆ dt_job_t

typedef struct _dt_job_t dt_job_t

Function Documentation

◆ dt_drawlayer_io_background_layer_job_run()

◆ dt_drawlayer_io_find_layer()

gboolean dt_drawlayer_io_find_layer ( const char *  path,
const char *  target_name,
const int  target_order,
dt_drawlayer_io_layer_info_t info 
)

◆ dt_drawlayer_io_free_layer_names()

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.

References dt_free, i, and n.

Referenced by _populate_layer_list().

◆ dt_drawlayer_io_insert_layer()

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().

◆ dt_drawlayer_io_layer_name_exists()

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.

References FALSE, and TRUE.

Referenced by _rename_current_layer_from_gui(), dt_drawlayer_io_make_unique_name(), and dt_drawlayer_io_make_unique_name_plain().

◆ dt_drawlayer_io_list_layer_names()

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().

◆ dt_drawlayer_io_load_flat_rgba()

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().

◆ dt_drawlayer_io_load_layer()

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 
)

◆ dt_drawlayer_io_make_unique_name()

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().

◆ dt_drawlayer_io_make_unique_name_plain()

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().

◆ dt_drawlayer_io_sidecar_path()

gboolean dt_drawlayer_io_sidecar_path ( const int32_t  imgid,
char *  path,
const size_t  path_size 
)

◆ dt_drawlayer_io_store_layer()

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().