HiRISE
 PDS_JP2

Image_Data_Block.hh
Go to the documentation of this file.
1 /* Image_Data_Block
2 
3 HiROC CVS ID: Image_Data_Block.hh,v 1.13 2013/03/14 21:00:43 guym Exp
4 
5 Copyright (C) 2006-2007 Arizona Board of Regents on behalf of the
6 Planetary Image Research Laboratory, Lunar and Planetary Laboratory at
7 the University of Arizona.
8 
9 This program is free software; you can redistribute it and/or modify it
10 under the terms of the GNU General Public License, version 2, as
11 published by the Free Software Foundation.
12 
13 This program is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 General Public License for more details.
17 
18 You should have received a copy of the GNU General Public License along
19 with this program; if not, write to the Free Software Foundation, Inc.,
20 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 */
22 
23 #ifndef _Image_Data_Block_
24 #define _Image_Data_Block_
25 
26 #include "PDS_Data_Block.hh"
27 
28 #include <string>
29 
30 namespace UA
31 {
32 namespace HiRISE
33 {
44 : public PDS_Data_Block
45 {
46 public:
47 /*==============================================================================
48  Constants:
49 */
51 static const char* const ID;
52 
54 static const char* const
56 
58 static const char* const
60 
62 static const char* const
64 
66 static const char* const
68 
70 static const char* const
72 
74 static const char* const
76 
80 static const char* const
82 
86 static const char* const
88 
92 static const char* const
94 
98 static const char* const
100 
102 static const char* const
104 
106 static const char* const
108 
109 /*==============================================================================
110  Constructors
111 */
115 
122  (
124  std::ios::off_type file_offset
125  );
126 
133  (
135  const std::string& filename
136  );
137 
138 
139 /*==============================================================================
140  Accessors:
141 */
149 unsigned int image_bands ()
150 {return Image_Bands;}
151 
158 unsigned int image_width ()
159 {return Image_Width;}
160 
167 unsigned int image_height ()
168 {return Image_Height;}
169 
180 unsigned int pixel_bytes ()
181 {return Pixel_Bytes;}
182 
198 unsigned int pixel_bits ()
199 {return Pixel_Bits;}
200 
210 {return Signed_Data;}
211 
220 int MSB_data ()
221 {return MSB_Data;}
222 
229 unsigned int line_prefix_bytes ()
230 {return Line_Prefix_Bytes;}
231 
238 unsigned int line_suffix_bytes ()
239 {return Line_Suffix_Bytes;}
240 
241 std::string source_filename();
242 
243 /*------------------------------------------------------------------------------
244  * Manipulators
245  */
246 std::string source_filename(std::string& pathname);
247 
248 /*==============================================================================
249  Data Members:
250 */
251 protected:
252 
253 
270 virtual unsigned long long data_block_size ();
271 
272 private:
273 
274 std::string
275  Source_Filename;
276 
277 unsigned int
278  Image_Bands,
279  Image_Width,
280  Image_Height,
281  Pixel_Bytes,
282  Pixel_Bits,
283  Line_Prefix_Bytes,
284  Line_Suffix_Bytes;
285 
287 int
288  Signed_Data,
289  MSB_Data;
290 };
291 
292 } // namespace HiRISE
293 } // namespace UA
294 #endif
An Image_Data_Block describes PDS image data.
Definition: Image_Data_Block.hh:45
static const char *const SIGNED_PIXEL_TYPE_IDENTIFIER
Substring of the PIXEL_DATA_TYPE_PARAMETER_NAME parameter that identifies a signed pixel value.
Definition: Image_Data_Block.hh:87
static const char *const IMAGE_BANDS_PARAMETER_NAME
The name of the parameter used to obtain the image bands value.
Definition: Image_Data_Block.hh:55
static const char *const PIXEL_BYTES_PARAMETER_NAME
The name of the parameter used to obtain the pixel storage bytes value.
Definition: Image_Data_Block.hh:67
std::string source_filename()
Definition: Image_Data_Block.cc:160
int MSB_data()
Determine if the pixel data is MSB ordered.
Definition: Image_Data_Block.hh:220
virtual unsigned long long data_block_size()
Calculate the size of the binary data block.
Definition: Image_Data_Block.cc:172
unsigned int image_bands()
Get the number of bands in the image.
Definition: Image_Data_Block.hh:149
static const char *const IMAGE_HEIGHT_PARAMETER_NAME
The name of the parameter used to obtain the image height value.
Definition: Image_Data_Block.hh:63
static const char *const LINE_SUFFIX_BYTES_PARAMETER_NAME
The name of the parameter used to obtain the line suffix bytes value.
Definition: Image_Data_Block.hh:107
static const char *const LINE_PREFIX_BYTES_PARAMETER_NAME
The name of the parameter used to obtain the line prefix bytes value.
Definition: Image_Data_Block.hh:103
unsigned int image_width()
Get the width of the image.
Definition: Image_Data_Block.hh:158
int signed_data()
Check if the pixel data is signed.
Definition: Image_Data_Block.hh:209
unsigned int pixel_bytes()
Get the storage size of a pixel in bytes.
Definition: Image_Data_Block.hh:180
static const char *const PIXEL_BITS_PARAMETER_NAME
The name of the parameter used to obtain the valid pixel bits value.
Definition: Image_Data_Block.hh:71
unsigned int line_suffix_bytes()
Get the number of line suffix bytes.
Definition: Image_Data_Block.hh:238
static const char *const PIXEL_DATA_TYPE_PARAMETER_NAME
The name of the parameter used to obtain the pixel data type values.
Definition: Image_Data_Block.hh:75
unsigned int line_prefix_bytes()
Get the number of line prefix bytes.
Definition: Image_Data_Block.hh:229
static const char *const LSB_PIXEL_TYPE_IDENTIFIER
Substring of the PIXEL_DATA_TYPE_PARAMETER_NAME parameter that identifies an LSB ordered pixel.
Definition: Image_Data_Block.hh:93
Image_Data_Block()
Constructs an empty Image_Data_Block.
Definition: Image_Data_Block.cc:94
static const char *const MSB_PIXEL_TYPE_IDENTIFIER
Substring of the PIXEL_DATA_TYPE_PARAMETER_NAME parameter that identifies an MSB ordered pixel.
Definition: Image_Data_Block.hh:99
static const char *const IMAGE_WIDTH_PARAMETER_NAME
The name of the parameter used to obtain the image width value.
Definition: Image_Data_Block.hh:59
static const char *const ID
Class identification name with source code version and date.
Definition: Image_Data_Block.hh:51
unsigned int pixel_bits()
Get the number valid bits (data precision) in a pixel.
Definition: Image_Data_Block.hh:198
static const char *const UNSIGNED_PIXEL_TYPE_IDENTIFIER
Substring of the PIXEL_DATA_TYPE_PARAMETER_NAME parameter that identifies an unsigned pixel value.
Definition: Image_Data_Block.hh:81
unsigned int image_height()
Get the height of the image.
Definition: Image_Data_Block.hh:167
A PDS_Data_Block describes a binary data block in a PDS label.
Definition: PDS_Data_Block.hh:56
virtual PDS_Data & parameters(const std::string &pathname)
Set the parameters from a source file.
Definition: PDS_Data.cc:305
std::string pathname(const Parameter *root=NULL) const
Definition: Dimensions.cc:30