Revision 20379
tags/JNI_Test/libjni-mrsid/.cvsignore | ||
---|---|---|
1 |
bin |
|
2 |
dist |
|
0 | 3 |
tags/JNI_Test/libjni-mrsid/CMakeLists.txt | ||
---|---|---|
1 |
project(jmrsid) |
|
2 |
|
|
3 |
|
|
4 |
# Looking for arch extension! |
|
5 |
SET(LIB_POSTFIX "32") |
|
6 |
IF(UNIX) |
|
7 |
IF(NOT APPLE) |
|
8 |
IF(CMAKE_SIZEOF_VOID_P MATCHES "8") |
|
9 |
SET(LIB_POSTFIX "64") |
|
10 |
ENDIF(CMAKE_SIZEOF_VOID_P MATCHES "8") |
|
11 |
ENDIF(NOT APPLE) |
|
12 |
ELSE(UNIX) |
|
13 |
IF(CMAKE_SYSTEM_NAME MATCHES Windows) |
|
14 |
IF(CMAKE_CL_64) |
|
15 |
SET(LIB_POSTFIX "64") |
|
16 |
ENDIF(CMAKE_CL_64) |
|
17 |
ENDIF(CMAKE_SYSTEM_NAME MATCHES Windows) |
|
18 |
ENDIF(UNIX) |
|
19 |
|
|
20 |
SET(platform_dir) |
|
21 |
IF(WIN32) |
|
22 |
IF(NOT CYGWIN) |
|
23 |
SET(platform_dir "w${LIB_POSTFIX}") |
|
24 |
ENDIF(NOT CYGWIN) |
|
25 |
ENDIF(WIN32) |
|
26 |
IF(UNIX) |
|
27 |
IF(APPLE) |
|
28 |
SET(platform_dir "mac") |
|
29 |
ELSE(APPLE) |
|
30 |
SET(platform_dir "linux") |
|
31 |
ENDIF(APPLE) |
|
32 |
ENDIF(UNIX) |
|
33 |
|
|
34 |
SET(GVSIG_BINARIES_PATH "${CMAKE_SOURCE_DIR}/../binaries/${platform_dir}/raster/mrsid") |
|
35 |
|
|
36 |
|
|
37 |
SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}") |
|
38 |
FILE(MAKE_DIRECTORY ${CMAKE_SOURCE_DIR}/lib-dist) |
|
39 |
#FILE(MAKE_DIRECTORY ${CMAKE_SOURCE_DIR}/bin-dist) |
|
40 |
|
|
41 |
set(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/lib-dist) |
|
42 |
#set(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin-dist) |
|
43 |
#set(CMAKE_SKIP_RPATH TRUE) |
|
44 |
IF(APPLE) |
|
45 |
SET(CMAKE_INSTALL_NAME_DIR @executable_path/../Resources/NativeLibs CACHE STRING "Executable Path for MacOS X" FORCE) |
|
46 |
MARK_AS_ADVANCED(CMAKE_INSTALL_NAME_DIR) |
|
47 |
ENDIF(APPLE) |
|
48 |
|
|
49 |
|
|
50 |
SET(CMAKE_INSTALL_PREFIX ${GVSIG_BINARIES_PATH} CACHE STRING "Forcing install path" FORCE) |
|
51 |
MARK_AS_ADVANCED(CMAKE_INSTALL_PREFIX) |
|
52 |
|
|
53 |
# This is for an advanced option to give aggressive warnings |
|
54 |
# under different compilers. If yours is not implemented, this option |
|
55 |
# will not be made available. |
|
56 |
IF(CMAKE_COMPILER_IS_GNUCXX) |
|
57 |
# To be complete, we might also do GNUCC flags, |
|
58 |
# but everything here is C++ code. |
|
59 |
# -Wshadow and -Woverloaded-virtual are also interesting flags, but OSG |
|
60 |
# returns too many hits. |
|
61 |
# FYI, if we do implement GNUCC, then -Wmissing-prototypes in another |
|
62 |
# interesting C-specific flag. |
|
63 |
# Also, there is a bug in gcc 4.0. Under C++, -pedantic will create |
|
64 |
# errors instead of warnings for certain issues, including superfluous |
|
65 |
# semicolons and commas, and the use of long long. -fpermissive seems |
|
66 |
# to be the workaround. |
|
67 |
SET(AGGRESSIVE_WARNING_FLAGS "-Wall -Wparentheses -Wformat=2 -Wno-long-long -Wno-import -pedantic -Wreturn-type -Wmissing-braces -Wunknown-pragmas -Wunused -fpermissive") |
|
68 |
ELSE(CMAKE_COMPILER_IS_GNUCXX) |
|
69 |
IF(MSVC) |
|
70 |
# FIXME: What are good aggressive warning flags for Visual Studio? |
|
71 |
# And do we need to further subcase this for different versions of VS? |
|
72 |
# CMake variables: MSVC60, MSVC70, MSVC71, MSVC80, CMAKE_COMPILER_2005 |
|
73 |
SET(AGGRESSIVE_WARNING_FLAGS "/Wall /W4") |
|
74 |
|
|
75 |
|
|
76 |
ELSE(MSVC) |
|
77 |
# CMake lacks an elseif, so other non-gcc, non-VS compilers need |
|
78 |
# to be listed below. If unhandled, OSG_AGGRESSIVE_WARNING_FLAGS should |
|
79 |
# remain unset. |
|
80 |
ENDIF(MSVC) |
|
81 |
ENDIF(CMAKE_COMPILER_IS_GNUCXX) |
|
82 |
|
|
83 |
# This part is for the CMake menu option to toggle the warnings on/off. |
|
84 |
# This will only be made available if we set values for OSG_AGGRESSIVE_WARNING_FLAGS. |
|
85 |
IF(AGGRESSIVE_WARNING_FLAGS) |
|
86 |
OPTION(USE_AGGRESSIVE_WARNINGS "Enable to activate aggressive warnings" OFF) |
|
87 |
MARK_AS_ADVANCED(USE_AGGRESSIVE_WARNINGS) |
|
88 |
|
|
89 |
IF(USE_AGGRESSIVE_WARNINGS) |
|
90 |
IF(NOT "${OLD_CMAKE_CXX_FLAGS_WAS_SET}") |
|
91 |
SET(OLD_CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" CACHE INTERNAL "Old CXX flags") |
|
92 |
SET(OLD_CMAKE_CXX_FLAGS_WAS_SET 1 CACHE INTERNAL "Old CXX flags was set") |
|
93 |
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${AGGRESSIVE_WARNING_FLAGS}" CACHE STRING "Flags used by the compiler during all build types." FORCE) |
|
94 |
ENDIF(NOT "${OLD_CMAKE_CXX_FLAGS_WAS_SET}") |
|
95 |
ELSE(USE_AGGRESSIVE_WARNINGS) |
|
96 |
# FIXME: This will lose any changes made after OLD_CMAKE_CXX_FLAGS was |
|
97 |
# set. The better way would be to parse the string and remove each |
|
98 |
# option explicitly. |
|
99 |
IF("${OLD_CMAKE_CXX_FLAGS_WAS_SET}") |
|
100 |
SET(CMAKE_CXX_FLAGS "${OLD_CMAKE_CXX_FLAGS}" CACHE STRING "Flags used by the compiler during all build types." FORCE) |
|
101 |
SET(OLD_CMAKE_CXX_FLAGS_WAS_SET 0 CACHE INTERNAL "Old CXX flags was set") |
|
102 |
ENDIF("${OLD_CMAKE_CXX_FLAGS_WAS_SET}") |
|
103 |
ENDIF(USE_AGGRESSIVE_WARNINGS) |
|
104 |
ENDIF(AGGRESSIVE_WARNING_FLAGS) |
|
105 |
|
|
106 |
# Set defaults for Universal Binaries. We want 32-bit Intel/PPC on 10.4 |
|
107 |
# and 32/64-bit Intel/PPC on >= 10.5. Anything <= 10.3 doesn't support. |
|
108 |
IF(APPLE) |
|
109 |
# These are just defaults/recommendations, but how we want to build |
|
110 |
# out of the box. But the user needs to be able to change these options. |
|
111 |
# So we must only set the values the first time CMake is run, or we |
|
112 |
# will overwrite any changes the user sets. |
|
113 |
# FORCE is used because the options are not reflected in the UI otherwise. |
|
114 |
# Seems like a good place to add version specific compiler flags too. |
|
115 |
IF(NOT CONFIG_HAS_BEEN_RUN_BEFORE) |
|
116 |
# This is really fragile, but CMake doesn't provide the OS system |
|
117 |
# version information we need. (Darwin versions can be changed |
|
118 |
# independently of OS X versions.) |
|
119 |
# It does look like CMake handles the CMAKE_OSX_SYSROOT automatically. |
|
120 |
IF(EXISTS /Developer/SDKs/10.5.sdk) |
|
121 |
SET(CMAKE_OSX_ARCHITECTURES "ppc;i386;ppc64;x86_64" CACHE STRING "Build architectures for OSX" FORCE) |
|
122 |
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.5 -ftree-vectorize -fvisibility-inlines-hidden" CACHE STRING "Flags used by the compiler during all build types." FORCE) |
|
123 |
ELSE(EXISTS /Developer/SDKs/10.5.sdk) |
|
124 |
IF(EXISTS /Developer/SDKs/MacOSX10.4u.sdk) |
|
125 |
SET(CMAKE_OSX_ARCHITECTURES "ppc;i386" CACHE STRING "Build architectures for OSX" FORCE) |
|
126 |
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.4 -ftree-vectorize -fvisibility-inlines-hidden" CACHE STRING "Flags used by the compiler during all build types." FORCE) |
|
127 |
ELSE(EXISTS /Developer/SDKs/MacOSX10.4u.sdk) |
|
128 |
# No Universal Binary support |
|
129 |
# Should break down further to set the -mmacosx-version-min, |
|
130 |
# but the SDK detection is too unreliable here. |
|
131 |
ENDIF(EXISTS /Developer/SDKs/MacOSX10.4u.sdk) |
|
132 |
ENDIF(EXISTS /Developer/SDKs/10.5.sdk) |
|
133 |
ENDIF(NOT CONFIG_HAS_BEEN_RUN_BEFORE) |
|
134 |
ENDIF(APPLE) |
|
135 |
|
|
136 |
|
|
137 |
SET(JMRSID_VERSION "0.0.5" CACHE STRING "JMRSID_VERSION") |
|
138 |
|
|
139 |
find_package(JNI) |
|
140 |
find_package(MRSID) |
|
141 |
|
|
142 |
link_directories(${LIBRARY_OUTPUT_PATH}) |
|
143 |
|
|
144 |
add_subdirectory(src/main/native/jmrsid) |
|
145 |
|
|
146 |
# This needs to be run very last so other parts of the scripts can take |
|
147 |
# advantage of this. |
|
148 |
IF(NOT CONFIG_HAS_BEEN_RUN_BEFORE) |
|
149 |
SET(CONFIG_HAS_BEEN_RUN_BEFORE 1 CACHE INTERNAL "Flag to track whether this is the first time running CMake or if CMake has been configured before") |
|
150 |
ENDIF(NOT CONFIG_HAS_BEEN_RUN_BEFORE) |
|
151 |
|
|
152 |
|
tags/JNI_Test/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.5"> |
|
15 |
<os family="unix"/> |
|
16 |
</condition> |
|
17 |
<condition property="jecw_version" value="005"> |
|
18 |
<os family="windows"/> |
|
19 |
</condition> |
|
20 |
<property name="jmrsid-jar" location="jmrsid-0.0.5.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}" /> |
|
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="-DJGDAL_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> |
tags/JNI_Test/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> |
|
0 | 34 |
tags/JNI_Test/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="lib" path="/home/miguel/eclipse/plugins/org.junit_3.8.2.v200706111738/junit.jar"/> |
|
8 |
<classpathentry kind="output" path="bin"/> |
|
9 |
</classpath> |
|
0 | 10 |
tags/JNI_Test/libjni-mrsid/sdk/include/writers/TIFFImageWriter.h | ||
---|---|---|
1 |
/* $Id: TIFFImageWriter.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 TIFFIMAGEWRITER_H |
|
14 |
#define TIFFIMAGEWRITER_H |
|
15 |
|
|
16 |
// lt_lib_mrsid_core |
|
17 |
#include "lti_geoFileImageWriter.h" |
|
18 |
|
|
19 |
struct tiff; |
|
20 |
|
|
21 |
|
|
22 |
LT_BEGIN_NAMESPACE(LizardTech) |
|
23 |
|
|
24 |
#if defined(LT_COMPILER_MS) |
|
25 |
#pragma warning(push,4) |
|
26 |
#endif |
|
27 |
|
|
28 |
class LTIPixelLookupTable; |
|
29 |
class LTReusableBuffer; |
|
30 |
|
|
31 |
|
|
32 |
/** |
|
33 |
* writes an image stage to a TIFF file |
|
34 |
* |
|
35 |
* This class writes an image stage to a TIFF file. |
|
36 |
*/ |
|
37 |
class TIFFImageWriter : public LTIGeoFileImageWriter |
|
38 |
{ |
|
39 |
public: |
|
40 |
/** |
|
41 |
* constructor |
|
42 |
* |
|
43 |
* Creates a writer for TIFF images. |
|
44 |
* |
|
45 |
* @param image the image to write from |
|
46 |
*/ |
|
47 |
TIFFImageWriter(LTIImageStage *image); |
|
48 |
|
|
49 |
virtual ~TIFFImageWriter(); |
|
50 |
virtual LT_STATUS initialize(); |
|
51 |
|
|
52 |
/** |
|
53 |
* Output resolution information. Set this to false to prevent writing |
|
54 |
* normal TIFF resolution information. |
|
55 |
* |
|
56 |
* The default is to write this information. |
|
57 |
* |
|
58 |
* @param enable set to true to write resolution information |
|
59 |
*/ |
|
60 |
void setWriteResolution(bool enable); |
|
61 |
|
|
62 |
LT_STATUS writeBegin(const LTIScene& scene); |
|
63 |
LT_STATUS writeStrip(LTISceneBuffer& stripBuffer, const LTIScene& stripScene); |
|
64 |
LT_STATUS writeEnd(); |
|
65 |
|
|
66 |
protected: |
|
67 |
virtual LT_STATUS writeHeaders(lt_uint32 width, lt_uint32 height); |
|
68 |
static LT_STATUS getLibtiffError(void); |
|
69 |
|
|
70 |
// GeoTIFFImageWriter sets this prior to calling Super::initialize() |
|
71 |
struct tiff *m_tiff; |
|
72 |
double m_x_resolution; |
|
73 |
double m_y_resolution; |
|
74 |
|
|
75 |
private: |
|
76 |
LT_STATUS checkImpedance() const; |
|
77 |
|
|
78 |
typedef LTIGeoFileImageWriter Super; |
|
79 |
|
|
80 |
LT_STATUS initMetadata(); |
|
81 |
LT_STATUS setColorMap(const LTIPixelLookupTable&); |
|
82 |
LT_STATUS writeFieldInformation(lt_uint32 width, lt_uint32 height); |
|
83 |
|
|
84 |
bool m_writeResolution; |
|
85 |
|
|
86 |
void init( const LTFileSpec& file ); |
|
87 |
char* m_tiff_file_name; |
|
88 |
long m_currentRow; |
|
89 |
int m_compression; |
|
90 |
LTReusableBuffer* m_stripBuffer; |
|
91 |
|
|
92 |
// nope |
|
93 |
TIFFImageWriter(); |
|
94 |
TIFFImageWriter(TIFFImageWriter&); |
|
95 |
TIFFImageWriter& operator=(const TIFFImageWriter&); |
|
96 |
}; |
|
97 |
|
|
98 |
|
|
99 |
LT_END_NAMESPACE(LizardTech) |
|
100 |
|
|
101 |
#if defined(LT_COMPILER_MS) |
|
102 |
#pragma warning(pop) |
|
103 |
#endif |
|
104 |
|
|
105 |
#endif // TIFFIMAGEWRITER_H |
tags/JNI_Test/libjni-mrsid/sdk/include/writers/lti_writersStatus.h | ||
---|---|---|
1 |
/* $Id: lti_writersStatus.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_WRITERSSTATUS_H |
|
14 |
#define LTI_WRITERSSTATUS_H |
|
15 |
|
|
16 |
#include "lt_base.h" |
|
17 |
|
|
18 |
#define LTI_STS_Writers_Base 50400 |
|
19 |
LT_STATUSSTRING_ADD(LTI_STS_Writers_Base, "lt_lib_mrsid_imageWriters base") |
|
20 |
|
|
21 |
#define LTI_STS_Writers_CannotWriteFile 50401 |
|
22 |
LT_STATUSSTRING_ADD(LTI_STS_Writers_CannotWriteFile, "Cannot write to file %F") |
|
23 |
|
|
24 |
#define LTI_STS_Writers_UnsupColorSpace 50402 |
|
25 |
LT_STATUSSTRING_ADD(LTI_STS_Writers_UnsupColorSpace, "unsupported colorspace") |
|
26 |
|
|
27 |
#define LTI_STS_Writers_UnsupDataType 50403 |
|
28 |
LT_STATUSSTRING_ADD(LTI_STS_Writers_UnsupDataType, "unsupported datatype") |
|
29 |
|
|
30 |
|
|
31 |
#define LTI_STS_Writers_TIFFFieldInfoNotSet 50410 |
|
32 |
LT_STATUSSTRING_ADD(LTI_STS_Writers_TIFFFieldInfoNotSet, "TIFF: field info not set") |
|
33 |
|
|
34 |
#define LTI_STS_Writers_TIFFLibraryError 50411 |
|
35 |
LT_STATUSSTRING_ADD(LTI_STS_Writers_TIFFLibraryError, "TIFF: library error - %s") |
|
36 |
|
|
37 |
#define LTI_STS_Writers_TIFFLibraryWarning 50412 |
|
38 |
LT_STATUSSTRING_ADD(LTI_STS_Writers_TIFFLibraryWarning, "TIFF: library warning - %s") |
|
39 |
|
|
40 |
#define LTI_STS_Writers_TIFFUnsupOutputFormat 50413 |
|
41 |
LT_STATUSSTRING_ADD(LTI_STS_Writers_TIFFUnsupOutputFormat, "TIFF: unsupported output format") |
|
42 |
|
|
43 |
#define LTI_STS_Writers_TIFFWriteDataFailed 50414 |
|
44 |
LT_STATUSSTRING_ADD(LTI_STS_Writers_TIFFWriteDataFailed, "TIFF: write data failed") |
|
45 |
|
|
46 |
#define LTI_STS_Writers_TIFFUnsupClutType 50415 |
|
47 |
LT_STATUSSTRING_ADD(LTI_STS_Writers_TIFFUnsupClutType, "TIFF: unsupported CLUT type") |
|
48 |
|
|
49 |
#define LTI_STS_Writers_TIFFMetadataError 50416 |
|
50 |
LT_STATUSSTRING_ADD(LTI_STS_Writers_TIFFMetadataError, "TIFF: metadata error") |
|
51 |
|
|
52 |
|
|
53 |
#define LTI_STS_Writers_GDALErrorMessage 50420 |
|
54 |
LT_STATUSSTRING_ADD(LTI_STS_Writers_GDALErrorMessage, "GDAL error: %s - %d") |
|
55 |
|
|
56 |
|
|
57 |
#define LTI_STS_Writers_GeoTIFFBadKeyDims 50430 |
|
58 |
LT_STATUSSTRING_ADD(LTI_STS_Writers_GeoTIFFBadKeyDims, "GeoTIFF: bad metadata key format") |
|
59 |
|
|
60 |
#define LTI_STS_Writers_GeoTIFFUnableToSetKey 504131 |
|
61 |
LT_STATUSSTRING_ADD(LTI_STS_Writers_GeoTIFFUnableToSetKey, "GeoTIFF: unable to set key") |
|
62 |
|
|
63 |
#define LTI_STS_Writers_GeoTIFFOpenFileError 50432 |
|
64 |
LT_STATUSSTRING_ADD(LTI_STS_Writers_GeoTIFFUnableToSetKey, "GeoTIFF: error opening file") |
|
65 |
|
|
66 |
|
|
67 |
#define LTI_STS_Writers_BBBCannotWriteFile 50440 |
|
68 |
LT_STATUSSTRING_ADD(LTI_STS_Writers_BBBCannotWriteFile, "BBB: cannot write to file") |
|
69 |
|
|
70 |
|
|
71 |
#define LTI_STS_Writers_BMPCannotWriteFile 50450 |
|
72 |
LT_STATUSSTRING_ADD(LTI_STS_Writers_BMPCannotWriteFile, "BMP: cannot write to file") |
|
73 |
|
|
74 |
|
|
75 |
#define LTI_STS_Writers_JPEGErrorMessage 50460 |
|
76 |
LT_STATUSSTRING_ADD(LTI_STS_Writers_JPEGErrorMessage, "JPEG error: %s") |
|
77 |
|
|
78 |
#define LTI_STS_Writers_JPEGOpenFileError 50461 |
|
79 |
LT_STATUSSTRING_ADD(LTI_STS_Writers_JPEGOpenFileError, "JPEG: error opening file") |
|
80 |
|
|
81 |
|
|
82 |
#define LTI_STS_Writers_Max 50499 |
|
83 |
LT_STATUSSTRING_ADD(LTI_STS_Writers_Max, "lt_lib_mrsid_imageWriters max") |
|
84 |
|
|
85 |
|
|
86 |
#endif // LTI_WRITERSSTATUS_H |
tags/JNI_Test/libjni-mrsid/sdk/include/writers/BMPImageWriter.h | ||
---|---|---|
1 |
/* $Id: BMPImageWriter.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 BMPIMAGEWRITER_H |
|
14 |
#define BMPIMAGEWRITER_H |
|
15 |
|
|
16 |
// lt_lib_mrsid_core |
|
17 |
#include "lti_geoFileImageWriter.h" |
|
18 |
|
|
19 |
// lt_lib_utils |
|
20 |
#include "lti_imageWriter.h" |
|
21 |
|
|
22 |
|
|
23 |
LT_BEGIN_NAMESPACE(LizardTech) |
|
24 |
|
|
25 |
#if defined(LT_COMPILER_MS) |
|
26 |
#pragma warning(push,4) |
|
27 |
#endif |
|
28 |
|
|
29 |
class LTReusableBuffer; |
|
30 |
|
|
31 |
/** |
|
32 |
* writes an image stage to a Windows BMP file |
|
33 |
* |
|
34 |
* This class writes an image stage to a Windows BMP file. |
|
35 |
*/ |
|
36 |
class BMPImageWriter : public LTIGeoFileImageWriter |
|
37 |
{ |
|
38 |
public: |
|
39 |
/** |
|
40 |
* constructor |
|
41 |
* |
|
42 |
* Creates a writer for Windows BMP images. |
|
43 |
* |
|
44 |
* @param image the image to write from |
|
45 |
*/ |
|
46 |
BMPImageWriter(LTIImageStage* image); |
|
47 |
virtual ~BMPImageWriter(); |
|
48 |
LT_STATUS initialize(); |
|
49 |
|
|
50 |
LT_STATUS writeBegin(const LTIScene& scene); |
|
51 |
LT_STATUS writeStrip(LTISceneBuffer& stripBuffer, const LTIScene& stripScene); |
|
52 |
LT_STATUS writeEnd(); |
|
53 |
|
|
54 |
private: |
|
55 |
typedef LTIGeoFileImageWriter Super; |
|
56 |
|
|
57 |
LT_STATUS checkImpedance() const; |
|
58 |
|
|
59 |
// override from LTIImageFilter |
|
60 |
LTIImageStage* getPreviousStage() const; |
|
61 |
|
|
62 |
LT_STATUS normalizeProperties(lt_uint32 width, lt_uint32 height); |
|
63 |
LT_STATUS initFile(lt_uint32 width, lt_uint32 height); |
|
64 |
LT_STATUS writeHeaders(lt_uint32 width, lt_uint32 height); |
|
65 |
LT_STATUS initBitmapHeader(lt_uint32 width, lt_uint32 height); |
|
66 |
LT_STATUS initEndian(); |
|
67 |
LT_STATUS writeStrip(lt_uint32 stripHeight, |
|
68 |
const lt_uint8* buf); |
|
69 |
|
|
70 |
LTIImageStage* m_mapTransform; |
|
71 |
|
|
72 |
lt_uint32 m_alignedRowBytes; |
|
73 |
lt_uint32 m_unalignedRowBytes; |
|
74 |
lt_uint8* m_padding; |
|
75 |
lt_uint32 m_padsize; |
|
76 |
|
|
77 |
struct bitmapFileHeaderType; |
|
78 |
struct bitmapHeaderType; |
|
79 |
|
|
80 |
bitmapFileHeaderType* m_bmpFileHeader; |
|
81 |
bitmapHeaderType* m_bmpHeader; |
|
82 |
|
|
83 |
// This will provide a marker so the image doesn't write over itself |
|
84 |
// I need to know how far back to seek. |
|
85 |
int m_seekBackTo; |
|
86 |
|
|
87 |
LTReusableBuffer* m_stripBuffer; |
|
88 |
|
|
89 |
// nope |
|
90 |
BMPImageWriter(); |
|
91 |
BMPImageWriter(BMPImageWriter&); |
|
92 |
BMPImageWriter& operator=(const BMPImageWriter&); |
|
93 |
}; |
|
94 |
|
|
95 |
|
|
96 |
LT_END_NAMESPACE(LizardTech) |
|
97 |
|
|
98 |
#if defined(LT_COMPILER_MS) |
|
99 |
#pragma warning(pop) |
|
100 |
#endif |
|
101 |
|
|
102 |
#endif // BMPIMAGEWRITER_H |
tags/JNI_Test/libjni-mrsid/sdk/include/writers/NITFImageWriter.h | ||
---|---|---|
1 |
/* $Id: NITFImageWriter.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 NITFIMAGEWRITER_H |
|
14 |
#define NITFIMAGEWRITER_H |
|
15 |
|
|
16 |
// lt_lib_mrsid_core |
|
17 |
#include "lti_geoFileImageWriter.h" |
|
18 |
|
|
19 |
#if defined(LT_COMPILER_MS) |
|
20 |
#pragma warning(push,4) |
|
21 |
#endif |
|
22 |
|
|
23 |
class GDALDataset; |
|
24 |
|
|
25 |
LT_BEGIN_NAMESPACE(LizardTech) |
|
26 |
|
|
27 |
class LTFileSpec; |
|
28 |
|
|
29 |
/** |
|
30 |
* writes an image stage to NITF file |
|
31 |
* |
|
32 |
* This class writes an image stage to NITF file. |
|
33 |
* |
|
34 |
* Only very limited NITF support is provided. Specifically, only simple |
|
35 |
* 8-bit and 16-bit data, and no special metadata support. |
|
36 |
*/ |
|
37 |
class NITFImageWriter : public LTIGeoFileImageWriter |
|
38 |
{ |
|
39 |
public: |
|
40 |
/** |
|
41 |
* constructor |
|
42 |
* |
|
43 |
* Creates a writer for NITF images. |
|
44 |
* |
|
45 |
* @param image the image to write from |
|
46 |
*/ |
|
47 |
NITFImageWriter(LTIImageStage* image); |
|
48 |
virtual ~NITFImageWriter(); |
|
49 |
LT_STATUS initialize(); |
|
50 |
|
|
51 |
LT_STATUS writeBegin(const LTIScene& scene); |
|
52 |
LT_STATUS writeStrip(LTISceneBuffer& stripBuffer, const LTIScene& stripScene); |
|
53 |
LT_STATUS writeEnd(); |
|
54 |
|
|
55 |
private: |
|
56 |
typedef LTIGeoFileImageWriter Super; |
|
57 |
|
|
58 |
LT_STATUS checkImpedance() const; |
|
59 |
|
|
60 |
void allocTempBuffer(lt_uint32); |
|
61 |
lt_uint8* copyIntoBuffer(lt_uint32 w, lt_uint32 h, lt_uint8* bipData); |
|
62 |
|
|
63 |
double m_xUL; |
|
64 |
double m_yUL; |
|
65 |
double m_xDim; |
|
66 |
double m_yDim; |
|
67 |
double m_xRot; |
|
68 |
double m_yRot; |
|
69 |
bool m_hasWorldInfo; |
|
70 |
|
|
71 |
lt_uint32 m_myBytesPerSample; |
|
72 |
lt_uint32 m_myNumBands; |
|
73 |
lt_uint32 m_myWidth; |
|
74 |
lt_uint32 m_myHeight; |
|
75 |
int m_gdalDataType; // (cast to GDALDataType) |
|
76 |
|
|
77 |
GDALDataset* m_gdalDataset; |
|
78 |
lt_uint8* m_tempBuffer; |
|
79 |
lt_uint32 m_tempBufferSize; |
|
80 |
|
|
81 |
// nope |
|
82 |
NITFImageWriter(); |
|
83 |
NITFImageWriter(NITFImageWriter&); |
|
84 |
NITFImageWriter& operator=(const NITFImageWriter&); |
|
85 |
}; |
|
86 |
|
|
87 |
|
|
88 |
LT_END_NAMESPACE(LizardTech) |
|
89 |
|
|
90 |
#if defined(LT_COMPILER_MS) |
|
91 |
#pragma warning(pop) |
|
92 |
#endif |
|
93 |
|
|
94 |
#endif // NITFIMAGEWRITER_H |
tags/JNI_Test/libjni-mrsid/sdk/include/writers/GeoTIFFImageWriter.h | ||
---|---|---|
1 |
/* $Id: GeoTIFFImageWriter.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 GEOTIFFIMAGEWRITER_H |
|
14 |
#define GEOTIFFIMAGEWRITER_H |
|
15 |
|
|
16 |
// lt_lib_mrsid_imageWriters |
|
17 |
#include "TIFFImageWriter.h" |
|
18 |
|
|
19 |
#if defined(LT_COMPILER_MS) |
|
20 |
#pragma warning(push,4) |
|
21 |
#endif |
|
22 |
|
|
23 |
LT_BEGIN_NAMESPACE(LizardTech) |
|
24 |
|
|
25 |
class LTIMetadataRecord; |
|
26 |
|
|
27 |
|
|
28 |
/** |
|
29 |
* writes an image stage to a GeoTIFF file |
|
30 |
* |
|
31 |
* This class writes an image stage to a GeoTIFF file. |
|
32 |
*/ |
|
33 |
class GeoTIFFImageWriter : public TIFFImageWriter |
|
34 |
{ |
|
35 |
public: |
|
36 |
/** |
|
37 |
* constructor |
|
38 |
* |
|
39 |
* Creates a writer for GeoTIFF images. |
|
40 |
* |
|
41 |
* @param image the image to write from |
|
42 |
*/ |
|
43 |
GeoTIFFImageWriter(LTIImageStage* image); |
|
44 |
virtual ~GeoTIFFImageWriter(); |
|
45 |
LT_STATUS initialize(); |
|
46 |
|
|
47 |
LT_STATUS writeBegin(const LTIScene& scene); |
|
48 |
LT_STATUS writeEnd(); |
|
49 |
|
|
50 |
/** |
|
51 |
* Sets the PIXELSCALE tag. This function can be used to manually |
|
52 |
* override the value set for the PIXELSCALE tag. |
|
53 |
* |
|
54 |
* @param pixScale the array of pixel scale values to use |
|
55 |
*/ |
|
56 |
void setPixelScale(double pixScale[]); |
|
57 |
|
|
58 |
/** |
|
59 |
* Sets the TIEPOINTS tag. This function can be used to manually |
|
60 |
* override the value set for the TIEPOINTS tag. |
|
61 |
* |
|
62 |
* @param tiePoints the array of tie point values to use |
|
63 |
* @param number the number of tie points in the array |
|
64 |
*/ |
|
65 |
void setTiePoints(double *tiePoints, int number); |
|
66 |
|
|
67 |
private: |
|
68 |
typedef TIFFImageWriter Super; |
|
69 |
|
|
70 |
LT_STATUS writeHeaders(lt_uint32 width, lt_uint32 height); |
|
71 |
|
|
72 |
// we use a uint for the key, to avoid exposing geokey_t |
|
73 |
bool setKey(lt_uint32 key, unsigned char byteVal); |
|
74 |
bool setKey(lt_uint32 key, unsigned short shortVal); |
|
75 |
bool setKey(lt_uint32 key, const char* asciiVal); |
|
76 |
bool setKey(lt_uint32 key, double doubleVal); |
|
77 |
bool setKey(lt_uint32 key, unsigned long longVal); |
|
78 |
|
|
79 |
char* getKeyName(lt_uint32 key); |
|
80 |
|
|
81 |
LT_STATUS setKeysFromMetadata(); |
|
82 |
LT_STATUS setKeyFromMetadata(const LTIMetadataRecord&); |
|
83 |
LT_STATUS setKeyFromMetadata_geotiffnum(const LTIMetadataRecord& rec); |
|
84 |
LT_STATUS setKeyFromMetadata_geo(const LTIMetadataRecord& rec); |
|
85 |
int getKeyId(const char*); |
|
86 |
|
|
87 |
void *m_geoTiffPtr; |
|
88 |
|
|
89 |
double m_tiePoints[6]; |
|
90 |
double m_res[3]; |
|
91 |
double m_xval; |
|
92 |
double m_yval; |
|
93 |
double m_xres; |
|
94 |
double m_yres; |
|
95 |
|
|
96 |
// nope |
|
97 |
GeoTIFFImageWriter(); |
|
98 |
GeoTIFFImageWriter(GeoTIFFImageWriter&); |
|
99 |
GeoTIFFImageWriter& operator=(const GeoTIFFImageWriter&); |
|
100 |
}; |
|
101 |
|
|
102 |
|
|
103 |
LT_END_NAMESPACE(LizardTech) |
|
104 |
|
|
105 |
#if defined(LT_COMPILER_MS) |
|
106 |
#pragma warning(pop) |
|
107 |
#endif |
|
108 |
|
|
109 |
#endif // GEOTIFFIMAGEWRITER_H |
tags/JNI_Test/libjni-mrsid/sdk/include/writers/JpegImageWriter.h | ||
---|---|---|
1 |
/* $Id: JpegImageWriter.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 JPEGIMAGEWRITER_H |
|
14 |
#define JPEGIMAGEWRITER_H |
|
15 |
|
|
16 |
// lt_lib_mrsid_core |
|
17 |
#include "lti_geoFileImageWriter.h" |
|
18 |
|
|
19 |
// system |
|
20 |
#include <stdio.h> |
|
21 |
|
|
22 |
#if defined(LT_COMPILER_MS) |
|
23 |
#pragma warning(push,4) |
|
24 |
#endif |
|
25 |
|
|
26 |
struct jpeg_compress_struct; |
|
27 |
struct jpeg_error_mgr; |
|
28 |
|
|
29 |
LT_BEGIN_NAMESPACE(LizardTech) |
|
30 |
|
|
31 |
class LTFileSpec; |
|
32 |
class LTReusableBuffer; |
|
33 |
|
|
34 |
/** |
|
35 |
* writes an image stage to a JPEG file |
|
36 |
* |
|
37 |
* This class writes an image stage to a JPEG file. |
|
38 |
*/ |
|
39 |
class JpegImageWriter : public LTIGeoFileImageWriter |
|
40 |
{ |
|
41 |
public: |
|
42 |
/** |
|
43 |
* constructor |
|
44 |
* |
|
45 |
* Creates a writer for JPEG images. |
|
46 |
* |
|
47 |
* @param image the image to write from |
|
48 |
* @param quality sets the JPEG "quality" encoding parameter; |
|
49 |
* this is a value between 0 and 100 |
|
50 |
* @param smoothing sets the JPEG "smoothing" encoding parameter; |
|
51 |
* this is a value between 0 and 100 |
|
52 |
*/ |
|
53 |
JpegImageWriter(LTIImageStage* image, |
|
54 |
int quality = 0, // 0-100 |
|
55 |
int smoothing = 0); // 0-100 |
|
56 |
virtual ~JpegImageWriter(); |
|
57 |
LT_STATUS initialize(); |
|
58 |
|
|
59 |
LT_STATUS writeBegin(const LTIScene& scene); |
|
60 |
LT_STATUS writeStrip(LTISceneBuffer& stripBuffer, const LTIScene& stripScene); |
|
61 |
LT_STATUS writeEnd(); |
|
62 |
|
|
63 |
private: |
|
64 |
typedef LTIGeoFileImageWriter Super; |
|
65 |
|
|
66 |
LT_STATUS checkImpedance() const; |
|
67 |
|
|
68 |
FILE* m_file; |
|
69 |
|
|
70 |
//struct that contains the JPEG compression parameters |
|
71 |
struct jpeg_compress_struct* m_jpegObject; |
|
72 |
|
|
73 |
//struct to handle error messages |
|
74 |
struct jpeg_error_mgr* m_jpegErr; |
|
75 |
|
|
76 |
//two parameters for setting compression quality |
|
77 |
int m_quality; |
|
78 |
int m_smoothingFactor; |
|
79 |
|
|
80 |
LTReusableBuffer* m_stripBuffer; |
|
81 |
|
|
82 |
// nope |
|
83 |
JpegImageWriter(); |
|
84 |
JpegImageWriter(JpegImageWriter&); |
|
85 |
JpegImageWriter& operator=(const JpegImageWriter&); |
|
86 |
}; |
|
87 |
|
|
88 |
|
|
89 |
LT_END_NAMESPACE(LizardTech) |
|
90 |
|
|
91 |
#if defined(LT_COMPILER_MS) |
|
92 |
#pragma warning(pop) |
|
93 |
#endif |
|
94 |
|
|
95 |
#endif // JPEGIMAGEWRITER_H |
tags/JNI_Test/libjni-mrsid/sdk/include/metadata/lti_metadataDumper.h | ||
---|---|---|
1 |
/* $Id: lti_metadataDumper.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 LTIMETADATADUMPER_H |
|
14 |
#define LTIMETADATADUMPER_H |
|
15 |
|
|
16 |
// lt_lib_mrsid_metadata |
|
17 |
#include "lti_metadataWriter.h" |
|
18 |
|
|
19 |
LT_BEGIN_NAMESPACE(LizardTech) |
|
20 |
|
|
21 |
#if defined(LT_COMPILER_MS) |
|
22 |
#pragma warning(push,4) |
|
23 |
#endif |
|
24 |
|
|
25 |
class LTIOStreamInf; |
|
26 |
class LTIMetadataRecord; |
|
27 |
|
|
28 |
|
|
29 |
/** |
|
30 |
* dumps contents of database in text form |
|
31 |
* |
|
32 |
* This class writes the given database in ASCII text, readable format |
|
33 |
* to a stream or stdout. |
|
34 |
*/ |
|
35 |
class LTIMetadataDumper: public LTIMetadataWriter |
|
36 |
{ |
|
37 |
public: |
|
38 |
/** |
|
39 |
* constructor |
|
40 |
* |
|
41 |
* This constructor creates an LTIMetadataWriter which will pretty-print |
|
42 |
* the records in the database to a stream or to stdout. |
|
43 |
* |
|
44 |
* @param database the database to write from |
|
45 |
* @param stream the stream to write to; if NULL, will write to stdout |
|
46 |
*/ |
|
47 |
LTIMetadataDumper(const LTIMetadataDatabase& database, |
|
48 |
LTIOStreamInf* stream); |
|
49 |
|
|
50 |
/** |
|
51 |
* destructor |
|
52 |
*/ |
|
53 |
~LTIMetadataDumper(); |
|
54 |
|
|
55 |
/** |
|
56 |
* write records to stream |
|
57 |
*/ |
|
58 |
LT_STATUS write() const; |
|
59 |
|
|
60 |
/** |
|
61 |
* write a single record to stream |
|
62 |
* |
|
63 |
* This function writes (pretty-prints) the given record to the stream. |
|
64 |
* |
|
65 |
* It is public and static because it is useful on its own for debugging. |
|
66 |
* |
|
67 |
* @param record the record to write |
|
68 |
* @param stream the stream to write to |
|
69 |
* @return status code indicating success or failure |
|
70 |
*/ |
|
71 |
static LT_STATUS writeRecord(const LTIMetadataRecord& record, |
|
72 |
LTIOStreamInf& stream); |
|
73 |
|
|
74 |
|
|
75 |
/** |
|
76 |
* INPUT_NAME metadata control |
|
77 |
* |
|
78 |
* Control if the IMAGE::INPUT_NAME tag is written out. |
|
79 |
* This can useful for certain debugging and validation situations. |
|
80 |
* |
|
81 |
* The default is to always write the INPUT_NAME tag. |
|
82 |
* |
|
83 |
* @param enable set to true to not skip the INPUT_NAME tag |
|
84 |
*/ |
|
85 |
void setWriteInputFilename(bool enable); |
|
86 |
|
|
87 |
private: |
|
88 |
LTIOStreamInf* m_stream; |
|
89 |
bool m_ownsStream; |
|
90 |
bool m_writeInputFilename; |
|
91 |
|
|
92 |
// nope |
|
93 |
LTIMetadataDumper(const LTIMetadataDumper&); |
|
94 |
LTIMetadataDumper& operator=(const LTIMetadataDumper&); |
|
95 |
}; |
|
96 |
|
|
97 |
|
|
98 |
LT_END_NAMESPACE(LizardTech) |
|
99 |
|
|
100 |
#if defined(LT_COMPILER_MS) |
|
101 |
#pragma warning(pop) |
|
102 |
#endif |
|
103 |
|
|
104 |
#endif // LTIMETADATADUMPER_H |
tags/JNI_Test/libjni-mrsid/sdk/include/metadata/lti_metadataWriter.h | ||
---|---|---|
1 |
/* $Id: lti_metadataWriter.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_METADATA_WRITER_H |
|
14 |
#define LTI_METADATA_WRITER_H |
|
15 |
|
|
16 |
// lt_lib_base |
|
17 |
#include "lt_base.h" |
|
18 |
|
|
19 |
LT_BEGIN_NAMESPACE(LizardTech) |
|
20 |
|
|
21 |
#if defined(LT_COMPILER_MS) |
|
22 |
#pragma warning(push,4) |
|
23 |
#endif |
|
24 |
|
|
25 |
|
|
26 |
class LTIMetadataDatabase; |
|
27 |
|
|
28 |
|
|
29 |
/** |
|
30 |
* abstract class for exporting a metadata database |
|
31 |
* |
|
32 |
* This abstract class provides an interface for exporting metadata records |
|
33 |
* from an LTIMetadataDatabase to a foreign source. |
|
34 |
* |
|
35 |
* This is used, for example, to provide a mechanism for writing the |
|
36 |
* format-neutral, in-memory database into binary TIFF tag format. it |
|
37 |
* is also used to dump the database to plain-text format (for debugging). |
|
38 |
*/ |
|
39 |
class LTIMetadataWriter |
|
40 |
{ |
|
41 |
public: |
|
42 |
/** |
|
43 |
* default constructor |
|
44 |
* |
|
45 |
* This base constructor creates a writer object which can export |
|
46 |
* records from a database to some foreign format. |
|
47 |
* |
|
48 |
* @param database the database to be read into |
|
49 |
*/ |
|
50 |
LTIMetadataWriter(const LTIMetadataDatabase& database); |
|
51 |
|
|
52 |
/** |
|
53 |
* destructor |
|
54 |
*/ |
|
55 |
virtual ~LTIMetadataWriter(); |
|
56 |
|
|
57 |
/** |
|
58 |
* write records out from database |
|
59 |
* |
|
60 |
* This function must be implemented in the derived class. It should |
|
61 |
* write each of the LTIMetadataRecord objects in the database out to |
|
62 |
* the foreign format. |
|
63 |
* |
|
64 |
* @return status code indicating success or failure |
|
65 |
*/ |
|
66 |
virtual LT_STATUS write() const = 0; |
|
67 |
|
|
68 |
protected: |
|
69 |
/** |
|
70 |
* the database to be written from |
|
71 |
* |
|
72 |
* This is the database to be written out from. Derived classes may access |
|
73 |
* it directly. |
|
74 |
*/ |
|
75 |
const LTIMetadataDatabase& m_database; |
|
76 |
|
|
77 |
private: |
|
78 |
// nope |
|
79 |
LTIMetadataWriter(const LTIMetadataWriter&); |
|
80 |
LTIMetadataWriter& operator=(const LTIMetadataWriter&); |
|
81 |
}; |
|
82 |
|
|
83 |
|
|
84 |
LT_END_NAMESPACE(LizardTech) |
|
85 |
|
|
86 |
#if defined(LT_COMPILER_MS) |
|
87 |
#pragma warning(pop) |
|
88 |
#endif |
|
89 |
|
|
90 |
#endif // LTI_METADATA_WRITER_H |
tags/JNI_Test/libjni-mrsid/sdk/include/metadata/lti_metadataRecord.h | ||
---|---|---|
1 |
/* $Id: lti_metadataRecord.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 LTIMETADATARECORD_H |
|
14 |
#define LTIMETADATARECORD_H |
|
15 |
|
|
16 |
// lt_lib_base |
|
17 |
#include "lt_base.h" |
|
18 |
|
|
19 |
// lt_lib_mrsid_metadata |
|
20 |
#include "lti_metadataTypes.h" |
|
21 |
|
|
22 |
LT_BEGIN_NAMESPACE(LizardTech) |
|
23 |
|
|
24 |
#if defined(LT_COMPILER_MS) |
|
25 |
#pragma warning(push,4) |
|
26 |
#endif |
|
27 |
|
|
28 |
|
|
29 |
/** |
|
30 |
* representation of a metadata record |
|
31 |
* |
|
32 |
* This class stores the data associated with a single record in the database. |
|
33 |
* The data consists of: |
|
34 |
* - the tag (a string), used to uniquely identify the record |
|
35 |
* - the type of the data, e.g. string, byte, etc |
|
36 |
* - the dimensionality of the data, e.g. scalar, 2x3 array, etc |
|
37 |
* - the actual data |
|
38 |
* |
|
39 |
* It is assumed each record has only a single set of data of a single datatype. |
|
40 |
* (That is, a record can't contain both a float and two ints.) |
|
41 |
* |
|
42 |
* Some of the functions for operating on records are cast in the guise |
|
43 |
* of scalar, vector, or array data. This is for notational convenience only; |
|
44 |
* the internal representation does not distinguish and treats everything as |
|
45 |
* a (possibly degenerate) array. |
|
46 |
*/ |
|
47 |
class LTIMetadataRecord |
|
48 |
{ |
|
49 |
public: |
|
50 |
/** |
|
51 |
* default constructor for scalar data |
|
52 |
* |
|
53 |
* The constructor creates a record containing a scalar data value. |
|
54 |
* |
|
55 |
* Note that the object makes a local copy of the data passed into the |
|
56 |
* record. |
|
57 |
* |
|
58 |
* @param tag the tag number of the record |
|
59 |
* @param type datatype of the data in the record |
|
60 |
* @param data pointer to the data to insert into the record |
|
61 |
*/ |
|
62 |
LTIMetadataRecord(LTIMetadataTag tag, |
|
63 |
LTIMetadataDataType type, |
|
64 |
const void* data); |
|
65 |
|
|
66 |
/** |
|
67 |
* default constructor for scalar data |
|
68 |
* |
|
69 |
* The constructor creates a record containing a scalar data value. |
|
70 |
* |
|
71 |
* Note that the object makes a local copy of the data passed into the |
|
72 |
* record. |
|
73 |
* |
|
74 |
* @param tagName the tag number of the record |
|
75 |
* @param type datatype of the data in the record |
|
76 |
* @param data pointer to the data to insert into the record |
|
77 |
*/ |
|
78 |
LTIMetadataRecord(const char* tagName, |
|
79 |
LTIMetadataDataType type, |
|
80 |
const void* data); |
|
81 |
|
|
82 |
/** |
|
83 |
* default constructor for vector data |
|
84 |
* |
|
85 |
* The constructor creates a record containing a vector of data values. |
|
86 |
* |
|
87 |
* Note that the object makes a local copy of the data passed into the |
|
88 |
* record. |
|
89 |
* |
|
90 |
* @param tag the tag number of the record |
|
91 |
* @param type datatype of the data in the record |
|
92 |
* @param data pointer to the data to insert into the record |
|
93 |
* @param vecLen the length of the data vector |
|
94 |
*/ |
|
95 |
LTIMetadataRecord(LTIMetadataTag tag, |
|
96 |
LTIMetadataDataType type, |
|
97 |
const void* data, |
|
98 |
lt_uint32 vecLen); |
|
99 |
/** |
|
100 |
* default constructor for vector data |
|
101 |
* |
|
102 |
* The constructor creates a record containing a vector of data values. |
|
103 |
* |
|
104 |
* Note that the object makes a local copy of the data passed into the |
|
105 |
* record. |
|
106 |
* |
|
107 |
* @param tagName the tag number of the record |
|
108 |
* @param type datatype of the data in the record |
|
109 |
* @param data pointer to the data to insert into the record |
|
110 |
* @param vecLen the length of the data vector |
|
111 |
*/ |
|
112 |
LTIMetadataRecord(const char* tagName, |
|
113 |
LTIMetadataDataType type, |
|
114 |
const void* data, |
|
115 |
lt_uint32 vecLen); |
|
116 |
|
|
117 |
/** |
|
118 |
* default constructor for array data |
|
119 |
* |
|
120 |
* The constructor creates a record containing an array of data values. |
|
121 |
* |
|
122 |
* Note that the object makes a local copy of the data passed into the |
|
123 |
* record. |
|
124 |
* |
|
125 |
* @param tag the tag number of the record |
|
126 |
* @param type datatype of the data in the record |
|
127 |
* @param data pointer to the data to insert into the record |
|
128 |
* @param numDims the length of the \a dims array |
|
129 |
* @param dims the dimensionality of the data |
|
130 |
*/ |
|
131 |
LTIMetadataRecord(LTIMetadataTag tag, |
|
132 |
LTIMetadataDataType type, |
|
133 |
const void* data, |
|
134 |
lt_uint32 numDims, |
|
135 |
const lt_uint32* dims); |
|
136 |
|
|
137 |
/** |
|
138 |
* default constructor for array data |
|
139 |
* |
|
140 |
* The constructor creates a record containing an array of data values. |
|
141 |
* |
|
142 |
* Note that the object makes a local copy of the data passed into the |
|
143 |
* record. |
|
144 |
* |
|
145 |
* @param tagName the tag number of the record |
|
146 |
* @param type datatype of the data in the record |
|
147 |
* @param data pointer to the data to insert into the record |
|
148 |
* @param numDims the length of the \a dims array |
|
149 |
* @param dims the dimensionality of the data |
|
150 |
*/ |
|
151 |
LTIMetadataRecord(const char* tagName, |
|
152 |
LTIMetadataDataType type, |
|
153 |
const void* data, |
|
154 |
lt_uint32 numDims, |
|
155 |
const lt_uint32* dims); |
|
156 |
|
|
157 |
/** |
|
158 |
* copy constructor |
|
159 |
*/ |
|
160 |
LTIMetadataRecord(const LTIMetadataRecord&); |
|
161 |
|
|
162 |
/** |
|
163 |
* destructor |
|
164 |
*/ |
|
165 |
~LTIMetadataRecord(); |
|
166 |
|
|
167 |
/** |
|
168 |
* get tag |
|
169 |
* |
|
170 |
* This function returns the tag number (enum) associated with the record. |
|
171 |
* |
|
172 |
* @return the tag |
|
173 |
*/ |
|
174 |
LTIMetadataTag getTag() const; |
|
175 |
|
|
176 |
/** |
|
177 |
* get tag name |
|
178 |
* |
|
179 |
* This function returns the tag name (string) associated with the record. |
|
180 |
* |
|
181 |
* @return the tag name |
|
182 |
*/ |
|
183 |
const char* getTagName() const; |
|
184 |
|
|
185 |
/** |
|
186 |
* get datatype |
|
187 |
* |
|
188 |
* This function returns the datatype of the data in the record. |
|
189 |
* |
|
190 |
* @return the datatype |
|
191 |
*/ |
|
192 |
LTIMetadataDataType getDataType() const; |
|
193 |
|
|
194 |
/** |
|
195 |
* get number of dimensions of the data set |
|
196 |
* |
|
197 |
* This function returns the number of dimensions in the dimensionality |
|
198 |
* of the dataset. |
|
199 |
* |
|
200 |
* This is the length of the array returned by the getDims() function. |
|
201 |
* |
|
202 |
* @return the number of dimensions |
|
203 |
*/ |
|
204 |
lt_uint32 getNumDims() const; |
|
205 |
|
|
206 |
/** |
|
207 |
* get dimensionality of the data set |
|
208 |
* |
|
209 |
* This function returns an array with the length of each dimension of the |
|
210 |
* dataset. |
|
211 |
* |
|
212 |
* For example, a 2x3 dataset would return an array of length two with the |
|
213 |
* values {2,3}. |
|
214 |
* |
|
215 |
* This is the length of the returned array is equal to getNumDims(). |
|
216 |
* |
|
217 |
* @return the number of dimensions |
|
218 |
*/ |
|
219 |
const lt_uint32* getDims() const; |
|
220 |
|
|
221 |
/** |
|
222 |
* is dataset a scalar? |
|
223 |
* |
|
224 |
* This function returns true iff the record's dataset consists only of a |
|
225 |
* single element. |
|
226 |
* |
|
227 |
* @return true if record data is a scalar value |
|
228 |
*/ |
|
229 |
bool isScalar() const; |
|
230 |
|
|
231 |
/** |
|
232 |
* is dataset a vector? |
|
233 |
* |
|
234 |
* This function returns true iff the record's dataset is a 1-D array. |
|
235 |
* |
|
236 |
* @return true if record data is a vector of values |
|
237 |
*/ |
|
238 |
bool isVector() const; |
|
239 |
|
|
240 |
/** |
|
241 |
* is dataset an array? |
|
242 |
* |
|
243 |
* This function returns true iff the record's dataset is neither |
|
244 |
* a scalar nor a vector. |
|
245 |
* |
|
246 |
* @return true if record data is not scalar or vector |
|
247 |
*/ |
|
248 |
bool isArray() const; |
|
249 |
|
|
250 |
/** |
|
251 |
* get scalar data value |
|
252 |
* |
|
253 |
* This function returns the record's data as a scalar value. It is |
|
254 |
* the caller's responsibility to assure that the record does indeed |
|
255 |
* contain a scalar dataset. |
|
256 |
* |
|
257 |
* The user is responsible for casting the returned value to the correct |
|
258 |
* datatype. |
|
259 |
* |
|
260 |
* @return a pointer to the scalar data value |
|
261 |
*/ |
|
262 |
const void* getScalarData() const; |
|
263 |
|
|
264 |
/** |
|
265 |
* get vector data values |
|
266 |
* |
|
267 |
* This function returns the record's data as a vector of values. It is |
|
268 |
* the caller's responsibility to assure that the record does indeed |
|
269 |
* contain a vector dataset. |
|
270 |
* |
|
271 |
* The user is responsible for casting the returned value to an array |
|
272 |
* of the correct datatype. |
|
273 |
* |
|
274 |
* @param vecLen the length of the returned vector |
|
275 |
* @return a pointer to the vector of data values |
|
276 |
*/ |
|
277 |
const void* getVectorData(lt_uint32& vecLen) const; |
|
278 |
|
|
279 |
/** |
|
280 |
* get array data values |
|
281 |
* |
|
282 |
* This function returns the record's data as an array of values. |
|
283 |
* |
|
284 |
* Note the function returns via its parameters the same information as |
|
285 |
* getNumDims() and getDims(). |
|
286 |
* |
|
287 |
* The user is responsible for casting the returned value to an array |
|
288 |
* of the correct datatype. |
|
289 |
* |
|
290 |
* @param numDims the number of dimensions in the \a dims parameter |
|
291 |
* @param dims the dimensionality array |
|
292 |
* @return a pointer to the array of data values |
|
293 |
*/ |
|
294 |
const void* getArrayData(lt_uint32& numDims, const lt_uint32*& dims) const; |
|
295 |
|
|
296 |
/** |
|
297 |
* get size of metadata record |
|
298 |
* |
|
299 |
* This function will return a close-enough estimate of the size of the |
|
300 |
* record, as if it were to be written directly to disk. |
|
301 |
* |
|
302 |
* @return size in bytes of the record |
|
303 |
*/ |
|
304 |
lt_int32 getApproximateSize() const; |
|
305 |
|
|
306 |
private: |
|
307 |
void initialize(LTIMetadataTag tag, |
|
308 |
const void* data, const lt_uint32* dims); |
|
309 |
void initialize(const char* tagName, |
|
310 |
const void* data, const lt_uint32* dims); |
|
311 |
|
|
312 |
lt_uint32 computeLen() const; |
|
313 |
|
|
314 |
char* m_tagName; |
|
315 |
LTIMetadataDataType m_type; |
|
316 |
lt_uint32 m_numDims; |
|
317 |
lt_uint32* m_dims; |
|
318 |
lt_uint8* m_data; |
|
319 |
|
|
320 |
// nope |
|
321 |
LTIMetadataRecord& operator=(const LTIMetadataRecord&); |
|
322 |
}; |
|
323 |
|
|
324 |
|
|
325 |
LT_END_NAMESPACE(LizardTech) |
|
326 |
|
|
327 |
#if defined(LT_COMPILER_MS) |
|
328 |
#pragma warning(pop) |
|
329 |
#endif |
|
330 |
|
|
331 |
#endif // LTIMETADATARECORD_H |
tags/JNI_Test/libjni-mrsid/sdk/include/metadata/lti_metadataUtils.h | ||
---|---|---|
1 |
/* $Id: lti_metadataUtils.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_METADATAUTILS_H |
|
14 |
#define LTI_METADATAUTILS_H |
|
15 |
|
|
16 |
// lt_lib_base |
|
17 |
#include "lt_base.h" |
|
18 |
|
|
19 |
// lt_lib_mrsid_metadata |
|
20 |
#include "lti_metadataTypes.h" |
|
21 |
|
|
22 |
|
|
23 |
LT_BEGIN_NAMESPACE(LizardTech) |
Also available in: Unified diff