Revision 62

View differences:

1.10/tags/gvSIG_3D_Animation_1_10_build_15/libraries/libjni-mrsid/build.xml
1
	<project name="libjni-mrsid" default="main" basedir=".">
2
	<description>
3
		Compila la librería jmrsid
4
	</description>
5
		
6
	<property name="src-java" location="src/main/java" />
7
	<property name="src-test-java" location="src/test/java" />
8
	<property name="jar-dist" location="jar-dist" />
9
	<property name="build" location="bin/" />
10
	<property name="build-test" location="bin-test/" />
11
	<property name="cmake_build" location="BMCMake/" />
12
	<property name="sdk-dir" location="/home/miguel/mrsid/Geo_DSDK-6.0.7.1407" />
13
	<property environment="env"/>
14
	<condition property="jmrsid_version" value="0.0.6">
15
		<os family="unix"/>
16
	</condition>
17
	<condition property="jmrsid_version" value="006">
18
		<os family="windows"/>
19
	</condition>
20
	<property name="jmrsid-jar" location="jmrsid-0.0.6.jar" />
21
	<condition property="cmake_generator" value="'Unix Makefiles'">
22
		<os family="unix"/>
23
	</condition>
24
	<condition property="cmake_generator" value="'NMake Makefiles'">
25
		<os family="windows"/>
26
	</condition>		
27

  
28
	<target name="main" description="compile java code, make jars, prepare and compile natives" depends="clean,jar,prepare-natives,compile-natives">
29
	</target>
30

  
31
	<target name="jar" description="makes jar file">
32
		<mkdir dir="${build}" />
33
		<javac srcdir="${src-java}" destdir="${build}" debug="true" />
34
		<mkdir dir="${jar-dist}" />
35
		<jar jarfile="${jmrsid-jar}" basedir="${build}" includes="es/gva/cit/jmrsid/**" />
36
		<move file="${jmrsid-jar}" todir="${jar-dist}" />
37
	</target>
38

  
39
	<target name="prepare-natives" description="prepares the natives to be compiled">
40
		<mkdir dir="${cmake_build}"/>
41
		<delete file="${cmake_build}/CMakeCache.txt"/>
42
		<exec dir="${cmake_build}" executable="cmake">
43
			<arg line=".." />
44
			<arg line="-G${cmake_generator}" />
45
			<arg line="-DMRSID_DIR=${sdk-dir}" />
46
			<arg line="-DCMAKE_BUILD_TYPE=Release" />
47
			<arg line="-DJMRSID_VERSION=${jmrsid_version}" />
48
		</exec>
49
	</target>
50

  
51
	<target name="compile-natives" description="compiles natives">
52
		<exec dir="${cmake_build}" executable="make" os="Linux">
53
			<arg line="install" />
54
		</exec>
55
		<exec dir="${cmake_build}" executable="nmake" os="Windows 98,Windows 2000,Windows XP,Windows NT (Unknown)">
56
			<arg line="install" />
57
		</exec>
58
	</target>
59

  
60
		
61
	<target name="clean" description="clean distribution">
62
		<delete dir="jar-dist"/>
63
		<delete dir="lib-dist"/>
64
		<delete dir="BMCMake"/>
65
	</target>
66

  
67
</project>
1.10/tags/gvSIG_3D_Animation_1_10_build_15/libraries/libjni-mrsid/.cdtproject
1
<?xml version="1.0" encoding="UTF-8"?>
2
<?eclipse-cdt version="2.0"?>
3

  
4
<cdtproject id="org.eclipse.cdt.make.core.make">
5
<extension point="org.eclipse.cdt.core.BinaryParser" id="org.eclipse.cdt.core.ELF"/>
6
<data>
7
<item id="org.eclipse.cdt.core.pathentry">
8
<pathentry kind="src" path=""/>
9
<pathentry kind="out" path=""/>
10
<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
11
</item>
12
<item id="cdt_indexer">
13
<indexEnabled indexValue="true"/>
14
<indexerProblemsEnabled indexProblemsValue="0"/>
15
</item>
16
<item id="org.eclipse.cdt.make.core.buildtargets">
17
<buildTargets>
18
<target name="all" targetID="org.eclipse.cdt.make.MakeTargetBuilder" path="">
19
<buildCommand>make</buildCommand>
20
<buildTarget>all</buildTarget>
21
<stopOnError>false</stopOnError>
22
<useDefaultCommand>true</useDefaultCommand>
23
</target>
24
<target name="clean" targetID="org.eclipse.cdt.make.MakeTargetBuilder" path="">
25
<buildCommand>make</buildCommand>
26
<buildTarget>clean</buildTarget>
27
<stopOnError>false</stopOnError>
28
<useDefaultCommand>true</useDefaultCommand>
29
</target>
30
</buildTargets>
31
</item>
32
</data>
33
</cdtproject>
1.10/tags/gvSIG_3D_Animation_1_10_build_15/libraries/libjni-mrsid/.classpath
1
<?xml version="1.0" encoding="UTF-8"?>
2
<classpath>
3
	<classpathentry kind="src" path="src/main/java"/>
4
	<classpathentry kind="src" path="src/test/java"/>
5
	<classpathentry kind="src" path="src/main/resources"/>
6
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
7
	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
8
	<classpathentry kind="output" path="bin"/>
9
</classpath>
1.10/tags/gvSIG_3D_Animation_1_10_build_15/libraries/libjni-mrsid/sdk/include/mrsid_readers/MrSIDPasswordDelegate.h
1
/* $Id: MrSIDPasswordDelegate.h 3539 2006-01-09 12:23:20Z nacho $ */
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 MRSIDPASSWORDDELEGATE_H
14
#define MRSIDPASSWORDDELEGATE_H
15

  
16
// lt_lib_base
17
#include "lt_base.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 EncryptImp;
28
class MrSIDImageReaderBase;
29
class MG2ImageWriter;
30
class MG3ImageWriter;
31

  
32

  
33
/**
34
 * delegate for locked MrSID images
35
 *
36
 * This abstract class is used with MrSIDImageReaderBase::setPasswordDelegate()
37
 * to supply a user-callback mechanism for supplying text passwords to
38
 * the internal MrSID decoder logic.
39
 *
40
 * Users should derive their own class from this, supplying their own
41
 * reportIncorrectPassword() and getPassword() methods.
42
 */
