00001 /* 00002 * The information in this file is 00003 * Copyright(c) 2007 Ball Aerospace & Technologies Corporation 00004 * and is subject to the terms and conditions of the 00005 * GNU Lesser General Public License Version 2.1 00006 * The license text is available from 00007 * http://www.gnu.org/licenses/lgpl.html 00008 */ 00009 00010 #ifndef NITFCHIPCONVERTER_H 00011 #define NITFCHIPCONVERTER_H 00012 00013 #include "LocationType.h" 00014 class RasterDataDescriptor; 00015 00016 namespace Nitf 00017 { 00018 /** 00019 * Performs all computation combining ICHIPB and the application's chipping representations. 00020 */ 00021 class ChipConverter 00022 { 00023 public: 00024 /** 00025 * Create a converter for a given descriptor. 00026 * 00027 * @param descriptor 00028 * The descriptor for the element to perform conversions for. 00029 */ 00030 ChipConverter(const RasterDataDescriptor &descriptor); 00031 00032 /** 00033 * Create a converter for a given descriptor and chip coefficients. 00034 * 00035 * @param descriptor 00036 * The descriptor for the element to perform conversions for. 00037 * @param coefficients 00038 * The coefficients to use. Must have 6 entries. 00039 */ 00040 ChipConverter(const RasterDataDescriptor &descriptor, const std::vector<double> &coefficients); 00041 00042 /** 00043 * Destructor. 00044 */ 00045 ~ChipConverter(); 00046 00047 /** 00048 * Convert an original value to the active one. 00049 * 00050 * @param original 00051 * The NITF original value. 00052 * 00053 * @return The active value. 00054 */ 00055 LocationType originalToActive(LocationType original) const; 00056 00057 /** 00058 * Convert an active value to the original one. 00059 * 00060 * @param active 00061 * The active value. 00062 * 00063 * @return The NITF original value. 00064 */ 00065 LocationType activeToOriginal(LocationType active) const; 00066 00067 /** 00068 * Get the coefficients used. 00069 * 00070 * @return The coefficients used. 00071 */ 00072 const std::vector<double> &getChipCoefficients() const; 00073 00074 private: 00075 ChipConverter& operator=(const ChipConverter& rhs); 00076 00077 std::vector<double> mChipCoefficients; 00078 const RasterDataDescriptor& mDescriptor; 00079 00080 }; 00081 } 00082 00083 #endif