0% found this document useful (0 votes)
6 views1 page

Java Multi-Dimensional Array Utility

This is code i wrote for a Java2 multi-dimensional array system for setting up handling image Raster information numerically in a javax.imageio.* SE application called "Sidewinder" for 24 bit colour photo balancing.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views1 page

Java Multi-Dimensional Array Utility

This is code i wrote for a Java2 multi-dimensional array system for setting up handling image Raster information numerically in a javax.imageio.* SE application called "Sidewinder" for 24 bit colour photo balancing.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

package sidewinderutil;

import [Link];
// Tue, Nov 30, 2010 at 2:00 PM [Link] Written by Mr. Samuel A Marchant nicephotog-
[Link] nicephotog@[Link]
// "C:\Program Files\Java\jdk1.6.0_22\bin\[Link]" [Link]
public class MultiDimArr{
public void debugPrint(){
[Link]("TRIGGERED PRINTER IN CLASS [Link]");
}

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


//[Link]("httimg-height: "+httimg);
//[Link]("lenbrdthimg-width: "+lenbrdthimg);
short[][] Overstep;
int[] pxlarr=new int[4];
pxlarr[0]=0;
pxlarr[1]=0;
pxlarr[2]=0;
pxlarr[3]=0; // [Link](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){
//[Link]("hty-height: "+fzst);
//[Link]("cwid-width: "+vto);
//pxlarr = [Link](hty,cwid,pxlarr);
pxlarr = [Link](vto,fzst,pxlarr); // !!! array is [H][W](y,x) getPixel is W,H(x,y)
Overstep[fzst][vto]=(new Integer(pxlarr[rgb]).shortValue());
//[Link]("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;
//[Link]("at start ydwn:"+ydwn);
//[Link]("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
//[Link]("iterNwBand:"+iterNwBand+" ydwn:"+ydwn);

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

}//enclss

You might also like