1 /*
2  * Copyright (C) 2017 Boudewijn Rempt <boud@valdyas.org>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public License
15  * along with this library; see the file COPYING.LIB.  If not, write to
16  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  */
19 
20 #ifndef GMIC_H
21 #define GMIC_H
22 
23 /**
24  * A sham header to make it easier to handle gmic types without
25  * needing gmic itself.
26  */
27 
28 enum OutputMode {   IN_PLACE = 0,
29                         NEW_LAYERS,
30                         NEW_ACTIVE_LAYERS,
31                         NEW_IMAGE
32 };
33 
34 
35 // this enum is also index in LAYER_MODE_STRINGS list
36 enum InputLayerMode {   NONE = 0,
37                         ACTIVE_LAYER,
38                         ALL_LAYERS,
39                         ACTIVE_LAYER_BELOW_LAYER,
40                         ACTIVE_LAYER_ABOVE_LAYER,
41                         ALL_VISIBLE_LAYERS,
42                         ALL_INVISIBLE_LAYERS,
43                         ALL_VISIBLE_LAYERS_DECR,
44                         ALL_INVISIBLE_DECR,
45                         ALL_DECR
46 };
47 
48 
49 template<typename T> struct gmic_image {
50     unsigned int _width;       // Number of image columns (dimension along the X-axis).
51     unsigned int _height;      // Number of image lines (dimension along the Y-axis)
52     unsigned int _depth;       // Number of image slices (dimension along the Z-axis).
53     unsigned int _spectrum;    // Number of image channels (dimension along the C-axis).
54     bool _is_shared;           // Tells if the data buffer is shared by another structure.
55     T *_data;                  // Pointer to the first pixel value.
56     QString name;              // Layer name
57 
assigngmic_image58     void assign(unsigned int w, unsigned int h, unsigned int d, unsigned int s) {
59         _width = w;
60         _height = h;
61         _depth = d;
62         _spectrum = s;
63 
64     }
65 };
66 
67 #endif // GMIC_H
68