Statistics
| Revision:

root / trunk / libraries / libjni-mrsid / include / filters / lti_cropFilter.h @ 13136

History | View | Annotate | Download (3.19 KB)

1 662 igbrotru
/* $Id$ */
2
/* //////////////////////////////////////////////////////////////////////////
3
//                                                                         //
4
// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
5
// Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
6
// prohibited.  Access to and use of this code is permitted only under     //
7
// license from LizardTech, Inc.  Portions of the code are protected by    //
8
// US and foreign patents and other filings. All Rights Reserved.          //
9
//                                                                         //
10
////////////////////////////////////////////////////////////////////////// */
11
/* PUBLIC */
12
13
#ifndef LTI_CROPFILTER_H
14
#define LTI_CROPFILTER_H
15
16
// lt_lib_mrsid_core
17
#include "lti_imageFilter.h"
18
19
20
LT_BEGIN_NAMESPACE(LizardTech)
21
22
#if defined(LT_COMPILER_MS)
23
   #pragma warning(push,4)
24
#endif
25
26
27
/**
28
 * crops the image stage to a smaller width and height
29
 *
30
 * This class crops the image stage to a smaller width and height.
31
 */
32
class LTICropFilter : public LTIImageFilter
33
{
34
public:
35
   /**
36
    * constructor
37
    *
38
    * Creates an image stage which corresponds to a cropped subsection of the
39
    * input image, according to the given offset, width, and height.
40
    *
41
    * @param  sourceImage    the base image
42
    * @param  xOffset        x-position of the origin of the new image
43
    *                        (specified relative to the input image)
44
    * @param  yOffset        y-position of the origin of the new image
45
    *                        (specified relative to the input image)
46
    * @param  newWidth       width of the new image
47
    * @param  newHeight      height of the new image
48
    * @param  takeOwnership  set to true to have the filter delete the \a sourceImage
49
    */
50
   LTICropFilter(LTIImageStage* sourceImage,
51
                 lt_int32 xOffset,
52
                 lt_int32 yOffset,
53
                 lt_int32 newWidth,
54
                 lt_int32 newHeight,
55
                 bool takeOwnership);
56
   virtual ~LTICropFilter();
57
   virtual LT_STATUS initialize();
58
59
   LT_STATUS projectPointAtMag(double upperLeft,
60
                               double mag,
61
                               double& newUpperLeft) const;
62
63
   LT_STATUS projectDimAtMag(double dim,
64
                             double mag,
65
                             double& newDim) const;
66
67
   LT_STATUS getDimsAtMag(double mag,
68
                          lt_uint32& width,
69
                          lt_uint32& height) const;
70
71
   bool getReaderScene(const LTIScene &decodeScene, LTIScene &readerScene) const;
72
73
protected:
74
   LT_STATUS decodeBegin(const LTIScene& scene);
75
   LT_STATUS decodeEnd();
76
   LT_STATUS decodeStrip(LTISceneBuffer& stripBuffer, const LTIScene& stripScene);
77
78
   LT_STATUS getChildScene(const LTIScene &decodeScene, LTIScene &childScene) const;
79
80
private:
81
   typedef LTIImageFilter Super;
82
83
   const lt_int32 m_xOffset;
84
   const lt_int32 m_yOffset;
85
   const lt_int32 m_newWidth;
86
   const lt_int32 m_newHeight;
87
88
   // nope
89
   LTICropFilter(const LTICropFilter&);
90
   LTICropFilter& operator=(const LTICropFilter&);
91
};
92
93
94
LT_END_NAMESPACE(LizardTech)
95
96
#if defined(LT_COMPILER_MS)
97
        #pragma warning(pop)
98
#endif
99
100
#endif // LTI_CROPFILTER_H