MrSID Decode SDK for Raster Reference Manual  9.0.0.3864
lti_embeddedImage.h
Go to the documentation of this file.
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_EMBEDDED_IMAGE_H
00014 #define LTI_EMBEDDED_IMAGE_H
00015 
00016 // lt_lib_mrsid_core
00017 #include "lti_imageFilter.h"
00018 #include "lti_imageStageOverrides.h"
00019 #include "lti_scene.h"
00020 #include "lti_sceneBuffer.h"
00021 
00022 LT_BEGIN_NAMESPACE(LizardTech)
00023 
00024 
00039 #ifdef SWIG
00040 class LTIEmbeddedImage : public LTIImageFilter
00041 #else
00042 class LTIEmbeddedImage : public LTIOverrideDimensions
00043                                 <LTIOverridePixelProps
00044                                 <LTIOverrideBackgroundPixel
00045                                 <LTIOverrideGeoCoord
00046                                 <LTIImageFilter> > > >
00047 #endif
00048 {
00049    LTI_REFERENCE_COUNTED_BOILERPLATE(LTIEmbeddedImage);
00050 public:
00051    enum AlphaMode
00052    {
00053       DoNothing,
00054       FromMerge,
00055       FromSourceRectangle,
00056    };
00057 
00077    LT_STATUS initialize(LTIImageStage* srcImage,
00078                         lt_uint32 newWidth,
00079                         lt_uint32 newHeight,
00080                         double newXPos,
00081                         double newYPos,
00082                         const LTIPixel* backgroundPixel,
00083                         const LTIPixel* nodataPixel,
00084                         AlphaMode alphaMode = DoNothing);
00085 
00086 
00087    // LTIImage
00088    LT_STATUS getDimsAtMag(double mag,
00089                           lt_uint32 &width,
00090                           lt_uint32 &height) const;
00091 
00092    // LTIImageStage
00093    lt_int64 getEncodingCost(const LTIScene& scene) const;
00094    bool getReaderScene(const LTIScene &decodeScene,
00095                        LTIScene &readerScene) const;
00096 
00097 
00104    LT_STATUS setFillingBackground(bool fill);
00105 
00111    bool getFillingBackground(void) const;
00112 
00118     LT_STATUS setFillMethod(LTIPixelFillMethod method,
00119                             double fuzzyThreshold /*= LTISceneBuffer::DefaultFuzzyThreshold*/);
00120    
00124    LTIPixelFillMethod getFillMethod(void) const;
00125    double getFuzzyThreshold(void) const;
00126 
00127    // LTIImageStage
00128    virtual lt_uint32 getModifications(const LTIScene &scene) const;
00129 
00130    // for LizardTech internal use only
00131    lt_int32 getChildXPosAtMag(double mag) const;
00132    // for LizardTech internal use only
00133    lt_int32 getChildYPosAtMag(double mag) const;
00134    // for LizardTech internal use only
00135    bool getChildScene(const LTIScene &parentScene, LTIScene &childScene) const;
00136 protected:
00137    LT_STATUS decodeBegin(const LTIPixel &pixelProps,
00138                          const LTIScene &fullScene);
00139    LT_STATUS decodeStrip(LTISceneBuffer &stripBuffer,
00140                          const LTIScene &stripScene);
00141    LT_STATUS decodeEnd(void);
00142 
00143 private:
00144    double m_childXPos_P;
00145    double m_childYPos_P;
00146 
00147    LTIScene m_parentScene;
00148    LTIScene m_childScene;
00149    bool m_haveAnything;
00150    lt_int32 m_firstStrip;
00151    lt_int32 m_lastStrip;
00152 
00153    bool m_fillingBackground;
00154    LTIPixelFillMethod m_fillMethod;
00155    double m_fuzzyThreshold;
00156    AlphaMode m_alphaMode;
00157 
00158    LTIPixel *m_decodePixelProps;
00159 };
00160 
00161 
00162 LT_END_NAMESPACE(LizardTech)
00163 
00164 #endif // LTI_EMBEDDED_IMAGE_H