| 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/TeMrSID.h
Go to the documentation of this file.

    00001 /************************************************************************************
    00002 TerraLib - a library for developing GIS applications.
    00003 Copyright ¨ 2001-2006 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_MRSID_H
    00027 #define  __TERRALIB_INTERNAL_MRSID_H
    00028
    00029 //Internal classes from LizardTech namespace
    00030 namespace LizardTech
    00031 {
    00032 class MrSIDImageReader;
    00033 class LTINavigator;
    00034 class LTISceneBuffer;
    00035 }
    00036
    00037 #include <string>
    00038 #include <vector>
    00039
    00040
    00042
    00047 class TeMrSIDReader
    00048 {
    00049            static bool mrsid_initialized; // indicates if MrSID has already been initialized
    00050            LizardTech::LTINavigator*                   sidNav_;
    00051            LizardTech::MrSIDImageReader*    sidImageFile_;
    00052            std::string                                                                  fileName_;
    00053
    00055
    00061            LizardTech::LTISceneBuffer*                 getImageBuffer(unsigned int width, unsigned int height,
    00062                                                                                                                                     unsigned int nbands, unsigned char* data);
    00063 public:
    00065            TeMrSIDReader(const std::string& fname);
    00066
    00068            ~TeMrSIDReader();
    00069
    00071            std::string fileName() const
    00072            {          return fileName_; }
    00073
    00075            typedef enum {
    00076                       ColorModelUnknown,
    00077                       ColorModelGray,
    00078                       ColorModelMap,
    00079                       ColorModelRGB,
    00080                       ColorModelRGBA
    00081            } ColorModel;
    00082
    00084            ColorModel getColorModel();
    00085
    00087            int nBands() const;
    00088
    00090            unsigned int bitsPerPixel() const;
    00091
    00093            unsigned int getWidth();
    00094
    00096            unsigned int getHeight();
    00097
    00099            void getDimensions(unsigned int& width, unsigned int& height);
    00100
    00102            bool hasWorldInfo();
    00103
    00105            double originX();
    00106
    00108            double originY();
    00109
    00111            void getOrigin(double& x, double& y);
    00112
    00114            double resX();
    00115
    00117            double resY();
    00118
    00120            void getResolution(double& rx, double& ry);
    00121
    00123            void getWorld(double& x0, double& y0, double& x1, double& y1);
    00124
    00126            void getBoundingBox(double& xmin, double& ymin, double& xmax, double& ymax);
    00127
    00129            void getNavigationParameters(std::vector<double>& nwf);
    00130
    00132            void world2Pixel(double wx, double wy, int& ix, int& iy);
    00133
    00135            void pixel2World(int ix, int iy, double& wx, double& wy);
    00136
    00140            int getBestResolutionLevel(unsigned int w, unsigned int h,
    00141                                                                                 double x0, double y0, double x1, double y1);
    00142
    00147            int getWorstResolutionLevel(unsigned int w, unsigned int h,
    00148                                                                                         double x0, double y0, double x1, double y1);
    00149
    00154            int getProxResolutionLevel(unsigned int w, unsigned int h,
    00155                                                                                         double x0, double y0, double x1, double y1);
    00156
    00161            int bestResolution(double res);
    00162
    00164            bool selectArea(int lev, double& x0, double& y0, double& x1, double& y1);
    00165
    00167            int getSelectedAreaWidth();
    00168
    00170            int getSelectedAreaHeight();
    00171
    00173            bool getSelectedAreaData(unsigned char*& data);
    00174
    00176            bool getNoDataPixel(std::vector<double>& nodata);
    00177
    00179            int getNumLevels();
    00180
    00182            bool zoomTo(int level);
    00183
    00185            bool getMaxValues(std::vector<double>& maxvalues);
    00186
    00188            bool getMinValues(std::vector<double>& minvalues);
    00189
    00190 };
    00191
    00193 inline void TeMrSIDReader::getDimensions(unsigned int& w, unsigned int& h)
    00194 {
    00195   w = getWidth();
    00196   h = getHeight();
    00197 }
    00198
    00199 inline void TeMrSIDReader::getResolution(double& rx, double& ry)
    00200 {
    00201   rx = resX();
    00202   ry = resY();
    00203 }
    00204
    00205 inline void TeMrSIDReader::getOrigin(double& x, double& y)
    00206 {
    00207   x = originX();
    00208   y = originY();
    00209 }
    00210 #endif

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines