class PaintHelper
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.nio.ByteBuffer |
bgraColors |
private static long |
cacheOffset |
private static Image |
colorsImg |
private static float |
FULL_TEXEL_Y |
private static Texture |
gradientCacheTexture |
private static int |
GTEX_CLR_TABLE_MIRRORED_SIZE |
private static int |
GTEX_CLR_TABLE_SIZE |
private static Texture |
gtexCacheTexture |
private static byte[] |
gtexColors |
private static Image |
gtexImg |
private static float |
HALF_TEXEL_Y |
private static int |
MULTI_CACHE_SIZE |
(package private) static int |
MULTI_MAX_FRACTIONS
The maximum number of gradient "stops" supported by our native
fragment shader implementations.
|
private static int |
MULTI_TEXTURE_SIZE
Make the texture width a power of two value larger
than MULTI_MAX_FRACTIONS.
|
private static Color |
PINK |
private static int[] |
previousColors |
private static Affine2D |
scratchXform2D |
private static Affine3D |
scratchXform3D |
private static java.nio.FloatBuffer |
stopVals |
Constructor and Description |
---|
PaintHelper() |
Modifier and Type | Method and Description |
---|---|
(package private) static Texture |
getGradientTexture(ShaderGraphics g,
Gradient paint) |
(package private) static AffineBase |
getImagePatternTx(ShaderGraphics g,
ImagePattern paint,
Shader shader,
BaseTransform renderTx,
float rx,
float ry,
float rw,
float rh) |
(package private) static AffineBase |
getLinearGradientTx(LinearGradient paint,
Shader shader,
BaseTransform renderTx,
float rx,
float ry,
float rw,
float rh) |
(package private) static AffineBase |
getRadialGradientTx(RadialGradient paint,
Shader shader,
BaseTransform renderTx,
float rx,
float ry,
float rw,
float rh) |
(package private) static Texture |
getWrapGradientTexture(ShaderGraphics g) |
static int |
initGradient(Gradient paint) |
(package private) static void |
initGradientTextures(ShaderGraphics g) |
private static void |
insertInterpColor(byte[] colors,
int index,
Color c0,
Color c1,
float t) |
private static float |
len(float dx,
float dy) |
(package private) static PickRay |
project(float x,
float y,
NGCamera cam,
BaseTransform inv,
PickRay tmpray,
Vec3d tmpvec,
Point2D ret) |
(package private) static void |
setImagePattern(ShaderGraphics g,
Shader shader,
ImagePattern paint,
float rx,
float ry,
float rw,
float rh)
We use the plane equation to automatically
map the ImagePattern image to the geometry being rendered.
|
(package private) static void |
setLinearGradient(ShaderGraphics g,
Shader shader,
LinearGradient paint,
float rx,
float ry,
float rw,
float rh)
This method uses techniques that are nearly identical to those
employed in setGradientPaint() above.
|
private static void |
setMultiGradient(Shader shader,
Gradient paint) |
(package private) static void |
setRadialGradient(ShaderGraphics g,
Shader shader,
RadialGradient paint,
float rx,
float ry,
float rw,
float rh)
This method calculates six m** values and a focus adjustment value that
are used by the native fragment shader.
|
private static void |
setTextureGradient(Shader shader,
Gradient paint) |
private static void |
stopsToGtexImage(java.util.List<Stop> stops,
int numStops) |
private static void |
stopsToImage(java.util.List<Stop> stops,
int numStops) |
static final int MULTI_MAX_FRACTIONS
private static final int MULTI_TEXTURE_SIZE
private static final int MULTI_CACHE_SIZE
private static final int GTEX_CLR_TABLE_SIZE
private static final int GTEX_CLR_TABLE_MIRRORED_SIZE
private static final float FULL_TEXEL_Y
private static final float HALF_TEXEL_Y
private static final java.nio.FloatBuffer stopVals
private static final java.nio.ByteBuffer bgraColors
private static final Image colorsImg
private static final int[] previousColors
private static final byte[] gtexColors
private static final Image gtexImg
private static long cacheOffset
private static Texture gradientCacheTexture
private static Texture gtexCacheTexture
private static final Affine2D scratchXform2D
private static final Affine3D scratchXform3D
private static Color PINK
private static float len(float dx, float dy)
static void initGradientTextures(ShaderGraphics g)
static Texture getGradientTexture(ShaderGraphics g, Gradient paint)
static Texture getWrapGradientTexture(ShaderGraphics g)
private static void stopsToImage(java.util.List<Stop> stops, int numStops)
private static void insertInterpColor(byte[] colors, int index, Color c0, Color c1, float t)
private static void stopsToGtexImage(java.util.List<Stop> stops, int numStops)
public static int initGradient(Gradient paint)
static void setLinearGradient(ShaderGraphics g, Shader shader, LinearGradient paint, float rx, float ry, float rw, float rh)
static AffineBase getLinearGradientTx(LinearGradient paint, Shader shader, BaseTransform renderTx, float rx, float ry, float rw, float rh)
static void setRadialGradient(ShaderGraphics g, Shader shader, RadialGradient paint, float rx, float ry, float rw, float rh)
static AffineBase getRadialGradientTx(RadialGradient paint, Shader shader, BaseTransform renderTx, float rx, float ry, float rw, float rh)
static void setImagePattern(ShaderGraphics g, Shader shader, ImagePattern paint, float rx, float ry, float rw, float rh)
static AffineBase getImagePatternTx(ShaderGraphics g, ImagePattern paint, Shader shader, BaseTransform renderTx, float rx, float ry, float rw, float rh)