Statistics
| Revision:

svn-gvsig-desktop / tags / v1_9_Build_1223 / libraries / libjni-mrsid-macosx / include / filters / lti_sampleMapTransformer.h @ 33825

History | View | Annotate | Download (3.01 KB)

1
/* $Id: lti_sampleMapTransformer.h 9099 2006-11-29 12:16:22Z mija $ */
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_SAMPLEMAPTRANSFORMER_H
14
#define LTI_SAMPLEMAPTRANSFORMER_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
class LTIReusableBSQBuffer;
28

    
29
/**
30
 * remaps the color bands of an image
31
 *
32
 * This class provides the ability to remap the color bands of an image, e.g.
33
 * from R-G-B to B-G-R.  Only proper permutations are supported; that is, the
34
 * number of bands may not be changed, and all bands must appear exactly once
35
 * in the remapped image.
36
 *
37
 * @note This class is \b deprecated.  A better way to remap the bands is to
38
 * manipulate the band pointers contained in the LTISceneBuffer object at the
39
 * end of the pipeline.
40
 */
41
class LTISampleMapTransformer : public LTIImageFilter
42
{
43
public:
44
   /**
45
    * constructor
46
    *
47
    * Creates an image stage with the bands of the source image reordered,
48
    * e.g. to change an image from RGB to BGR format.
49
    *
50
    * The length of the permutation array is equal to the number of bands in
51
    * the image and the elements must be a proper permutation of the band
52
    * numbers.  That is, the default map "0,1,2" may be set to "2,1,0" or
53
    * "1,2,0" but not "0,1,1" or "2".
54
    *
55
    * @param  sourceImage   the base image
56
    * @param  dstSampleMap  the band permutation array (if NULL, the default
57
    *                       map of "0,1,2,..." will be used)
58
    * @param takeOwnership  set to true to have the filter delete the \a sourceImage
59
    */
60
   LTISampleMapTransformer(LTIImageStage* sourceImage,
61
                           const lt_uint16* dstSampleMap,
62
                           bool takeOwnership);
63
   virtual ~LTISampleMapTransformer();
64
   virtual LT_STATUS initialize();
65

    
66
protected:
67
   LT_STATUS decodeBegin(const LTIScene& scene);
68
   LT_STATUS decodeEnd();
69
   LT_STATUS decodeStrip(LTISceneBuffer& stripBuffer, const LTIScene& stripScene);
70

    
71
private:
72
   typedef LTIImageFilter Super;
73

    
74
   const lt_uint16* m_tmpSampleMap;
75
   lt_uint16* m_newMap;
76
   bool m_isIdentity;
77

    
78
   LTIReusableBSQBuffer* m_buffer;
79

    
80
   // nope
81
   LTISampleMapTransformer(const LTISampleMapTransformer&);
82
   LTISampleMapTransformer& operator=(const LTISampleMapTransformer&);
83
};
84

    
85

    
86
LT_END_NAMESPACE(LizardTech)
87

    
88
#if defined(LT_COMPILER_MS)
89
        #pragma warning(pop)
90
#endif
91

    
92
#endif // LTI_SAMPLEMAPTRANSFORMER_H