|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.media.image.Colorization
public class Colorization
Used to support recoloring images.
| Field Summary | |
|---|---|
protected int[] |
_fhsv
Fixed HSV values for our root color; used when calculating recolorizations using this colorization. |
protected float[] |
_hsv
HSV values for our root color; used when calculating recolorizations using this colorization. |
int |
colorizationId
Every colorization must have a unique id that can be used to compare a particular colorization record with another. |
float[] |
offsets
The adjustments to make to hue, saturation and value. |
float[] |
range
The range around the root color that will be colorized (in delta-hue, delta-saturation, delta-value. |
Color |
rootColor
The root color for the colorization. |
| Constructor Summary | |
|---|---|
Colorization(int colorizationId,
Color rootColor,
float[] range,
float[] offsets)
Constructs a colorization record with the specified identifier. |
|
| Method Summary | |
|---|---|
static int |
distance(int a,
int b,
int N)
Returns the distance between the supplied to numbers modulo N. |
boolean |
equals(Object other)
|
Color |
getColorizedRoot()
Returns the root color adjusted by the colorization. |
int |
hashCode()
|
boolean |
matches(float[] hsv,
int[] fhsv)
Returns true if this colorization matches the supplied color, false otherwise. |
int |
recolorColor(float[] hsv)
Adjusts the supplied color by the offsets in this colorization, taking the appropriate measures for hue (wrapping it around) and saturation and value (clipping). |
static int[] |
toFixedHSV(float[] hsv,
int[] fhsv)
Converts floating point HSV values to a fixed point integer representation. |
String |
toString()
|
String |
toVerboseString()
Returns a long string representation of this colorization. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public int colorizationId
public Color rootColor
public float[] range
public float[] offsets
protected int[] _fhsv
protected float[] _hsv
| Constructor Detail |
|---|
public Colorization(int colorizationId,
Color rootColor,
float[] range,
float[] offsets)
| Method Detail |
|---|
public Color getColorizedRoot()
public int recolorColor(float[] hsv)
public boolean matches(float[] hsv,
int[] fhsv)
hsv - the HSV values for the color in question.fhsv - the HSV values converted to fixed point via toFixedHSV(float[], int[]) for the color
in question.public int hashCode()
hashCode in class Objectpublic boolean equals(Object other)
equals in class Objectpublic String toString()
toString in class Objectpublic String toVerboseString()
public static int[] toFixedHSV(float[] hsv,
int[] fhsv)
hsv - the HSV values to be converted.fhsv - the destination array into which the fixed values will be stored. If this is
null, a new array will be created of the appropriate length.
fhsv parameter if it was non-null or the newly created target
array.
public static int distance(int a,
int b,
int N)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||