Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
develop/format.c
Go to the documentation of this file.
1/*
2 This file is part of darktable,
3 Copyright (C) 2016 Roman Lebedev.
4 Copyright (C) 2018 Edgardo Hoszowski.
5 Copyright (C) 2019 Hanno Schwalm.
6 Copyright (C) 2020 Pascal Obry.
7 Copyright (C) 2022 Martin Baƙinka.
8 Copyright (C) 2022 Philipp Lutz.
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#include "pixel/format.h"
25#include "develop/imageop.h"
26#include "develop/develop.h"
27
30{
31 dsc->channels = 4;
32 dsc->datatype = TYPE_FLOAT;
33 dsc->cst = self->default_colorspace(self, pipe, piece);
34
35 if(dsc->cst == IOP_CS_RAW)
36 {
37 if(dt_image_is_raw(&pipe->dev->image_storage)) dsc->channels = 1;
38
40 <= dt_ioppr_get_iop_order(pipe->iop_order_list, "rawprepare", 0)
41 && ((piece && piece->dsc_in.filters) || (!piece && pipe->dev->image_storage.dsc.filters)))
42 dsc->datatype = TYPE_UINT16;
43 }
44}
45
48{
49 dsc->channels = 4;
50 dsc->datatype = TYPE_FLOAT;
51 dsc->cst = self->default_colorspace(self, pipe, piece);
52
53 if(dsc->cst == IOP_CS_RAW)
54 {
55 if(dt_image_is_raw(&pipe->dev->image_storage)) dsc->channels = 1;
56
57 // FIXME: this is shit. Chain it in input/output_format() so each module
58 // actually tells what it does without relying on pipeline-centric hardcoded assumptions
59 // like that.
61 < dt_ioppr_get_iop_order(pipe->iop_order_list, "rawprepare", 0)
62 && ((piece && piece->dsc_in.filters) || (!piece && pipe->dev->image_storage.dsc.filters)))
63 dsc->datatype = TYPE_UINT16;
64 }
65}
66
68 const dt_dev_pixelpipe_iop_t *piece)
69{
70 return self->default_colorspace(self, pipe, piece);
71}
72
73// clang-format off
74// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
75// vim: shiftwidth=2 expandtab tabstop=2 cindent
76// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
77// clang-format on
@ IOP_CS_RAW
gboolean dt_image_is_raw(const dt_image_t *img)
void default_output_format(dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece, dt_iop_buffer_dsc_t *dsc)
void default_input_format(dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece, dt_iop_buffer_dsc_t *dsc)
int default_blend_colorspace(dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece)
@ TYPE_FLOAT
Definition format.h:56
@ TYPE_UINT16
Definition format.h:57
int dt_ioppr_get_iop_order(GList *iop_order_list, const char *op_name, const int multi_priority)
Return the iop_order for a given operation/instance pair.
Definition iop_order.c:913
dt_iop_buffer_dsc_t dsc_in
struct dt_develop_t * dev
dt_image_t image_storage
Definition develop.h:226
dt_iop_buffer_dsc_t dsc
Definition image.h:395
uint32_t filters
Definition format.h:89
unsigned int channels
Definition format.h:83
dt_iop_buffer_type_t datatype
Definition format.h:85
GModule *dt_dev_operation_t op
Definition imageop.h:255