Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

package sidewinderutil;

import java.awt.*;
import java.awt.image.*; // ??? feed 0 to raster method in sidewinder main
// Tue, Nov 30, 2010 at 2:00 PM Rotators.java Written by Mr. Samuel A Marchant nicephotog-
jsp.net nicephotog@gmail.com
public class Rotators{
int storeImgType; // has to be sent from sidewinder main class first e.g. clssref.storeImgType =
bumi.getType()
//BufferedImage bmiimg;
public Rotators(int storeImgType){
this.storeImgType = storeImgType;
}//enconstr
// remake original data calibrator arrays after "Counter Clockwise rotation of image" 90 degrees
// call by x 3
public short[][] rotateCCw(int currWid,int currHit,short[][] origicolo){
int nwHit = currWid;
int nwWid = currHit;
short[][] nwCCw;
nwCCw = new short[nwHit][];
for(int fge=0;fge<nwHit;fge++){
nwCCw[fge] = new short[nwWid];
}//enfr
//
int wlkRGTdwn = 0;
currWid-=1;
while(wlkRGTdwn<nwHit){ // currWid = nwHit
for(int iuthey=0;iuthey<nwWid;iuthey++){
nwCCw[wlkRGTdwn][iuthey] = origicolo[iuthey][currWid];
}//enfr
currWid--;
wlkRGTdwn++;
}//enwhl
return (short[][])nwCCw;
}//enmeth

// ================= remake original data calibrator array after "Clockwise rotation of image" 90
degrees
public short[][] rotateCw(int currWid,int currHit,short[][] origicolo){
int nwHit = currWid;
int nwWid = currHit;
short[][] nwCw;
nwCw = new short[nwHit][];
for(int fge=0;fge<nwHit;fge++){
nwCw[fge] = new short[nwWid];
}//enfr
int sta = currHit-1;
int nwy = 0;
while(nwy<nwHit){
for(int cxdzq=0;cxdzq<nwWid;cxdzq++){
if(cxdzq==0){
sta = currHit-1;
}//enif
nwCw[nwy][cxdzq] = origicolo[sta][nwy];
sta--;
}//enfr
nwy++;
}//enwhl
return (short[][])nwCw;
}//enmeth
// ready makes a base plate image ready for populating from renewed array above after restoration in
sidewinder main class
// for memory space this may be better returned directly to bumi
public BufferedImage mkBasePlateIMG(int nw,int nht){ // new use for copybumi
return (new BufferedImage(nw,nht,storeImgType));
}//enmeth

}//enclss

You might also like