|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sub_arctic.output.gradient | +--sub_arctic.output.radial_gradient
A class to representing a radial gradient object. This gradient operates about a center point produces an image which is uniform along any vector away from that center point.
Field Summary | |
protected double |
_angle_offset
Angular offset of gradient (in radians). |
protected double |
_fxc
Cache of X coordinate of center point as float. |
protected double |
_fyc
Cache of Y coordinate of center point as float. |
protected int |
_xc
X coordinate of center point. |
protected int |
_yc
Y coordinate of center point. |
Fields inherited from class sub_arctic.output.gradient |
_color_values,
alpha_shift,
blue_shift,
green_shift,
MASK_A_EQ,
MASK_A_GT,
MASK_A_LT,
MASK_B_EQ,
MASK_B_GT,
MASK_B_LT,
MASK_EQ,
red_shift |
Constructor Summary | |
radial_gradient(int[] colors,
int xc_loc,
int yc_loc,
double ang)
Constructor with broken out coordinate values for center point. |
|
radial_gradient(int[] colors,
java.awt.Point cent,
double ang)
Constructor with Point value. The center point and angular offset given here establish a coordinate system for the gradient. |
|
radial_gradient(radial_gradient prototype,
int xc_loc,
int yc_loc,
double ang)
Construct from another radial_gradient and broken out values for a new center point. |
|
radial_gradient(radial_gradient prototype,
java.awt.Point cent,
double ang)
Construct from another radial_gradient and a new center. |
Method Summary | |
protected double |
angle_offset()
Angular offset of gradient (in radians). |
java.awt.Point |
center_point()
Center point. |
float |
map_point_to_index(int ptx,
int pty)
Map the given point (expressed in the coordinate system used for the center point) to an index within the radial gradient color value array. |
loaded_image |
render_image(int x,
int y,
int w,
int h,
int xc,
int yc,
double ang)
Produce an in-memory loaded_image containing the drawing of a gradient with the same color sequence, but using a different center line and/or angular offset. |
loaded_image |
render_image(int x,
int y,
int w,
int h,
int xc,
int yc,
double ang,
loaded_image mask,
int test_code,
boolean invert,
int ref_color,
int outside_mask_color)
Produce an in-memory loaded_image containing the drawing of a masked gradient with the same color sequence, but using a different center line and/or angular offset. |
loaded_image |
render_image(int x,
int y,
int w,
int h,
java.awt.Point cent,
double ang)
Produce an in-memory loaded_image containing the drawing of a gradient with the same color sequence, but using a different center point and/or angular offset. |
loaded_image |
render_image(int x,
int y,
int w,
int h,
java.awt.Point cent,
double ang,
loaded_image mask,
int test_code,
boolean invert,
int ref_color,
int outside_mask_color)
Produce an in-memory loaded_image containing the drawing of a masked gradient with the same color sequence, but using a different center point and/or angular offset. |
int[] |
render_to_data(int x,
int y,
int w,
int h,
int xc,
int yc,
double ang)
Produce an in-memory data array (suitable for constructing an image) containing the drawing of a gradient with the same color sequence, but using a different center point and/or angular offset. |
int[] |
render_to_data(int x,
int y,
int w,
int h,
int xc,
int yc,
double ang,
loaded_image mask,
int test_code,
boolean invert,
int ref_color,
int outside_mask_color)
Produce an in-memory data array (suitable for constructing an image) containing the drawing of a masked gradient with the same color sequence, but using a different center point and/or angular offset. |
int[] |
render_to_data(int x,
int y,
int w,
int h,
java.awt.Point cent,
double ang)
Produce an in-memory data array (suitable for constructing an image) containing the drawing of a gradient with the same color sequence, but using a different center point and/or angular offset. |
int[] |
render_to_data(int x,
int y,
int w,
int h,
java.awt.Point cent,
double ang,
loaded_image mask,
int test_code,
boolean invert,
int ref_color,
int outside_mask_color)
Produce an in-memory data array (suitable for constructing an image) containing the drawing of a masked gradient with the same color sequence, but using a different center point and/or angular offset. |
protected void |
set_angle_offset(double val)
Set the angular offset of gradient (in radians). |
void |
set_center_point(int xval,
int yval)
Set the center point. |
void |
set_center_point(java.awt.Point val)
Set the center point. |
void |
set_xc(int val)
Set the X coordinate of the center point. |
void |
set_y1(int val)
Set the Y coordinate of the center point. |
int |
xc()
X coordinate of center point. |
int |
yc()
Y coordinate of center point. |
Methods inherited from class sub_arctic.output.gradient |
average_of_range,
color_for_pixel,
color_values,
render_image,
render_image,
render_to_data,
render_to_data,
set_color_values |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected int _xc
protected int _yc
protected double _fxc
protected double _fyc
protected double _angle_offset
Constructor Detail |
public radial_gradient(int[] colors, java.awt.Point cent, double ang)
The center point and angular offset given here establish a coordinate system for the gradient. Drawing of the gradient will be done with respect to these coordinates.
int[]
- colors array of color values encoded as integers using
the standard aarrggbb encoding (i.e., alpha value
in the high byte, red value in the next, etc.).
This array must have at least 2 values or an error
will be thrown.Point
- cent center pointdouble
- ang angular offset in radianspublic radial_gradient(int[] colors, int xc_loc, int yc_loc, double ang)
The center point and angular offset given here establish a coordinate system for the gradient. Drawing of the gradient will be done with respect to these coordinates.
int[]
- colors array of color values encoded as integers using
the standard aarrggbb encoding (i.e., alpha value
in the high byte, red value in the next, etc.).
This array must have at least 2 values or an error
will be thrown.int
- xc_loc x coordinate of center pointint
- yc_loc y coordinate of center pointdouble
- ang angular offset in radianspublic radial_gradient(radial_gradient prototype, java.awt.Point cent, double ang)
The center point and angular offset given here establish a coordinate system for the gradient. Drawing of the gradient will be done with respect to these coordinates.
radial_gradient
- prototype object that we get a color sequence from.
Note: we share (not copy) the
color sequence array.Point
- cent new center pointdouble
- ang new angular offset in radianspublic radial_gradient(radial_gradient prototype, int xc_loc, int yc_loc, double ang)
The center point and angular offset given here establish a coordinate system for the gradient. Drawing of the gradient will be done with respect to these coordinates.
radial_gradient
- prototype object that we get a color sequence from.
Note: we share (not copy) the
color sequence array.int
- xc_loc x coordinate of center pointint
- yc_loc y coordinate of center pointdoulbe
- ang angular offset in radiansMethod Detail |
public int xc()
public int yc()
public java.awt.Point center_point()
public void set_xc(int val)
int
- val the new coordinate valuepublic void set_y1(int val)
int
- val the new coordinate valuepublic void set_center_point(int xval, int yval)
int
- xval x coordinate of the new center point valueint
- yval y coordinate of the new center point valuepublic void set_center_point(java.awt.Point val)
Point
- val the new center point valueprotected double angle_offset()
protected void set_angle_offset(double val)
double
- val the new angular offset of the gradient.public float map_point_to_index(int ptx, int pty)
int
- ptx x coordinate of the point to be mappedint
- pty y coordinate of the point to be mappedfloat
- the index position (possibly fractional) that the point
maps to.public int[] render_to_data(int x, int y, int w, int h, int xc, int yc, double ang)
int
- x left of result rectangleint
- y top of result rectangleint
- w width of result rectangleint
- h height of result rectangleint
- xc x coordinate of center pointint
- yc y coordinate of center pointdouble
- ang angular offset in radianspublic int[] render_to_data(int x, int y, int w, int h, java.awt.Point cent, double ang)
int
- x left of result rectangleint
- y top of result rectangleint
- w width of result rectangleint
- h height of result rectanglePoint
- cent center pointdouble
- ang angular offset in radianspublic loaded_image render_image(int x, int y, int w, int h, int xc, int yc, double ang)
int
- x left of result rectangleint
- y top of result rectangleint
- w width of result rectangleint
- h height of result rectangleint
- xc x coordinate of center pointint
- yc y coordinate of center pointdouble
- ang angular offset in radianspublic loaded_image render_image(int x, int y, int w, int h, java.awt.Point cent, double ang)
int
- x left of result rectangleint
- y top of result rectangleint
- w width of result rectangleint
- h height of result rectanglePoint
- cent center pointdouble
- ang angular offset in radianspublic int[] render_to_data(int x, int y, int w, int h, int xc, int yc, double ang, loaded_image mask, int test_code, boolean invert, int ref_color, int outside_mask_color)
int
- x left of result rectangleint
- y top of result rectangleint
- w width of result rectangleint
- h height of result rectangleint
- xc x coordinate of center pointint
- yc y coordinate of center pointdouble
- ang angular offset in radiansloaded_image
- mask the mask to draw through. This must be
of size w, h, or an error will be thrown.int
- test_code test done on mask pixels. Must have one
of the values MASK_EQ, MASK_A_{EQ,LT,GT},
or MASK_B_{EQ,LT,GT}.boolean
- invert indicating if we should invert sense of testint
- ref_color reference color for mask testint
- outside_mask_color color to draw pixels that fall
outside the maskpublic int[] render_to_data(int x, int y, int w, int h, java.awt.Point cent, double ang, loaded_image mask, int test_code, boolean invert, int ref_color, int outside_mask_color)
int
- x left of result rectangleint
- y top of result rectangleint
- w width of result rectangleint
- h height of result rectanglePoint
- cent center pointdouble
- ang angular offset in radiansloaded_image
- mask the mask to draw through. This must be
of size w, h, or an error will be thrown.int
- test_code test done on mask pixels. Must have one
of the values MASK_EQ, MASK_A_{EQ,LT,GT},
or MASK_B_{EQ,LT,GT}.boolean
- invert indicating if we should invert sense of testint
- ref_color reference color for mask testint
- outside_mask_color color to draw pixels that fall
outside the maskpublic loaded_image render_image(int x, int y, int w, int h, int xc, int yc, double ang, loaded_image mask, int test_code, boolean invert, int ref_color, int outside_mask_color)
int
- x left of result rectangleint
- y top of result rectangleint
- w width of result rectangleint
- h height of result rectangleint
- xc x coordinate of center pointint
- yc y coordinate of center pointdouble
- ang angular offset in radiansloaded_image
- mask the mask to draw through. This must be
of size w, h, or an error will be thrown.int
- test_code test done on mask pixels. Must have one
of the values MASK_EQ, MASK_A_{EQ,LT,GT},
or MASK_B_{EQ,LT,GT}.boolean
- invert indicating if we should invert sense of testint
- ref_color reference color for mask testint
- outside_mask_color color to draw pixels that fall
outside the maskpublic loaded_image render_image(int x, int y, int w, int h, java.awt.Point cent, double ang, loaded_image mask, int test_code, boolean invert, int ref_color, int outside_mask_color)
int
- x left of result rectangleint
- y top of result rectangleint
- w width of result rectangleint
- h height of result rectanglePoint
- cent center pointdouble
- ang angular offset in radiansloaded_image
- mask the mask to draw through. This must be
of size w, h, or an error will be thrown.int
- test_code test done on mask pixels. Must have one
of the values MASK_EQ, MASK_A_{EQ,LT,GT},
or MASK_B_{EQ,LT,GT}.boolean
- invert indicating if we should invert sense of testint
- ref_color reference color for mask testint
- outside_mask_color color to draw pixels that fall
outside the mask
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |