Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //----------------------------------------------------------------------------
- // File: Constants.h
- //
- // License: See top level LICENSE.txt file.
- //
- // Author: David Burken
- //
- // Description: Constants for ossimjni c++ library.
- //
- //----------------------------------------------------------------------------
- // $Id: Constants.h 19748 2011-06-12 15:34:56Z dburken $
- #ifndef ossimjniConstants_HEADER
- #define ossimjniConstants_HEADER 1
- /**
- * DLL IMPORT/EXORT SECTION
- */
- #if defined(__MINGW32__) || defined(__CYGWIN__) || defined(_MSC_VER) || defined(__VISUALC__) || defined(__BORLANDC__) || defined(__WATCOMC__)
- # define OSSIMJNIEXPORT __declspec(dllexport)
- # define OSSIMJNIIMPORT __declspec(dllimport)
- # ifdef OSSIMJNI_LIBRARY
- # define OSSIMJNIDLL OSSIMJNIEXPORT
- # else
- # define OSSIMJNIDLL OSSIMJNIIMPORT
- # endif
- #else /* not #if defined(_MSC_VER) */
- # define OSSIMJNIEXPORT
- # define OSSIMJNIIMPORT
- # define OSSIMJNIDLL
- #endif /* #if defined(_MSC_VER) */
- // Primative data type typedefs
- typedef char ossimjni_int8;
- typedef signed char ossimjni_sint8;
- typedef unsigned char ossimjni_uint8;
- typedef short ossimjni_int16;
- typedef unsigned short ossimjni_uint16;
- typedef signed short ossimjni_sint16;
- typedef int ossimjni_int32;
- typedef unsigned int ossimjni_uint32;
- typedef signed int ossimjni_sint32;
- typedef long long ossimjni_int64;
- typedef unsigned long long ossimjni_uint64;
- typedef signed long long ossimjni_sint64;
- typedef float ossimjni_float32;
- typedef double ossimjni_float64;
- #endif /* #ifndef ossimjniConstants_HEADER */
- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- //-----------------------------------------------------------------------------
- // File: Info.h
- //
- // License: See top level LICENSE.txt file.
- //
- // Author: David Burken
- //
- // Description: Class declaration for Info.
- //
- //-----------------------------------------------------------------------------
- // $Id: Info.h 19750 2011-06-13 15:04:07Z dburken $
- #ifndef ossimjniInfo_HEADER
- #define ossimjniInfo_HEADER 1
- #include <ossimjni/Constants.h>
- #include <map>
- #include <string>
- class ossimInfo;
- namespace ossimjni
- {
- class OSSIMJNIDLL Info
- {
- public:
- /** @brief default constructor. */
- Info();
- /** @brief destructor */
- ~Info();
- /**
- * @brief Initial method.
- *
- * Typically called from application prior to execute. This parses
- * all options and put in keyword list m_kwl.
- *
- * @param ap Arg parser to initialize from.
- * @return true, indicating process should continue with execute.
- * @note A throw with an error message of "usage" is used to get out when
- * a usage is printed.
- */
- bool initialize(int argc, char* argv[]);
- /**
- * @brief execute method.
- *
- * Performs the actual dump of information. This executes any options
- * set including image operations, i.e. -i -p --dno and so on.
- *
- * @note Throws ossimException on error.
- */
- void execute();
- /**
- * @brief getImageInfo Method to open image "file" and get image info
- * in the form of a std::map<std::string, std::string>.
- *
- * Flags turn on various pieces of info. These equate to options in
- * ossim-info for image information.
- *
- * @param file Image file to get information for.
- * @param dumpFlag ossim-info -d
- * @param dnoFlag ossim-info --dno
- * @param imageGeomFlag ossim-info -p
- * @param imageInfoFlag ossim-info -i
- * @param metaDataFlag ossim-info -m
- * @param paletteFlag ossim-info --palette
- *
- * @note Throws ossimException on error.
- */
- std::map<std::string, std::string> getImageInfo(
- const std::string& file,
- bool dumpFlag,
- bool dnoFlag,
- bool imageGeomFlag,
- bool imageInfoFlag,
- bool metaDataFlag,
- bool paletteFlag) const;
- private:
- ossimInfo* m_info;
- };
- } // End of namespace ossimjni.
- #endif /* #ifndef ossimjniInfo_HEADER */
- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- //-----------------------------------------------------------------------------
- // File: Init.h
- //
- // License: See top level LICENSE.txt file.
- //
- // Author: David Burken
- //
- // Description: Class declaration for Init. Handles ossim initialization.
- //
- //-----------------------------------------------------------------------------
- // $Id: Init.h 19748 2011-06-12 15:34:56Z dburken $
- #ifndef ossimjniInit_HEADER
- #define ossimjniInit_HEADER 1
- #include <ossimjni/Constants.h>
- namespace ossimjni
- {
- class OSSIMJNIDLL Init
- {
- public:
- /** @brief destructor */
- ~Init();
- /**
- * @brief Instance method.
- *
- * @return The instance of this class.
- */
- static ossimjni::Init* instance();
- /** @brief Initialize method. */
- void initialize();
- /**
- * @brief Initialize method.
- *
- * @param argc Argument count.
- *
- * @param argv Array of args.
- */
- void initialize(int argc, char* argv[]);
- private:
- /** @brief default constructor - hidden from use */
- Init();
- /** @brief copy constructor - hidden from use */
- Init(const ossimjni::Init& obj);
- /** @brief assignment operator - hidden from use */
- const ossimjni::Init& operator=(const ossimjni::Init& obj);
- /** @brief The single static instance of this class. */
- static ossimjni::Init* m_instance;
- /** Flag to ignore duplicate initialization calls. */
- bool m_initCalledFlag;
- };
- } // End of namespace ossimjni.
- #endif /* #ifndef ossimjniInit_HEADER */
- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- //-----------------------------------------------------------------------------
- // File: SingleImageChain.h
- //
- // License: See top level LICENSE.txt file.
- //
- // Author: David Burken
- //
- // Description: Class declaration for SingleImageChain.
- //
- //-----------------------------------------------------------------------------
- // $Id: SingleImageChain.h 19748 2011-06-12 15:34:56Z dburken $
- #ifndef ossimjniSingleImageChain_HEADER
- #define ossimjniSingleImageChain_HEADER 1
- #include <ossimjni/Constants.h>
- #include <string>
- #include <vector>
- class ossimSingleImageChain;
- namespace ossimjni
- {
- /**
- * @class SingleImageChain
- *
- * Interface to/from java/ossim for ossimSingleImageChain.
- *
- * @note Interfaces with integers signed for java.
- */
- class OSSIMJNIDLL SingleImageChain
- {
- public:
- /** @brief default constructor. */
- SingleImageChain();
- /** @brief destructor */
- ~SingleImageChain();
- /**
- * @brief open method that takes an image file.
- *
- * Opens file and creates a simple chain with ossimImageHandler.
- *
- * @param file File to open.
- *
- * @return true on success, false on error.
- *
- * @note This will close previous chain if one was opened.
- */
- bool open(const std::string& file);
- /**
- * @brief open method that takes an image file and an entry.
- *
- * Opens file and creates a simple chain with ossimImageHandler.
- *
- * @param file File to open.
- *
- * @param entry Zero based entry.
- *
- * @return true on success, false on error.
- *
- * @note This will close previous chain if one was opened.
- */
- bool open(const std::string& file, ossimjni_int32 entry);
- /** @return true if image handler is opened. */
- bool isOpen() const;
- /** @brief close method to delete the image handler. */
- void close();
- /**
- * @param entryList This is the list to initialize with entry indexes.
- *
- * @note This implementation returns puts one entry "0" in the list.
- */
- std::vector<ossimjni_int32> getEntryList() const;
- /** @return The filename of the image. */
- std::string getFilename() const;
- /**
- * @brief Create a rendered image chain.
- *
- * Typical usage is to call this after "open" method returns true like:
- * if ( myChain->open(myFile) == true )
- * {
- * myChain->createRenderedChain();
- * code-goes-here();
- * }
- *
- * Typical chain is:
- *
- * 1) image handler
- * 2) band selector (optional)
- * 3) histogram remapper(optional)
- * 4) scalar remapper (optional)
- * 5) resampler cache
- * 6) resampler
- * 7) band selector (optional when going one band to three)
- * 8) chain cache
- *
- * NOTES:
- * 1) If doing a sequential write where tiles to the right of the
- * resampler will not be revisited the chain cache could be
- * disabled to save memory.
- */
- void createRenderedChain();
- /**
- * @brief selectBands
- *
- * Used to select which bands to use.
- *
- * @note Bands are zero based.
- *
- * @return true on success, false if not open or bands out of range.
- */
- bool selectBands(const std::vector<ossimjni_uint32>& bands);
- /**
- * @brief getBandSelection
- *
- * @note Bands are zero based.
- *
- * @return A list of bands selected to use in the output product.
- */
- std::vector<ossimjni_uint32> getBandSelection() const;
- /** @return Number of bands or 0 if not open. */
- ossimjni_uint32 getNumberOfBands() const;
- /**
- * @brief setHistogram
- *
- * Used to identify a histogram file associated with the source image.
- * @param his Fully qualified path to a histogram file.
- */
- bool setHistogram(const std::string& his);
- /** @return Histogram file. */
- std::string getHistogramFile() const;
- /** @brief setOverview */
- bool setOverview(const std::string& ovr);
- /** @return overview file. */
- std::string getOverviewFile() const;
- private:
- /** @returns true if bands in range, false if not or if image is not open. */
- bool verifyBandRange(const std::vector<ossimjni_uint32>& bands) const;
- ossimSingleImageChain* m_img;
- };
- } // End of namespace ossimjni.
- #endif /* #ifndef ossimjniSingleImageChain_HEADER */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement