HiRISE
 PDS_JP2

PDS_Converter.hh
Go to the documentation of this file.
1/* PDS_Converter
2
3HiROC CVS ID: PDS_Converter.hh,v 1.16 2012/01/24 03:08:13 castalia Exp
4
5Copyright (C) 2007 Arizona Board of Regents on behalf of the
6Planetary Image Research Laboratory, Lunar and Planetary Laboratory at
7the University of Arizona.
8
9This library is free software; you can redistribute it and/or modify it
10under the terms of the GNU Lesser General Public License, version 2.1,
11as published by the Free Software Foundation.
12
13This library is distributed in the hope that it will be useful, but
14WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16Lesser General Public License for more details.
17
18You should have received a copy of the GNU Lesser General Public License
19along with this library; if not, write to the Free Software Foundation,
20Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
21
22*******************************************************************************/
23
24#ifndef _PDS_Converter_
25#define _PDS_Converter_
26
27#include "PDS_Data.hh"
28#include "Image_Data_Block.hh"
29#include "Dimensions.hh"
30
31namespace UA
32{
33namespace HiRISE
34{
55: public PDS_Data
56{
57public:
58/*==============================================================================
59 Constants:
60*/
62static const char* const
64
69static const char
71
75static const char
77
81static const char
83
84// Common additional parameters:
85
87static const char
90static const char
93static const char
95
96/*==============================================================================
97 Constructors:
98*/
102
121explicit PDS_Converter (const std::string& pathname,
122 const char** excluded_names = NULL, const char** image_names = NULL);
123
128PDS_Converter (const PDS_Converter& converter);
129
135virtual PDS_Converter& operator= (const PDS_Converter& converter);
136
139virtual ~PDS_Converter ();
140
141/*==============================================================================
142 Manipulators:
143*/
181 (
182 const std::string& PDS_label_pathname,
183 const std::string& JP2_pathname,
184 const char** removed_parameter_names = NULL,
185 PDS_Data* additional_parameters = NULL
186 ) = 0;
187
228virtual void write_PDS_label
229 (
230 const std::string& PDS_label_pathname,
231 const Rectangle* image_region = NULL,
232 unsigned int resolution_level = 1,
233 const char** removed_parameter_names = NULL,
234 PDS_Data* additional_parameters = NULL
235 ) = 0;
236
237/*==============================================================================
238 Accessors:
239*/
256virtual std::string product_names () const;
257
268virtual bool label_recognized () const = 0;
269
282PDS_Converter& label_size (unsigned int size)
283 {Label_Size = size; return *this;}
284
289unsigned int label_size () const
290 {return Label_Size;}
291
304
311void refresh_data_blocks ();
312
329
341PDS_Converter& excluded_data_block_names (const char** names);
342
349const char** excluded_data_block_names () const
351
366PDS_Converter& image_data_block_names (const char** names);
367
375const char** image_data_block_names () const
376 {return Image_Data_Block_Names;}
377
378/*==============================================================================
379 Helpers:
380*/
429 (const std::string& JP2_pathname);
430
455unsigned int
457 (
458 const std::string& pathname,
459 PDS_Data& label,
460 idaeim::PVL::Lister* lister = NULL,
461 bool pad_label = false
462 );
463
464
465protected:
466
471void clear_data_blocks ();
472
473/*==============================================================================
474 Data Members:
475*/
476protected:
477
482const char**
484
488
490const char**
492
496
498unsigned int
500
501}; // End class PDS_Converter
502
503} // namespace HiRISE
504} // namespace UA
505#endif
PDS_Converter()
Constructs an empty PDS_Converter.
Definition PDS_Converter.cc:104
An Image_Data_Block describes PDS image data.
Definition Image_Data_Block.hh:45
A PDS_Converter is used to convert an attached PDS image label to or from a detached PDS/JP2 label.
Definition PDS_Converter.hh:56
static const char * DEFAULT_PRODUCT_TYPE
Default product name.
Definition PDS_Converter.hh:70
Image_Data_Block * image_data()
Get the Image_Data_Block from the PDS_Data::PDS_Data_Block_List.
Definition PDS_Converter.cc:204
virtual PDS_Converter & operator=(const PDS_Converter &converter)
Assigns another PDS_Converter to this PDS_Converter.
Definition PDS_Converter.cc:152
void refresh_data_blocks()
Refresh the list of data blocks.
Definition PDS_Converter.cc:267
static const char * GeoTIFF_PARAMETER_NAME
GeoTIFF included.
Definition PDS_Converter.hh:88
virtual ~PDS_Converter()
Frees the PDS_Data::PDS_Data_Block_List and its contents.
Definition PDS_Converter.cc:192
const char ** image_data_block_names() const
Get the parameter names of image data blocks.
Definition PDS_Converter.hh:375
unsigned int write_label(const std::string &pathname, PDS_Data &label, idaeim::PVL::Lister *lister=NULL, bool pad_label=false)
Write a label file.
Definition PDS_Converter.cc:402
static const char * COMPRESSED_FILE_PARAMETERS_GROUP
Names of the PDS/JP2 label parameter group describing the destination compressed file.
Definition PDS_Converter.hh:82
Image_Data_Block * IMAGE_Data_Block
Pointer to the IMAGE data block in the Data_Blocks list.
Definition PDS_Converter.hh:495
const char ** excluded_data_block_names() const
Get the names of parameters to be excluded from the data block list.
Definition PDS_Converter.hh:349
virtual bool label_recognized() const =0
Test whether the label parameters are recognized by this converter.
static const char * UNCOMPRESSED_FILE_PARAMETERS_GROUP
Name of the PDS/JP2 label parameter group describing the source uncompressed file.
Definition PDS_Converter.hh:76
PDS_Converter()
Constructs an empty PDS_Converter.
Definition PDS_Converter.cc:104
virtual void write_PDS_JP2_label(const std::string &PDS_label_pathname, const std::string &JP2_pathname, const char **removed_parameter_names=NULL, PDS_Data *additional_parameters=NULL)=0
Write a detached PDS/JP2 label file.
virtual void write_PDS_label(const std::string &PDS_label_pathname, const Rectangle *image_region=NULL, unsigned int resolution_level=1, const char **removed_parameter_names=NULL, PDS_Data *additional_parameters=NULL)=0
Write a PDS label file for image data to be appended.
static const char * GML_PARAMETER_NAME
GML included.
Definition PDS_Converter.hh:91
PDS_Converter & label_size(unsigned int size)
Set the preferred size of a label file.
Definition PDS_Converter.hh:282
void clear_data_blocks()
Clear the data blocks list.
Definition PDS_Converter.cc:276
static const char * NO_VERSION_CHANGE_PARAMETER_NAME
No Version number change.
Definition PDS_Converter.hh:94
PDS_Data::PDS_Data_Block_List * data_blocks() const
Get the list of data blocks in the PDS label.
Definition PDS_Converter.hh:302
const char ** Image_Data_Block_Names
Names (NULL-terminated array) of data blocks that are Image_Data_Blocks.
Definition PDS_Converter.hh:491
virtual std::string product_names() const
Get the name of the product types that this converter is intended to process.
Definition PDS_Converter.cc:199
unsigned int Label_Size
The preferred size of the attached PDS label.
Definition PDS_Converter.hh:499
const char ** Excluded_Data_Block_Names
Names (NULL-terminated array) of data blocks to be exluded from the list of data blocks (probably bec...
Definition PDS_Converter.hh:483
idaeim::PVL::Aggregate * PDS_JP2_image_parameters(const std::string &JP2_pathname)
Assemble PDS/JP2 image file description parameters.
Definition PDS_Converter.cc:294
static const char *const ID
Class identification name with source code version and date.
Definition PDS_Converter.hh:63
PDS_Data::PDS_Data_Block_List * Data_Blocks
Pointer to the list of data blocks found in the PDS label.
Definition PDS_Converter.hh:487
unsigned int label_size() const
Get the preferred size of a label file.
Definition PDS_Converter.hh:289
PDS_Data contains PDS label PVL parameters.
Definition PDS_Data.hh:52
std::vector< PDS_Data_Block * > PDS_Data_Block_List
A vector of PDS_Data_Block object pointers.
Definition PDS_Data.hh:58
PDS_Data()
Construct PDS_Data with no parameters.
Definition PDS_Data.cc:98
std::string pathname(const Parameter *root=NULL) const
Definition Dimensions.cc:32
Definition Dimensions.cc:30
A Rectangle is a position with a size.
Definition Dimensions.hh:223