Vous êtes sur la page 1sur 1

package sidewinderutil;

import java.awt.image.WritableRaster;
// Tue, Nov 30, 2010 at 2:00 PM MultiDimArr.java Written by Mr. Samuel A Marchant nicephotog-
jsp.net nicephotog@gmail.com
// "C:\Program Files\Java\jdk1.6.0_22\bin\javac.exe" MultiDimArr.java
public class MultiDimArr{
public void debugPrint(){
System.out.println("TRIGGERED PRINTER IN CLASS MultiDimArr.java");
}

public short[][] colOverstepstore(int rgb,int httimg,int lenbrdthimg,WritableRaster wras){


//System.out.println("httimg-height: "+httimg);
//System.out.println("lenbrdthimg-width: "+lenbrdthimg);
short[][] Overstep;
int[] pxlarr=new int[4];
pxlarr[0]=0;
pxlarr[1]=0;
pxlarr[2]=0;
pxlarr[3]=0; // wras.getPixel(a,alng,pxlarr);
//
Overstep = new short[httimg][];
//
for(int hty=0;(hty<httimg);hty++){
Overstep[hty] = new short[lenbrdthimg];
}//enwhl

int fzst=0;
int vto=0;
while(fzst<httimg){
vto=0;
while(vto<lenbrdthimg){
//System.out.println("hty-height: "+fzst);
//System.out.println("cwid-width: "+vto);
//pxlarr = wras.getPixel(hty,cwid,pxlarr);
pxlarr = wras.getPixel(vto,fzst,pxlarr); // !!! array is [H][W](y,x) getPixel is W,H(x,y)
Overstep[fzst][vto]=(new Integer(pxlarr[rgb]).shortValue());
//System.out.println("Overstep[][]: "+Overstep[fzst][vto]);
vto++;
}//enwhl
fzst++;
}//enwhl

return ((short[][])Overstep);
}//enmeth

//public abstract int getDimensionOfArray();


// the purpose of this method is to reconstruct the cropped image original data at point of cropping
for the accuracy backing calibrator array
public short[][] reMakeCropArr(int xaccrStrt,int ydownStrt,int nwWidth,int nwHeight,short[][]
oldArr){

short[][] nwArr;
nwArr = new short[nwHeight][];
//
for(int bhty=0;(bhty<nwHeight);bhty++){
nwArr[bhty] = new short[nwWidth];
}//enwhl

// start loading
int iterNwBand = 0;
int ydwn = ydownStrt;
//xaccrStrt-=1;
//System.out.println("at start ydwn:"+ydwn);
//System.out.println("at start xaccrStrt:"+xaccrStrt);
while(iterNwBand<nwHeight){ // counts the band lines
int xacr = xaccrStrt;
for(int asc=0;asc<nwWidth;asc++){
nwArr[iterNwBand][asc] = oldArr[ydwn][xacr];
xacr++;
}//enfr
ydwn++;
iterNwBand++;
}//enwhl
//System.out.println("iterNwBand:"+iterNwBand+" ydwn:"+ydwn);

return ((short[][])nwArr);
}//enmeth

}//enclss

Vous aimerez peut-être aussi