Krita Source Code Documentation
Loading...
Searching...
No Matches
gmic.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2017 Boudewijn Rempt <boud@valdyas.org>
3 * SPDX-FileCopyrightText: 2020-2021 L. E. Segovia <amy@amyspark.me>
4 *
5 * SPDX-License-Identifier: LGPL-2.0-or-later
6 */
7
8#ifndef GMIC_H
9#define GMIC_H
10
11#include <QString>
12
19
20// this enum is also index in LAYER_MODE_STRINGS list
21enum class InputLayerMode {
22 NoInput,
23 Active,
24 All,
29 AllVisiblesDesc_DEPRECATED, /* Removed since 2.8.2 */
30 AllInvisiblesDesc_DEPRECATED, /* Removed since 2.8.2 */
31 AllDesc_DEPRECATED, /* Removed since 2.8.2 */
32 Unspecified = 100
33};
34
35template<typename T>
36struct gmic_image {
37 unsigned int _width{0}; // Number of image columns (dimension along the X-axis).
38 unsigned int _height{0}; // Number of image lines (dimension along the Y-axis)
39 unsigned int _depth{1}; // Number of image slices (dimension along the Z-axis).
40 unsigned int _spectrum{3}; // Number of image channels (dimension along the C-axis).
41 bool _is_shared{false}; // Tells if the data buffer is shared by another structure.
42 T *_data{nullptr}; // Pointer to the first pixel value.
43 QString name{}; // Layer name
44
45 // Destructor.
47 {
48 if (!_is_shared)
49 delete[] _data;
50 }
51
52 void assign(unsigned int w, unsigned int h, unsigned int d, unsigned int s)
53 {
54 _width = w;
55 _height = h;
56 _depth = d;
57 _spectrum = s;
58 }
59};
60
61#endif // GMIC_H
InputLayerMode
Definition gmic.h:21
@ AllInvisiblesDesc_DEPRECATED
@ AllVisiblesDesc_DEPRECATED
OutputMode
Definition gmic.h:18
unsigned int _depth
Definition gmic.h:39
unsigned int _height
Definition gmic.h:38
T * _data
Definition gmic.h:42
void assign(unsigned int w, unsigned int h, unsigned int d, unsigned int s)
Definition gmic.h:52
QString name
Definition gmic.h:43
unsigned int _spectrum
Definition gmic.h:40
~gmic_image()
Definition gmic.h:46
bool _is_shared
Definition gmic.h:41
unsigned int _width
Definition gmic.h:37