Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
iop/drawlayer/cache.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#ifndef DT_IOP_DRAWLAYER_CACHE_H
20#define DT_IOP_DRAWLAYER_CACHE_H
21
22#include "develop/imageop.h"
24#include "iop/drawlayer/paint.h"
25
26#include <glib.h>
27#include <stddef.h>
28#include <stdint.h>
29
48
50void *dt_drawlayer_cache_alloc_temp_buffer(size_t bytes, const char *name);
52void dt_drawlayer_cache_free_temp_buffer(void **buffer, const char *name);
54float *dt_drawlayer_cache_ensure_scratch_buffer(float **buffer, size_t *capacity_pixels, size_t needed_pixels,
55 const char *name);
56
58void dt_drawlayer_cache_clear_transparent_float(float *pixels, size_t pixel_count);
59
61void dt_drawlayer_cache_patch_clear(dt_drawlayer_cache_patch_t *patch, const char *external_alloc_name);
64 int width, int height, const char *name, int *created_out);
67 const char *name);
76
79 dt_drawlayer_cache_patch_t *process_stroke_mask,
80 int width, int height,
81 const char *patch_buffer_name,
82 const char *mask_buffer_name);
83
84#endif // DT_IOP_DRAWLAYER_CACHE_H
gboolean dt_drawlayer_cache_patch_alloc_shared(dt_drawlayer_cache_patch_t *patch, uint64_t hash, size_t pixel_count, int width, int height, const char *name, int *created_out)
Allocate/reuse shared patch storage from pixel cache.
void dt_drawlayer_cache_patch_wrunlock(const dt_drawlayer_cache_patch_t *patch)
Release write lock on shared patch cache entry.
gboolean dt_drawlayer_cache_ensure_process_patch_buffer(dt_drawlayer_cache_patch_t *process_patch, dt_drawlayer_cache_patch_t *process_stroke_mask, int width, int height, const char *patch_buffer_name, const char *mask_buffer_name)
Ensure process patch and its stroke mask buffers are allocated.
void dt_drawlayer_cache_patch_wrlock(const dt_drawlayer_cache_patch_t *patch)
Acquire write lock on shared patch cache entry.
void dt_drawlayer_cache_patch_clear(dt_drawlayer_cache_patch_t *patch, const char *external_alloc_name)
Drop patch storage and clear metadata.
void * dt_drawlayer_cache_alloc_temp_buffer(size_t bytes, const char *name)
Allocate a temporary RGBA scratch buffer.
void dt_drawlayer_cache_clear_transparent_float(float *pixels, size_t pixel_count)
Fill RGBA float buffer with transparent black.
float * dt_drawlayer_cache_ensure_scratch_buffer(float **buffer, size_t *capacity_pixels, size_t needed_pixels, const char *name)
Ensure a float RGBA scratch buffer capacity in pixels.
void dt_drawlayer_cache_free_temp_buffer(void **buffer, const char *name)
Release temporary scratch buffer allocated by cache helpers.
void dt_drawlayer_cache_patch_rdlock(const dt_drawlayer_cache_patch_t *patch)
Acquire read lock on shared patch cache entry.
gboolean dt_drawlayer_cache_ensure_mask_buffer(dt_drawlayer_cache_patch_t *mask, int width, int height, const char *name)
Ensure a float stroke-mask buffer exists for the requested size.
void dt_drawlayer_cache_patch_rdunlock(const dt_drawlayer_cache_patch_t *patch)
Release read lock on shared patch cache entry.
Stroke-level path sampling and runtime-state API for drawlayer.
hash
Definition layers.h:90
uint32_t width
Definition mipmap_cache.c:0
uint32_t height
Definition mipmap_cache.c:1
const char * name
Definition pdf.h:90
Pixelpipe cache for storing intermediate results in the pixelpipe.
unsigned __int64 uint64_t
Definition strptime.c:75
Generic float RGBA patch stored either in malloc memory or pixel cache.
dt_pixel_cache_entry_t * cache_entry