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 darktable developers.
4
5 darktable is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser 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 darktable 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 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License
16 along with darktable. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19#pragma once
20
21/*
22 This API encapsulate the color picker behavior for IOP module. Providing
23 4 routines (get_set, apply, reset and update, it will handle multiple
24 color pickers in a module.
25
26 A simpler version requires only apply to be passed and the picker widget when
27 a single color picker is available in a module.
28*/
29
30#include <gtk/gtk.h>
31#include "develop/imageop.h"
32
34{
36 // FIXME: s/AREA/BOX/
38 DT_COLOR_PICKER_POINT_AREA // allow the user to select between point and area
40
42{
43 // iop which contains this picker, or NULL if primary colorpicker
44 dt_iop_module_t *module;
53 GtkWidget *colorpick;
54 // positions are associated with the current picker widget: will set
55 // the picker request for the primary picker when this picker is
56 // activated, and will remember the most recent picker position
57 float pick_pos[2];
59 gboolean changed;
61
62
64
65//* reset current color picker if not keep-active or not keep */
66void dt_iop_color_picker_reset(dt_iop_module_t *module, gboolean keep);
67
68/* sets the picker colorspace */
70
71/* returns the active picker colorspace (if any) */
73
74/* global init: link signal */
76
77/* global cleanup */
79
80/* link color picker to widget */
81GtkWidget *dt_color_picker_new(dt_iop_module_t *module, dt_iop_color_picker_kind_t kind, GtkWidget *w);
82
83/* link color picker to widget and initialize color picker color space with given value */
85 const dt_iop_colorspace_type_t cst);
86
87// clang-format off
88// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
89// vim: shiftwidth=2 expandtab tabstop=2 cindent
90// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
91// clang-format on
92
dt_iop_colorspace_type_t
Definition color_conversion.h:24
enum _iop_color_picker_kind_t dt_iop_color_picker_kind_t
_iop_color_picker_kind_t
Definition color_picker_proxy.h:34
@ DT_COLOR_PICKER_AREA
Definition color_picker_proxy.h:37
@ DT_COLOR_PICKER_POINT
Definition color_picker_proxy.h:35
@ DT_COLOR_PICKER_POINT_AREA
Definition color_picker_proxy.h:38
void dt_iop_color_picker_reset(dt_iop_module_t *module, gboolean keep)
Definition color_picker_proxy.c:120
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:234
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:352
void dt_iop_color_picker_init()
Definition color_picker_proxy.c:299
GtkWidget * dt_color_picker_new(dt_iop_module_t *module, dt_iop_color_picker_kind_t kind, GtkWidget *w)
Definition color_picker_proxy.c:347
gboolean dt_iop_color_picker_is_visible(const dt_develop_t *dev)
Definition color_picker_proxy.c:62
void dt_iop_color_picker_cleanup()
Definition color_picker_proxy.c:309
dt_iop_colorspace_type_t dt_iop_color_picker_get_active_cst(dt_iop_module_t *module)
Definition color_picker_proxy.c:246
float dt_boundingbox_t[4]
Definition darktable.h:467
Definition develop.h:143
Definition color_picker_proxy.h:42
float pick_pos[2]
Definition color_picker_proxy.h:57
gboolean changed
Definition color_picker_proxy.h:59
dt_iop_module_t *dt_iop_color_picker_kind_t kind
Definition color_picker_proxy.h:45
dt_boundingbox_t pick_box
Definition color_picker_proxy.h:58
GtkWidget * colorpick
Definition color_picker_proxy.h:53
dt_iop_colorspace_type_t picker_cst
Definition color_picker_proxy.h:51
Definition imageop.h:182