43
class MrSIDPasswordDelegate
44
{
45
public:
46
   /**
47
    * constructor
48
    */
49
   MrSIDPasswordDelegate();
50

  
51
   /**
52
    * destructor
53
    */
54
   virtual ~MrSIDPasswordDelegate();
55

  
56
   /**
57
    * user function for user notification
58
    *
59
    * This function is called by the decoder if the password
60
    * entered was incorrect.  Derived classes must implement
61
    * this function, e.g. to pop up a message box, abort the
62
    * operation, etc.
63
    *
64
    * @return success or failure in reporting to user
65
    */
66
   virtual LT_STATUS reportIncorrectPassword() = 0;
67

  
68
   /**
69
    * user function for getting the password
70
    *
71
    * This function is called by the decoder to request a password
72
    * from the user.  Derived classes must implement
73
    * this function, e.g. to pop up a text-entry dialog box.
74
    *
75
    * The implementation of this function must copy the password
76
    * into the buffer pointed by getPasswordBuffer().
77
    *
78
    * @return success or failure in getting password from user
79
    */
80
   virtual LT_STATUS getPassword() = 0;
81

  
82
protected:
83
   /**
84
    * get password buffer
85
    *
86
    * This function returns a pointer to the allocated area for the
87
    * password obtained from the user.
88
    *
89
    * @return  pointer to the password buffer
90
    */
91
   char* getPasswordBuffer();
92

  
93
   /**
94
    * get password buffer length
95
    *
96
    * This function returns the length of the buffer returned from
97
    * getPasswordBuffer().
98
    *
99
    * @return  length of the password buffer
100
    */
101
   lt_uint32 getPasswordBufferLength();
102

  
103
private:
104
   friend class EncryptImp;
105
   EncryptImp* m_encryptImp;
106
   char* m_passwordBuffer;
107
   
108
   static const lt_uint32 s_passwordBufferLength;
109

  
110
   friend class MrSIDImageReaderBase;
111
   friend class MG2ImageWriter;
112
   friend class MG3ImageWriter;
113
   void registerProvider();
114

  
115
   // nope
116
   MrSIDPasswordDelegate(const MrSIDPasswordDelegate&);
117
   MrSIDPasswordDelegate& operator=(const MrSIDPasswordDelegate&);
118
};
119

  
120

  
121
/**
122
 * simple concrete delegate for locked MrSID images
123
 *
124
 * This class is a concrete password delegate class which just
125
 * takes a fixed string in its ctor.
126
 */
127
class MrSIDSimplePasswordDelegate : public MrSIDPasswordDelegate
128
{
129
public:
130
   /**
131
    * constructor
132
    * 
133
    * Create a password delegate, using the given string.
134
    *
135
    * @param password the password to use to unlock the image
136
    */
137
   MrSIDSimplePasswordDelegate(const char* password);
138

  
139
   /**
140
    * failure user notification
141
    *
142
    * This function just returns LT_STS_Failure.
143
    *
144
    * @return always LT_STS_Failure
145
    */
146
   LT_STATUS reportIncorrectPassword();
147

  
148
   /**
149
    * get the password
150
    *
151
    * This function does nothing, as the password is fixed (determined
152
    * by parameter to constructor).
153
    *
154
    * @return always LT_STS_Success
155
    */
156
   LT_STATUS getPassword();
157

  
158
private:
159
   // nope
160
   MrSIDSimplePasswordDelegate(const MrSIDSimplePasswordDelegate&);
161
   MrSIDSimplePasswordDelegate& operator=(const MrSIDSimplePasswordDelegate&);
162
};
163

  
164

  
165
LT_END_NAMESPACE(LizardTech)
166

  
167
#if defined(LT_COMPILER_MS)
168
	#pragma warning(pop)
169
#endif
170

  
171
#endif // MRSIDPASSWORDDELEGATE_H
1.10/tags/gvSIG_3D_Animation_1_10_build_15/libraries/libjni-mrsid/sdk/include/mrsid_readers/MG3CompositeImageReader.h
1
/* $Id: MG3CompositeImageReader.h 3539 2006-01-09 12:23:20Z nacho $ */
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 MG3COMPOSITEIMAGEREADER_H
14
#define MG3COMPOSITEIMAGEREADER_H
15

  
16
// lt_lib_mrsid_mrsidReaders
17
#include "MrSIDImageReaderBase.h"
18

  
19

  
20
LT_BEGIN_NAMESPACE(LizardTech)
21

  
22
#if defined(LT_COMPILER_MS)
23
   #pragma warning(push,4)
24
#endif
25

  
26
class MG3Container;
27
class LTIMosaicFilter;
28
class MG3SingleImageReader;
29
class MG2ImageReader;
30
class J2KImageReader;
31

  
32
/**
33
 * reader for MrSID/MG3 images
34
 *
35
 * This class supports reading MrSID/MG3 images.
36
 *
37
 * @note MrSID/MG2 images are not supported with this class.
38
 */
