|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object core.image.ScalarImage core.image.AccumImage
Stores a monochrome float image with alpha = < width, height, float-buffer, alpha-buffer, minalpha, coverage >. An AccumImage extends ScalarImage to include an alpha component for every scalar value. The alpha values are pre-multiplied into the scalar, so to obtain the scalar value at a pixel, the alpha must be divided out of it. This sort of image is useful for accumulation operations. Each AccumImage also automatically maintains information about the coverage of the image. Every time a pixel surpasses the "minalpha" requirement, "coverage" is incremented to indicated the total count of such pixels.
Field Summary | |
float[] |
a
a[] stores all the alpha values for the corresponding array f[] |
int |
coverage
coverage indicates the number of pixels whose alpha exceeds "minalpha" |
double |
minalpha
minalpha defines the minimum alpha required for a pixel to be "covered" |
Fields inherited from class core.image.ScalarImage |
f, height, offset, size, width |
Constructor Summary | |
AccumImage(int width,
int height)
Constructs a new AccumImage = < width, height, zero-buffer, zero-buffer, 1.0, 0 > |
Method Summary | |
void |
Accumulate(int x,
int y,
double s)
Adds "s" to the scalar value at (x, y) and increments the corresponding alpha value. |
void |
Accumulate(int x,
int y,
double s,
double sa)
Adds "s" and "sa" to the scalar and alpha values at (x, y) if it is in-bounds. |
void |
AccumulateBilinear(double x,
double y,
double s)
Bilinearly accumulates "s" to the four integer grid points surrounding the continuous coordinate (x, y), weighting the alpha accumulation bilinearly as well. |
void |
AccumulateBilinear(Vec2 v,
double s)
Bilinearly accumulates "s" to the four integer grid points surrounding the continuous coordinate "v", weighting the alpha accumulation bilinearly as well. |
void |
Clear()
Clears both the scalar and alpha components in "this" |
void |
Copy(AccumImage image)
Copies the scalar and alpha values from the top-left corner of "image" to "this" Requires: "image" is at least as large as "this" |
void |
Copy(AccumImage image,
int xorigin,
int yorigin)
Copies the scalar and alpha values from the sub-window of "image" starting at (xorigin, yorigin) to "this". |
double |
get(int x,
int y)
Returns: the value at (x, y) with the alpha divided out Requires: 0<=x |
double |
getAlpha(int x,
int y)
Returns: the alpha value at (x, y) Requires: 0<=x |
boolean |
hasSingularity()
Returns: true if an scalar or alpha value in "this" is invalid |
void |
Normalize()
Divides out the alpha component in "this", renormalizing it to 1.0 |
void |
Normalize(int x,
int y)
Divides out the alpha component at coordinate (x, y) in "this", renormalizing it to 1.0 Requires: 0<=x |
void |
Set(int x,
int y,
double s,
double sa)
Sets the scalar and alpha value at (x, y) to (s, sa). |
void |
SetAlpha()
Sets the scalar component of "this" to the alpha component |
void |
SetZero()
Sets the samples in "this" to zero, with an alpha of 1.0 |
Methods inherited from class core.image.ScalarImage |
Add, Clamp, Convolve3x3, Copy, Copy, getBilinear, getBilinear, inBounds, inBounds, inBounds, Modulate, Power, Rescale, Set, SetRandom, SetRandom, StretchBilinear, Vec2FieldMagnitude, Vec2FieldZero |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public float[] a
public double minalpha
public int coverage
Constructor Detail |
public AccumImage(int width, int height)
Method Detail |
public void SetZero()
SetZero
in class ScalarImage
public void Clear()
Clear
in class ScalarImage
public void SetAlpha()
public void Copy(AccumImage image, int xorigin, int yorigin)
public void Copy(AccumImage image)
public void Normalize()
public void Normalize(int x, int y)
public double get(int x, int y)
get
in class ScalarImage
public double getAlpha(int x, int y)
public void Set(int x, int y, double s, double sa)
public void Accumulate(int x, int y, double s)
Accumulate
in class ScalarImage
public void Accumulate(int x, int y, double s, double sa)
public void AccumulateBilinear(double x, double y, double s)
AccumulateBilinear
in class ScalarImage
public void AccumulateBilinear(Vec2 v, double s)
AccumulateBilinear
in class ScalarImage
public boolean hasSingularity()
hasSingularity
in class ScalarImage
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |