| TerraLib 4.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/drivers/MrSID/TeDecoderMrSID.h
Go to the documentation of this file.

    00001 /************************************************************************************
    00002 TerraLib - a library for developing GIS applications.
    00003 Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
    00004
    00005 This code is part of the TerraLib library.
    00006 This library is free software; you can redistribute it and/or
    00007 modify it under the terms of the GNU Lesser General Public
    00008 License as published by the Free Software Foundation; either
    00009 version 2.1 of the License, or (at your option) any later version.
    00010
    00011 You should have received a copy of the GNU Lesser General Public
    00012 License along with this library.
    00013
    00014 The authors reassure the license terms regarding the warranties.
    00015 They specifically disclaim any warranties, including, but not limited to,
    00016 the implied warranties of merchantability and fitness for a particular purpose.
    00017 The library provided hereunder is on an "as is" basis, and the authors have no
    00018 obligation to provide maintenance, support, updates, enhancements, or modifications.
    00019 In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
    00020 indirect, special, incidental, or consequential damages arising out of the use
    00021 of this library and its documentation.
    00022 *************************************************************************************/
    00026 #ifndef  __TERRALIB_INTERNAL_DECODERMRSID_H
    00027 #define  __TERRALIB_INTERNAL_DECODERMRSID_H
    00028
    00029 #include "../../kernel/TeDecoder.h"
    00030 #include "TeMrSID.h"
    00031
    00033 /*
    00034            This class depends on the SDK provided by LizardTech, available at the
    00035            website <www.lizardtech.com.br>. You should include this file in your
    00036            final application and link it against the SDK libraries. \par
    00037            This decoder provides only decoding capacities. It is not possible
    00038            to codifiy images in MrSID format. \par
    00039            The default file extension associated to this decoder is ".sid".
    00040 */
    00041 class TeDecoderMrSID : public TeDecoder
    00042 {
    00043 public:
    00044
    00046            TeDecoderMrSID(const TeRasterParams& par);
    00047
    00049            TeDecoderMrSID(const std::string& fname);
    00050
    00052            ~TeDecoderMrSID();
    00053
    00055            void init();
    00056
    00058            bool clear();
    00059
    00061            bool setElement(int /*col*/, int /*lin*/, double /*val*/, int /*band=0*/)
    00062            { return false; }
    00063
    00065
    00071            bool getElement(int /*col*/, int /*lin*/, double& /*val*/, int /*band=0*/)
    00072            { return false; }
    00073
    00075            /*
    00076                       \param bb bounding box geographical coordinates of the area to be covered
    00077                       \param ncols number of columns of the area
    00078                       \param nlines number of lines of the area
    00079                       \param proj projection of the geographical coordinates
    00080                       \returns A resolution level available in the MrSID files
    00081                       \note Resolution level in decoder MrSid is a level in a multi-resolution pyramid
    00082                       stored in the format. Original resolution has value 0 and following higher
    00083                       levels assume integer values (1,2,3,4...)
    00084            */
    00085            int bestResolution(TeBox& bb, int ncols, int nlines, TeProjection* proj);
    00086
    00088            /*
    00089                       \param bb bounding box (in geographical coordinates) of that area to be selected
    00090                       \param the resolution level desired
    00091                       \param parBlock returns the parameters of the portion selected
    00092                       \returns TRUE if could select the portion and FALSE otherwise
    00093                       \note MrSID navigator will be bounded to the given resolution level
    00094            */
    00095            bool selectBlocks(TeBox& bbox, int resLevel, TeRasterParams& parBlock);
    00096
    00098            /*
    00099                       \param memDec a pointer to a decoder to a raster in memory. This decoder
    00100                       should be previously initialized
    00101            */
    00102            bool getSelectedRasterBlock(TeDecoderMemory* memDec);
    00103
    00105            int numberOfSelectedBlocks()
    00106            {          return nSelectedBlocks_; }
    00107
    00109            void clearBlockSelection();
    00110
    00112            int bestResolution(double res);
    00113
    00114
    00115 private:
    00116            // Methods
    00117            TeDecoderMrSID();
    00118            TeProjection* readProjection();
    00119            void readMetadataInformation();
    00120
    00121
    00122            // Members
    00123            TeMrSIDReader* mrsid_;
    00124            int nSelectedBlocks_;
    00125 };
    00126
    00128 class TeDecoderMrSIDFactory : public TeDecoderFactory
    00129 {
    00130 public:
    00132            TeDecoderMrSIDFactory(const string& name);
    00133
    00135            TeDecoder* build (const TeRasterParams& arg)
    00136            {  return new TeDecoderMrSID(arg); }
    00137 };
    00138
    00140 namespace
    00141 {
    00143            static TeDecoderMrSIDFactory theDecoderMrSIDFactory("MrSID");
    00144 };
    00145 #endif

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines