public static class FloatFilters.YCoCgFilter extends FloatFilter
FloatFilters.YCbCrFilter
, but edits its input colors in YCoCg color space, or like FloatFilters.HSVFilter
except it
doesn't add, it multiplies. Most of the time you should prefer FloatFilters.YCbCrFilter
as long as it isn't a
performance bottleneck; this method is faster but less accurate. Y is luminance, ranging from 0 (dark) to 1
(light), and affects how bright the color is, but isn't very accurate perceptually. Co is Chrominance(orange) and
Cg is Chrominance(green) (both range from -0.5 to 0.5), two inter-related channels that determine the hue and
vividness of a specific color. When Co and Cg are both 0, the color is grayscale. When Co is 0.5 and Cg is -0.5,
the color is red unless Y is very high or low. When Co is -0.5 and Cg is 0.5, the color is cyan with the same
caveats re: Y. When Co and Cg are both -0.5, the color is blue (same caveats), and when both are 0.5, the color
is yellow.
Constructor and Description |
---|
YCoCgFilter(float luminanceMul,
float orangeMul,
float greenMul) |
Modifier and Type | Method and Description |
---|---|
float |
alter(float color)
Takes a packed float color and produces a potentially-different packed float color that this FloatFilter edited.
|
alter
public YCoCgFilter(float luminanceMul, float orangeMul, float greenMul)
public float alter(float color)
alter
in class FloatFilter
color
- a packed float color, as produced by Color.toFloatBits()
Color.toFloatBits()
Copyright © Eben Howard 2012–2022. All rights reserved.