39
class MG3CompositeImageReader : public MrSIDImageReaderBase
40
{
41
public:
42
   /**
43
    * constructor
44
    *
45
    * Create an MG3 reader from the given file.
46
    *
47
    * The \a imageNumber array allows for control over
48
    * which tiles in the image should be opened to form
49
    * the composite (mosaic) image.  If NULL is passed,
50
    * all tiles will be used.
51
    *
52
    * To determine the tiles available in the image,
53
    * you can use the static getCompositeImageInfo()
54
    * member function.
55
    *
56
    * @param fileSpec      file containing MrSID image
57
    * @param imageNumber   array of image tile numbers
58
    * @param numImages     size of \a imageNumber array
59
    * @param useWorldFile  incorporate world file data when reading image
60
    * @param memoryUsage   control memory resource usage
61
    * @param streamUsage   control stream resource usage
62
    */
63
   MG3CompositeImageReader(const LTFileSpec& fileSpec,
64
                           const lt_uint32* imageNumber,
65
                           lt_uint32 numImages,
66
                           bool useWorldFile,
67
                           MrSIDMemoryUsage memoryUsage,
68
                           MrSIDStreamUsage streamUsage);
69

  
70
   /**
71
    * constructor
72
    *
73
    * Construct an MG3 image from a stream.  (See file-based
74
    * constructor for details.)
75
    *
76
    * @param stream           stream containing MrSID image (may not be NULL)
77
    * @param imageNumber      array of image tile numbers
78
    * @param numImages        size of \a imageNumber array
79
    * @param worldFileStream  stream containing world file data (may be NULL)
80
    * @param memoryUsage      control memory resource usage
81
    * @param streamUsage      control stream resource usage
82
    */
83
   MG3CompositeImageReader(LTIOStreamInf* stream,
84
                           const lt_uint32* imageNumber,
85
                           lt_uint32 numImages,
86
                           LTIOStreamInf* worldFileStream,
87
                           MrSIDMemoryUsage memoryUsage,
88
                           MrSIDStreamUsage streamUsage);
89

  
90
   MG3CompositeImageReader(MG3Container* container,
91
                           const lt_uint32* imageNumber,
92
                           lt_uint32 numImages,
93
                           LTIOStreamInf* worldFileStream,
94
                           MrSIDMemoryUsage memoryUsage,
95
                           MrSIDStreamUsage streamUsage);
96

  
97
   virtual ~MG3CompositeImageReader();
98
   LT_STATUS initialize();
99

  
100
   LT_STATUS setStripHeight(lt_uint32 stripHeight);
101
   lt_uint32 getStripHeight() const;
102

  
103
   lt_uint8 getNumLevels() const;
104
   bool isLocked() const;
105

  
106
   void getVersion(lt_uint8& major, lt_uint8& minor, lt_uint8& tweak, char& letter) const;
107

  
108
   /**
109
    * query if is optimizable
110
    *
111
    * Returns true if and only if the image can be further compressed.
112
    *
113
    * @return true, if and only if the image may be compressed
114
    */
115
   bool isOptimizable() const;
116

  
117
   /**
118
    * tile type queries
119
    *
120
    * These functions are used to determine whether any of the tiles
121
    * in the image are MG2 or JPEG 2000.
122
    */
123
   /*@{*/
124
   bool hasMG2Data() const;
125
   bool hasJP2Data() const;
126
   /*@}*/
127

  
128
   void setInterruptDelegate(LTIInterruptDelegate* delegate);
129

  
130
   lt_int64 getPhysicalFileSize() const;
131

  
132
   /**
133
    * file format type of image tile
134
    */
135
   enum CompositeImageType
136
   {
137
      COMPOSITETYPE_MG2 = 1,
138
      COMPOSITETYPE_MG3 = 2,
139
      COMPOSITETYPE_JP2 = 3
140
   };
141

  
142
   /**
143
    * structure representing tiled image
144
    */
145
   struct CompositeImageInfo
146
   {
147
      /** image tile number */
148
      lt_uint32 imageId;
149

  
150
      /** x-position of tile in the mosaic */
151
      double xPos;
152

  
153
      /** y-position of tile in the mosaic */
154
      double yPos;
155

  
156
      /** type of image tile */
157
      CompositeImageType imageType;
158
   };
159

  
160
   /**
161
    * query tile information
162
    *
163
    * This function is used to collect information about the tiles in the
164
    * image.
165
    *
166
    * The caller takes ownership of the returned \a tileInfo array.
167
    *
168
    * @param  tileInfo  array of tile information structures to be set
169
    * @param  numTiles  number of tiles
170
    * @return status code indicating success or failure
171
    */
172
   LT_STATUS getTileInfo(CompositeImageInfo *&tileInfo, lt_uint32 &numTiles) const;
173

  
174
   /**
175
    * query tile information
176
    *
177
    * This function is used to collect information about the tiles in
178
    * the image contained in the given file.
179
    *
180
    * The caller takes ownership of the returned \a info array.
181
    *
182
    * @param  fileSpec  name of image to query
183
    * @param  tileInfo  array of tile information structures to be set
184
    * @param  numTiles  number of tiles
185
    * @return status code indicating success or failure
186
    */
187
   static LT_STATUS getCompositeImageInfo(const LTFileSpec &fileSpec,
188
                                          CompositeImageInfo *&tileInfo,
189
                                          lt_uint32 &numTiles);
190

  
191
   /**
192
    * query tile information
193
    *
194
    * This function is used to collect information about the tiles in
195
    * the image contained in the given stream.
196
    *
197
    * The caller takes ownership of the returned \a info array.
198
    *
199
    * @param  stream    stream containing image to query
200
    * @param  tileInfo  array of tile information structures to be set
201
    * @param  numTiles  number of tiles
202
    * @return status code indicating success or failure
203
    */
204
   static LT_STATUS getCompositeImageInfo(LTIOStreamInf &stream,
205
                                          CompositeImageInfo *&tileInfo,
206
                                          lt_uint32 &numTiles);
207

  
208
   static LT_STATUS getCompositeImageInfo(const MG3Container &container,
209
                                          CompositeImageInfo *&tileInfo,
210
                                          lt_uint32 &numTiles);
211

  
212

  
213
//protected: // only used be MG3Optimizer
214
   bool getReaderScene(lt_uint32 imageIndex,
215
                       const LTIScene &scene,
216
                       LTIScene &readerScene) const;
217

  
218
protected:
219
   LT_STATUS decodeBegin(const LTIScene& scene);
220
   LT_STATUS decodeStrip(LTISceneBuffer& stripBuffer,
221
                         const LTIScene& stripScene);
222
   LT_STATUS decodeEnd();
223

  
224
   LT_STATUS init(void);
225

  
226
   virtual LT_STATUS createMG2Reader(lt_uint32 imageNumber,
227
                                       MG2ImageReader *&mg2Reader);
228
   virtual LT_STATUS createMG3Reader(lt_uint32 imageNumber,
229
                                       MG3SingleImageReader *&mg3Reader);
230
   virtual LT_STATUS createJP2Reader(lt_uint32 imageNumber,
231
                                       J2KImageReader *&jp2Reader);
232
                              
233
   virtual LT_STATUS updateMemoryModel();
234

  
235
#ifndef DOXYGEN_EXCLUDE
236
   struct Data
237
   {
238
      ~Data(void);
239
      Data(const LTFileSpec *fileSpec,
240
           LTIOStreamInf *stream,
241
           MG3Container* container,
242
           lt_uint32 numImages,
243
           const lt_uint32* imageNumbers,
244
           LTIOStreamInf* worldFileStream);
245
 
246
      MG3Container* m_container;
247
      bool m_ownContainer;   
248

  
249
      lt_uint32 m_numImages;
250
      lt_uint32* m_imageNumbers;
251
      LTIImageReader** m_readers;
252
      LTIImageStage** m_images;
253
      CompositeImageType *m_tileType;
254
      LTIMosaicFilter* m_mosaic;
255

  
256
      LTFileSpec* m_fileSpec;
257
      LTIOStreamInf* m_stream;
258
      bool m_ownStream;
259
      LTIOStreamInf* m_worldFileStream;
260

  
261
      bool m_isLockedComposite;
262
      lt_uint8 m_numLevelsComposite;
263
      bool m_isOptimizableComposite;
264
      bool m_hasMG2Composite;
265
      bool m_hasJP2Composite;
266
   };
267
#endif
268
   Data *m_dat;
269

  
270
private:
271
   typedef MrSIDImageReaderBase Super;
272

  
273
   // nope
274
   MG3CompositeImageReader(const MG3CompositeImageReader&);
275
   MG3CompositeImageReader& operator=(const MG3CompositeImageReader&);
276
};
277

  
278

  
279
LT_END_NAMESPACE(LizardTech)
280

  
281
#if defined(LT_COMPILER_MS)
282
	#pragma warning(pop)
