00001
00002
00003
00004
00005
00006
00007
00008
00009
00011
00012
00013 #ifndef LTI_IMAGE_STAGE_OVERRIDES_H
00014 #define LTI_IMAGE_STAGE_OVERRIDES_H
00015
00016
00017 #include "lti_types.h"
00018 #include "lti_pixel.h"
00019
00020 LT_BEGIN_NAMESPACE(LizardTech)
00021
00022
00023
00024
00025
00026 struct LTIOverrideMetadataData
00027 {
00028 LTIOverrideMetadataData();
00029 ~LTIOverrideMetadataData();
00030
00031 LT_STATUS createMetadata(const LTIMetadataDatabase *metadata);
00032 LTIMetadataDatabase &getMetadata();
00033
00034 LTIMetadataDatabase *m_metadata;
00035 };
00036
00037
00038 template<class BASE>
00039 struct LTIOverrideMetadata : public BASE,
00040 protected LTIOverrideMetadataData
00041 {
00042 const LTIMetadataDatabase &getMetadata() const
00043 {
00044 return *m_metadata;
00045 }
00046
00047 LT_STATUS overrideMetadata(const LTIMetadataDatabase &metadata)
00048 {
00049 return LTIOverrideMetadataData::createMetadata(&metadata);
00050 }
00051 };
00052
00055
00056 struct LTIOverrideDimensionsData
00057 {
00058 LTIOverrideDimensionsData();
00059
00072 LT_STATUS setDimensions(lt_uint32 width, lt_uint32 height);
00073
00074 lt_uint32 m_width;
00075 lt_uint32 m_height;
00076 };
00077
00078 template<class BASE>
00079 struct LTIOverrideDimensions : public BASE,
00080 protected LTIOverrideDimensionsData
00081
00082 {
00083 lt_uint32 getWidth() const
00084 {
00085 return m_width;
00086 }
00087
00088 lt_uint32 getHeight() const
00089 {
00090 return m_height;
00091 }
00092 };
00093
00096
00097 struct LTIOverridePixelPropsData
00098 {
00099 LTIOverridePixelPropsData();
00100 ~LTIOverridePixelPropsData();
00101
00115 LT_STATUS setPixelProps(const LTIPixel& pixelProps);
00116 LT_STATUS setPixelBPS(lt_uint8 bps);
00117
00136 LT_STATUS setDynamicRange(const LTIPixel& drmin,
00137 const LTIPixel& drmax);
00138
00153 LT_STATUS setDefaultDynamicRange(void);
00154
00155 LTIPixel *m_pixelProps;
00156 LTIPixel *m_drminPixel;
00157 LTIPixel *m_drmaxPixel;
00158 };
00159
00160 template<class BASE>
00161 struct LTIOverridePixelProps : public BASE,
00162 protected LTIOverridePixelPropsData
00163 {
00164 const LTIPixel &getPixelProps() const
00165 {
00166 return *m_pixelProps;
00167 }
00168
00169 const LTIPixel &getMinDynamicRange() const
00170 {
00171 return *m_drminPixel;
00172 }
00173
00174 const LTIPixel &getMaxDynamicRange() const
00175 {
00176 return *m_drmaxPixel;
00177 }
00178
00179 LT_STATUS overridePixelBPS(lt_uint8 bps)
00180 {
00181 return setPixelBPS(bps);
00182 }
00183
00184 LT_STATUS overrideDynamicRange(const LTIPixel& drmin,
00185 const LTIPixel& drmax)
00186 {
00187 return setDynamicRange(drmin, drmax);
00188 }
00189 };
00190
00193
00194 struct LTIOverrideBackgroundPixelData
00195 {
00196 LTIOverrideBackgroundPixelData();
00197 ~LTIOverrideBackgroundPixelData();
00198
00212 LT_STATUS setBackgroundPixel(const LTIPixel* backgroundPixel);
00213
00227 LT_STATUS setNoDataPixel(const LTIPixel* nodataPixel);
00228
00229 LTIPixel *m_backgroundPixel;
00230 LTIPixel *m_nodataPixel;
00231 };
00232
00233
00234 template<class BASE>
00235 struct LTIOverrideBackgroundPixel : public BASE,
00236 protected LTIOverrideBackgroundPixelData
00237 {
00238 public:
00239 const LTIPixel *getBackgroundPixel() const
00240 {
00241 return m_backgroundPixel;
00242 }
00243 const LTIPixel *getNoDataPixel() const
00244 {
00245 return m_nodataPixel;
00246 }
00247
00248 LT_STATUS overrideBackgroundPixel(const LTIPixel *backgroundPixel)
00249 {
00250 if (backgroundPixel != NULL)
00251 {
00252 LTIPixel mergedPixel(this->getPixelProps());
00253 mergedPixel.setNonAlphaSampleValuesFromPixel(*backgroundPixel);
00254 return setBackgroundPixel(&mergedPixel);
00255 }
00256 else
00257 return setBackgroundPixel(NULL);
00258 }
00259
00260 LT_STATUS overrideNoDataPixel(const LTIPixel *nodataPixel)
00261 {
00262 if (nodataPixel != NULL)
00263 {
00264 LTIPixel mergedPixel(this->getPixelProps());
00265 mergedPixel.setNonAlphaSampleValuesFromPixel(*nodataPixel);
00266 return setNoDataPixel(&mergedPixel);
00267 }
00268 else
00269 return setNoDataPixel(NULL);
00270 }
00271 };
00272
00275
00276 struct LTIOverrideGeoCoordData
00277 {
00278 LTIOverrideGeoCoordData();
00279 ~LTIOverrideGeoCoordData();
00280
00293 LT_STATUS setGeoCoord(const LTIGeoCoord& geoCoord);
00294
00311 LT_STATUS setDefaultGeoCoord(const LTIImage &image);
00312
00313 LTIGeoCoord *m_geoCoord;
00314 bool m_geoCoordImplicit;
00315 };
00316
00317 template<class BASE>
00318 struct LTIOverrideGeoCoord : public BASE,
00319 protected LTIOverrideGeoCoordData
00320 {
00321 const LTIGeoCoord &getGeoCoord() const
00322 {
00323 return *m_geoCoord;
00324 }
00325
00326 bool isGeoCoordImplicit() const
00327 {
00328 return m_geoCoordImplicit;
00329 }
00330
00331 LT_STATUS overrideGeoCoord(const LTIGeoCoord &geoCoord)
00332 {
00333 return setGeoCoord(geoCoord);
00334 }
00335 };
00336
00339
00340 struct LTIOverrideMagnificationData
00341 {
00342 LTIOverrideMagnificationData();
00343
00359 LT_STATUS setMagnification(double minMag,
00360 double maxMag);
00361
00362 double m_minMag;
00363 double m_maxMag;
00364 };
00365
00366 template<class BASE>
00367 struct LTIOverrideMagnification : public BASE,
00368 protected LTIOverrideMagnificationData
00369 {
00370 double getMinMagnification() const
00371 {
00372 return m_minMag;
00373 }
00374
00375 double getMaxMagnification() const
00376 {
00377 return m_maxMag;
00378 }
00379 };
00380
00383
00384 struct LTIOverrideIsSelectiveData
00385 {
00386 LTIOverrideIsSelectiveData();
00387
00401 void setIsSelective(bool enable);
00402
00403 bool m_isSelective;
00404 };
00405
00406 template<class BASE>
00407 struct LTIOverrideIsSelective : public BASE,
00408 protected LTIOverrideIsSelectiveData
00409 {
00410 bool isSelective() const
00411 {
00412 return m_isSelective;
00413 }
00414 };
00415
00418
00419 struct LTIOverrideStripHeightData
00420 {
00421 LTIOverrideStripHeightData();
00422
00423 lt_uint32 m_stripHeight;
00424 };
00425
00426 template<class BASE>
00427 struct LTIOverrideStripHeight : public BASE,
00428 protected LTIOverrideStripHeightData
00429 {
00430 lt_uint32 getStripHeight() const
00431 {
00432 return m_stripHeight;
00433 }
00434
00435 LT_STATUS setStripHeight(lt_uint32 stripHeight)
00436 {
00437 m_stripHeight = stripHeight;
00438 return LT_STS_Success;
00439 }
00440 };
00441
00444
00445 struct LTIOverrideDelegatesData
00446 {
00447 LTIOverrideDelegatesData();
00448
00449 LTIProgressDelegate *m_progressDelegate;
00450 LTIInterruptDelegate *m_interruptDelegate;
00451 };
00452
00453 template<class BASE>
00454 struct LTIOverrideDelegates : public BASE,
00455 protected LTIOverrideDelegatesData
00456 {
00457 void setProgressDelegate(LTIProgressDelegate* delegate)
00458 {
00459 m_progressDelegate = delegate;
00460 }
00461
00462 LTIProgressDelegate *getProgressDelegate() const
00463 {
00464 return m_progressDelegate;
00465 }
00466
00467 void setInterruptDelegate(LTIInterruptDelegate* delegate)
00468 {
00469 m_interruptDelegate = delegate;
00470 }
00471
00472 LTIInterruptDelegate *getInterruptDelegate() const
00473 {
00474 return m_interruptDelegate;
00475 }
00476 };
00477
00480
00481 struct LTIOverridePixelLookupTablesData
00482 {
00483 LTIOverridePixelLookupTablesData();
00484 ~LTIOverridePixelLookupTablesData();
00485
00501 LT_STATUS setPixelLookupTable(const LTIPixelLookupTable* pixelLookupTable);
00502
00503 LTIPixelLookupTable *m_pixelLookupTable;
00504 };
00505
00506 template<class BASE>
00507 struct LTIOverridePixelLookupTables : public BASE,
00508 protected LTIOverridePixelLookupTablesData
00509 {
00510 const LTIPixelLookupTable *getPixelLookupTable() const
00511 {
00512 return m_pixelLookupTable;
00513 }
00514
00515 LT_STATUS overridePixelLookupTable(const LTIPixelLookupTable* pixelLookupTable)
00516 {
00517 return setPixelLookupTable(pixelLookupTable);
00518 }
00519 };
00520
00521
00524
00527
00530
00531 LT_END_NAMESPACE(LizardTech)
00532
00533
00534 #endif // LTI_IMAGE_STAGE_OVERRIDES_H