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#ifndef DT_GUI_COLOR_PICKER_PROXY_H
27#define DT_GUI_COLOR_PICKER_PROXY_H
28
29/*
30 This API encapsulates color-picker state ownership, cache sampling, and
31 `DT_SIGNAL_CONTROL_PICKERDATA_READY` publication for darkroom.
32
33 Module GUIs instantiate picker widgets here, then consume ready samples from
34 the data-ready signal by querying the current picker state with
35 `dt_iop_color_picker_get_ready_data()`.
36*/
37
38#include <gtk/gtk.h>
39#include "develop/imageop.h"
40#include "develop/develop.h"
41
43{
45 // FIXME: s/AREA/BOX/
47 DT_COLOR_PICKER_POINT_AREA // allow the user to select between point and area
49
51{
52 // iop which contains this picker, or NULL if primary colorpicker
53 dt_iop_module_t *module;
63 // positions are associated with the current picker widget: will set
64 // the picker request for the primary picker when this picker is
65 // activated, and will remember the most recent picker position
66 float pick_pos[2];
72
73
75
89
90/* reset current color picker unless keep is TRUE */
91void dt_iop_color_picker_reset(dt_iop_module_t *module, gboolean keep);
92
93/* sets the picker colorspace */
95
96/* returns the active picker colorspace (if any) */
98
99/* mark that the active picker geometry or selection changed and resample from cache if possible */
101
123 struct dt_dev_pixelpipe_t **pipe,
124 const struct dt_dev_pixelpipe_iop_t **piece);
125
126/* global init: link signal */
128
129/* global cleanup */
131
132/* link color picker to widget */
134
135/* link color picker to widget and initialize color picker color space with given value */
137 const dt_iop_colorspace_type_t cst);
138
139#endif // DT_GUI_COLOR_PICKER_PROXY_H
140
141// clang-format off
142// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
143// vim: shiftwidth=2 expandtab tabstop=2 cindent
144// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
145// clang-format on
static const dt_adaptation_t kind
dt_iop_colorspace_type_t
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
@ DT_COLOR_PICKER_AREA
@ DT_COLOR_PICKER_POINT
@ DT_COLOR_PICKER_POINT_AREA
void dt_iop_color_picker_request_update(void)
void dt_iop_color_picker_reset(dt_iop_module_t *module, gboolean keep)
void dt_iop_color_picker_set_cst(dt_iop_module_t *module, const dt_iop_colorspace_type_t picker_cst)
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)
gboolean dt_iop_color_picker_is_active_module(const dt_iop_module_t *module)
Tell whether one module currently owns the active darkroom picker.
void dt_iop_color_picker_init()
GtkWidget * dt_color_picker_new(dt_iop_module_t *module, dt_iop_color_picker_kind_t kind, GtkWidget *w)
gboolean dt_iop_color_picker_is_visible(const dt_develop_t *dev)
void dt_iop_color_picker_cleanup()
dt_iop_colorspace_type_t dt_iop_color_picker_get_active_cst(dt_iop_module_t *module)
struct _GtkWidget GtkWidget
GtkWidget, opaque, spelled exactly as GTK spells it.
Definition colorspaces.h:98
float dt_boundingbox_t[4]
Definition image.h:83
dt_iop_module_t *dt_iop_color_picker_kind_t kind
dt_boundingbox_t pick_box
dt_iop_colorspace_type_t picker_cst