283
#endif
284

  
285
#endif // MG3COMPOSITEIMAGEREADER_H
1.10/tags/gvSIG_3D_Animation_1_10_build_15/libraries/libjni-mrsid/sdk/include/mrsid_readers/MrSIDImageReaderBase.h
1
/* $Id: MrSIDImageReaderBase.h 3539 2006-01-09 12:23:20Z nacho $ */
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 MRSIDIMAGEREADERBASE_H
14
#define MRSIDIMAGEREADERBASE_H
15

  
16
// lt_lib_mrsid_core
17
#include "lti_imageReader.h"
18

  
19

  
20
LT_BEGIN_NAMESPACE(LizardTech)
21

  
22
#if defined(LT_COMPILER_MS)
23
   #pragma warning(push,4)
24
#endif
25

  
26
class LTFileSpec;
27
class LTIOStreamInf;
28
class MrSIDPasswordDelegate;
29
class MrSIDSimplePasswordDelegate;
30

  
31
/*
32
 * memory settings for creating MrSID decoders
33
 *
34
 * "Small", "medium", and "large" refer to how much memory the
35
 * decoder will use when opening the image and constructing certain
36
 * internal data structures and tables.  In general, decode
37
 * performance will increase if more memory can be used.
38
 */
39
enum MrSIDMemoryUsage
40
{
41
   MRSID_MEMORY_USAGE_INVALID    = 0,
42
   MRSID_MEMORY_USAGE_DEFAULT    = 1,
43
   MRSID_MEMORY_USAGE_SMALL      = 2,
44
   MRSID_MEMORY_USAGE_MEDIUM     = 3,
45
   MRSID_MEMORY_USAGE_LARGE      = 4
46
};
47

  
48
/*
49
 * stream settings for creating MrSID decoders
50
 *
51
 * Normally, the stream used by the decoder is
52
 * only opened when doing actual decode work, as resources like
53
 * file handles can be a scarce resource in some environments.  This
54
 * obviously incurs a performance penalty; the "KeepStreamOpen" modes
55
 * can be used to change the behaviour.
56
 */
57
enum MrSIDStreamUsage
58
{
59
   MRSID_STREAM_USAGE_INVALID    = 0,
60
   MRSID_STREAM_USAGE_KEEPOPEN   = 2,
61
   MRSID_STREAM_USAGE_KEEPCLOSED = 3,
62
   MRSID_STREAM_USAGE_DEFAULT    = MRSID_STREAM_USAGE_KEEPCLOSED
63
};
64

  
65

  
66
/**
67
 * base class for MrSID image readers
68
 *
69
 * All the MrSID image readers (MrSIDImageReader, MG3CompositeImageReader, etc)
70
 * inherit from this class.
71
 */
