Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
color_picker_proxy.h
Go to the documentation of this file.
1/*
2 This file is part of darktable,
3 Copyright (C) 2018-2020 Pascal Obry.
4 Copyright (C) 2019 Edgardo Hoszowski.
5 Copyright (C) 2019 Ulrich Pegelow.
6 Copyright (C) 2020 Diederik Ter Rahe.
7 Copyright (C) 2020 Harold le Clément de Saint-Marcq.
8 Copyright (C) 2021 Dan Torop.
9 Copyright (C) 2022 Martin Bařinka.
10 Copyright (C) 2022 Philipp Lutz.
11 Copyright (C) 2026 Aurélien PIERRE.
12
13 darktable is free software: you can redistribute it and/or modify
14 it under the terms of the GNU Lesser General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 darktable is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU Lesser General Public License for more details.
22
23 You should have received a copy of the GNU Lesser General Public License
24 along with darktable. If not, see <http://www.gnu.org/licenses/>.
25*/
26#pragma once
27
28/*
29 This API encapsulates color-picker state ownership, cache sampling, and
30 `DT_SIGNAL_CONTROL_PICKERDATA_READY` publication for darkroom.
31
32 Module GUIs instantiate picker widgets here, then consume ready samples from
33 the data-ready signal by querying the current picker state with
34 `dt_iop_color_picker_get_ready_data()`.
35*/
36
37#include <gtk/gtk.h>
38#include "develop/imageop.h"
39#include "develop/develop.h"
40
42{
44 // FIXME: s/AREA/BOX/
46 DT_COLOR_PICKER_POINT_AREA // allow the user to select between point and area
48
50{
51 // iop which contains this picker, or NULL if primary colorpicker
52 dt_iop_module_t *module;
62 // positions are associated with the current picker widget: will set
63 // the picker request for the primary picker when this picker is
64 // activated, and will remember the most recent picker position
65 float pick_pos[2];
70
71
73
87
88/* reset current color picker unless keep is TRUE */
89void dt_iop_color_picker_reset(dt_iop_module_t *module, gboolean keep);
90
91/* sets the picker colorspace */
93
94/* returns the active picker colorspace (if any) */
96
97/* mark that the active picker geometry or selection changed and resample from cache if possible */
99
121 struct dt_dev_pixelpipe_t **pipe,
122 const struct dt_dev_pixelpipe_iop_t **piece);
123
139 const dt_iop_module_t *module);
140
141/* global init: link signal */
143
144/* global cleanup */
146
147/* link color picker to widget */
149
150/* link color picker to widget and initialize color picker color space with given value */
152 const dt_iop_colorspace_type_t cst);
153
154// clang-format off
155// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
156// vim: shiftwidth=2 expandtab tabstop=2 cindent
157// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
158// clang-format on
static const dt_adaptation_t kind
Definition chromatic_adaptation.h:124
dt_iop_colorspace_type_t
Definition color_conversion.h:30
enum _iop_color_picker_kind_t dt_iop_color_picker_kind_t
int dt_iop_color_picker_get_ready_data(const dt_iop_module_t *module, GtkWidget **picker, struct dt_dev_pixelpipe_t **pipe, const struct dt_dev_pixelpipe_iop_t **piece)
Resolve the current ready picker payload for one module.
_iop_color_picker_kind_t
Definition color_picker_proxy.h:42
@ DT_COLOR_PICKER_AREA
Definition color_picker_proxy.h:45
@ DT_COLOR_PICKER_POINT
Definition color_picker_proxy.h:43
@ DT_COLOR_PICKER_POINT_AREA
Definition color_picker_proxy.h:46
void dt_iop_color_picker_request_update(void)
Definition color_picker_proxy.c:630
void dt_iop_color_picker_reset(dt_iop_module_t *module, gboolean keep)
Definition color_picker_proxy.c:471
void dt_iop_color_picker_set_cst(dt_iop_module_t *module, const dt_iop_colorspace_type_t picker_cst)
Definition color_picker_proxy.c:609
GtkWidget * dt_color_picker_new_with_cst(dt_iop_module_t *module, dt_iop_color_picker_kind_t kind, GtkWidget *w, const dt_iop_colorspace_type_t cst)
Definition color_picker_proxy.c:746
gboolean dt_iop_color_picker_is_active_module(const dt_iop_module_t *module)
Tell whether one module currently owns the active darkroom picker.
Definition color_picker_proxy.c:94
gboolean dt_iop_color_picker_force_cache(const dt_develop_t *dev, const struct dt_dev_pixelpipe_t *pipe, const dt_iop_module_t *module)
Tell whether the active picker requires host-cache retention on one module output.
void dt_iop_color_picker_init()
Definition color_picker_proxy.c:665
GtkWidget * dt_color_picker_new(dt_iop_module_t *module, dt_iop_color_picker_kind_t kind, GtkWidget *w)
Definition color_picker_proxy.c:741
gboolean dt_iop_color_picker_is_visible(const dt_develop_t *dev)
Definition color_picker_proxy.c:82
void dt_iop_color_picker_cleanup()
Definition color_picker_proxy.c:671
dt_iop_colorspace_type_t dt_iop_color_picker_get_active_cst(dt_iop_module_t *module)
Definition color_picker_proxy.c:620
float dt_boundingbox_t[4]
Definition darktable.h:630
struct _GtkWidget GtkWidget
Definition splash.h:29
Definition pixelpipe_hb.h:95
Definition pixelpipe_hb.h:216
Definition develop.h:155
Definition color_picker_proxy.h:50
float pick_pos[2]
Definition color_picker_proxy.h:65
dt_iop_module_t *dt_iop_color_picker_kind_t kind
Definition color_picker_proxy.h:53
dt_boundingbox_t pick_box
Definition color_picker_proxy.h:66
GtkWidget * colorpick
Definition color_picker_proxy.h:61
gboolean update_pending
Definition color_picker_proxy.h:68
dt_iop_colorspace_type_t picker_cst
Definition color_picker_proxy.h:59
Definition imageop.h:216