diff --git a/Code/BasicFilters/otbBCOInterpolateImageFunction.h b/Code/BasicFilters/otbBCOInterpolateImageFunction.h index a9f4c934d8dbc4d6cc47785a8d263424b8895de9..1f47e6289a3da0ac9c91007edfab2263cb543e30 100644 --- a/Code/BasicFilters/otbBCOInterpolateImageFunction.h +++ b/Code/BasicFilters/otbBCOInterpolateImageFunction.h @@ -105,15 +105,14 @@ public: * calling the method. */ virtual OutputType EvaluateAtContinuousIndex( const ContinuousIndexType & index ) const = 0; + /** Compute the BCO coefficients. */ + virtual void EvaluateCoef( const ContinuousIndexType & index ) const; + protected: BCOInterpolateImageFunctionBase(); ~BCOInterpolateImageFunctionBase(); void PrintSelf(std::ostream& os, itk::Indent indent) const; - /** Compute the BCO coefficients. */ - virtual void EvaluateCoef( const ContinuousIndexType & index ); - virtual double GetBCOCoefX(unsigned int idx) const; - virtual double GetBCOCoefY(unsigned int idx) const; - + private: BCOInterpolateImageFunctionBase( const Self& ); //purposely not implemented void operator=( const Self& ); //purposely not implemented @@ -121,10 +120,7 @@ private: /** Used radius for the BCO */ double m_Radius; /** Optimisation Coefficient */ - double m_Alpha; - /** Used BCO coefficiet */ - CoefContainerType m_BCOCoefX; - CoefContainerType m_BCOCoefY; + double m_Alpha; }; diff --git a/Code/BasicFilters/otbBCOInterpolateImageFunction.txx b/Code/BasicFilters/otbBCOInterpolateImageFunction.txx index 29df5d91809c888adbe825648f86cc74e3b0e1ad..4fdf968281a8ffeeedb437e0a865567e96220b9c 100644 --- a/Code/BasicFilters/otbBCOInterpolateImageFunction.txx +++ b/Code/BasicFilters/otbBCOInterpolateImageFunction.txx @@ -30,7 +30,7 @@ template <class TInputImage, class TCoordRep> BCOInterpolateImageFunctionBase<TInputImage, TCoordRep> ::BCOInterpolateImageFunctionBase() { - m_Radius = 1; + m_Radius = 2; m_Alpha = -0.5; } @@ -83,29 +83,15 @@ double BCOInterpolateImageFunctionBase<TInputImage, TCoordRep> return m_Alpha; } -template <class TInputImage, class TCoordRep> -double BCOInterpolateImageFunctionBase<TInputImage, TCoordRep> -::GetBCOCoefX(unsigned int idx) const -{ - return m_BCOCoefX[idx]; -} - -template <class TInputImage, class TCoordRep> -double BCOInterpolateImageFunctionBase<TInputImage, TCoordRep> -::GetBCOCoefY(unsigned int idx) const -{ - return m_BCOCoefY[idx]; -} - template<class TInputImage, class TCoordRep> void BCOInterpolateImageFunctionBase<TInputImage, TCoordRep> -::EvaluateCoef( const ContinuousIndexType & index ) +::EvaluateCoef( const ContinuousIndexType & index ) const { // Init BCO coefficient container unsigned int winSize = 2*m_Radius+1; - m_BCOCoefX = CoefContainerType(winSize, 0.); - m_BCOCoefY = CoefContainerType(winSize, 0.); + CoefContainerType BCOCoefX = CoefContainerType(winSize, 0.); + CoefContainerType BCOCoefY = CoefContainerType(winSize, 0.); double offsetX, offsetY, distX, distY, position, step; offsetX = index[0] - itk::Math::Floor<IndexValueType>(index[0]+0.5); @@ -125,50 +111,39 @@ BCOInterpolateImageFunctionBase<TInputImage, TCoordRep> { if (distX <= 1.) { - m_BCOCoefX[m_Radius+i] = (m_Alpha + 2.)*vcl_abs(vcl_pow(distX, 3)) + BCOCoefX[m_Radius+i] = (m_Alpha + 2.)*vcl_abs(vcl_pow(distX, 3)) - (m_Alpha + 3.)*vcl_pow(distX, 2) + 1; } else { - m_BCOCoefX[m_Radius+i] = m_Alpha*vcl_abs(vcl_pow(distX, 3)) - 5 + BCOCoefX[m_Radius+i] = m_Alpha*vcl_abs(vcl_pow(distX, 3)) - 5 *m_Alpha*vcl_pow(distX, 2) + 8*m_Alpha*vcl_abs(distX) - 4*m_Alpha; } } else { - m_BCOCoefX[m_Radius+i] = 0; + BCOCoefX[m_Radius+i] = 0; } if( distY <= 2. ) { if (distY <= 1.) { - m_BCOCoefY[m_Radius+i] = (m_Alpha + 2.)*vcl_abs(vcl_pow(distY, 3)) + BCOCoefY[m_Radius+i] = (m_Alpha + 2.)*vcl_abs(vcl_pow(distY, 3)) - (m_Alpha + 3.)*vcl_pow(distY, 2) + 1; } else { - m_BCOCoefY[m_Radius+i] = m_Alpha*vcl_abs(vcl_pow(distY, 3)) - 5 + BCOCoefY[m_Radius+i] = m_Alpha*vcl_abs(vcl_pow(distY, 3)) - 5 *m_Alpha*vcl_pow(distY, 2) + 8*m_Alpha*vcl_abs(distY) - 4*m_Alpha; } } else { - m_BCOCoefY[m_Radius+i] = 0; + BCOCoefY[m_Radius+i] = 0; } - /* - std::cout << "distX : " << distX << std::endl; - std::cout << "distY : " << distY << std::endl; - std::cout << "position : " << position << std::endl; - */ position += step; } - /* - std::cout << "m_BCOCoefX : " << std::endl; - std::cout << m_BCOCoefX << std::endl; - std::cout << "m_BCOCoefY : " << std::endl; - std::cout << m_BCOCoefX << std::endl; - */ } @@ -210,7 +185,7 @@ BCOInterpolateImageFunction<TInputImage, TCoordRep> IndexType baseIndex; IndexType neighIndex; - vnl_vector<RealType> lineRes(winSize, 0.); + std::vector<RealType> lineRes(winSize, 0.); RealType value = itk::NumericTraits<RealType>::Zero; @@ -300,9 +275,9 @@ BCOInterpolateImageFunction<TInputImage, TCoordRep> #endif lineRes[i+radius] = lineRes[i+radius] - + static_cast<RealType>( this->GetInputImage()->GetPixel( neighIndex ) ) * BCOCoefY(j+radius) ; + + static_cast<RealType>( this->GetInputImage()->GetPixel( neighIndex ) ) * BCOCoefY[j+radius] ; } - value += lineRes[i+radius]*BCOCoefX(i+radius); + value += lineRes[i+radius]*BCOCoefX[i+radius]; } norma = (vcl_log(radius)/vcl_log(2.0)); @@ -375,7 +350,7 @@ BCOInterpolateImageFunction< otb::VectorImage<TPixel,VImageDimension> , TCoordRe OutputType output; - output.SetSize(1); + output.SetSize(componentNumber); offsetX = index[0] - itk::Math::Floor<IndexValueType>(index[0]+0.5); offsetY = index[1] - itk::Math::Floor<IndexValueType>(index[1]+0.5); @@ -464,12 +439,12 @@ BCOInterpolateImageFunction< otb::VectorImage<TPixel,VImageDimension> , TCoordRe for( unsigned int k = 0; k<componentNumber; k++) { lineRes[i+radius].at(k) = lineRes[i+radius].at(k) - + this->GetInputImage()->GetPixel( neighIndex ).GetElement(k) * BCOCoefY(j+radius) ; + + this->GetInputImage()->GetPixel( neighIndex ).GetElement(k) * BCOCoefY[j+radius] ; } } for( unsigned int k = 0; k<componentNumber; k++) { - value.at(k) += lineRes[i+radius].at(k)*BCOCoefX(i+radius); + value.at(k) += lineRes[i+radius].at(k)*BCOCoefX[i+radius]; } } diff --git a/Code/Common/otbStreamingTraits.h b/Code/Common/otbStreamingTraits.h index ac405dfadf7291503f6e062244b32e55090d1eda..1edd0e516da6a581c5b18db8ec9222d6c8c07bf1 100644 --- a/Code/Common/otbStreamingTraits.h +++ b/Code/Common/otbStreamingTraits.h @@ -32,6 +32,7 @@ #include "otbWindowedSincInterpolateImageWelchFunction.h" #include "otbWindowedSincInterpolateImageLanczosFunction.h" #include "otbWindowedSincInterpolateImageBlackmanFunction.h" +#include "otbBCOInterpolateImageFunction.h" #include "otbProlateInterpolateImageFunction.h" @@ -151,6 +152,7 @@ public: typedef WindowedSincInterpolateImageLanczosFunction<ImageType> LanczosInterpolationType; typedef WindowedSincInterpolateImageBlackmanFunction<ImageType> BlackmanInterpolationType; typedef ProlateInterpolateImageFunction<ImageType> ProlateInterpolationType; + typedef BCOInterpolateImageFunction<ImageType> BCOInterpolationType; static unsigned int CalculateNeededRadiusForInterpolator(const InterpolationType* interpolator); }; @@ -195,6 +197,8 @@ public: // OTB Interpolators (supported for otb::VectorImage) typedef WindowedSincInterpolateImageGaussianFunction<ImageType> GaussianInterpolationType; + typedef BCOInterpolateImageFunction<ImageType> BCOInterpolationType; + //typedef WindowedSincInterpolateImageCosineFunction<ImageType> CosineInterpolationType; //typedef WindowedSincInterpolateImageHammingFunction<ImageType> HammingInterpolationType; //typedef WindowedSincInterpolateImageWelchFunction<ImageType> WelchInterpolationType; diff --git a/Code/Common/otbStreamingTraits.txx b/Code/Common/otbStreamingTraits.txx index 62a1f31d043ba659c9c03b9d8d421bffb8980a63..57aef4d9fd1cab73eaa7f0e89bb78f344b5ebff2 100644 --- a/Code/Common/otbStreamingTraits.txx +++ b/Code/Common/otbStreamingTraits.txx @@ -290,6 +290,12 @@ unsigned int StreamingTraits<TImage> otbMsgDevMacro(<< "Blackman Windowed Interpolator"); neededRadius = dynamic_cast<const BlackmanInterpolationType *>(interpolator)->GetRadius(); } + else if (className == "BCOInterpolateImageFunction") + { + otbMsgDevMacro(<< "BCO Interpolator"); + neededRadius = dynamic_cast<const BCOInterpolationType *>(interpolator)->GetRadius(); + } + /*else if (className == "WindowedSincInterpolateImageFunction") { @@ -334,6 +340,11 @@ unsigned int StreamingTraits< otb::VectorImage<TPixel,VImageDimension> > otbMsgDevMacro(<< "Gaussian Windowed Interpolator"); neededRadius = dynamic_cast<const GaussianInterpolationType *>(interpolator)->GetRadius(); } + else if (className == "BCOInterpolateImageFunction") + { + otbMsgDevMacro(<< "BCO Interpolator"); + neededRadius = dynamic_cast<const BCOInterpolationType *>(interpolator)->GetRadius(); + } /*else if (className == "WindowedSincInterpolateImageFunction") { diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt index f383b8611dc780c3f40d497a72a44b95e7a06cb2..a270f259f70567dd0a7acd2e1a08b963f016ffc9 100644 --- a/RELEASE_NOTES.txt +++ b/RELEASE_NOTES.txt @@ -28,7 +28,7 @@ OTB-v.3.6.0 - Changes since version 3.4.0 (2010/??/??) * System * Internal ITK updated to 3.20.0 + OTB Patches - * Internal OSSIM and ossim plugins updated to svn revision 18139 + OTB patches + * Internal OSSIM and ossim plugins updated to svn revision 18162 + OTB patches (almost none left) * Enable the use of an external build of libLAS * Fix internal libkml for MSVC 2010 diff --git a/Testing/Code/BasicFilters/otbStreamingTraits.cxx b/Testing/Code/BasicFilters/otbStreamingTraits.cxx index 1ecc13e51007dce657f39f30594a10256db4ebb9..ccedb02f8a4c01c47f5822e98fb68bdcfeeb0665 100644 --- a/Testing/Code/BasicFilters/otbStreamingTraits.cxx +++ b/Testing/Code/BasicFilters/otbStreamingTraits.cxx @@ -50,6 +50,7 @@ int otbStreamingTraitsImage(int argc, char* argv[]) TestInstanciate<StreamingTraits::LanczosInterpolationType>(); TestInstanciate<StreamingTraits::BlackmanInterpolationType>(); TestInstanciate<StreamingTraits::ProlateInterpolationType>(); + TestInstanciate<StreamingTraits::BCOInterpolationType>(); return EXIT_SUCCESS; } @@ -64,6 +65,7 @@ int otbStreamingTraitsVectorImage(int argc, char* argv[]) TestInstanciate<StreamingTraits::NearestNeighborInterpolationType>(); TestInstanciate<StreamingTraits::LinearInterpolationType>(); TestInstanciate<StreamingTraits::GaussianInterpolationType>(); + TestInstanciate<StreamingTraits::BCOInterpolationType>(); return EXIT_SUCCESS; } diff --git a/UseOTB.cmake.in b/UseOTB.cmake.in index 0ae21268c55a94a49d4b5005559e28d9d7b4a0c6..9a197de5dfcd121f83bb25a607430f3518fa6090 100644 --- a/UseOTB.cmake.in +++ b/UseOTB.cmake.in @@ -123,7 +123,12 @@ if(OTB_USE_EXTERNAL_FLTK) FIND_PACKAGE(FLTK) LINK_DIRECTORIES(${FLTK_LIBRARY_DIRS}) else(OTB_USE_EXTERNAL_FLTK) - SET(FLTK_FLUID_EXECUTABLE ${OTB_BINARY_DIRS}/fluid) +FIND_PROGRAM(FLTK_FLUID_EXECUTABLE fluid PATHS + ${OTB_BINARY_DIRS} + ${OTB_BINARY_DIRS}/Release + ${OTB_BINARY_DIRS}/RelWithDebInfo + ${OTB_BINARY_DIRS}/Debug + NO_SYSTEM_PATH) endif(OTB_USE_EXTERNAL_FLTK) # The use curl definition diff --git a/Utilities/otbossim/include/ossim/imaging/ossimJpegStdIOSrc.h b/Utilities/otbossim/include/ossim/imaging/ossimJpegStdIOSrc.h index 40f15eb75f188eaf355f2e04e6b51e647be0337e..9ea09a8b8b4c7c425c2c3c72c00f8ef3643a2990 100644 --- a/Utilities/otbossim/include/ossim/imaging/ossimJpegStdIOSrc.h +++ b/Utilities/otbossim/include/ossim/imaging/ossimJpegStdIOSrc.h @@ -17,13 +17,13 @@ extern "C" #include <cstdio> /** for size_t */ #include <csetjmp> /** for jmp_buf */ #include <jpeglib.h> /** for jpeg stuff */ -//#include <jinclude.h> -//#include <jerror.h> -/** - * @brief Method which uses memory instead of a FILE* to read from. - * @note Used in place of "jpeg_stdio_src(&cinfo, infile)". - */ -OSSIM_DLL void ossimJpegStdIOSrc ( j_decompress_ptr cinfo, - FILE* infile); + //#include <jinclude.h> + //#include <jerror.h> + /** + * @brief Method which uses memory instead of a FILE* to read from. + * @note Used in place of "jpeg_stdio_src(&cinfo, infile)". + */ + OSSIM_DLL void ossimJpegStdIOSrc ( j_decompress_ptr cinfo, + FILE* infile); } #endif /* #ifndef ossimJpegMemSrc_HEADER */ diff --git a/Utilities/otbossim/include/ossim/support_data/ossimNitfCsexraTag.h b/Utilities/otbossim/include/ossim/support_data/ossimNitfCsexraTag.h index fdec19e8a670955bea50b64410ae7f32a9f33873..fef8a55f9bfc68d5a4b90774cdabbb085767d8f3 100644 --- a/Utilities/otbossim/include/ossim/support_data/ossimNitfCsexraTag.h +++ b/Utilities/otbossim/include/ossim/support_data/ossimNitfCsexraTag.h @@ -55,6 +55,151 @@ public: virtual std::ostream& print(std::ostream& out, const std::string& prefix) const; + /** + * @brief Get the SENSOR field. + * @return The SENSOR field as a string. + */ + ossimString getSensor() const; + + /** + * @brief Get the TIME_FIRST_LINE_IMAGE field. + * @return The TIME_FIRST_LINE_IMAGE field as a string. + */ + ossimString getTimeFirstLineImage() const; + + /** + * @brief Get the TIME_IMAGE_DURATION field. + * @return The TIME_IMAGE_DURATION field as a string. + */ + ossimString getTimeImageDuration() const; + + /** + * @brief Get the MAX_GSDfield. + * @return The MAX_GSD field as a string. + */ + ossimString getMaxGsd() const; + + /** + * @brief Get the ALONG_SCAN_GSD field. + * @return The ALONG_SCAN_GSD field as a string. + */ + ossimString getAlongScanGsd() const; + + /** + * @brief Get the CROSS_SCAN_GSD field. + * @return TheCROSS_SCAN_GSD field as a string. + */ + ossimString getCrossScanGsd() const; + + /** + * @brief Get the GEO_MEAN_GSD field. + * @return The GEO_MEAN_GSD field as a string. + */ + ossimString getGeoMeanGsd() const; + + /** + * @brief Get the A_S_VERT_GSD field. + * @return The A_S_VERT_GSD field as a string. + */ + ossimString getAlongScanVerticalGsd() const; + + /** + * @brief Get the C_S_VERT_GSD field. + * @return The C_S_VERT_GSD field as a string. + */ + ossimString getCrossScanVerticalGsd() const; + + /** + * @brief Get the GEO_MEAN_VERT_GSD field. + * @return The GEO_MEAN_VERT_GSD field as a string. + */ + ossimString getGeoMeanVerticalGsd() const; + + /** + * @brief Get the GEO_BETA_ANGLEfield. + * @return The GEO_BETA_ANGLE field as a string. + */ + ossimString getGeoBetaAngle() const; + + /** + * @brief Get the DYNAMIC_RANGE field. + * @return The DYNAMIC_RANGE field as a string. + */ + ossimString getDynamicRange() const; + + /** + * @brief Get the NUM_LINES field. + * @return The NUM_LINES field as a string. + */ + ossimString getNumLines() const; + + + /** + * @brief Get the NUM_SAMPLES field. + * @return The NUM_SAMPLES field as a string. + */ + ossimString getNumSamples() const; + + /** + * @brief Get the ANGLE_TO_NORTH field. + * @return The ANGLE_TO_NORTH field as a string. + */ + ossimString getAngleToNorth() const; + + /** + * @brief Get the OBLIQUITY_ANGLE field. + * @return The OBLIQUITY_ANGLE field as a string. + */ + ossimString getObliquityAngle() const; + + /** + * @brief Get the AZ_OF_OBLIQUITY field. + * @return The AZ_OF_OBLIQUITY field as a string. + */ + ossimString getAzimuthOfObliquity() const; + + /** + * @brief Get the GRD_COVER field. + * @return The GRD_COVER field as a string. + */ + ossimString getGroundCover() const; + + /** + * @brief Get the SNOW_DEPTH_CAT field. + * @return The SNOW_DEPTH_CAT field as a string. + */ + ossimString getSnowDepth() const; + + /** + * @brief Get the SUN_AZIMUTH field. + * @return The SUN_AZIMUTH field as a string. + */ + ossimString getSunAzimuth() const; + + /** + * @brief Get the SUN_ELEVATION field. + * @return The SUN_ELEVATION field as a string. + */ + ossimString getSunElevation() const; + + /** + * @brief Get the PREDICTED_NIIRS field. + * @return The PREDICTED_NIIRS field as a string. + */ + ossimString getPredictedNiirs() const; + + /** + * @brief Get the CIRCL_ERR field. + * @return The CIRCL_ERR field as a string. + */ + ossimString getCE90() const; + + /** + * @brief Get the LINEAR_ERR field. + * @return The LINEAR_ERR field as a string. + */ + ossimString getLE90() const; + protected: /** diff --git a/Utilities/otbossim/src/ossim/elevation/ossimSrtmElevationDatabase.cpp b/Utilities/otbossim/src/ossim/elevation/ossimSrtmElevationDatabase.cpp index 1603dcb2d09d1f19ac757837a70f020029efd0ed..dddd196e7e56c5d96ebd7ec6efe0ca62aeedfd45 100644 --- a/Utilities/otbossim/src/ossim/elevation/ossimSrtmElevationDatabase.cpp +++ b/Utilities/otbossim/src/ossim/elevation/ossimSrtmElevationDatabase.cpp @@ -204,38 +204,4 @@ ossimSrtmElevationDatabase::createCell(const ossimGpt& gpt) } return result; - -#if 0 - ossimRefPtr<ossimElevCellHandler> result = 0; - ossim_uint64 id = createId(gpt); - OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_cacheMapMutex); - CellMap::iterator iter = m_cacheMap.find(id); - - if(iter != m_cacheMap.end()) - { - iter->second->updateTimestamp(); - result = iter->second->m_handler.get(); - } - else - { - ossimFilename f; - createFullPath(f, gpt); - - if(f.exists()) - { - ossimRefPtr<ossimSrtmHandler> h = new ossimSrtmHandler(); - if (h->open(f, m_memoryMapCellsFlag)) - { - m_cacheMap.insert(std::make_pair(id, new CellInfo(createId(gpt), h.get()))); - result = h.get(); - if(m_cacheMap.size() > m_maxOpenCells) - { - flushCacheToMinOpenCells(); - } - } - } - } - - return result; -#endif } diff --git a/Utilities/otbossim/src/ossim/imaging/ossimImageGeometryFactory.cpp b/Utilities/otbossim/src/ossim/imaging/ossimImageGeometryFactory.cpp index f0494a983c55111f040a95282c13d62fe4b503ef..44b359c7003c887e7f4d55757f744d14992dff5d 100644 --- a/Utilities/otbossim/src/ossim/imaging/ossimImageGeometryFactory.cpp +++ b/Utilities/otbossim/src/ossim/imaging/ossimImageGeometryFactory.cpp @@ -170,18 +170,20 @@ ossim2dTo2dTransform* ossimImageGeometryFactory::createTransformFromNitf(ossimNi ossimNitfIchipbTag* ichipb = PTR_CAST(ossimNitfIchipbTag, tag.get()); if (ichipb) { - const ossimRefPtr<ossimNitfRegisteredTag> blocka = - hdr->getTagData(ossimString("BLOCKA")); - const ossimRefPtr<ossimNitfRegisteredTag> rpc00a = - hdr->getTagData(ossimString("RPC00A")); - const ossimRefPtr<ossimNitfRegisteredTag> rpc00b = - hdr->getTagData(ossimString("RPC00B")); +// const ossimRefPtr<ossimNitfRegisteredTag> blocka = +// hdr->getTagData(ossimString("BLOCKA")); +// const ossimRefPtr<ossimNitfRegisteredTag> rpc00a = +// hdr->getTagData(ossimString("RPC00A")); +// const ossimRefPtr<ossimNitfRegisteredTag> rpc00b = +// hdr->getTagData(ossimString("RPC00B")); //--- // If any of these tags are present we will use the sub image from // the ichipb tag. //--- - if ( blocka.get() || rpc00a.get() || rpc00b.get() ) +// if ( blocka.get() || rpc00a.get() || rpc00b.get() ) + + // ************************* THERE ARE PROBLEMS NOT SETTING THIS AT SITE. GO AHEAD AND ALWAYS INIT THE SHIFT { result = ichipb->newTransform(); } diff --git a/Utilities/otbossim/src/ossim/imaging/ossimJpegStdIOSrc.cpp b/Utilities/otbossim/src/ossim/imaging/ossimJpegStdIOSrc.cpp index 598cacee46c83d89bbdbd710a8f18b2d25ea1e35..ea5a383643636508f7f7f77af7cfe2705b150805 100644 --- a/Utilities/otbossim/src/ossim/imaging/ossimJpegStdIOSrc.cpp +++ b/Utilities/otbossim/src/ossim/imaging/ossimJpegStdIOSrc.cpp @@ -1,19 +1,19 @@ /*========================================================================= - - Program: ORFEO Toolbox - Language: C++ - Date: $Date$ - Version: $Revision$ - - - Copyright (c) Centre National d'Etudes Spatiales. All rights reserved. - See OTBCopyright.txt for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + + Program: ORFEO Toolbox + Language: C++ + Date: $Date$ + Version: $Revision$ + + + Copyright (c) Centre National d'Etudes Spatiales. All rights reserved. + See OTBCopyright.txt for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ /* * jdatasrc.c @@ -40,7 +40,7 @@ #define INPUT_BUF_SIZE 4096 /* choose an efficiently fread'able size */ #define JFREAD(file,buf,sizeofbuf) \ - ((size_t) fread((void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file))) +((size_t) fread((void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file))) /* * In ANSI C, and indeed any rational implementation, size_t is also the @@ -54,195 +54,195 @@ extern "C" { - -/* Expanded data source object for stdio input */ - -typedef struct { - struct jpeg_source_mgr pub; /* public fields */ - - FILE * infile; /* source stream */ - JOCTET * buffer; /* start of buffer */ - boolean start_of_file; /* have we gotten any data yet? */ -} ossimJpegStdIOSourceMgr; - -typedef ossimJpegStdIOSourceMgr * ossimJpegStdIOSourceMgrPtr; - - - -/* - * Initialize source --- called by jpeg_read_header - * before any data is actually read. - */ - -void -ossimJpegStdIOSrc_init_source (j_decompress_ptr cinfo) -{ - ossimJpegStdIOSourceMgrPtr src = (ossimJpegStdIOSourceMgrPtr) cinfo->src; - - /* We reset the empty-input-file flag for each image, - * but we don't clear the input buffer. - * This is correct behavior for reading a series of images from one source. - */ - src->start_of_file = TRUE; -} - - -/* - * Fill the input buffer --- called whenever buffer is emptied. - * - * In typical applications, this should read fresh data into the buffer - * (ignoring the current state of next_input_byte & bytes_in_buffer), - * reset the pointer & count to the start of the buffer, and return TRUE - * indicating that the buffer has been reloaded. It is not necessary to - * fill the buffer entirely, only to obtain at least one more byte. - * - * There is no such thing as an EOF return. If the end of the file has been - * reached, the routine has a choice of ERREXIT() or inserting fake data into - * the buffer. In most cases, generating a warning message and inserting a - * fake EOI marker is the best course of action --- this will allow the - * decompressor to output however much of the image is there. However, - * the resulting error message is misleading if the real problem is an empty - * input file, so we handle that case specially. - * - * In applications that need to be able to suspend compression due to input - * not being available yet, a FALSE return indicates that no more data can be - * obtained right now, but more may be forthcoming later. In this situation, - * the decompressor will return to its caller (with an indication of the - * number of scanlines it has read, if any). The application should resume - * decompression after it has loaded more data into the input buffer. Note - * that there are substantial restrictions on the use of suspension --- see - * the documentation. - * - * When suspending, the decompressor will back up to a convenient restart point - * (typically the start of the current MCU). next_input_byte & bytes_in_buffer - * indicate where the restart point will be if the current call returns FALSE. - * Data beyond this point must be rescanned after resumption, so move it to - * the front of the buffer rather than discarding it. - */ - -boolean -ossimJpegStdIOSrc_fill_input_buffer (j_decompress_ptr cinfo) -{ - ossimJpegStdIOSourceMgrPtr src = (ossimJpegStdIOSourceMgrPtr) cinfo->src; - size_t nbytes; - - nbytes = JFREAD(src->infile, src->buffer, INPUT_BUF_SIZE); - - if (nbytes <= 0) { - if (src->start_of_file) /* Treat empty input file as fatal error */ - ERREXIT(cinfo, JERR_INPUT_EMPTY); - WARNMS(cinfo, JWRN_JPEG_EOF); - /* Insert a fake EOI marker */ - src->buffer[0] = (JOCTET) 0xFF; - src->buffer[1] = (JOCTET) JPEG_EOI; - nbytes = 2; - } - - src->pub.next_input_byte = src->buffer; - src->pub.bytes_in_buffer = nbytes; - src->start_of_file = FALSE; - - return TRUE; -} - - -/* - * Skip data --- used to skip over a potentially large amount of - * uninteresting data (such as an APPn marker). - * - * Writers of suspendable-input applications must note that skip_input_data - * is not granted the right to give a suspension return. If the skip extends - * beyond the data currently in the buffer, the buffer can be marked empty so - * that the next read will cause a fill_input_buffer call that can suspend. - * Arranging for additional bytes to be discarded before reloading the input - * buffer is the application writer's problem. - */ - -void -ossimJpegStdIOSrc_skip_input_data (j_decompress_ptr cinfo, long num_bytes) -{ - ossimJpegStdIOSourceMgrPtr src = (ossimJpegStdIOSourceMgrPtr) cinfo->src; - - /* Just a dumb implementation for now. Could use fseek() except - * it doesn't work on pipes. Not clear that being smart is worth - * any trouble anyway --- large skips are infrequent. - */ - if (num_bytes > 0) { - while (num_bytes > (long) src->pub.bytes_in_buffer) { - num_bytes -= (long) src->pub.bytes_in_buffer; - (void) ossimJpegStdIOSrc_fill_input_buffer(cinfo); - /* note we assume that fill_input_buffer will never return FALSE, - * so suspension need not be handled. + + /* Expanded data source object for stdio input */ + + typedef struct { + struct jpeg_source_mgr pub; /* public fields */ + + FILE * infile; /* source stream */ + JOCTET * buffer; /* start of buffer */ + boolean start_of_file; /* have we gotten any data yet? */ + } ossimJpegStdIOSourceMgr; + + typedef ossimJpegStdIOSourceMgr * ossimJpegStdIOSourceMgrPtr; + + + + /* + * Initialize source --- called by jpeg_read_header + * before any data is actually read. + */ + + void + ossimJpegStdIOSrc_init_source (j_decompress_ptr cinfo) + { + ossimJpegStdIOSourceMgrPtr src = (ossimJpegStdIOSourceMgrPtr) cinfo->src; + + /* We reset the empty-input-file flag for each image, + * but we don't clear the input buffer. + * This is correct behavior for reading a series of images from one source. */ - } - src->pub.next_input_byte += (size_t) num_bytes; - src->pub.bytes_in_buffer -= (size_t) num_bytes; - } -} - - -/* - * An additional method that can be provided by data source modules is the - * resync_to_restart method for error recovery in the presence of RST markers. - * For the moment, this source module just uses the default resync method - * provided by the JPEG library. That method assumes that no backtracking - * is possible. - */ - - -/* - * Terminate source --- called by jpeg_finish_decompress - * after all data has been read. Often a no-op. - * - * NB: *not* called by jpeg_abort or jpeg_destroy; surrounding - * application must deal with any cleanup that should happen even - * for error exit. - */ - -void -ossimJpegStdIOSrc_term_source (j_decompress_ptr cinfo) -{ - (void)cinfo; - /* no work necessary here */ -} - - -/* - * Prepare for input from a stdio stream. - * The caller must have already opened the stream, and is responsible - * for closing it after finishing decompression. - */ - -void -ossimJpegStdIOSrc (j_decompress_ptr cinfo, FILE * infile) -{ - ossimJpegStdIOSourceMgrPtr src; - - /* The source object and input buffer are made permanent so that a series - * of JPEG images can be read from the same file by calling jpeg_stdio_src - * only before the first one. (If we discarded the buffer at the end of - * one image, we'd likely lose the start of the next one.) - * This makes it unsafe to use this manager and a different source - * manager serially with the same JPEG object. Caveat programmer. - */ - if (cinfo->src == NULL) { /* first time for this JPEG object? */ - cinfo->src = (struct jpeg_source_mgr *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, - SIZEOF(ossimJpegStdIOSourceMgr)); - src = (ossimJpegStdIOSourceMgrPtr) cinfo->src; - src->buffer = (JOCTET *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, - INPUT_BUF_SIZE * SIZEOF(JOCTET)); - } - - src = (ossimJpegStdIOSourceMgrPtr) cinfo->src; - src->pub.init_source = ossimJpegStdIOSrc_init_source; - src->pub.fill_input_buffer = ossimJpegStdIOSrc_fill_input_buffer; - src->pub.skip_input_data = ossimJpegStdIOSrc_skip_input_data; - src->pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */ - src->pub.term_source = ossimJpegStdIOSrc_term_source; - src->infile = infile; - src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer on first read */ - src->pub.next_input_byte = NULL; /* until buffer loaded */ -} + src->start_of_file = TRUE; + } + + + /* + * Fill the input buffer --- called whenever buffer is emptied. + * + * In typical applications, this should read fresh data into the buffer + * (ignoring the current state of next_input_byte & bytes_in_buffer), + * reset the pointer & count to the start of the buffer, and return TRUE + * indicating that the buffer has been reloaded. It is not necessary to + * fill the buffer entirely, only to obtain at least one more byte. + * + * There is no such thing as an EOF return. If the end of the file has been + * reached, the routine has a choice of ERREXIT() or inserting fake data into + * the buffer. In most cases, generating a warning message and inserting a + * fake EOI marker is the best course of action --- this will allow the + * decompressor to output however much of the image is there. However, + * the resulting error message is misleading if the real problem is an empty + * input file, so we handle that case specially. + * + * In applications that need to be able to suspend compression due to input + * not being available yet, a FALSE return indicates that no more data can be + * obtained right now, but more may be forthcoming later. In this situation, + * the decompressor will return to its caller (with an indication of the + * number of scanlines it has read, if any). The application should resume + * decompression after it has loaded more data into the input buffer. Note + * that there are substantial restrictions on the use of suspension --- see + * the documentation. + * + * When suspending, the decompressor will back up to a convenient restart point + * (typically the start of the current MCU). next_input_byte & bytes_in_buffer + * indicate where the restart point will be if the current call returns FALSE. + * Data beyond this point must be rescanned after resumption, so move it to + * the front of the buffer rather than discarding it. + */ + + boolean + ossimJpegStdIOSrc_fill_input_buffer (j_decompress_ptr cinfo) + { + ossimJpegStdIOSourceMgrPtr src = (ossimJpegStdIOSourceMgrPtr) cinfo->src; + size_t nbytes; + + nbytes = JFREAD(src->infile, src->buffer, INPUT_BUF_SIZE); + + if (nbytes <= 0) { + if (src->start_of_file) /* Treat empty input file as fatal error */ + ERREXIT(cinfo, JERR_INPUT_EMPTY); + WARNMS(cinfo, JWRN_JPEG_EOF); + /* Insert a fake EOI marker */ + src->buffer[0] = (JOCTET) 0xFF; + src->buffer[1] = (JOCTET) JPEG_EOI; + nbytes = 2; + } + + src->pub.next_input_byte = src->buffer; + src->pub.bytes_in_buffer = nbytes; + src->start_of_file = FALSE; + + return TRUE; + } + + + /* + * Skip data --- used to skip over a potentially large amount of + * uninteresting data (such as an APPn marker). + * + * Writers of suspendable-input applications must note that skip_input_data + * is not granted the right to give a suspension return. If the skip extends + * beyond the data currently in the buffer, the buffer can be marked empty so + * that the next read will cause a fill_input_buffer call that can suspend. + * Arranging for additional bytes to be discarded before reloading the input + * buffer is the application writer's problem. + */ + + void + ossimJpegStdIOSrc_skip_input_data (j_decompress_ptr cinfo, long num_bytes) + { + ossimJpegStdIOSourceMgrPtr src = (ossimJpegStdIOSourceMgrPtr) cinfo->src; + + /* Just a dumb implementation for now. Could use fseek() except + * it doesn't work on pipes. Not clear that being smart is worth + * any trouble anyway --- large skips are infrequent. + */ + if (num_bytes > 0) { + while (num_bytes > (long) src->pub.bytes_in_buffer) { + num_bytes -= (long) src->pub.bytes_in_buffer; + (void) ossimJpegStdIOSrc_fill_input_buffer(cinfo); + /* note we assume that fill_input_buffer will never return FALSE, + * so suspension need not be handled. + */ + } + src->pub.next_input_byte += (size_t) num_bytes; + src->pub.bytes_in_buffer -= (size_t) num_bytes; + } + } + + + /* + * An additional method that can be provided by data source modules is the + * resync_to_restart method for error recovery in the presence of RST markers. + * For the moment, this source module just uses the default resync method + * provided by the JPEG library. That method assumes that no backtracking + * is possible. + */ + + + /* + * Terminate source --- called by jpeg_finish_decompress + * after all data has been read. Often a no-op. + * + * NB: *not* called by jpeg_abort or jpeg_destroy; surrounding + * application must deal with any cleanup that should happen even + * for error exit. + */ + + void + ossimJpegStdIOSrc_term_source (j_decompress_ptr cinfo) + { + (void)cinfo; + /* no work necessary here */ + } + + + /* + * Prepare for input from a stdio stream. + * The caller must have already opened the stream, and is responsible + * for closing it after finishing decompression. + */ + + void + ossimJpegStdIOSrc (j_decompress_ptr cinfo, FILE * infile) + { + ossimJpegStdIOSourceMgrPtr src; + + /* The source object and input buffer are made permanent so that a series + * of JPEG images can be read from the same file by calling jpeg_stdio_src + * only before the first one. (If we discarded the buffer at the end of + * one image, we'd likely lose the start of the next one.) + * This makes it unsafe to use this manager and a different source + * manager serially with the same JPEG object. Caveat programmer. + */ + if (cinfo->src == NULL) { /* first time for this JPEG object? */ + cinfo->src = (struct jpeg_source_mgr *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + SIZEOF(ossimJpegStdIOSourceMgr)); + src = (ossimJpegStdIOSourceMgrPtr) cinfo->src; + src->buffer = (JOCTET *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + INPUT_BUF_SIZE * SIZEOF(JOCTET)); + } + + src = (ossimJpegStdIOSourceMgrPtr) cinfo->src; + src->pub.init_source = ossimJpegStdIOSrc_init_source; + src->pub.fill_input_buffer = ossimJpegStdIOSrc_fill_input_buffer; + src->pub.skip_input_data = ossimJpegStdIOSrc_skip_input_data; + src->pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */ + src->pub.term_source = ossimJpegStdIOSrc_term_source; + src->infile = infile; + src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer on first read */ + src->pub.next_input_byte = NULL; /* until buffer loaded */ + } } diff --git a/Utilities/otbossim/src/ossim/imaging/ossimJpegTileSource.cpp b/Utilities/otbossim/src/ossim/imaging/ossimJpegTileSource.cpp index 009b6691da79214eb0763d5856aed39360e866fa..07da1a9425b8de0081168b885e538f1f30c99101 100644 --- a/Utilities/otbossim/src/ossim/imaging/ossimJpegTileSource.cpp +++ b/Utilities/otbossim/src/ossim/imaging/ossimJpegTileSource.cpp @@ -8,13 +8,15 @@ // // Contains class definition for JpegTileSource. //******************************************************************* -// $Id: ossimJpegTileSource.cpp 16860 2010-03-11 15:28:09Z gpotts $ +// $Id: ossimJpegTileSource.cpp 18145 2010-09-27 14:22:32Z dburken $ + #if defined(__BORLANDC__) -#include <iostream> +# include <iostream> using std::size_t; -#include <stdlib.h> -#include <stdio.h> +# include <stdlib.h> +# include <stdio.h> #endif + extern "C" { #include <stdio.h> @@ -49,58 +51,59 @@ static ossimTrace traceDebug("ossimJpegTileSource:degug"); class ossimJpegTileSource::PrivateData { public: - PrivateData() - :theCinfo(), - theJerr() - { - - } - virtual ~PrivateData() - { - clear(); - } - void clear() - { - jpeg_destroy_decompress( &theCinfo ); - } + PrivateData() + :theCinfo(), + theJerr() + { + + } + virtual ~PrivateData() + { + clear(); + } + void clear() + { + jpeg_destroy_decompress( &theCinfo ); + } struct jpeg_decompress_struct theCinfo; struct jpeg_error_mgr theJerr; }; + //******************************************************************* // Public Constructor: //******************************************************************* ossimJpegTileSource::ossimJpegTileSource() : ossimImageHandler(), - theTile(NULL), - theCacheTile(NULL), - theLineBuffer(NULL), + theTile(0), + theCacheTile(0), + theLineBuffer(0), theFilePtr(0), theBufferRect(0, 0, 0, 0), theImageRect(0, 0, 0, 0), theNumberOfBands(0), theCacheSize (0), - thePrivateData(0), + thePrivateData(0), theCacheId(-1) { } //******************************************************************* -// Public Constructor: -//******************************************************************* -ossimJpegTileSource::ossimJpegTileSource(const ossimKeywordlist& kwl, - const char* prefix) + // Public Constructor: + //******************************************************************* + ossimJpegTileSource::ossimJpegTileSource(const ossimKeywordlist& kwl, + const char* prefix) : ossimImageHandler(), - theTile(NULL), - theCacheTile(NULL), - theLineBuffer(NULL), + theTile(0), + theCacheTile(0), + theLineBuffer(0), theFilePtr(0), theBufferRect(0, 0, 0, 0), theImageRect(0, 0, 0, 0), theNumberOfBands(0), theCacheSize (0), - thePrivateData(0), + thePrivateData(0), theCacheId(-1) { if (loadState(kwl, prefix) == false) @@ -115,15 +118,15 @@ ossimJpegTileSource::ossimJpegTileSource(const ossimKeywordlist& kwl, ossimJpegTileSource::ossimJpegTileSource(const char* jpeg_file) : ossimImageHandler(), - theTile(NULL), - theCacheTile(NULL), - theLineBuffer(NULL), + theTile(0), + theCacheTile(0), + theLineBuffer(0), theFilePtr(0), theBufferRect(0, 0, 0, 0), theImageRect(0, 0, 0, 0), theNumberOfBands(0), theCacheSize(0), - thePrivateData(0), + thePrivateData(0), theCacheId(-1) { static const char MODULE[] @@ -152,13 +155,13 @@ void ossimJpegTileSource::destroy() { ossimAppFixedTileCache::instance()->deleteCache(theCacheId); - theTile = NULL; - theCacheTile = NULL; + theTile = 0; + theCacheTile = 0; if (theLineBuffer) { delete [] theLineBuffer; - theLineBuffer = NULL; + theLineBuffer = 0; } if (theFilePtr) { @@ -167,8 +170,8 @@ void ossimJpegTileSource::destroy() } if(thePrivateData) { - delete thePrivateData; - thePrivateData = 0; + delete thePrivateData; + thePrivateData = 0; } } diff --git a/Utilities/otbossim/src/ossim/imaging/ossimNitfTileSource.cpp b/Utilities/otbossim/src/ossim/imaging/ossimNitfTileSource.cpp index 429b96ce249360c94e514b714820567b9f147203..e4f546fbe59be0fe2512a856a63a0a4b049c50ca 100644 --- a/Utilities/otbossim/src/ossim/imaging/ossimNitfTileSource.cpp +++ b/Utilities/otbossim/src/ossim/imaging/ossimNitfTileSource.cpp @@ -9,7 +9,7 @@ // Description: Contains class definition for ossimNitfTileSource. // //******************************************************************* -// $Id: ossimNitfTileSource.cpp 17978 2010-08-24 16:17:00Z dburken $ +// $Id: ossimNitfTileSource.cpp 18148 2010-09-27 15:24:28Z gpotts $ #include <jerror.h> #include <fstream> @@ -50,7 +50,7 @@ RTTI_DEF1_INST(ossimNitfTileSource, "ossimNitfTileSource", ossimImageHandler) #ifdef OSSIM_ID_ENABLED - static const char OSSIM_ID[] = "$Id: ossimNitfTileSource.cpp 17978 2010-08-24 16:17:00Z dburken $"; + static const char OSSIM_ID[] = "$Id: ossimNitfTileSource.cpp 18148 2010-09-27 15:24:28Z gpotts $"; #endif //--- @@ -929,18 +929,19 @@ ossimImageGeometry* ossimNitfTileSource::getImageGeometry() PTR_CAST(ossimNitfIchipbTag, tag.get()); if (ichipb) { - const ossimRefPtr<ossimNitfRegisteredTag> blocka = - hdr->getTagData(ossimString("BLOCKA")); - const ossimRefPtr<ossimNitfRegisteredTag> rpc00a = - hdr->getTagData(ossimString("RPC00A")); - const ossimRefPtr<ossimNitfRegisteredTag> rpc00b = - hdr->getTagData(ossimString("RPC00B")); +// const ossimRefPtr<ossimNitfRegisteredTag> blocka = +// hdr->getTagData(ossimString("BLOCKA")); +// const ossimRefPtr<ossimNitfRegisteredTag> rpc00a = +// hdr->getTagData(ossimString("RPC00A")); +// const ossimRefPtr<ossimNitfRegisteredTag> rpc00b = +// hdr->getTagData(ossimString("RPC00B")); //--- // If any of these tags are present we will use the sub // image from the ichipb tag. //--- - if ( blocka.get() || rpc00a.get() || rpc00b.get() ) +// if ( blocka.get() || rpc00a.get() || rpc00b.get() ) + // ************************* THERE ARE PROBLEMS NOT SETTING THIS AT SITE. GO AHEAD AND ALWAYS INIT THE SHIFT { transform = ichipb->newTransform(); } diff --git a/Utilities/otbossim/src/ossim/support_data/ossimNitfCsexraTag.cpp b/Utilities/otbossim/src/ossim/support_data/ossimNitfCsexraTag.cpp index 2bfd204ab47686643b59aae46e6acb37bb75b801..8ab848d77b727f2eaf435f37837814421d6c3c41 100644 --- a/Utilities/otbossim/src/ossim/support_data/ossimNitfCsexraTag.cpp +++ b/Utilities/otbossim/src/ossim/support_data/ossimNitfCsexraTag.cpp @@ -226,4 +226,122 @@ std::ostream& ossimNitfCsexraTag::print( return out; } - +ossimString ossimNitfCsexraTag::getSensor() const +{ + return ossimString(theSensor); +} + +ossimString ossimNitfCsexraTag::getTimeFirstLineImage() const +{ + return ossimString(theTileFirstLine); +} + +ossimString ossimNitfCsexraTag::getTimeImageDuration() const +{ + return ossimString(theImageTimeDuration); +} + +ossimString ossimNitfCsexraTag::getMaxGsd() const +{ + return ossimString(theMaxGsd); +} + +ossimString ossimNitfCsexraTag::getAlongScanGsd() const +{ + return ossimString(theAlongScanGsd); +} + +ossimString ossimNitfCsexraTag::getCrossScanGsd() const +{ + return ossimString(theCrossScanGsd); +} + +ossimString ossimNitfCsexraTag::getGeoMeanGsd() const +{ + return ossimString(theGeoMeanGsd); +} + +ossimString ossimNitfCsexraTag::getAlongScanVerticalGsd() const +{ + return ossimString(theAlongScanVertGsd); +} + +ossimString ossimNitfCsexraTag::getCrossScanVerticalGsd() const +{ + return ossimString(theCrossScanVertGsd); +} + +ossimString ossimNitfCsexraTag::getGeoMeanVerticalGsd() const +{ + return ossimString(theGeoMeanVertGsd); +} + +ossimString ossimNitfCsexraTag::getGeoBetaAngle() const +{ + return ossimString(theGeoBetaAngle); +} + +ossimString ossimNitfCsexraTag::getDynamicRange() const +{ + return ossimString(theDynamicRange); +} + +ossimString ossimNitfCsexraTag::getNumLines() const +{ + return ossimString(theLine); +} + +ossimString ossimNitfCsexraTag::getNumSamples() const +{ + return ossimString(theSamples); +} + +ossimString ossimNitfCsexraTag::getAngleToNorth() const +{ + return ossimString(theAngleToNorth); +} + +ossimString ossimNitfCsexraTag::getObliquityAngle() const +{ + return ossimString(theObliquityAngle); +} + +ossimString ossimNitfCsexraTag::getAzimuthOfObliquity() const +{ + return ossimString(theAzOfObliquity); +} + +ossimString ossimNitfCsexraTag::getGroundCover() const +{ + return ossimString(theGrdCover); +} + +ossimString ossimNitfCsexraTag::getSnowDepth() const +{ + return ossimString(theSnowDepthCategory); +} + +ossimString ossimNitfCsexraTag::getSunAzimuth() const +{ + return ossimString(theSunAzimuth); +} + +ossimString ossimNitfCsexraTag::getSunElevation() const +{ + return ossimString(theSunElevation); +} + +ossimString ossimNitfCsexraTag::getPredictedNiirs() const +{ + return ossimString(thePredictedNiirs); +} + +ossimString ossimNitfCsexraTag::getCE90() const +{ + return ossimString(theCircularError); +} + +ossimString ossimNitfCsexraTag::getLE90() const +{ + return ossimString(theLinearError); +} diff --git a/Utilities/otbossim/src/ossim/support_data/ossimSpotDimapSupportData.cpp b/Utilities/otbossim/src/ossim/support_data/ossimSpotDimapSupportData.cpp index cd9e94388f2550c827fb16706e898a9bd57b06f9..80d7590a1e7e3bf7c9bea23b28f4540a42832a8e 100644 --- a/Utilities/otbossim/src/ossim/support_data/ossimSpotDimapSupportData.cpp +++ b/Utilities/otbossim/src/ossim/support_data/ossimSpotDimapSupportData.cpp @@ -9,7 +9,7 @@ // Contains definition of class ossimSpotDimapSupportData. // //***************************************************************************** -// $Id: ossimSpotDimapSupportData.cpp 17814 2010-08-03 12:44:02Z dburken $ +// $Id: ossimSpotDimapSupportData.cpp 18140 2010-09-27 11:17:57Z gpotts $ #include <iostream> diff --git a/Utilities/otbossimplugins/ossim/ossimFormosatModel.cpp b/Utilities/otbossimplugins/ossim/ossimFormosatModel.cpp index 4c911ddcc6dbe64876e4f32e6f4dc60db74e838e..c6be8f7f21bc91cd933f4aac527d0e269b526845 100644 --- a/Utilities/otbossimplugins/ossim/ossimFormosatModel.cpp +++ b/Utilities/otbossimplugins/ossim/ossimFormosatModel.cpp @@ -29,8 +29,10 @@ using namespace std; #include <ossimFormosatDimapSupportData.h> +namespace ossimplugins +{ RTTI_DEF1(ossimFormosatModel, "ossimFormosatModel", ossimSensorModel); - +} //--- // Define Trace flags for use within this file: @@ -65,7 +67,7 @@ static const ossim_float64 SIGMA[] = { 0.0001, // degrees 0.00005, // delta degrees 0.0001 }; // percent -ossimFormosatModel::ossimFormosatModel() +ossimplugins::ossimFormosatModel::ossimFormosatModel() : ossimSensorModel (), theSupportData (NULL), @@ -89,7 +91,7 @@ ossimFormosatModel::ossimFormosatModel() initAdjustableParameters(); } -ossimFormosatModel::ossimFormosatModel(ossimFormosatDimapSupportData* sd) +ossimplugins::ossimFormosatModel::ossimFormosatModel(ossimFormosatDimapSupportData* sd) : ossimSensorModel (), theSupportData (sd), @@ -136,7 +138,7 @@ ossimFormosatModel::ossimFormosatModel(ossimFormosatDimapSupportData* sd) // DESTRUCTOR: ~ossimFormosatModel() // //***************************************************************************** -ossimFormosatModel::~ossimFormosatModel() +ossimplugins::ossimFormosatModel::~ossimFormosatModel() { if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG DESTRUCTOR: ~ossimFormosatModel(): entering..." << std::endl; @@ -145,7 +147,7 @@ ossimFormosatModel::~ossimFormosatModel() if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG DESTRUCTOR: ~ossimFormosatModel(): returning..." << std::endl; } -ossimFormosatModel::ossimFormosatModel(const ossimFormosatModel& rhs) +ossimplugins::ossimFormosatModel::ossimFormosatModel(const ossimFormosatModel& rhs) :ossimSensorModel(rhs) { if(rhs.theSupportData.valid()) @@ -157,7 +159,7 @@ ossimFormosatModel::ossimFormosatModel(const ossimFormosatModel& rhs) } -void ossimFormosatModel::computeSatToOrbRotation(NEWMAT::Matrix& result, ossim_float64 t)const +void ossimplugins::ossimFormosatModel::computeSatToOrbRotation(NEWMAT::Matrix& result, ossim_float64 t)const { if (traceExec()) { @@ -205,7 +207,7 @@ void ossimFormosatModel::computeSatToOrbRotation(NEWMAT::Matrix& result, ossim_f //***************************************************************************** // METHOD //***************************************************************************** -void ossimFormosatModel::computeSatToOrbRotation(ossim_float64 t)const +void ossimplugins::ossimFormosatModel::computeSatToOrbRotation(ossim_float64 t)const { if (traceExec()) { @@ -257,7 +259,7 @@ void ossimFormosatModel::computeSatToOrbRotation(ossim_float64 t)const // array. // //***************************************************************************** -void ossimFormosatModel::updateModel() +void ossimplugins::ossimFormosatModel::updateModel() { clearErrorStatus(); @@ -308,7 +310,7 @@ void ossimFormosatModel::updateModel() } } -void ossimFormosatModel::initAdjustableParameters() +void ossimplugins::ossimFormosatModel::initAdjustableParameters() { if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFormosatModel::initAdjustableParameters(): entering..." << std::endl; @@ -333,7 +335,7 @@ void ossimFormosatModel::initAdjustableParameters() if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFormosatModel::initAdjustableParameters(): returning..." << std::endl; } -void ossimFormosatModel::loadSupportData() +void ossimplugins::ossimFormosatModel::loadSupportData() { if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "ossimFormosatModel::loadSupportData(): entering..." << std::endl; @@ -439,12 +441,12 @@ void ossimFormosatModel::loadSupportData() if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFormosatModel::loadSupportData(): returning..." << std::endl; } -ossimObject* ossimFormosatModel::dup() const +ossimObject* ossimplugins::ossimFormosatModel::dup() const { return new ossimFormosatModel(*this); } -std::ostream& ossimFormosatModel::print(std::ostream& out) const +std::ostream& ossimplugins::ossimFormosatModel::print(std::ostream& out) const { // Capture stream flags since we are going to mess with them. std::ios_base::fmtflags f = out.flags(); @@ -479,7 +481,7 @@ std::ostream& ossimFormosatModel::print(std::ostream& out) const return ossimSensorModel::print(out); } -bool ossimFormosatModel::saveState(ossimKeywordlist& kwl, +bool ossimplugins::ossimFormosatModel::saveState(ossimKeywordlist& kwl, const char* prefix) const { if(theSupportData.valid()) @@ -495,7 +497,7 @@ bool ossimFormosatModel::saveState(ossimKeywordlist& kwl, return ossimSensorModel::saveState(kwl, prefix); } -bool ossimFormosatModel::loadState(const ossimKeywordlist& kwl, +bool ossimplugins::ossimFormosatModel::loadState(const ossimKeywordlist& kwl, const char* prefix) { ossimString supportPrefix = ossimString(prefix) + "support_data."; @@ -523,7 +525,7 @@ bool ossimFormosatModel::loadState(const ossimKeywordlist& kwl, return (getErrorStatus()==ossimErrorCodes::OSSIM_OK); } -void ossimFormosatModel::imagingRay(const ossimDpt& image_point, +void ossimplugins::ossimFormosatModel::imagingRay(const ossimDpt& image_point, ossimEcefRay& image_ray) const { bool runtime_dbflag = 0; @@ -639,7 +641,7 @@ void ossimFormosatModel::imagingRay(const ossimDpt& image_point, } } -void ossimFormosatModel::lineSampleHeightToWorld(const ossimDpt& image_point, +void ossimplugins::ossimFormosatModel::lineSampleHeightToWorld(const ossimDpt& image_point, const ossim_float64& heightEllipsoid, ossimGpt& worldPoint) const { @@ -666,7 +668,7 @@ void ossimFormosatModel::lineSampleHeightToWorld(const ossimDpt& image_point, worldPoint = ossimGpt(Pecf); } -// ossimDpt ossimFormosatModel::extrapolate (const ossimGpt& gp) const +// ossimDpt ossimplugins::ossimFormosatModel::extrapolate (const ossimGpt& gp) const // { // ossimDpt temp; @@ -682,7 +684,7 @@ void ossimFormosatModel::lineSampleHeightToWorld(const ossimDpt& image_point, // } -// ossimGpt ossimFormosatModel::extrapolate (const ossimDpt& ip, +// ossimGpt ossimplugins::ossimFormosatModel::extrapolate (const ossimDpt& ip, // const double& height) const // { // return ossimGpt(ossim::nan(), ossim::nan(), ossim::nan(), 0); @@ -696,7 +698,7 @@ void ossimFormosatModel::lineSampleHeightToWorld(const ossimDpt& image_point, // } bool -ossimFormosatModel::setupOptimizer(const ossimString& init_file) +ossimplugins::ossimFormosatModel::setupOptimizer(const ossimString& init_file) { ossimFilename FormosatTest = init_file; ossimFilename geomFile = init_file; @@ -747,7 +749,7 @@ ossimFormosatModel::setupOptimizer(const ossimString& init_file) } bool -ossimFormosatModel::initFromMetadata(ossimFormosatDimapSupportData* sd) +ossimplugins::ossimFormosatModel::initFromMetadata(ossimFormosatDimapSupportData* sd) { // init parms theSupportData = sd; @@ -773,7 +775,7 @@ ossimFormosatModel::initFromMetadata(ossimFormosatDimapSupportData* sd) loadSupportData(); if (getErrorStatus() != ossimErrorCodes::OSSIM_OK) { - if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFormosatModel::initFromMetadata(dimap_file): returning with error..." << std::endl; + if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimplugins::ossimFormosatModel::initFromMetadata(dimap_file): returning with error..." << std::endl; return false; } diff --git a/Utilities/otbossimplugins/ossim/ossimFormosatModel.h b/Utilities/otbossimplugins/ossim/ossimFormosatModel.h index 9b7c22eee8638cdec649c75b3795af28401e6054..fade82102f83ebafe83fec91a61ada1ecea48440 100644 --- a/Utilities/otbossimplugins/ossim/ossimFormosatModel.h +++ b/Utilities/otbossimplugins/ossim/ossimFormosatModel.h @@ -17,6 +17,7 @@ #include <iostream> using namespace std; +#include <ossimPluginConstants.h> #include <ossim/projection/ossimSensorModel.h> #include <ossim/base/ossimIpt.h> #include <ossim/base/ossimFilename.h> @@ -28,7 +29,9 @@ using namespace std; class ossimFormosatDimapSupportData; -class OSSIMDLLEXPORT ossimFormosatModel : public ossimSensorModel +namespace ossimplugins +{ +class OSSIM_PLUGINS_DLL ossimFormosatModel : public ossimSensorModel { public: /*! @@ -157,5 +160,5 @@ protected: TYPE_DATA }; - +} #endif /* #ifndef ossimFormosatModel_HEADER */