72
class MrSIDImageReaderBase : public LTIImageReader
73
{
74
public:
75
   /**
76
    * constructor
77
    *
78
    * Creates a MrSIDImageReaderBase object.
79
    *
80
    * @param  memoryUsage   the memory model to use
81
    * @param  streamUsage   the stream model to use
82
    * @param  useWorldFile  whether or not a world file is being used
83
    */
84
   MrSIDImageReaderBase(MrSIDMemoryUsage memoryUsage,
85
                        MrSIDStreamUsage streamUsage,
86
                        bool useWorldFile);
87
   virtual ~MrSIDImageReaderBase();
88
   virtual LT_STATUS initialize();
89

  
90
   /**
91
    * get number of resolution levels
92
    *
93
    * Returns the number of resolution levels supported by the image.
94
    * This value returned corresponds to the LTIImage::getMinMagnification()
95
    * function.
96
    *
97
    * @return the number of resolution levels in the MrSID image
98
    */
99
   virtual lt_uint8 getNumLevels() const =0;
100

  
101
   /**
102
    * image encryption query
103
    *
104
    * Returns true iff the image is password-protected.  If the image is
105
    * locked, the setPasswordDelegate() or setPassword() function must be
106
    * used to provide the decoder with information to decrypt the image
107
    * as decode requests are processed.
108
    *
109
    * @return true, if image is password-protected
110
    */
111
   virtual bool isLocked() const =0;
112

  
113
   /**
114
    * get MrSID image version
115
    *
116
    * Returns detailed version information for the MrSID image.  Typical
117
    * version numbers will be 1.0.1 for MG2 (the \a letter value is not
118
    * used) and 3.0.26.q for MG3.  Most developers need only consider the
119
    * \a major number, which will be either 2 or 3..
120
    *
121
    * See also getSidVersion().
122
    *
123
    * @param major  the major version number
124
    * @param minor  the minor version number
125
    * @param tweak  the revision number
126
    * @param letter  the revision build number (MG3 only)
127
    */
128
   virtual void getVersion(lt_uint8& major, lt_uint8& minor, lt_uint8& tweak, char& letter) const=0;
129

  
130
   /**
131
    * set password handler
132
    *
133
    * This function is used to set up a password delegate, which will be
134
    * automatically called form within the internal decoder logic to obtain
135
    * a text password, if one is needed for decoded the image.
136
    *
137
    * Alternatively, the more direct setPassword() function may be used.
138
    *
139
    * See the isLocked() function for more details.
140
    * 
141
    * @param  passwordDelegate  the delegate to be called
142
    */
143
   void setPasswordDelegate(MrSIDPasswordDelegate* passwordDelegate);
144

  
145
   /**
146
    * set password handler
147
    *
148
    * This function is set the password used by the decoder logic
149
    * to decode the image, if one is needed.
150
    *
151
    * The password must be set prior to performing any decode (read)
152
    * requests; for more flexibility, the setPasswordDelegate() function
153
    * may be used.
154
    *
155
    * See the isLocked() function for more details.
156
    * 
157
    * @param  password  the password for the image
158
    */
159
   void setPassword(const lt_utf8* password);
160

  
161
public:
162
   /**
163
    * get MrSID version information
164
    *
165
    * Returns version information for a specific MrSID image.  This is
166
    * a static function, which is passed a filename; the getVersion()
167
    * function operates on the image represented by this MrSIDImageReaderBase
168
    * image and returns more detailed information.
169
    *
170
    * The \a ver value returned will be 2 (for MrSID/MG2), 3 (for MrSID/MG3),
171
    * or 0 (if error).
172
    *
173
    * @param fileSpec  the file to get the version of
174
    * @param ver       the major version number
175
    * @return status code indicating success or failure
176
    */
177
   static LT_STATUS getSidVersion(const LTFileSpec& fileSpec, lt_uint8& ver);
178

  
179
   /**
180
    * MrSID version information
181
    *
182
    * Returns version information for a specific MrSID image.  This is
183
    * a static function, which is passed a stream; the getVersion()
184
    * function operates on the image represented by this MrSIDImageReaderBase
185
    * image and returns more detailed information.
186
    *
187
    * The \a ver value returned will be 2 (for MrSID/MG2), 3 (for MrSID/MG3),
188
    * or 0 (if error).
189
    *
190
    * @param stream  the file to get the version of
191
    * @param ver       the major version number
192
    * @return status code indicating success or failure
193
    */
194
   static LT_STATUS getSidVersion(LTIOStreamInf& stream, lt_uint8& ver);
195

  
196
protected:
197

  
198
   LT_STATUS setupDynamicRangeFromMetadata(bool& gotThem,
199
                                           double& min,
200
                                           double& max);
201

  
202
   static LT_STATUS setupClutFromMetadata(const LTIMetadataDatabase& metadata,
203
                                          LTIPixelLookupTable*& clut);
204

  
205
   static LT_STATUS setupDefaultPixelFromMetadata(LTIMetadataDatabase& metadata,
206
                                                  const LTIPixel& pixelProps,
207
                                                  LTIPixel*& backgroundPixel,
208
                                                  LTIPixel*& nodataPixel);
209

  
210
   LT_STATUS setupGeoInfoFromMetadata(bool &didSet);
211

  
212
   LT_STATUS setupGeoInfoFromWorldFile(const LTFileSpec *file,
213
                                       LTIOStreamInf *stream,
214
                                       bool &didSet);
215
   LT_STATUS updateGeoMetadata();
216

  
217
   MrSIDMemoryUsage m_memoryUsage;
218
   MrSIDStreamUsage m_streamUsage;
219
   bool m_useWorldFile;
220

  
221
private:
222
   typedef LTIImageReader Super;
223

  
224
   MrSIDPasswordDelegate* m_pwdDelegate;
225
   MrSIDSimplePasswordDelegate* m_localPwdDelegate;
226

  
227
   // nope
228
   MrSIDImageReaderBase(const MrSIDImageReaderBase&);
229
   MrSIDImageReaderBase& operator=(const MrSIDImageReaderBase&);
230
};
231

  
232

  
233
LT_END_NAMESPACE(LizardTech)
234

  
235
#if defined(LT_COMPILER_MS)
236
	#pragma warning(pop)
237
#endif
238

  
239
#endif // MRSIDIMAGEREADERBASE_H
1.10/tags/gvSIG_3D_Animation_1_10_build_15/libraries/libjni-mrsid/sdk/include/mrsid_readers/lti_mrsidReadersStatus.h
1
/* $Id: lti_mrsidReadersStatus.h 3539 2006-01-09 12:23:20Z nacho $ */
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_MRSIDREADERSSTATUS_H
14
#define LTI_MRSIDREADERSSTATUS_H
15

  
16
#include "lt_base.h"
17

  
18

  
19
#define LTI_STS_MrSIDReaders_Base                           50600
20
LT_STATUSSTRING_ADD(LTI_STS_MrSIDReaders_Base, "lt_lib_mrsid_mrsidReaders base")
21

  
22
#define LTI_STS_MrSIDReaders_UnsupColorSpace                50601
23
LT_STATUSSTRING_ADD(LTI_STS_MrSIDReaders_UnsupColorSpace, "unsupported colorspace")
24

  
25
#define LTI_STS_MrSIDReaders_UnsupDataType                  50602
26
LT_STATUSSTRING_ADD(LTI_STS_Filters_UnsupDataType, "unsupported datatype")
27

  
28
#define LTI_STS_MrSIDReaders_InvalidMemoryModel             50603
29
LT_STATUSSTRING_ADD(LTI_STS_MrSIDReaders_InvalidMemoryModel, "invalid memory model")
30

  
31
#define LTI_STS_MrSIDReaders_InvalidMetadata                50604
32
LT_STATUSSTRING_ADD(LTI_STS_MrSIDReaders_InvalidMetadata, "invalid metadata")
33

  
34
#define LTI_STS_MrSIDReaders_MetadataReadError              50605
35
LT_STATUSSTRING_ADD(LTI_STS_MrSIDReaders_MetadataReadError, "error reading metadata")
36

  
37
#define LTI_STS_MrSIDReaders_InvalidStripHeight             50606
38
LT_STATUSSTRING_ADD(LTI_STS_MrSIDReaders_InvalidStripHeight, "invalid stripheight")
39

  
40
#define LTI_STS_MrSIDReaders_BadFileFormat                  50607
41
LT_STATUSSTRING_ADD(LTI_STS_MrSIDReaders_BadFileFormat, "invalid mrsid file format")
42

  
43

  
44
#define LTI_STS_MrSIDReaders_BadMG2letInit                  50608
45
LT_STATUSSTRING_ADD(LTI_STS_MrSIDReaders_BadMG2letInit, "mg2let init error")
46

  
47
#define LTI_STS_MrSIDReaders_BadMG3letInit                  50609
48
LT_STATUSSTRING_ADD(LTI_STS_MrSIDReaders_BadMG3letInit, "mg3let init error")
49

  
50
#define LTI_STS_MrSIDReaders_MG2Error                       50610
51
LT_STATUSSTRING_ADD(LTI_STS_MrSIDReaders_MG2Error, "error decoding MG2 file")
52

  
53
#define LTI_STS_MrSIDReaders_BadSidletFormat                50611
54
LT_STATUSSTRING_ADD(LTI_STS_MrSIDReaders_BadSidletFormat, "invalid sidlet message")
55

  
56
#define LTI_STS_MrSIDReaders_UnknownTileImageFormat         50612
57
LT_STATUSSTRING_ADD(LTI_STS_MrSIDReaders_UnknownTileImageFormat, "unknown tile image format")
58

  
59
#define LTI_STS_MrSIDReaders_CannotOpenFile                 50613
60
LT_STATUSSTRING_ADD(LTI_STS_MrSIDReaders_CannotOpenFile, "can't open file: %F")
61

  
62

  
63
#define LTI_STS_MrSIDReaders_Max                            50699
64
LT_STATUSSTRING_ADD(LTI_STS_MrSIDReaders_Max, "lt_lib_mrsid_mrsidReaders max")
65

  
66

  
67
#endif // LTI_MRSIDREADERSSTATUS_H
1.10/tags/gvSIG_3D_Animation_1_10_build_15/libraries/libjni-mrsid/sdk/include/mrsid_readers/MrSIDImageReader.h
1
/* $Id: MrSIDImageReader.h 3539 2006-01-09 12:23:20Z nacho $ */
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 MRSIDIMAGEREADER_H
14
#define MRSIDIMAGEREADER_H
15

  
16
// lt_lib_mrsid_mrsidReader
17
#include "MrSIDImageReaderBase.h"
18

  
19

  
20
LT_BEGIN_NAMESPACE(LizardTech)
21

  
22
#if defined(LT_COMPILER_MS)
23
   #pragma warning(push,4)
