-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPlastic_QImage.hh
200 lines (164 loc) · 7.38 KB
/
Plastic_QImage.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
/* Plastic_QImage
HiROC CVS ID: $Id: Plastic_QImage.hh,v 1.13 2012/06/15 01:16:07 castalia Exp $
Copyright (C) 2009-2011 Arizona Board of Regents on behalf of the
Planetary Image Research Laboratory, Lunar and Planetary Laboratory at
the University of Arizona.
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License, version 2.1,
as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this library; if not, write to the Free Software Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*******************************************************************************/
#ifndef HiView_Plastic_QImage_hh
#define HiView_Plastic_QImage_hh
#include "Plastic_Image.hh"
namespace UA
{
namespace HiRISE
{
class Plastic_QImage
: public Plastic_Image
{
public:
/*==============================================================================
Constants
*/
//! Class identification name with source code version and date.
static const char* const
ID;
/*==============================================================================
Constructors
*/
/** Construct a Plastic_QImage from a pointer to a QImage.
<b>N.B.</b>: Ownership of the QImage is transfered to the
Plastic_QImage; i.e. the QImage must have been constructed on the
heap.
@param image A pointer to a QImage that will provide the source
image for this Plastic_Image. If NULL an empty QImage will be
provided that will have zero-valued parameters and no image
data.
@param size The size of the new Plastic_QImage. If the size is
not valid the size of the QImage, if provided, will be used.
@param band_map A pointer to unsigned int array of three values
that will be used as the shared band map for this
Plastic_Image. If NULL band map sharing is not enabled and a
default band map will be provided.
@param transforms An array of QTransform pointers, one for each
band of the image, that will be used as the shared geometric
transforms for this Plastic_Image. If NULL geometric transforms
sharing is not enabled and default identity transforms will be
provided.
@param data_maps An array of data map arrays, one for each band
of the image, that will be used as the shared data maps for this
Plastic_Image. If NULL data map sharing is not enabled and
default identity data maps will be provided.
*/
explicit Plastic_QImage (QImage* image = NULL,
const QSize& size = QSize (),
const unsigned int* band_map = NULL,
const QTransform** transforms = NULL,
const Data_Map** data_maps = NULL);
/** Construct a Plastic_QImage from a QImage.
@param image A QImage that will be copied to provide the source
image for this Plastic_Image. If the image is null a new
empty QImage will be provided.
@param size The size of the new Plastic_QImage. If the size is
not valid the size of the QImage will be used.
@param band_map A pointer to unsigned int array of three values
that will be used as the shared band map for this
Plastic_Image. If NULL band map sharing is not enabled and a
default band map will be provided.
@param transforms An array of QTransform pointers, one for each
band of the image, that will be used as the shared geometric
transforms for this Plastic_Image. If NULL geometric transforms
sharing is not enabled and default identity transforms will be
provided.
@param data_maps An array of data map arrays, one for each band
of the image, that will be used as the shared data maps for this
Plastic_Image. If NULL data map sharing is not enabled and
default identity data maps will be provided.
*/
explicit Plastic_QImage (const QImage& image,
const QSize& size = QSize (),
const unsigned int* band_map = NULL,
const QTransform** transforms = NULL,
const Data_Map** data_maps = NULL);
/** Copy a Plastic_QImage.
The image {@link source() source} - a QImage - is copied. However, if
the image has no source an empty source is provided. The image {@link
source_transforms() geometric transforms}, {@link source_band_map()
band map} and {@link source_data_maps() data maps} are copied unless
the corresponding shared mappings flag inidicates they are to be
shared with the image being copied. The {@link background_color()
background color} is also copied.
<b>Warning</b>: If any data mappings are shared the Plastic_QImage
being copied must remain valid as long as this Plastic_QImage is
in use.
<b>N.B.</b>: If {@link default_auto_update() default auto-update} is
false the image clone will not have been rendered, but will be filled
with the {@link background_color() background color}; in this case
the image should be either {@link render_image() rendered} or {@link
update() updated}.
@param image The Plastic_QImage to be copied. If the image does
not have a {@link source() source} image an empty QImage will be
provided for the source of this Plastic_QImage.
@param size The size of the new Plastic_QImage. If the size is
not valid the size of the Plastic_QImage being copied (not its
source image) will be used.
@param shared_mappings A Mapping_Type that specifies any combination
of {@link #BAND_MAP}, {@link #TRANSFORMS} or {@link #DATA_MAPS} -
or {@link #NO_MAPPINGS} - data mappings that are to be shared with
the Plastic_QImage being copied.
*/
explicit Plastic_QImage (const Plastic_QImage& image,
const QSize& size = QSize (),
Mapping_Type shared_mappings = NO_MAPPINGS);
/** Destroy this Plastic_QImage.
The {@link source() source} QImage is deleted.
*/
virtual ~Plastic_QImage ();
/*==============================================================================
Accessors
*/
/** Clone this Plastic_QImage.
A {@link
Plastic_QImage(const Plastic_QImage&, const QSize& Mapping_Type)
copy} of this Plastic_QImage is constructed.
<b>N.B.</b>: If {@link default_auto_update() default auto-update} is
false the image clone will not have been rendered, but will be filled
with the {@link background_color() background color}; in this case
the image should be either {@link render_image() rendered} or {@link
update() updated}.
@param size The size of the new Plastic_QImage. If the size is
not valid the size of this Plastic_QImage being copied (not its
source image) will be used.
@param shared_mappings A Mapping_Type that specifies any combination
of {@link #BAND_MAP}, {@link #TRANSFORMS} or {@link #DATA_MAPS} -
or {@link #NO_MAPPINGS} - data mappings that are to be shared with
this Plastic_QImage being copied.
@return A pointer to a Plastic_QImage.
*/
virtual Plastic_QImage* clone (const QSize& size = QSize (),
Mapping_Type shared_mappings = NO_MAPPINGS) const;
virtual const void* source () const;
virtual QSize source_size () const;
virtual unsigned int source_bands () const;
virtual unsigned int source_precision_bits () const;
virtual Pixel_Datum source_pixel_value
(unsigned int x, unsigned int y, unsigned int band) const;
virtual Plastic_Image::Triplet source_pixel (const QPoint& point) const;
/*==============================================================================
Data
*/
protected:
QImage
*Source;
}; // Class Plastic_QImage
} // namespace HiRISE
} // namespace UA
#endif