PDS_JP2
|
00001 /* PDS_Converter 00002 00003 HiROC CVS ID: PDS_Converter.hh,v 1.16 2012/01/24 03:08:13 castalia Exp 00004 00005 Copyright (C) 2007 Arizona Board of Regents on behalf of the 00006 Planetary Image Research Laboratory, Lunar and Planetary Laboratory at 00007 the University of Arizona. 00008 00009 This library is free software; you can redistribute it and/or modify it 00010 under the terms of the GNU Lesser General Public License, version 2.1, 00011 as published by the Free Software Foundation. 00012 00013 This library is distributed in the hope that it will be useful, but 00014 WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 Lesser General Public License for more details. 00017 00018 You should have received a copy of the GNU Lesser General Public License 00019 along with this library; if not, write to the Free Software Foundation, 00020 Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 00021 00022 *******************************************************************************/ 00023 00024 #ifndef _PDS_Converter_ 00025 #define _PDS_Converter_ 00026 00027 #include "PDS_Data.hh" 00028 #include "Image_Data_Block.hh" 00029 #include "Dimensions.hh" 00030 00031 namespace UA 00032 { 00033 namespace HiRISE 00034 { 00054 class PDS_Converter 00055 : public PDS_Data 00056 { 00057 public: 00058 /*============================================================================== 00059 Constants: 00060 */ 00062 static const char* const 00063 ID; 00064 00069 static const char 00070 *DEFAULT_PRODUCT_TYPE; 00071 00075 static const char 00076 *UNCOMPRESSED_FILE_PARAMETERS_GROUP; 00077 00081 static const char 00082 *COMPRESSED_FILE_PARAMETERS_GROUP; 00083 00084 // Common additional parameters: 00085 00087 static const char 00088 *GeoTIFF_PARAMETER_NAME; 00090 static const char 00091 *GML_PARAMETER_NAME; 00093 static const char 00094 *NO_VERSION_CHANGE_PARAMETER_NAME; 00095 00096 /*============================================================================== 00097 Constructors: 00098 */ 00101 PDS_Converter (); 00102 00121 explicit PDS_Converter (const std::string& pathname, 00122 const char** excluded_names = NULL, const char** image_names = NULL); 00123 00128 PDS_Converter (const PDS_Converter& converter); 00129 00135 virtual PDS_Converter& operator= (const PDS_Converter& converter); 00136 00139 virtual ~PDS_Converter (); 00140 00141 /*============================================================================== 00142 Manipulators: 00143 */ 00180 virtual void write_PDS_JP2_label 00181 ( 00182 const std::string& PDS_label_pathname, 00183 const std::string& JP2_pathname, 00184 const char** removed_parameter_names = NULL, 00185 PDS_Data* additional_parameters = NULL 00186 ) = 0; 00187 00228 virtual void write_PDS_label 00229 ( 00230 const std::string& PDS_label_pathname, 00231 const Rectangle* image_region = NULL, 00232 unsigned int resolution_level = 1, 00233 const char** removed_parameter_names = NULL, 00234 PDS_Data* additional_parameters = NULL 00235 ) = 0; 00236 00237 /*============================================================================== 00238 Accessors: 00239 */ 00256 virtual std::string product_names () const; 00257 00268 virtual bool label_recognized () const = 0; 00269 00282 PDS_Converter& label_size (unsigned int size) 00283 {Label_Size = size; return *this;} 00284 00289 unsigned int label_size () const 00290 {return Label_Size;} 00291 00302 PDS_Data::PDS_Data_Block_List* data_blocks () const 00303 {return Data_Blocks;} 00304 00311 void refresh_data_blocks (); 00312 00328 Image_Data_Block* image_data (); 00329 00341 PDS_Converter& excluded_data_block_names (const char** names); 00342 00349 const char** excluded_data_block_names () const 00350 {return Excluded_Data_Block_Names;} 00351 00366 PDS_Converter& image_data_block_names (const char** names); 00367 00375 const char** image_data_block_names () const 00376 {return Image_Data_Block_Names;} 00377 00378 /*============================================================================== 00379 Helpers: 00380 */ 00428 idaeim::PVL::Aggregate* PDS_JP2_image_parameters 00429 (const std::string& JP2_pathname); 00430 00455 unsigned int 00456 write_label 00457 ( 00458 const std::string& pathname, 00459 PDS_Data& label, 00460 idaeim::PVL::Lister* lister = NULL, 00461 bool pad_label = false 00462 ); 00463 00464 00465 protected: 00466 00471 void clear_data_blocks (); 00472 00473 /*============================================================================== 00474 Data Members: 00475 */ 00476 protected: 00477 00482 const char** 00483 Excluded_Data_Block_Names; 00484 00486 PDS_Data::PDS_Data_Block_List 00487 *Data_Blocks; 00488 00490 const char** 00491 Image_Data_Block_Names; 00492 00494 Image_Data_Block 00495 *IMAGE_Data_Block; 00496 00498 unsigned int 00499 Label_Size; 00500 00501 }; // End class PDS_Converter 00502 00503 } // namespace HiRISE 00504 } // namespace UA 00505 #endif