24
#endif
25

  
26
class LTFileSpec;
27
class LTIOStreamInf;
28
class MG2ImageReader;
29
class MG3SingleImageReader;
30
class MG3CompositeImageReader;
31
class MG3Container;
32

  
33

  
34
/**
35
 * reader for MrSID images (MG2 and MG3)
36
 *
37
 * This class supports reading MrSID/MG2 and MrSID/MG3 images, including
38
 * composite MG3 images.
39
 */
40
class MrSIDImageReader : public MrSIDImageReaderBase
41
{
42
public:
43
   /**
44
    * constructor
45
    *
46
    * Construct a MrSID reader from the given file.
47
    *
48
    * @param  fileSpec      file containing MrSID image
49
    * @param  useWorldFile  incorporate world file data when reading image
50
    * @param  memoryUsage   control memory resource usage
51
    * @param  streamUsage   control stream resource usage
52
    */
53
   MrSIDImageReader(const LTFileSpec& fileSpec,
54
                    bool useWorldFile = false,
55
                    MrSIDMemoryUsage memoryUsage=MRSID_MEMORY_USAGE_DEFAULT,
56
                    MrSIDStreamUsage streamUsage=MRSID_STREAM_USAGE_DEFAULT);
57

  
58
   /**
59
    * constructor
60
    *
61
    * Construct a MrSID reader from the given stream.
62
    *
63
    * @param  stream        stream containing MrSID image (may not be NULL)
64
    * @param  worldFileStream  stream containing world file data (may be NULL)
65
    * @param  memoryUsage   control memory resource usage
66
    * @param  streamUsage   control stream resource usage
67
    */
68
   MrSIDImageReader(LTIOStreamInf* stream,
69
                    LTIOStreamInf* worldFileStream = 0,
70
                    MrSIDMemoryUsage memoryUsage=MRSID_MEMORY_USAGE_DEFAULT,
71
                    MrSIDStreamUsage streamUsage=MRSID_STREAM_USAGE_DEFAULT);
72

  
73
   virtual ~MrSIDImageReader();
74

  
75
   virtual LT_STATUS initialize();
76

  
77
   /**
78
    * number of levels
79
    * 
80
    * Return the number of resolution levels in the image.  (This is similar to querying
81
    * getMinMagnificaton(), but expressed as an integer.)
82
    *
83
    * @return the number of levels in the image
84
    */
85
   virtual lt_uint8 getNumLevels() const;
86

  
87
   /**
88
    * query for image encryption
89
    * 
90
    * Return true if the image is password-protected.
91
    *
92
    * @return true, if and only if the image is encrypted
93
    */
94
   virtual bool isLocked() const;
95

  
96
   /**
97
    * query for file format version
98
    * 
99
    * This functions returns detailed version information for the
100
    * MG2 or MG3 file.
101
    *
102
    * @param major the major version number
103
    * @param minor the minor version number
104
    * @param tweak the reversion number
105
    * @param letter the format letter (MG3 only)
106
    */
107
   virtual void getVersion(lt_uint8& major, lt_uint8& minor, lt_uint8& tweak, char& letter) const;
108

  
109
   virtual lt_int64 getPhysicalFileSize() const;
110

  
111
   virtual LT_STATUS setStripHeight(lt_uint32 stripHeight);
112
   virtual lt_uint32 getStripHeight() const;
113

  
114
   // not for the faint of heart
115
   MG2ImageReader* getMG2Reader() const;
116
   MG3SingleImageReader* getMG3SingleReader() const;
117
   MG3CompositeImageReader* getMG3CompositeReader() const;
118

  
119
   virtual LT_STATUS projectPointAtMag(double upperLeft,
120
                                       double mag,
121
                                       double& newUpperLeft) const;
122
   virtual LT_STATUS projectDimAtMag(double dim,
123
                                     double mag,
124
                                     double& newDim) const;
125

  
126
   virtual LT_STATUS getDimsAtMag(double mag,
127
                                  lt_uint32& width,
128
                                  lt_uint32& height) const;
129

  
130
   void setProgressDelegate(LTIProgressDelegate* delegate);
131
   void setInterruptDelegate(LTIInterruptDelegate* delegate);
132

  
133
protected:
134
   virtual LT_STATUS decodeBegin(const LTIScene& scene);
135
   virtual LT_STATUS decodeStrip(LTISceneBuffer& stripBuffer,
136
                                 const LTIScene& stripScene);
137
   virtual LT_STATUS decodeEnd();
138

  
139
   virtual LT_STATUS createMG2Reader(void);
140
   virtual LT_STATUS createMG3Reader(void);
141

  
142
#ifndef DOXYGEN_EXCLUDE
143
   struct Data
144
   {
145
      ~Data(void);
146
      Data(const LTFileSpec *fileSpec,
147
           LTIOStreamInf *stream,
148
           MG3Container* container,
149
           LTIOStreamInf* worldFileStream);
150
   
151
      LTIOStreamInf* m_stream;
152
      LTFileSpec* m_fileSpec;
153
      bool m_ownStream;
154
      LTIOStreamInf* m_worldFileStream;
155
      bool m_worldFileStreamOwned;
156
      MG3Container* m_container;
157
      MrSIDImageReaderBase *m_mrsidReader;
158
      MG3CompositeImageReader* m_mg3CompositeReader;
159
      MG3SingleImageReader* m_mg3SingleReader;
160
      MG2ImageReader* m_mg2Reader;
161
   };
162
#endif
163
   Data *m_dat;
164

  
165
private:
166
   typedef MrSIDImageReaderBase Super;
167

  
168
   // nope
169
   MrSIDImageReader(const MrSIDImageReader&);
170
   MrSIDImageReader& operator=(const MrSIDImageReader&);
171
};
172

  
173

  
174
LT_END_NAMESPACE(LizardTech)
175

  
176
#if defined(LT_COMPILER_MS)
177
	#pragma warning(pop)
