public class PixelUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
ADD |
static int |
ALPHA |
static int |
ALPHA_TO_GRAY |
static int |
AVERAGE |
static int |
CLEAR |
static int |
COLOR |
static int |
DIFFERENCE |
static int |
DISSOLVE |
static int |
DST_IN |
static int |
EXCHANGE |
static int |
HUE |
static int |
MAX |
static int |
MIN |
static int |
MULTIPLY |
static int |
NORMAL |
static int |
OVERLAY |
static int |
REPLACE |
static int |
SATURATION |
static int |
SCREEN |
static int |
SUBTRACT |
static int |
VALUE |
Constructor and Description |
---|
PixelUtils() |
Modifier and Type | Method and Description |
---|---|
static int |
brightness(int rgb)
Return the brightness.
|
static int |
clamp(int c)
Clamp a value to the range 0..255.
|
static int |
combinePixels(int rgb1,
int rgb2,
int op)
Return rgb1 painted onto rgb2.
|
static int |
combinePixels(int rgb1,
int rgb2,
int op,
int extraAlpha)
Return rgb1 painted onto rgb2.
|
static int |
combinePixels(int rgb1,
int rgb2,
int op,
int extraAlpha,
int channelMask)
Return rgb1 painted onto rgb2.
|
static int |
interpolate(int v1,
int v2,
float f)
Interpolate between two values.
|
static boolean |
nearColors(int rgb1,
int rgb2,
int tolerance)
Return true of the colors are near each other.
|
public static final int REPLACE
public static final int NORMAL
public static final int MIN
public static final int MAX
public static final int ADD
public static final int SUBTRACT
public static final int DIFFERENCE
public static final int MULTIPLY
public static final int HUE
public static final int SATURATION
public static final int VALUE
public static final int COLOR
public static final int SCREEN
public static final int AVERAGE
public static final int OVERLAY
public static final int CLEAR
public static final int EXCHANGE
public static final int DISSOLVE
public static final int DST_IN
public static final int ALPHA
public static final int ALPHA_TO_GRAY
public static int clamp(int c)
c
- The value to be clampedpublic static int interpolate(int v1, int v2, float f)
v1
- The first valuev2
- The second valuef
- The amount of interpolation, typically between 0 and 1.public static int brightness(int rgb)
rgb
- RFB encoded.public static boolean nearColors(int rgb1, int rgb2, int tolerance)
rgb1
- The first colorrgb2
- The second colortolerance
- The maximum difference for r, g, and b
between the two values.public static int combinePixels(int rgb1, int rgb2, int op)
rgb1
- The first pixel.rgb2
- The second pixel.op
- The operation as defined by this class.public static int combinePixels(int rgb1, int rgb2, int op, int extraAlpha, int channelMask)
rgb1
- The first pixel.rgb2
- The second pixel.op
- The operation as defined by this class.extraAlpha
- The extra alpha.channelMask
- The channel mask.public static int combinePixels(int rgb1, int rgb2, int op, int extraAlpha)
rgb1
- The first pixel.rgb2
- The second pixel.op
- The operation as defined by this class.extraAlpha
- The extra alpha.