Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
colorchart.h
Go to the documentation of this file.
1/*
2 * This file is part of darktable,
3 * Copyright (C) 2016 johannes hanika.
4 * Copyright (C) 2016-2017 Tobias Ellinghaus.
5 * Copyright (C) 2020 Aurélien PIERRE.
6 * Copyright (C) 2020 Pascal Obry.
7 * Copyright (C) 2021 Ralf Brown.
8 * Copyright (C) 2022 Martin Bařinka.
9 *
10 * darktable is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * darktable is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with darktable. If not, see <http://www.gnu.org/licenses/>.
22 */
23
24#pragma once
25
26#include "common/colorspaces.h"
28
29#include <glib.h>
30
31typedef struct point_t
32{
33 float x, y;
35
36typedef struct f_line_t
37{
40
41typedef struct box_t
42{
43 // position
45 float w, h;
46 // color
48 dt_aligned_pixel_t color; // either XYZ or Lab, depending on color_space
49 dt_aligned_pixel_t rgb; // color converted to sRGB for rough displaying of patches
51
52typedef struct chart_t
53{
54 // the F marks
55 GList *f_list;
56 // the two kinds of boxen
57 GHashTable *d_table, *box_table;
58 // the box sets. the data is as follows:
59 // a hash table with a human readable name as key. the values are GList* with the names of patches.
60 // use those to lookup box_table
61 GHashTable *patch_sets;
62 // the bounding box
63 float bb_w, bb_h;
64 // other data from the CHT file
67
68
69void free_chart(chart_t *chart);
70chart_t *parse_cht(const char *filename);
71int parse_it8(const char *filename, chart_t *chart);
73
74
75// clang-format off
76// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
77// vim: shiftwidth=2 expandtab tabstop=2 cindent
78// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
79// clang-format on
80
struct point_t point_t
chart_t * parse_cht(const char *filename)
Definition colorchart.c:155
void free_chart(chart_t *chart)
Definition colorchart.c:50
int parse_it8(const char *filename, chart_t *chart)
Definition colorchart.c:525
void checker_set_color(box_t *box, dt_colorspaces_color_profile_type_t color_space, float c0, float c1, float c2)
Definition colorchart.c:113
dt_colorspaces_color_profile_type_t
Definition colorspaces.h:81
dt_colorspaces_color_profile_type_t color_space
Definition mipmap_cache.c:5
Definition colorchart.h:42
float h
Definition colorchart.h:45
float w
Definition colorchart.h:45
dt_colorspaces_color_profile_type_t color_space
Definition colorchart.h:47
dt_aligned_pixel_t color
Definition colorchart.h:48
dt_aligned_pixel_t rgb
Definition colorchart.h:49
point_t p
Definition colorchart.h:44
Definition colorchart.h:53
float bb_w
Definition colorchart.h:63
GHashTable * patch_sets
Definition colorchart.h:61
float bb_h
Definition colorchart.h:63
float box_shrink
Definition colorchart.h:65
GHashTable * box_table
Definition colorchart.h:57
GHashTable * d_table
Definition colorchart.h:57
float ref_rotation
Definition colorchart.h:65
GList * f_list
Definition colorchart.h:55
Definition colorchart.h:37
point_t p[4]
Definition colorchart.h:38
Definition colorchart.h:32
float y
Definition colorchart.h:33
float x
Definition colorchart.h:33
#define c2
Definition colorspaces_inline_conversions.h:1055
#define c1
Definition colorspaces_inline_conversions.h:1054