Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
imageio_format_api.h
Go to the documentation of this file.
1/*
2 This file is part of darktable,
3 Copyright (C) 2016 Roman Lebedev.
4 Copyright (C) 2016-2017, 2019-2020 Tobias Ellinghaus.
5 Copyright (C) 2017 luzpaz.
6 Copyright (C) 2020-2021 Pascal Obry.
7 Copyright (C) 2021 Diederik Ter Rahe.
8 Copyright (C) 2022 Martin Bařinka.
9 Copyright (C) 2025 Alynx Zhou.
10 Copyright (C) 2025 Aurélien PIERRE.
11
12 darktable is free software: you can redistribute it and/or modify
13 it under the terms of the GNU Lesser General Public License as published by
14 the Free Software Foundation, either version 3 of the License, or
15 (at your option) any later version.
16
17 darktable is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU Lesser General Public License for more details.
21
22 You should have received a copy of the GNU Lesser General Public License
23 along with darktable. If not, see <http://www.gnu.org/licenses/>.
24*/
25#include "common/module_api.h"
26
27#ifdef FULL_API_H
28
29#include <stddef.h>
30#include <stdint.h>
31
32#include "common/colorspaces.h" // because forward declaring enums doesn't work in C++ :(
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
41
42/* early definition of modules to do type checking */
43
44#pragma GCC visibility push(default)
45
46#endif // FULL_API_H
47
48// gui and management:
49/* get translated module name */
50REQUIRED(const char *, name,);
51/* construct widget above */
53/* destroy resources */
55/* reset options to defaults */
57
58/* construct widget above */
60/* construct widget above */
62
63/* gets the current export parameters from gui/conf and stores in this struct for later use. */
64OPTIONAL(void *, legacy_params, struct dt_imageio_module_format_t *self, const void *const old_params,
65 const size_t old_params_size, const int old_version, const int new_version,
66 size_t *new_size);
70/* resets the gui to the parameters as given here. return != 0 on fail. */
71REQUIRED(int, set_params, struct dt_imageio_module_format_t *self, const void *params, const int size);
72
73/* returns the mime type of the exported image. */
74REQUIRED(const char *, mime, struct dt_imageio_module_data_t *data);
75/* this extension (plus dot) is appended to the exported filename. */
76REQUIRED(const char *, extension, struct dt_imageio_module_data_t *data);
77/* get storage max supported image dimension, return 0 if no dimension restrictions exists. */
79 uint32_t *height);
80
81// writing functions:
82/* bits per pixel and color channel we want to write: 8: char x3, 16: uint16_t x3, 32: float x3. */
84/* write to file, with exif if not NULL, and icc profile if supported. */
85REQUIRED(int, write_image, struct dt_imageio_module_data_t *data, const char *filename, const void *in,
86 dt_colorspaces_color_profile_type_t over_type, const char *over_filename,
87 void *exif, int exif_len, int32_t imgid, int num, int total, struct dt_dev_pixelpipe_t *pipe,
88 const gboolean export_masks);
89/* flag that describes the available precision/levels of output format. mainly used for dithering. */
91
92// sometimes we want to tell the world about what we can do
94
95OPTIONAL(int, read_image, struct dt_imageio_module_data_t *data, uint8_t *out);
96
97#ifdef FULL_API_H
98
99#pragma GCC visibility pop
100
101#ifdef __cplusplus
102}
103#endif
104
105#endif // FULL_API_H
106
107// clang-format off
108// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
109// vim: shiftwidth=2 expandtab tabstop=2 cindent
110// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
111// clang-format on
const char * mime(dt_imageio_module_data_t *data)
Definition avif.c:699
size_t params_size(dt_imageio_module_format_t *self)
Definition avif.c:624
void gui_reset(dt_imageio_module_format_t *self)
Definition avif.c:936
const char * extension(dt_imageio_module_data_t *data)
Definition avif.c:704
int set_params(dt_imageio_module_format_t *self, const void *params, const int size)
Definition avif.c:664
void cleanup(dt_imageio_module_format_t *self)
Definition avif.c:213
void free_params(dt_imageio_module_format_t *self, dt_imageio_module_data_t *params)
Definition avif.c:682
int levels(struct dt_imageio_module_data_t *data)
Definition avif.c:694
void init(dt_imageio_module_format_t *self)
Definition avif.c:151
void * get_params(dt_imageio_module_format_t *self)
Definition avif.c:629
int write_image(struct dt_imageio_module_data_t *data, const char *filename, const void *in, dt_colorspaces_color_profile_type_t over_type, const char *over_filename, void *exif, int exif_len, int32_t imgid, int num, int total, struct dt_dev_pixelpipe_t *pipe, const gboolean export_masks)
Definition avif.c:217
int width
Definition bilateral.h:1
int height
Definition bilateral.h:1
dt_colorspaces_color_profile_type_t
Definition colorspaces.h:81
static const dt_colormatrix_t dt_aligned_pixel_t out
Definition colorspaces_inline_conversions.h:184
char * name
Definition common/metadata.c:61
void * legacy_params(dt_imageio_module_format_t *self, const void *const old_params, const size_t old_params_size, const int old_version, const int new_version, size_t *new_size)
Definition exr.cc:320
int bpp
Definition imageio/format/pdf.c:88
int dimension(struct dt_imageio_module_format_t *self, dt_imageio_module_data_t *data, uint32_t *width, uint32_t *height)
Definition imageio/format/pdf.c:434
int read_image(dt_imageio_png_t *png, void *out)
Definition imageio_png.c:129
static void gui_cleanup(dt_lib_import_t *d)
Definition import.c:1257
static void gui_init(dt_lib_import_t *d)
Definition import.c:939
size_t size
Definition mipmap_cache.c:3
dt_mipmap_buffer_dsc_flags flags
Definition mipmap_cache.c:4
#define REQUIRED(return_type, function_name,...)
Definition module_api.h:80
#define OPTIONAL(return_type, function_name,...)
Definition module_api.h:79
Definition pixelpipe_hb.h:216
int32_t imgid
Definition pixelpipe_hb.h:218
Definition imageio_module.h:81
Definition imageio_module.h:91