uk.ac.starlink.ttools.plot
Interface Shader


public interface Shader

Defines an object which can modify an sRGB colour as defined by a scalar parameter.

Since:
5 Jun 2007
Author:
Mark Taylor

Method Summary
 void adjustRgba(float[] rgba, float value)
          Modifies the elements of an sRGB colour definition array in place according to a supplied parameter.
 Icon createIcon(boolean horizontal, int width, int height, int xpad, int ypad)
          Returns an icon which displays this shader in action.
 String getName()
          Returns a name for this shader.
 boolean isAbsolute()
          Indicates whether the shading performed by this shader is dependent on the input colour or not.
 

Method Detail

adjustRgba

void adjustRgba(float[] rgba,
                float value)
Modifies the elements of an sRGB colour definition array in place according to a supplied parameter. The supplied rgba array has 4-elements giving red, green blue, alpha values respetively, each element in the range 0 to 1. The value parameter is a value in the range 0 to 1 which parameterises how the rgba array is to be modified.

Parameters:
rgba - 4-element (red,green,blue,alpha) array
value - adjustment parameter in the range 0..1

isAbsolute

boolean isAbsolute()
Indicates whether the shading performed by this shader is dependent on the input colour or not.

Returns:
true if adjustRgba(float[], float) depends on the input colour

getName

String getName()
Returns a name for this shader.

Returns:
short human-readable label

createIcon

Icon createIcon(boolean horizontal,
                int width,
                int height,
                int xpad,
                int ypad)
Returns an icon which displays this shader in action.

Parameters:
horizontal - true for shading running horizontally, false for vertically
width - total icon width in pixels
height - total icon height in pixels
xpad - internal padding in the X direction
ypad - internal padding in the Y direction
Returns:
icon


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.