public class Pixel extends Object implements Point2d, Cloneable
| Modifier and Type | Field and Description |
|---|---|
int |
x
The x-coordinate of this pixel
|
int |
y
The y-coordinate of this pixel
|
| Constructor and Description |
|---|
Pixel()
Construct a pixel at the origin
|
Pixel(int x,
int y)
Construct a pixel with the given coordinates.
|
| Modifier and Type | Method and Description |
|---|---|
String |
asciiHeader()
Header for ascii input.
|
byte[] |
binaryHeader()
Header for binary input.
|
Pixel |
clone() |
Pixel |
copy()
Clone the point
|
void |
copyFrom(Point2d p)
Copy the values of the given point into this point.
|
boolean |
equals(Object o) |
int |
getDimensions() |
Integer |
getOrdinate(int dimension)
Get the ordinate value for a specific dimension.
|
float |
getX() |
float |
getY() |
int |
hashCode() |
Point2d |
minus(Point2d a)
Take point point from another point such that return = this - a
|
void |
readASCII(Scanner in)
Read internal state from in.
|
void |
readBinary(DataInput in)
Read internal state from in.
|
void |
setOrdinate(int dimension,
Number value)
Set the ordinate value for a specific dimension.
|
void |
setX(float x)
Set x coordinate of point
|
void |
setY(float y)
Set y coordinate of point
|
String |
toString() |
Pixel |
transform(Jama.Matrix transform)
Transform the point by the given matrix
|
Pixel |
transformInplace(Jama.Matrix transform)
Inplace transform the point by the given matrix.
|
void |
translate(float x,
float y)
Translate the position of the point by the given amounts
|
void |
translate(Point2d v)
Translate the position of the point by the given amounts
|
void |
writeASCII(PrintWriter out)
Write the content of this as ascii to out.
|
void |
writeBinary(DataOutput out)
Write the content of this as binary to out.
|
public int x
public int y
public Pixel(int x, int y)
x - The x-coordinate of the pixely - The y-coordinate of the pixelpublic Pixel()
public boolean equals(Object o)
equals in class ObjectObject.equals(java.lang.Object)public int hashCode()
hashCode in class ObjectObject.hashCode()public String toString()
toString in class ObjectObject.toString()public float getX()
getX in interface Point2dPoint2d.getX()public float getY()
getY in interface Point2dPoint2d.getY()public void setX(float x)
setX in interface Point2dx - x-coordinatePoint2d.setX(float)public void setY(float y)
setY in interface Point2dy - y-coordinatePoint2d.setY(float)public void copyFrom(Point2d p)
copyFrom in interface Point2dp - The point to copy values from.Point2d.copyFrom(org.openimaj.math.geometry.point.Point2d)public Integer getOrdinate(int dimension)
getOrdinate in interface Coordinatedimension - The index of the dimension we are interested inCoordinate.getOrdinate(int)public int getDimensions()
getDimensions in interface CoordinateCoordinate.getDimensions()public void translate(float x, float y)
Point2dpublic Pixel transform(Jama.Matrix transform)
Point2dpublic Pixel transformInplace(Jama.Matrix transform)
transform - the transformpublic Point2d minus(Point2d a)
Point2dpublic void readASCII(Scanner in) throws IOException
ReadableASCIIreadASCII in interface ReadableASCIIin - source to read from.IOException - an error reading inputpublic String asciiHeader()
ReadableASCIIasciiHeader in interface ReadableASCIIasciiHeader in interface WriteableASCIIpublic void readBinary(DataInput in) throws IOException
ReadableBinaryreadBinary in interface ReadableBinaryin - source to read from.IOException - an error reading inputpublic byte[] binaryHeader()
ReadableBinarybinaryHeader in interface ReadableBinarybinaryHeader in interface WriteableBinarypublic void writeASCII(PrintWriter out) throws IOException
WriteableASCIIwriteASCII in interface WriteableASCIIout - sink to write toIOException - an error writing to outpublic void writeBinary(DataOutput out) throws IOException
WriteableBinarywriteBinary in interface WriteableBinaryout - sink to write toIOException - an error writing to outpublic void translate(Point2d v)
Point2dpublic void setOrdinate(int dimension, Number value)
CoordinatesetOrdinate in interface Coordinatedimension - The index of the dimension we are interested invalue - The value of the ordinate of the given dimension.