public abstract class RectRecurse extends ImageFinder
Modifier and Type  Field and Description 

static int 
CONSUMED 
protected Transformer 
fromOut
The transformation from the output pixels to the celestial sphere

static int 
NO_COVERAGE 
static int 
NON_PHYSICAL 
static int 
SPLIT_X 
static int 
SPLIT_XY 
static int 
SPLIT_Y 
static int 
UNCHECKED 
Constructor and Description 

RectRecurse() 
Modifier and Type  Method and Description 

protected int 
cornerMatch(int[] corners,
boolean[] valid,
boolean[] newValid)
Check the corners of a rectangle.

protected abstract double 
criterion(int image,
int nx,
int ny,
double tx,
double ty)
The criterion function should return a larger value
for more desirable inputs.

protected boolean 
edgeOff(int match,
int p0,
int pe,
int dp,
boolean[] valid)
Check whether all pixels on an edge of a rectangle all have the same best fit image.

int[] 
findImages(Image[] input,
Image output)
Find the best image for each output pixel.

protected Image 
getCandidate(int i)
Return a particular candidate.

protected double[] 
getImage(Image img,
double[] inp)
Convert an input unit vector to a position in an image.

protected int[] 
getInputLimits(Image in) 
protected double 
minDist(double x,
double y,
double a,
double b)
Given a point at x,y in an image of size a,b
in the rectangle 0,a 0,b
find the minimum distance to the edge.

void 
printOut(int[] arr,
int mx)
Debugging output

protected double 
radiusSquared(double tx,
double ty,
double nx,
double ny,
int index,
Image input)
The default for this is to use the radius from the center of the image.

void 
setStrict(boolean flag)
Set a strict geometry.

factory
protected Transformer fromOut
public static final int UNCHECKED
public static final int NO_COVERAGE
public static final int NON_PHYSICAL
public static final int CONSUMED
public static final int SPLIT_X
public static final int SPLIT_Y
public static final int SPLIT_XY
public int[] findImages(Image[] input, Image output)
findImages
in class ImageFinder
input
 An array of images that may be sampled to get the output image.output
 The output image. In this routine we are interested in its
geometry, not its data.protected Image getCandidate(int i)
i
 The index of the requested candidatepublic void setStrict(boolean flag)
setStrict
in class ImageFinder
flag
 Should strict checking be enabled?protected boolean edgeOff(int match, int p0, int pe, int dp, boolean[] valid)
match
 The value each edge is to be compared against.p0
 The first pixel offset to be checked.pe
 The last pixel offset to be checked.dp
 The spacing between pixels (either 1 or the number of pixels in a row).valid
 Should we consider this image?valid
 If we recurse should be consider this image?protected int cornerMatch(int[] corners, boolean[] valid, boolean[] newValid)
corners
 The corners of the rectangle. It is assumed that
there are four elements in corners, and they are
in the order p00, p01, p10, p11valid
 The images to be checked at the current level of recursion.newValid
 The images to be checked at the next level of recursion.
This routine will look at the corners of the
image in relation to the bounds of the valid images to
decide which images to search at a future level of recursion.protected double minDist(double x, double y, double a, double b)
x
 The x value of the point.y
 The y value of the pointa
 The width of the image.b
 the height of the imageprotected double[] getImage(Image img, double[] inp)
img
 The image we are transforming into the plane of.inp
 The input unit celestial coordinate unit vector.protected int[] getInputLimits(Image in)
protected double radiusSquared(double tx, double ty, double nx, double ny, int index, Image input)
tx
 The x value of the first point.ty
 The y value of the first point.nx
 The width of the image.ny
 the height of the image.protected abstract double criterion(int image, int nx, int ny, double tx, double ty)
image
 The index of the image being considerednx
 The width of the candidate imageny
 The height of the caandiate imagetx
 The xvalue of the requested point.ty
 The yvalue of the requested point.public void printOut(int[] arr, int mx)
arr
 An input array.mx
 The number of values to put on a line