178
#endif
179

  
180
#endif // MRSIDIMAGEREADER_H
1.10/tags/gvSIG_3D_Animation_1_10_build_15/libraries/libjni-mrsid/sdk/include/filters/lti_colorTransformer.h
1
/* $Id: lti_colorTransformer.h 3539 2006-01-09 12:23:20Z nacho $ */
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_COLORTRANSFORMER_H
14
#define LTI_COLORTRANSFORMER_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
class LTIReusableBSQBuffer;
27

  
28
/**
29
 * change the colorspace of the image
30
 *
31
 * This class changes the colorspace of the image.
32
 *
33
 * The supported color transforms are:
34
 * \li from RGB to CMYK, GRAYSCALE, or YIQ
35
 * \li from GRAYSCALE to RGB
36
 * \li from CMYK to RGB, RGBK, or YIQK
37
 * \li from YIQ to RGB
38
 * \li from YIQK to CMYK
39
 */
40
class LTIColorTransformer : public LTIImageFilter
41
{
42
public:
43
   /**
44
    * constructor
45
    *
46
    * Creates an image stage with the given colorspace.  The sample values
47
    * will undergo the requisite color transform function to map from the
48
    * input colorspace to the output colorspace.
49
    *
50
    * @note The value of \a dstNumBands image is set according to the
51
    * \a dstColorSpace, as is in the constructor for the LTIPixel class.
52
    *
53
    * @param  sourceImage    the base image
54
    * @param  dstColorSpace  the colorspace of the new image
55
    * @param  dstNumBands    the number of bands in the new image
56
    * @param  takeOwnership  set to true to have the filter delete the \a sourceImage
57
    */
58
   LTIColorTransformer(LTIImageStage* sourceImage,
59
                       LTIColorSpace dstColorSpace,
60
                       lt_uint16 dstNumBands,
61
                       bool takeOwnership);
62
   virtual ~LTIColorTransformer();
63
   virtual LT_STATUS initialize();
64

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

  
70
protected: // these are only protected for the temporary LTIColorTransformerMultiband class
71
   LTIPixel* remapPixel(const LTIPixel& pixel);
72

  
73
   const LTIColorSpace m_dstColorSpace;
74
   const lt_uint16 m_dstNumBands;
75
   LTIColorSpace m_srcColorSpace;
76
   lt_uint16 m_srcNumBands;
77
   bool m_isIdentity;
78

  
79
   LTIReusableBSQBuffer* m_buffer;
80

  
81
private:
82
   // nope
83
   LTIColorTransformer(const LTIColorTransformer&);
84
   LTIColorTransformer& operator=(const LTIColorTransformer&);
85
};
86

  
87

  
88

  
89
/**
90
 * Extends LTIColorTransformer to change the colorspace of the image and
91
 * also remap the bands.
92
 *
93
 * This class is typically used for mapping multispectral images to known
94
 * (and often displayable) colorspaces.  For example, a 6-banded
95
 * multispectral image might be changed to an RGB colorspace using only bands
96
 * 0, 2, and 3.
97
 *
98
 * Note that the allowed remapping of bands is different than in the
99
 * LTISampleMapTransformer class.
100
 *
101
 * @note This class is likely to change in a future release.
102
 */
103
class LTIColorTransformerMultiband : public LTIColorTransformer
104
{
105
public:
106
   /**
107
   * Constructor.
108
   *
109
   * Creates an image stage with the given colorspace using the given
110
   * remapping of bands.
111
   *
112
   * The \a dstBandMap parameter is an array of band numbers.  The array
113
   * elements must be within the range of the number of bands in the input
114
   * colorspace, and the number of elements in the array must be equal to
115
   * \a dstNumBands.  A given band may be specified more than once.
116
   *
117
   * @note The value of \a dstNumBands image is set according to the
118
   * \a dstColorSpace, as is in the constructor for the LTIPixel class.
119
   *
120
   * @param  sourceImage    the base image
121
   * @param  dstColorSpace  the colorspace of the new image
122
   * @param  dstBandMap     the array of bands to map to the new colorspace
123
   * @param  dstNumBands    the number of bands in the new image
124
   * @param  takeOwnership  set to true to have the filter delete the \a sourceImage
125
   */
126
   LTIColorTransformerMultiband(LTIImageStage* sourceImage,
127
                                LTIColorSpace dstColorSpace,
128
                                lt_uint16* dstBandMap,
129
                                lt_uint16 dstNumBands,
130
                                bool takeOwnership);
131
   virtual ~LTIColorTransformerMultiband();
132
   virtual LT_STATUS initialize();
133

  
134
   LT_STATUS decodeStrip(LTISceneBuffer &stripBuffer, const LTIScene &stripScene);
135

  
136
private:
137
   typedef LTIColorTransformer Super;
138

  
139
   const lt_uint16 *m_dstBandMapCtor;
140
   lt_uint16 *m_dstBandMap;
141
   LTIColorTransformerMultiband(const LTIColorTransformerMultiband&);
142
   LTIColorTransformerMultiband& operator=(const LTIColorTransformerMultiband&);
143
};
144

  
145
LT_END_NAMESPACE(LizardTech)
146

  
147
#if defined(LT_COMPILER_MS)
148
	#pragma warning(pop)
