public class Pixel extends java.lang.Object implements java.lang.Comparable<Pixel>
Modifier and Type | Field and Description |
---|---|
static Pixel |
BLACK
Some constant colors
|
static Pixel |
BLUE |
static Pixel |
GREEN |
static Pixel |
RED |
static Pixel |
WHITE |
Modifier and Type | Method and Description |
---|---|
Pixel |
clip()
create a copy of the pixel with components bounded between 0 and 255
|
int |
compareTo(Pixel o) |
int |
distance(Pixel px)
Determines how similar this pixel is to another.
|
boolean |
equals(java.lang.Object other)
Checks whether this pixel has the same components as the given Object.
|
int |
getBlue()
gets the blue component
|
int[] |
getComponents()
get the array of components
|
int |
getGreen()
gets the green component
|
int |
getRed()
gets the red component
|
int |
hashCode() |
java.lang.String |
toString()
Returns a String representation of this pixel
|
public static final Pixel BLACK
public static final Pixel BLUE
public static final Pixel RED
public static final Pixel GREEN
public static final Pixel WHITE
public Pixel clip()
public int getRed()
public int getGreen()
public int getBlue()
public int[] getComponents()
public int distance(Pixel px)
px
- The other pixel with which to comparepublic java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object