|
|||||||||
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.linear_gradient
A class to representing a linear gradient object. This gradient operates along an orientation line and produces an image which is semetric with respect to that line.
Field Summary | |
protected float |
_fx1
Cache of x1 as a float. |
protected float |
_fx2
Cache of x2 as a float. |
protected float |
_fy1
Cache of y1 as a float. |
protected float |
_fy2
Cache of y2 as a float. |
protected int |
_x1
X coordinate of first end point of orientation line. |
protected int |
_x2
X coordinate of second end point of orientation line. |
protected int |
_y1
Y coordinate of first end point of orientation line. |
protected int |
_y2
Y coordinate of second end point of orientation line. |
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 | |
linear_gradient(int[] colors,
int x2_loc,
int y2_loc)
Constructor which defaults to a reference line starting at 0,0 and ending at a given point (broken out coordinate form). |
|
linear_gradient(int[] colors,
int x1_loc,
int y1_loc,
int x2_loc,
int y2_loc)
Constructor with broken out coordinate values. |
|
linear_gradient(int[] colors,
java.awt.Point pt2_val)
Constructor which defaults to a reference line starting at 0,0 and ending at a given point (Point form). |
|
linear_gradient(int[] colors,
java.awt.Point pt1_val,
java.awt.Point pt2_val)
Constructor with Point values. The reference line given here establishes a coordinate system for the gradient. |
|
linear_gradient(linear_gradient prototype,
int x2_loc,
int y2_loc)
Construct from another linear_gradient defaulting to a reference line starting at 0,0 and ending at a given point (broken out coord form). |
|
linear_gradient(linear_gradient prototype,
int x1_loc,
int y1_loc,
int x2_loc,
int y2_loc)
Construct from another linear_gradient and broken out values. |
|
linear_gradient(linear_gradient prototype,
java.awt.Point pt2_val)
Construct from another linear_gradient defaulting to a reference line starting at 0,0 and ending at a given point (Point form). |
|
linear_gradient(linear_gradient prototype,
java.awt.Point pt1_val,
java.awt.Point pt2_val)
Construct from another linear_gradient and Point values. |
Method Summary | |
float |
map_point_to_index(int ptx,
int pty)
Map the given point (expressed in the coordinate system used for the orientation line) to an index within the linear gradient color value array. |
java.awt.Point |
pt1()
First end point of orientation line. |
java.awt.Point |
pt2()
Second end point of orientation line. |
loaded_image |
render_image(int x,
int y,
int w,
int h,
int x1,
int y1,
int x2,
int y2)
Produce an in-memory loaded_image containing the drawing of a gradient with the same color sequence, but using a different orientation line. |
loaded_image |
render_image(int x,
int y,
int w,
int h,
int x1,
int y1,
int x2,
int y2,
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 orientation line. |
loaded_image |
render_image(int x,
int y,
int w,
int h,
java.awt.Point pt1,
java.awt.Point pt2)
Produce an in-memory loaded_image containing the drawing of a gradient with the same color sequence, but using a different orientation line. |
loaded_image |
render_image(int x,
int y,
int w,
int h,
java.awt.Point pt1,
java.awt.Point pt2,
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 orientation line. |
int[] |
render_to_data(int x,
int y,
int w,
int h,
int x1,
int y1,
int x2,
int y2)
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 orientation line. |
int[] |
render_to_data(int x,
int y,
int w,
int h,
int x1,
int y1,
int x2,
int y2,
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 orientation line. |
int[] |
render_to_data(int x,
int y,
int w,
int h,
java.awt.Point pt1,
java.awt.Point pt2)
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 orientation line. |
int[] |
render_to_data(int x,
int y,
int w,
int h,
java.awt.Point pt1,
java.awt.Point pt2,
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 orientation line. |
void |
set_points(int x1_val,
int y1_val,
int x2_val,
int y2_val)
Set both end points of orientation line. |
void |
set_points(java.awt.Point pnt1,
java.awt.Point pnt2)
Set both end points of orientation line. |
void |
set_pt1(java.awt.Point val)
Set the first end point of orientation line. |
void |
set_pt2(java.awt.Point val)
Set the second end point of orientation line. |
void |
set_x1(int val)
Set the X coordinate of first end point of orientation line. |
void |
set_x2(int val)
Set the X coordinate of second end point of orientation line. |
void |
set_y1(int val)
Set the Y coordinate of first end point of orientation line. |
void |
set_y2(int val)
Set the Y coordinate of second end point of orientation line. |
int |
x1()
X coordinate of first end point of orientation line. |
int |
x2()
X coordinate of second end point of orientation line. |
int |
y1()
Y coordinate of first end point of orientation line. |
int |
y2()
Y coordinate of second end point of orientation line. |
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 _x1
protected int _y1
protected int _x2
protected int _y2
protected float _fx1
protected float _fy1
protected float _fx2
protected float _fy2
Constructor Detail |
public linear_gradient(int[] colors, java.awt.Point pt1_val, java.awt.Point pt2_val)
The reference line given here establishes 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
- pt1_val first point of orientation linePoint
- pt2_val first point of orientation linepublic linear_gradient(int[] colors, int x1_loc, int y1_loc, int x2_loc, int y2_loc)
The reference line given here establishes 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
- x1_loc x coordinate of first point of orientation lineint
- y1_loc y coordinate of first point of orientation lineint
- x2_loc x coordinate of second point of orientation lineint
- y2_loc y coordinate of second point of orientation linepublic linear_gradient(int[] colors, java.awt.Point pt2_val)
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
- pt2_val second point of orientation linepublic linear_gradient(int[] colors, int x2_loc, int y2_loc)
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
- x2_loc x coordinate of second point of orientation lineint
- y2_loc y coordinate of second point of orientation linepublic linear_gradient(linear_gradient prototype, java.awt.Point pt1_val, java.awt.Point pt2_val)
The reference line given here establishes a coordinate system for the gradient. Drawing of the gradient will be done with respect to these coordinates.
linear_gradient
- prototype object that we get a color sequence from.
Note: we share (not copy) the
color sequence array.Point
- pt1_val first point of orientation linePoint
- pt2_val first point of orientation linepublic linear_gradient(linear_gradient prototype, int x1_loc, int y1_loc, int x2_loc, int y2_loc)
The reference line given here establishes a coordinate system for the gradient. Drawing of the gradient will be done with respect to these coordinates.
linear_gradient
- prototype object that we get a color sequence from.
Note: we share (not copy) the
color sequence array.int
- x1_loc x coordinate of first point of orientation lineint
- y1_loc y coordinate of first point of orientation lineint
- x2_loc x coordinate of second point of orientation lineint
- y2_loc y coordinate of second point of orientation linepublic linear_gradient(linear_gradient prototype, java.awt.Point pt2_val)
The reference line given here establishes a coordinate system for the gradient. Drawing of the gradient will be done with respect to these coordinates.
linear_gradient
- prototype object that we get a color sequence from.
Note: we share (not copy) the
color sequence array.Point
- pt2_val second point of orientation linepublic linear_gradient(linear_gradient prototype, int x2_loc, int y2_loc)
The reference line given here establishes a coordinate system for the gradient. Drawing of the gradient will be done with respect to these coordinates.
linear_gradient
- prototype object that we get a color sequence from.
Note: we share (not copy) the
color sequence array.int
- x2_loc x coordinate of second point of orientation lineint
- y2_loc y coordinate of second point of orientation lineMethod Detail |
public int x1()
public int y1()
public java.awt.Point pt1()
public int x2()
public int y2()
public java.awt.Point pt2()
public void set_x1(int val)
int
- val the new coordinate valuepublic void set_y1(int val)
int
- val the new coordinate valuepublic void set_pt1(java.awt.Point val)
Point
- val the new endpoint valuepublic void set_x2(int val)
int
- val the new coordinate valuepublic void set_y2(int val)
int
- val the new coordinate valuepublic void set_pt2(java.awt.Point val)
Point
- val the new endpoint valuepublic void set_points(int x1_val, int y1_val, int x2_val, int y2_val)
int
- x1_val x coordinate of the new first endpoint valueint
- y1_val y coordinate of the new first endpoint valueint
- x2_val x coordinate of the new second endpoint valueint
- y2_val y coordinate of the new second endpoint valuepublic void set_points(java.awt.Point pnt1, java.awt.Point pnt2)
Point
- pnt1 the new first endpoint valuePoint
- pnt2 the new first endpoint valuepublic 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 x1, int y1, int x2, int y2)
int
- x left of result rectangleint
- y top of result rectangleint
- w width of result rectangleint
- h height of result rectangleint
- x1 x coordinate of first point of orientation lineint
- y1 y coordinate of first point of orientation lineint
- x2 x coordinate of second point of orientation lineint
- y2 y coordinate of second point of orientation linepublic int[] render_to_data(int x, int y, int w, int h, java.awt.Point pt1, java.awt.Point pt2)
int
- x left of result rectangleint
- y top of result rectangleint
- w width of result rectangleint
- h height of result rectanglePoint
- pt1 first point of orientation linePoint
- pt2 second point of orientation linepublic loaded_image render_image(int x, int y, int w, int h, int x1, int y1, int x2, int y2)
int
- x left of result rectangleint
- y top of result rectangleint
- w width of result rectangleint
- h height of result rectangleint
- x1 x coordinate of first point of orientation lineint
- y1 y coordinate of first point of orientation lineint
- x2 x coordinate of second point of orientation lineint
- y2 y coordinate of second point of orientation linepublic loaded_image render_image(int x, int y, int w, int h, java.awt.Point pt1, java.awt.Point pt2)
int
- x left of result rectangleint
- y top of result rectangleint
- w width of result rectangleint
- h height of result rectanglePoint
- pt1 first point of orientation linePoint
- pt2 second point of orientation linepublic int[] render_to_data(int x, int y, int w, int h, int x1, int y1, int x2, int y2, 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
- x1 x coordinate of first point of orientation lineint
- y1 y coordinate of first point of orientation lineint
- x2 x coordinate of second point of orientation lineint
- y2 y coordinate of second point of orientation lineloaded_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 pt1, java.awt.Point pt2, 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
- pt1 first point of orientation linePoint
- pt2 second point of orientation lineloaded_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 x1, int y1, int x2, int y2, 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
- x1 x coordinate of first point of orientation lineint
- y1 y coordinate of first point of orientation lineint
- x2 x coordinate of second point of orientation lineint
- y2 y coordinate of second point of orientation linePoint
- pt1 first point of orientation linePoint
- pt2 second point of orientation lineloaded_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 pt1, java.awt.Point pt2, 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
- pt1 first point of orientation linePoint
- pt2 second point of orientation lineloaded_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 |