149
#endif
150

  
151
#endif // LTI_COLORTRANSFORMER_H
1.10/tags/gvSIG_3D_Animation_1_10_build_15/libraries/libjni-mrsid/sdk/include/filters/lti_mosaicFilter.h
1
/* $Id: lti_mosaicFilter.h 3539 2006-01-09 12:23:20Z nacho $ */
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_MOSAICFILTER_H
14
#define LTI_MOSAICFILTER_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 LTIEmbeddedImage;
28
class LTIStaticZoomFilter;
29

  
30

  
31
/**
32
 * create a single mosaicked image from a set of images
33
 *
34
 * This class create a single mosaicked image from a set of images.
35
 *
36
 * The set of input images are all assumed to be in the same coordinate
37
 * space.  In general, all the images must have the same resolution;
38
 * differences that are within a small epsilon or exactly a power of two
39
 * are optionally allowed.
40
 */
41
class LTIMosaicFilter : public LTIImageFilter
42
{
43
public:
44
   /**
45
    * constructor
46
    *
47
    * Creates an image stage which is a mosaic of the set of input images.
48
    *
49
    * The "res correct" feature allows images with slightly different
50
    * resolutions to be mosaicked.  This allows for proper handling of
51
    * situations where one image has a resolution of 0.5000 and another has a
52
    * resolution of 0.4999.
53
    *
54
    * The "multires" feature allows images whose resolutions which differ by
55
    * a power of two to be mosaicked together.  (The LTIStaticZoomFilter class
56
    * is used to implement this feature.)
57
    *
58
    * NoData and background pixel settings are honored by the mosaic process.
59
    *
60
    * @param  images           array of base images to be mosaicked together
61
    * @param  numImages        number of images in the \a images array
62
    * @param  backgroundPixel  color of the background pixel for the new image stage
63
    * @param  useResCorrect    allow images to have slightly different resolutions
64
    * @param  useMultires      allow images whose resolutions differ by a power of two
65
    * @param  takeOwnership    set to true to have the filter delete the \a sourceImage
66
    */
67
   LTIMosaicFilter(LTIImageStage** images,
68
                   lt_uint32 numImages,
69
                   const LTIPixel* backgroundPixel,
70
                   bool useResCorrect,
71
                   bool useMultires,
72
                   bool takeOwnership);
73
   virtual ~LTIMosaicFilter();
74
   virtual LT_STATUS initialize();
75

  
76
   // must be called AFTER initialize()
77
   LT_STATUS setUsingFuzzyNoData(bool fuzzy);
78
   bool getUsingFuzzyNoData(void) const;
79

  
80
   lt_int64 getPhysicalFileSize() const;
81

  
82
   lt_uint32 getStripHeight() const;
83
   LT_STATUS setStripHeight(lt_uint32 stripHeight);
84

  
85
   lt_int64 getEncodingCost(const LTIScene& scene) const;
86

  
87
   bool isSelective() const;
88

  
89
   LT_STATUS projectPointAtMag(double upperLeft,
90
                               double mag,
91
                               double& newUpperLeft) const;
92
   
93
   LT_STATUS projectDimAtMag(double dim,
94
                             double mag,
95
                             double& newDim) const;
96

  
97
   LT_STATUS getDimsAtMag(double mag,
98
                          lt_uint32& width,
99
                          lt_uint32& height) const;
100

  
101
   bool getReaderScene(const LTIScene &decodeScene, LTIScene &readerScene) const;
102

  
103
   bool getReaderScene(lt_uint32 child,
104
                       const LTIScene &decodeScene,
105
                       LTIScene &readerScene) const;
106

  
107
   /**
108
    * Check if a set of images can be mosaicked together.  The parameters to
109
    * this function mirror those of the constructor: this function will
110
    * return LT_STS_Success if and only if the images' resolutions are such
111
    * that a mosaic can be produced.
112
    *
113
    * @param  images           array of base images to be mosaicked together
114
    * @param  numImages        number of images in the \a images array
115
    * @param  useResCorrect    allow images to have slightly different resolutions
116
    * @param  useMultires      allow images whose resolutions differ by a power of two
117
    * @return status code indicating success or failure
118
    */
119
   static LT_STATUS checkResolutionConformance(LTIImageStage** images,
120
                                               lt_uint32 numImages,
121
                                               bool useResCorrect,
122
                                               bool useMultires);
123

  
124
protected:
125
   virtual LT_STATUS decodeBegin(const LTIScene& scene);
126
   virtual LT_STATUS decodeStrip(LTISceneBuffer& stripBuffer, const LTIScene& stripScene);
127
   virtual LT_STATUS decodeEnd();
128

  
129
   //LTIImageStage* getUnderlying(lt_uint32 i) const;
130

  
131
private:
132
   typedef LTIImageFilter Super;
133

  
134

  
135
   LT_STATUS checkCompat() const;
136
   LT_STATUS checkCompatResCorrect() const;
137
   LT_STATUS checkCompatResCorrectForImage(lt_uint32 i) const;
138

  
139
   LT_STATUS fixMultires();
140

  
141
   LTIImageStage** m_imagesUnderlying;
142
   LTIImageStage** m_images;
143

  
144
   lt_uint32 m_numImages;
145
   bool m_useResCorrect;
146
   bool m_useMultires;
147
   bool m_takeOwnership;
148

  
149
   LTIPixel* m_userBackgroundPixel;
150

  
151
   // nope
152
   LTIMosaicFilter(const LTIMosaicFilter&);
153
   LTIMosaicFilter& operator=(const LTIMosaicFilter&);
154
};
155

  
156

  
157
LT_END_NAMESPACE(LizardTech)
158

  
159
#if defined(LT_COMPILER_MS)
160
	#pragma warning(pop)
161
#endif
162

  
163
#endif // LTI_MOSAICFILTER_H
1.10/tags/gvSIG_3D_Animation_1_10_build_15/libraries/libjni-mrsid/sdk/include/filters/lti_sampleMapTransformer.h
1
/* $Id: lti_sampleMapTransformer.h 3539 2006-01-09 12:23:20Z nacho $ */
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,
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff