Revision 1471 trunk/libraries/libjni-readecw-linux/src/com/ermapper/ecw/JNCSRenderer.java
JNCSRenderer.java | ||
---|---|---|
55 | 55 |
alphaComposite = AlphaComposite.getInstance(3, transparencyValue); |
56 | 56 |
} |
57 | 57 |
|
58 |
public void setView(int nBands, int bandList[], int tlx, int tly, int brx, int bry, int width,
|
|
59 |
int height)
|
|
58 |
public int setView(int i, int ai[], int j, int k, int l, int i1, int j1,
|
|
59 |
int k1)
|
|
60 | 60 |
throws JNCSFileNotOpenException, JNCSInvalidSetViewException |
61 | 61 |
{ |
62 |
int l1 = tlx;
|
|
63 |
int i2 = tly;
|
|
64 |
int j2 = brx;
|
|
65 |
int k2 = bry;
|
|
66 |
if(tlx < 0)
|
|
62 |
int l1 = j;
|
|
63 |
int i2 = k;
|
|
64 |
int j2 = l;
|
|
65 |
int k2 = i1;
|
|
66 |
if(j < 0)
|
|
67 | 67 |
l1 = 0; |
68 |
if(tly < 0)
|
|
68 |
if(k < 0)
|
|
69 | 69 |
i2 = 0; |
70 |
if(brx > super.width - 1)
|
|
70 |
if(l > super.width - 1)
|
|
71 | 71 |
j2 = super.width - 1; |
72 |
if(bry > super.height - 1)
|
|
72 |
if(i1 > super.height - 1)
|
|
73 | 73 |
k2 = super.height - 1; |
74 |
int l2 = (int)Math.round(((double)(l1 - tlx) / (double)(brx - tlx)) * (double)width);
|
|
75 |
int i3 = (int)Math.round(((double)(i2 - tly) / (double)(bry - tly)) * (double)height);
|
|
76 |
int j3 = (int)Math.round(((double)(j2 - tlx) / (double)(brx - tlx)) * (double)width);
|
|
77 |
int k3 = (int)Math.round(((double)(k2 - tly) / (double)(bry - tly)) * (double)height);
|
|
78 |
super.setView(nBands, bandList, l1, i2, j2, k2, j3 - l2, k3 - i3);
|
|
74 |
int l2 = (int)Math.round(((double)(l1 - j) / (double)(l - j)) * (double)j1);
|
|
75 |
int i3 = (int)Math.round(((double)(i2 - k) / (double)(i1 - k)) * (double)k1);
|
|
76 |
int j3 = (int)Math.round(((double)(j2 - j) / (double)(l - j)) * (double)j1);
|
|
77 |
int k3 = (int)Math.round(((double)(k2 - k) / (double)(i1 - k)) * (double)k1);
|
|
78 |
super.setView(i, ai, l1, i2, j2, k2, j3 - l2, k3 - i3);
|
|
79 | 79 |
bHaveValidSetView = true; |
80 | 80 |
if(!super.progressive) |
81 | 81 |
{ |
... | ... | |
86 | 86 |
dRendererSetViewWidth = j3 - l2; |
87 | 87 |
dRendererSetViewHeight = k3 - i3; |
88 | 88 |
} |
89 |
|
|
89 |
return 0; |
|
90 | 90 |
} |
91 | 91 |
|
92 |
|
|
93 |
public int setView(int nBands, int bandList[], double dWorldTLX, double dWorldTLY, double dWorldBRX, double dWorldBRY, int width, int height) |
|
92 |
public int setView(int i, int ai[], double d, double d1, double d2, double d3, int j, int k) |
|
94 | 93 |
throws JNCSFileNotOpenException, JNCSInvalidSetViewException |
95 | 94 |
{ |
96 |
JNCSDatasetPoint jncsdatasetpoint = convertWorldToDataset(dWorldTLX, dWorldTLY);
|
|
97 |
JNCSDatasetPoint jncsdatasetpoint1 = convertWorldToDataset(dWorldBRY, dWorldBRY);
|
|
98 |
double d4 = dWorldTLX;
|
|
99 |
double d5 = dWorldTLY;
|
|
100 |
double d6 = dWorldBRY;
|
|
101 |
double d7 = dWorldBRY;
|
|
95 |
JNCSDatasetPoint jncsdatasetpoint = convertWorldToDataset(d, d1);
|
|
96 |
JNCSDatasetPoint jncsdatasetpoint1 = convertWorldToDataset(d2, d3);
|
|
97 |
double d4 = d; |
|
98 |
double d5 = d1;
|
|
99 |
double d6 = d2;
|
|
100 |
double d7 = d3;
|
|
102 | 101 |
jncsdatasetpoint.x = (int)Math.floor((d4 - super.originX) / super.cellIncrementX); |
103 | 102 |
jncsdatasetpoint.y = (int)Math.floor((d5 - super.originY) / super.cellIncrementY); |
104 | 103 |
jncsdatasetpoint1.x = (int)Math.ceil((d6 - super.originX) / super.cellIncrementX); |
... | ... | |
127 | 126 |
bHaveValidSetView = false; |
128 | 127 |
return 1; |
129 | 128 |
} |
130 |
int l = (int)Math.round(((d4 - dWorldTLX) / (dWorldBRY - dWorldTLX)) * (double)width);
|
|
131 |
int i1 = (int)Math.round(((d5 - dWorldTLY) / (dWorldBRY - dWorldTLY)) * (double)height);
|
|
132 |
int j1 =(int)Math.round(((d6 - dWorldTLX) / (dWorldBRY - dWorldTLX)) * (double)width);
|
|
133 |
int k1 = (int)Math.round(((d7 - dWorldTLY) / (dWorldBRY - dWorldTLY)) * (double)height);
|
|
129 |
int l = (int)Math.round(((d4 - d) / (d2 - d)) * (double)j);
|
|
130 |
int i1 = (int)Math.round(((d5 - d1) / (d3 - d1)) * (double)k);
|
|
131 |
int j1 = (int)Math.round(((d6 - d) / (d2 - d)) * (double)j);
|
|
132 |
int k1 = (int)Math.round(((d7 - d1) / (d3 - d1)) * (double)k);
|
|
134 | 133 |
if(j1 - l > jncsdatasetpoint1.x - jncsdatasetpoint.x) |
135 | 134 |
{ |
136 | 135 |
j1 = jncsdatasetpoint1.x; |
... | ... | |
146 | 145 |
bHaveValidSetView = false; |
147 | 146 |
return 1; |
148 | 147 |
} |
149 |
super.setView(nBands, bandList, d4, d5, d6, d7, j1 - l, k1 - i1);
|
|
148 |
super.setView(i, ai, d4, d5, d6, d7, j1 - l, k1 - i1);
|
|
150 | 149 |
bHaveValidSetView = true; |
151 | 150 |
if(!super.progressive) |
152 | 151 |
{ |
Also available in: Unified diff