cz.cuni.jagrlib.iface
Interface StrokeCallback

All Superinterfaces:
java.io.Serializable

public interface StrokeCallback
extends java.io.Serializable

Interface for stroke call-back routines.

Since:
0.02
See Also:
StrokeCallback.java

Field Summary
static int MASK_ALPHA
          Use alpha-channel modulation.
static int MASK_BIT
          Use bit-mask modulation.
static int MASK_COLOR
          Use color modulation.
static int MASK_PARAMETRIC
          Use parametric (relative) coordinates.
static int MASK_WIDTH
          Use line width modulation.
 
Method Summary
 double getAlpha(double t, boolean cyclic)
          Returns alpha-channel information about the given point on the stroke.
 double getAlpha(int i, int length, boolean cyclic)
          Returns alpha-channel information about the given point on the stroke.
 boolean getBit(double t, boolean cyclic)
          Returns boolean information about the given point on the stroke.
 boolean getBit(int i, int length, boolean cyclic)
          Returns boolean information about the given point on the stroke.
 void getColor(double[] color, double t, boolean cyclic)
          Returns color information (RGB) about the given point on the stroke.
 void getColor(double[] color, int i, int length, boolean cyclic)
          Returns color information (RGB) about the given point on the stroke.
 int getFeatures()
          Tells which features are used by this stroke-modulation function.
 double getWidth(double t, boolean cyclic)
          Returns width of the given point on the stroke.
 double getWidth(int i, int length, boolean cyclic)
          Returns width of the given point on the stroke.
 

Field Detail

MASK_BIT

static final int MASK_BIT
Use bit-mask modulation.

See Also:
Constant Field Values

MASK_ALPHA

static final int MASK_ALPHA
Use alpha-channel modulation.

See Also:
Constant Field Values

MASK_COLOR

static final int MASK_COLOR
Use color modulation.

See Also:
Constant Field Values

MASK_WIDTH

static final int MASK_WIDTH
Use line width modulation.

See Also:
Constant Field Values

MASK_PARAMETRIC

static final int MASK_PARAMETRIC
Use parametric (relative) coordinates.

See Also:
Constant Field Values
Method Detail

getFeatures

int getFeatures()
Tells which features are used by this stroke-modulation function.

Returns:
Flags using MASK_* constants.

getBit

boolean getBit(int i,
               int length,
               boolean cyclic)
Returns boolean information about the given point on the stroke.

Parameters:
i - Point's index (from 0 to length-1).
length - Total stroke length.
cyclic - Is that stroke cyclic?.
Returns:
true for the point that has to be drawn.

getBit

boolean getBit(double t,
               boolean cyclic)
Returns boolean information about the given point on the stroke.

Parameters:
t - Point's relative coordinate (from 0.0 to 1.0).
cyclic - Is that stroke cyclic?.
Returns:
true for the point that has to be drawn.

getAlpha

double getAlpha(int i,
                int length,
                boolean cyclic)
Returns alpha-channel information about the given point on the stroke.

Parameters:
i - Point's index (from 0 to length-1).
length - Total stroke length.
cyclic - Is that stroke cyclic?.
Returns:
Alpha (opacity) to draw the point with (from 0.0 to 1.0).

getAlpha

double getAlpha(double t,
                boolean cyclic)
Returns alpha-channel information about the given point on the stroke.

Parameters:
t - Point's relative coordinate (from 0.0 to 1.0).
cyclic - Is that stroke cyclic?.
Returns:
Alpha (opacity) to draw the point with (from 0.0 to 1.0).

getColor

void getColor(double[] color,
              int i,
              int length,
              boolean cyclic)
Returns color information (RGB) about the given point on the stroke.

Parameters:
color - RGB color of the point.
i - Point's index (from 0 to length-1).
length - Total stroke length.
cyclic - Is that stroke cyclic?.

getColor

void getColor(double[] color,
              double t,
              boolean cyclic)
Returns color information (RGB) about the given point on the stroke.

Parameters:
color - RGB color of the point.
t - Point's relative coordinate (from 0.0 to 1.0).
cyclic - Is that stroke cyclic?.

getWidth

double getWidth(int i,
                int length,
                boolean cyclic)
Returns width of the given point on the stroke.

Parameters:
i - Point's index (from 0 to length-1).
length - Total stroke length.
cyclic - Is that stroke cyclic?.
Returns:
Width of the point.

getWidth

double getWidth(double t,
                boolean cyclic)
Returns width of the given point on the stroke.

Parameters:
t - Point's relative coordinate (from 0.0 to 1.0).
cyclic - Is that stroke cyclic?.
Returns:
Width of the point.