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-2021 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#include "common/module_api.h"
20
21#ifdef FULL_API_H
22
23#include <stddef.h>
24#include <stdint.h>
25
26#include "common/colorspaces.h" // because forward declaring enums doesn't work in C++ :(
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
35
36/* early definition of modules to do type checking */
37
38#pragma GCC visibility push(default)
39
40#endif // FULL_API_H
41
42// gui and management:
43/* get translated module name */
44REQUIRED(const char *, name,);
45/* construct widget above */
47/* destroy resources */
49/* reset options to defaults */
51
52/* construct widget above */
54/* construct widget above */
56
57/* gets the current export parameters from gui/conf and stores in this struct for later use. */
58OPTIONAL(void *, legacy_params, struct dt_imageio_module_format_t *self, const void *const old_params,
59 const size_t old_params_size, const int old_version, const int new_version,
60 size_t *new_size);
64/* resets the gui to the parameters as given here. return != 0 on fail. */
65REQUIRED(int, set_params, struct dt_imageio_module_format_t *self, const void *params, const int size);
66
67/* returns the mime type of the exported image. */
68REQUIRED(const char *, mime, struct dt_imageio_module_data_t *data);
69/* this extension (plus dot) is appended to the exported filename. */
70REQUIRED(const char *, extension, struct dt_imageio_module_data_t *data);
71/* get storage max supported image dimension, return 0 if no dimension restrictions exists. */
73 uint32_t *height);
74
75// writing functions:
76/* bits per pixel and color channel we want to write: 8: char x3, 16: uint16_t x3, 32: float x3. */
78/* write to file, with exif if not NULL, and icc profile if supported. */
79REQUIRED(int, write_image, struct dt_imageio_module_data_t *data, const char *filename, const void *in,
80 dt_colorspaces_color_profile_type_t over_type, const char *over_filename,
81 void *exif, int exif_len, int32_t imgid, int num, int total, struct dt_dev_pixelpipe_t *pipe,
82 const gboolean export_masks);
83/* flag that describes the available precision/levels of output format. mainly used for dithering. */
85
86// sometimes we want to tell the world about what we can do
88
89OPTIONAL(int, read_image, struct dt_imageio_module_data_t *data, uint8_t *out);
90
91#ifdef FULL_API_H
92
93#pragma GCC visibility pop
94
95#ifdef __cplusplus
96}
97#endif
98
99#endif // FULL_API_H
100
101// clang-format off
102// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
103// vim: shiftwidth=2 expandtab tabstop=2 cindent
104// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
105// clang-format on
const char * mime(dt_imageio_module_data_t *data)
Definition avif.c:690
size_t params_size(dt_imageio_module_format_t *self)
Definition avif.c:615
void gui_reset(dt_imageio_module_format_t *self)
Definition avif.c:927
const char * extension(dt_imageio_module_data_t *data)
Definition avif.c:695
int set_params(dt_imageio_module_format_t *self, const void *params, const int size)
Definition avif.c:655
void cleanup(dt_imageio_module_format_t *self)
Definition avif.c:204
void free_params(dt_imageio_module_format_t *self, dt_imageio_module_data_t *params)
Definition avif.c:673
int levels(struct dt_imageio_module_data_t *data)
Definition avif.c:685
void init(dt_imageio_module_format_t *self)
Definition avif.c:142
void * get_params(dt_imageio_module_format_t *self)
Definition avif.c:620
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:208
int width
Definition bilateral.h:1
int height
Definition bilateral.h:1
dt_colorspaces_color_profile_type_t
Definition colorspaces.h:61
char * name
Definition common/metadata.c:41
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:300
int bpp
Definition imageio/format/pdf.c:76
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:416
int read_image(dt_imageio_png_t *png, void *out)
Definition imageio_png.c:119
static void gui_cleanup(dt_lib_import_t *d)
Definition import.c:1243
static void gui_init(dt_lib_import_t *d)
Definition import.c:926
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:74
#define OPTIONAL(return_type, function_name,...)
Definition module_api.h:73
Definition pixelpipe_hb.h:127
int32_t imgid
Definition pixelpipe_hb.h:129
Definition imageio_module.h:62
Definition imageio_module.h:72