Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
io.h
Go to the documentation of this file.
1/*
2 This file is part of the Ansel project.
3 Copyright (C) 2026 Aurélien PIERRE.
4
5 Ansel is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 Ansel is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with Ansel. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19#pragma once
20
21#include <glib.h>
22#include <limits.h>
23#include <stddef.h>
24#include <stdint.h>
25
30#define DT_DRAWLAYER_IO_NAME_SIZE 64
31#define DT_DRAWLAYER_IO_PROFILE_SIZE 256
32
42
54
55typedef struct _dt_job_t dt_job_t;
56
74
86
88gboolean dt_drawlayer_io_sidecar_path(int32_t imgid, char *path, size_t path_size);
90gboolean dt_drawlayer_io_find_layer(const char *path, const char *target_name, int target_order,
93gboolean dt_drawlayer_io_load_layer(const char *path, const char *target_name, int target_order, int raw_width,
94 int raw_height, dt_drawlayer_io_patch_t *patch);
96gboolean dt_drawlayer_io_store_layer(const char *path, const char *target_name, int target_order,
97 const char *work_profile, const dt_drawlayer_io_patch_t *patch, int raw_width,
98 int raw_height, gboolean delete_target, int *final_order);
100gboolean dt_drawlayer_io_insert_layer(const char *path, const char *target_name, int insert_after_order,
101 const char *work_profile, const dt_drawlayer_io_patch_t *patch, int raw_width,
102 int raw_height, int *final_order);
104gboolean dt_drawlayer_io_load_flat_rgba(const char *path, float **pixels, int *width, int *height);
106gboolean dt_drawlayer_io_layer_name_exists(const char *path, const char *candidate, int ignore_index);
108void dt_drawlayer_io_make_unique_name(const char *path, const char *requested, const char *fallback_name, char *name,
109 size_t name_size);
111void dt_drawlayer_io_make_unique_name_plain(const char *path, const char *requested, char *name, size_t name_size);
113gboolean dt_drawlayer_io_list_layer_names(const char *path, char ***names, int *count);
115void dt_drawlayer_io_free_layer_names(char ***names, int *count);
int width
Definition bilateral.h:1
int height
Definition bilateral.h:1
char * name
Definition common/metadata.c:61
#define PATH_MAX
Definition darktable.h:993
int32_t dt_drawlayer_io_background_layer_job_run(dt_job_t *job)
Worker entrypoint for async "create background from input" sidecar jobs.
Definition io.c:989
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.
Definition io.c:904
#define DT_DRAWLAYER_IO_PROFILE_SIZE
Definition io.h:31
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.
Definition io.c:676
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.
Definition io.c:882
gboolean dt_drawlayer_io_layer_name_exists(const char *path, const char *candidate, int ignore_index)
Check whether candidate layer name already exists.
Definition io.c:611
gboolean dt_drawlayer_io_list_layer_names(const char *path, char ***names, int *count)
List all layer names from sidecar TIFF.
Definition io.c:942
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.
Definition io.c:922
gboolean dt_drawlayer_io_sidecar_path(int32_t imgid, char *path, size_t path_size)
Build absolute sidecar TIFF path from image id.
Definition io.c:651
#define DT_DRAWLAYER_IO_NAME_SIZE
Definition io.h:30
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.
Definition io.c:739
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.
Definition io.c:893
void dt_drawlayer_io_free_layer_names(char ***names, int *count)
Free name list returned by dt_drawlayer_io_list_layer_names.
Definition io.c:980
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.
Definition io.c:662
Definition jobs.c:51
Parameters owned by the async "create background from input" job.
Definition io.h:59
int insert_after_order
Definition io.h:65
char work_profile[256]
Definition io.h:67
char initiator_layer_name[64]
Definition io.h:70
int initiator_layer_order
Definition io.h:71
GSourceFunc done_idle
Definition io.h:72
char sidecar_path[PATH_MAX]
Definition io.h:66
char filter[64]
Definition io.h:69
char requested_bg_name[64]
Definition io.h:68
int32_t imgid
Definition io.h:60
Result posted back to the UI after background-layer creation.
Definition io.h:77
int initiator_layer_order
Definition io.h:83
char initiator_layer_name[64]
Definition io.h:82
gboolean success
Definition io.h:78
char message[256]
Definition io.h:84
int64_t sidecar_timestamp
Definition io.h:80
int32_t imgid
Definition io.h:79
char created_bg_name[64]
Definition io.h:81
Metadata returned when probing one layer directory in sidecar TIFF.
Definition io.h:45
uint32_t height
Definition io.h:50
char work_profile[256]
Definition io.h:52
uint32_t width
Definition io.h:49
char name[64]
Definition io.h:51
int count
Definition io.h:48
int index
Definition io.h:47
gboolean found
Definition io.h:46
Raw float RGBA patch used by drawlayer I/O routines.
Definition io.h:35
int width
Definition io.h:38
int y
Definition io.h:37
int x
Definition io.h:36
float * pixels
Definition io.h:40
int height
Definition io.h:39