MrSID Decode SDK for Raster Reference Manual
9.5.4.4709
|
00001 /* $Id$ */ 00002 /* ////////////////////////////////////////////////////////////////////////// 00003 // // 00004 // This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue, // 00005 // Suite 200, Seattle, WA 98104. Unauthorized use or distribution // 00006 // prohibited. Access to and use of this code is permitted only under // 00007 // license from LizardTech, Inc. Portions of the code are protected by // 00008 // US and foreign patents and other filings. All Rights Reserved. // 00009 // // 00011 /* PUBLIC */ 00012 00013 #ifndef LTI_GEOCOORD_H 00014 #define LTI_GEOCOORD_H 00015 00016 // lt_lib_mrsid_core 00017 #include "lti_types.h" 00018 00019 #include <stdlib.h> 00020 00021 LT_BEGIN_NAMESPACE(LizardTech) 00022 00023 00032 class LTIGeoCoord 00033 { 00034 public: 00048 LTIGeoCoord(double xUL, double yUL, 00049 double xRes, double yRes, 00050 double xRot, double yRot, 00051 const char *wkt = NULL); 00052 00056 LTIGeoCoord(); 00057 00061 LTIGeoCoord(const LTIGeoCoord&); 00062 00066 ~LTIGeoCoord(); 00067 00071 LTIGeoCoord& operator=(const LTIGeoCoord&); 00072 00076 bool operator==(const LTIGeoCoord&) const; 00077 00081 bool operator!=(const LTIGeoCoord&) const; 00082 00090 double getX() const; 00091 00099 double getY() const; 00100 00108 double getXRes() const; 00109 00117 double getYRes() const; 00118 00126 double getXRot() const; 00127 00135 double getYRot() const; 00136 00144 const char *getWKT() const; 00145 00146 00147 00161 void get(double& xUL, double& yUL, 00162 double& xRes, double& yRes, 00163 double& xRot, double& yRot) const; 00164 00175 LT_STATUS pixelToGeo(double pixelX, double pixelY, double mag, 00176 double &geoX, double &geoY) const; 00177 00188 LT_STATUS geoToPixel(double geoX, double geoY, double mag, 00189 double &pixelX, double &pixelY) const; 00190 00200 LTIGeoCoord getGeoCoordForScene(const LTIScene &scene) const; 00201 00212 LTIGeoCoord scaleGeoCoord(double xMag, double yMag) const; 00213 00214 00222 void setX(double x); 00223 00231 void setY(double y); 00232 00240 void setXRes(double xRes); 00241 00249 void setYRes(double yRes); 00250 00258 void setXRot(double xRot); 00259 00267 void setYRot(double yRot); 00268 00282 void set(double xUL, double yUL, 00283 double xRes, double yRes, 00284 double xRot, double yRot); 00285 00293 void setWKT(const char *wkt); 00294 00306 LT_STATUS writeWorldFile(const LTFileSpec& fileSpec, 00307 bool determineExtension) const; 00308 00320 LT_STATUS readWorldFile(const LTFileSpec& fileSpec, 00321 bool determineExtension, 00322 bool& fileFound); 00323 00333 LT_STATUS readWorldFile(LTIOStreamInf& stream); 00334 00353 static LT_STATUS getWorldFileExtension(const LTFileSpec& fileSpec, 00354 char* ext); 00355 00356 00365 LT_STATUS writeMetadata(LTIMetadataDatabase &metadata) const; 00366 00376 LT_STATUS readMetadata(const LTIMetadataDatabase &metadata, bool &found); 00377 00378 bool hasRotation(void) const; 00379 00380 private: 00381 double m_xUL; 00382 double m_yUL; 00383 double m_xRes; 00384 double m_yRes; 00385 double m_xRot; 00386 double m_yRot; 00387 00388 char *m_wkt; 00389 }; 00390 00391 LT_END_NAMESPACE(LizardTech) 00392 00393 00394 #endif // LTI_GEOCOORD_H