Class ColorLuts
java.lang.Object
com.codename1.gpu.ColorLuts
Builds colour lookup strips for PostProcess.setColorLut. Each method
returns the 256 by 16 ARGB pixels; upload them with
GraphicsDevice.createTexture(ColorLuts.WIDTH, ColorLuts.HEIGHT, pixels).
import com.codename1.gpu.*;
void grade(GraphicsDevice device, PostProcess post) {
Texture look = device.createTexture(ColorLuts.WIDTH, ColorLuts.HEIGHT,
ColorLuts.filmic(0.6f, 0.15f));
post.setColorLut(look, 1f);
}
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic int[]filmic(float warmth, float fade) Returns a film look: warm highlights, cool shadows and lifted blacks.static int[]identity()Returns the table that changes nothing, a starting point to edit.static int[]posterize(int levels) Returns a table that snaps every channel to a few levels, for a poster or cel look.
-
Field Details
-
WIDTH
public static final int WIDTHThe strip's width in pixels.- See Also:
-
HEIGHT
public static final int HEIGHTThe strip's height in pixels.- See Also:
-
-
Method Details
-
identity
public static int[] identity()Returns the table that changes nothing, a starting point to edit. -
filmic
public static int[] filmic(float warmth, float fade) Returns a film look: warm highlights, cool shadows and lifted blacks.
Parameters
-
warmth: 0 to 1, how far highlights and shadows are split -
fade: 0 to 0.3, how far black is lifted
-
-
posterize
public static int[] posterize(int levels) Returns a table that snaps every channel to a few levels, for a poster or cel look.
Parameters
levels: levels per channel, 2 to 16
-