Statistics
| Revision:

root / trunk / libraries / libjni-ecwcompress / src / es / gva / cit / jecwcompress / NCSEcwCompressClient.java @ 1429

History | View | Annotate | Download (4.67 KB)

1
/**********************************************************************
2
 * $Id: NCSEcwCompressClient.java 1429 2005-02-10 12:49:04Z igbrotru $
3
 *
4
 * Name:     NCSEcwCompressClient.java
5
 * Project:  
6
 * Purpose:  
7
 * Author:   Nacho Brodin, brodin_ign@gva.es
8
 *
9
 **********************************************************************/
10
/*Copyright (C) 2004  Nacho Brodin <brodin_ign@gva.es>
11

12
 This program is free software; you can redistribute it and/or
13
 modify it under the terms of the GNU General Public License
14
 as published by the Free Software Foundation; either version 2
15
 of the License, or (at your option) any later version.
16

17
 This program is distributed in the hope that it will be useful,
18
 but WITHOUT ANY WARRANTY; without even the implied warranty of
19
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
 GNU General Public License for more details.
21

22
 You should have received a copy of the GNU General Public License
23
 along with this program; if not, write to the Free Software
24
 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
25
 */
26

    
27

    
28
/**
29
 * @author Nacho Brodin <brodin_ign@gva.es>.<BR> Equipo de desarrollo gvSIG.<BR> http://www.gvsig.gva.es
30
 * @version 0.0
31
 * @link http://www.gvsig.gva.es
32
 */
33

    
34
package es.gva.cit.jecwcompress;
35

    
36
public class NCSEcwCompressClient extends JNIBase{
37

    
38
        private native long NCSEcwCompressClientNat();
39
        private native void NCSEcwCompressOpenNat(long cPtr, boolean bCalculateSizesOnly);
40
        
41
        private String                                inputFilename;                        
42
        private        String                                 outputFilename;        
43
        private double                                 targetCompression;
44
        private String                                eCompressFormat;
45
        private int                                        eCompressHint;
46
        private int                                        nBlockSizeX;
47
        private int                                        nBlockSizeY;
48
        private int                                        nInOutSizeX;
49
        private int                                        nInOutSizeY;
50
        private int                                        nInputBands;
51
        private int                                        nOutputBands;
52
        private long                                nInputSize;
53
        private double                                fCellIncrementX;
54
        private double                                fCellIncrementY;
55
        private double                                fOriginX;
56
        private double                                fOriginY;
57
        private int                                        eCellSizeUnits;
58
        private String                                 szDatum;
59
        private String                                 szProjection;
60
        private double                                fActualCompression;        
61
        private double                                fCompressionSeconds;
62
        private double                                fCompressionMBSec;
63
        private long                                nOutputSize;
64
        
65
        private byte[]                                buffer;
66
        
67
        /**
68
         * Esta funci?n es llamada desde C para inicializar el buffer que contendr? 1 linea de datos
69
         */
70
        
71
        private void initialize(){
72
                buffer=new byte[nInOutSizeX*nInputBands];
73
        }
74
        
75
        /**
76
         * 
77
         */
78
        
79
        public NCSEcwCompressClient()throws EcwException{
80
                
81
                long cPtr = NCSEcwCompressClientNat();
82
                
83
                if(cPtr<=0)
84
                    throw new EcwException("Error en la creaci?n del objeto NCSEcwCompressClient");
85
        }
86
        
87
        /**
88
         * 
89
         */
90
        
91
        public void NCSEcwCompressOpen(boolean bCalculateSizesOnly)throws EcwException{
92
                
93
                if(cPtr <= 0)
94
                        throw new EcwException("Error en NCSEcwCompressOpen(). No hay una referencia v?lida al objeto NCSEcwCompressClient.");
95
                
96
                NCSEcwCompressOpenNat(cPtr, bCalculateSizesOnly);
97
                            
98
        }
99
        
100
        public void setInputFilename(String filename){inputFilename=filename;};
101
        public void setOutputFilename(String filename){outputFilename=filename;};
102
        public void setTargetCompress(double compress){targetCompression=compress;};
103
        
104
        /**
105
         * COMPRESS_NONE        = NCSCS_NONE,
106
         * COMPRESS_UINT8        = NCSCS_GREYSCALE,
107
         * COMPRESS_YUV                = NCSCS_YUV,
108
         * COMPRESS_MULTI        = NCSCS_MULTIBAND,
109
         * COMPRESS_RGB                = NCSCS_sRGB
110
         */
111
        
112
        public void setCompressFormat(String format){eCompressFormat=format;};
113
        
114
        /**
115
         * COMPRESS_HINT_NONE        = 0,
116
         * COMPRESS_HINT_FAST        = 1,
117
         * COMPRESS_HINT_BEST        = 2,
118
         * COMPRESS_HINT_INTERNET = 3
119
         */
120
        
121
        public void setCompressHint(int hint){eCompressHint=hint;};
122
        public void setNBlockSizeX(int n){nBlockSizeX=n;};
123
        public void setNBlockSizeY(int n){nBlockSizeY=n;};
124
        public void setNInOutSizeX(int n){nInOutSizeX=n;};
125
        public void setNInOutSizeY(int n){nInOutSizeY=n;};
126
        public void setNInputBands(int n){nInputBands=n;};
127
        public void setNOutputBands(int n){nOutputBands=n;};
128
        public void setNInputSize(long nis){nInputSize=nis;};
129
        public void setCellIncrementX(double x){fCellIncrementX=x;};
130
        public void setCellIncrementY(double y){fCellIncrementY=y;};
131
        public void setOriginX(double x){fOriginX=x;};
132
        public void setOriginY(double y){fOriginY=y;};
133

    
134
        /**
135
        * ECW_CELL_UNITS_INVALID        =        0,
136
        * ECW_CELL_UNITS_METERS                =        1,
137
        * ECW_CELL_UNITS_DEGREES        =        2,
138
        * ECW_CELL_UNITS_FEET                =        3,
139
        * ECW_CELL_UNITS_UNKNOWN        =        4
140
        */
141
        
142
        public void setCellSizeUnits(int cellu){eCellSizeUnits=cellu;};
143
        public void setDatum(String dat){szDatum=dat;};
144
        public void setProjection(String proj){szProjection=proj;};
145
        public void setActualCompression(double comp){fActualCompression=comp;};
146
        public void setCompressionSeconds(double comp){fCompressionSeconds=comp;};
147
        public void setCompressionMBSec(double comp){fCompressionMBSec=comp;};
148
        public void setNOutputSize(long n){nOutputSize=n;};
149
}