juno.media.geometry Module

Licence
See licence.txt for use and distribution terms.

struct Point;

Represents a pair of x- and y-coordinates that defines a point in a two-dimensional plane.

int x;

Gets or sets the x-coordinate.

int y;

Gets or sets the y-coordinate.

static Point opCall(int x, int y);

Initializes a new instance with the specified coordintates.

Parameters
int x
The horizontal position.
int y
The vertical position.

bool equals(Point other);
bool opEquals(Point other);

Tests whether the specified Point has the same coordinates as this instance.

Parameters
Point other
The Point to test.

Returns
true if other has the same x- and y-coordinates as this instance; otherwise, false.

static Point ceiling(PointF value);

Converts the specified PointF to a Point by rounding the PointF values to the next highest integer.

Parameters
PointF value
The PointF to convert.

Returns
The Point this method converts to.

static Point round(PointF value);

Converts the specified PointF to a Point by rounding the Point values to the nearest integer.

Parameters
PointF value
The PointF to convert.

Returns
The Point this method converts to.

void offset(Point p);

Translates this instance by the specified amount.

Parameters
Point p
The Point used to offset this instance.

void offset(int x, int y);

Translates this instance by the specified amount.

Parameters
int x
The amount to offset the x-coordinate.
int y
The amount to offset the y-coordinate.

bool isEmpty();

Gets a value indicating whether this instance is empty.

Returns
true if both x and y are zero; otherwise, false.

static Point add(Point pt, Size sz);
Point opAdd(Size sz);
void opAddAssign(Size sz);

Adds the specified Size to the specified Point.

Parameters
Point pt
The Point to add.
Size sz
The Size to add.

Returns
The Point that is the result of the addition operation.

static Point subtract(Point pt, Size sz);
Point opSub(Size sz);
void opSubAssign(Size sz);

Subtracts the specified Size from the specified Point.

Parameters
Point pt
The Point to be subtracted from.
Size sz
The Size to subtract from the Point.

Returns
The Point that is the result of the subtraction operation.

struct PointF;

Represents a pair of floating-point x- and y-coordinates that defines a point in a two-dimensional plane.

float x;

Gets or sets the x-coordinate.

float y;

Gets or sets the y-coordinate.

static PointF opCall(float x, float y);

Initializes a new instance with the specified coordintates.

Parameters
float x
The horizontal position.
float y
The vertical position.

static PointF opCall(Point p);

Converts the specified Point structure to a PointF structure.

Parameters
Point p
The Point to be converted.

Returns
The PointF that results from the conversion.

bool equals(PointF other);
bool opEquals(PointF other);

Tests whether the specified PointF has the same coordinates as this instance.

Parameters
PointF other
The PointF to test.

Returns
true if other has the same x- and y-coordinates as this instance; otherwise, false.

bool isEmpty();

Gets a value indicating whether this instance is empty.

Returns
true if both x and y are zero; otherwise, false.

static PointF add(PointF pt, SizeF sz);
PointF opAdd(SizeF sz);
void opAddAssign(SizeF sz);

Adds the specified SizeF to the specified PointF.

Parameters
PointF pt
The PointF to add.
SizeF sz
The SizeF to add.

Returns
The PointF that is the result of the addition operation.

static PointF subtract(PointF pt, SizeF sz);
PointF opSub(SizeF sz);
void opSubAssign(SizeF sz);

Subtracts the specified SizeF from the specified PointF.

Parameters
PointF pt
The PointF to be subtracted from.
SizeF sz
The SizeF to subtract from the Point.

Returns
The PointF that is the result of the subtraction operation.

struct Size;

Represents a pair of integers, typically the width and height of a rectangle.

int width;

Gets or sets the horizontal component.

int height;

Gets or sets the vertical component.

static Size empty;

Represents a Size that has width and height values set to zero.

static Size opCall(int width, int height);

Initializes a new instance from the specified dimensions.

Parameters
int width
The horizontal component.
int height
The vertical component.

bool equals(Size other);
bool opEquals(Size other);

Tests whether the specified Size has the same dimensions as this instance.

Parameters
Size other
The Size to test.

Returns
true if other has the same width and height as this instance; otherwise, false.

static Size ceiling(SizeF value);

Converts the specified SizeF structure to a Size structure by rounding the values of the Size structure to the next highest integer.

Parameters
SizeF value
The SizeF structure to convert.

Returns
The Size structure this method converts to.

static Size round(SizeF value);

Converts the specified SizeF structure to a Size structure by rounding the values of the SizeF structure to the nearest integer.

Parameters

Returns
The Size structure this methods converts to.

static Size truncate(SizeF value);

Converts the specified SizeF structure to a Size structure by truncating the values of the SizeF structure to the next lowest integer values.

Parameters
SizeF value
The SizeF structure to convert.

Returns
The Size structure this method converts to.

bool isEmpty();

Tests whether this instance has width and height set to zero.

Returns
true if both width and height are zero; otherwise, false.

static Size add(Size sz1, Size sz2);
Size opAdd(Size other);
void opAddAssign(Size other);

Adds the width and height of one Size structure to the width and height of another.

Parameters
Size sz1
The first Size to add.
Size sz2
The second Size to add.

Returns
A Size structure that is the result of the addition operation.

static Size subtract(Size sz1, Size sz2);
Size opSub(Size other);
void opSubAssign(Size other);

Subtracts the width and height of one Size structure from the width and height of another.

Parameters
Size sz1
The first Size to subtract.
Size sz2
The second Size to subtract.

Returns
A Size structure that is the result of the subtraction operation.

struct SizeF;

Represents a pair of floating-point numbers, typically the width and height of a rectangle.

float width;

Gets or sets the horizontal component.

float height;

Gets or sets the vertical component.

static SizeF empty;

Represents a Size that has width and height values set to zero.

static SizeF opCall(float width, float height);

Initializes a new instance from the specified dimensions.

Parameters
float width
The horizontal component.
float height
The vertical component.

static SizeF opCall(Size sz);

Converts the specified Size to a SizeF.

Parameters
Size sz
The Size to convert.

Returns
The SizeF structure to which this operator converts.

bool equals(SizeF other);
bool opEquals(SizeF other);

Tests whether the specified SizeF has the same dimensions as this instance.

Parameters
SizeF other
The SizeF to test.

Returns
true if other has the same width and height as this instance; otherwise, false.

bool isEmpty();

Tests whether this instance has width and height set to zero.

Returns
true if both width and height are zero; otherwise, false.

static SizeF add(SizeF sz1, SizeF sz2);
SizeF opAdd(SizeF sz);
void opAddAssign(SizeF sz);

Adds the width and height of one FSize structure to the width and height of another.

Parameters
SizeF sz1
The first SizeF to add.
SizeF sz2
The second SizeF to add.

Returns
A SizeF structure that is the result of the addition operation.

static SizeF subtract(SizeF sz1, SizeF sz2);
SizeF opSub(SizeF sz);
void opSubAssign(SizeF sz);

Subtracts the width and height of one SizeF structure from the width and height of another.

Parameters
SizeF sz1
The first SizeF to subtract.
SizeF sz2
The second SizeF to subtract.

Returns
A SizeF structure that is the result of the subtraction operation.

struct Rect;

Represents a set of four integers that define the location and size of a rectangle.

int x;

Gets or sets the x-coordinate.

int y;

Gets of sets the y-coordinate.

int width;

Gets or sets the width component.

int height;

Gets or sets the height component.

static Rect empty;

Represents an uninitialized Rect structure.

static Rect opCall(int x, int y, int width, int height);

Initializes a new instance with the specified location and size.

Parameters
int x
The x-coordinate.
int y
The y-coordinate.
int width
The width.
int height
The height.

static Rect opCall(Point location, Size size);

Initializes a new instance with the specified location and size.

Parameters
Point location
The upper-left corner.
Size size
The width and height.

static Rect fromLTRB(int left, int top, int right, int bottom);

Creates a Rect structure width the specified edge locations.

Parameters
int left
The x-coordinate of the upper-left corner.
int top
The y-coordinate of the upper-left corner.
int right
The x-coordinate of the lower-right corner.
int bottom
The y-coordinate of the lower-right corner.

Returns
The new Rect that this method creates.

bool equals(Rect other);
bool opEquals(Rect other);

Tests whether the specified Rect structure has the same location and size as this instance.

Parameters
Rect other
The Rect to test.

Returns
true if the x, y, width and height properties of other are equal to the corresponding properties of this instance; otherwise, false.

static Rect ceiling(RectF value);

Converts the specified RectF structure to a Rect structure by rounding the RectF values to the next highest integers.

Parameters
RectF value
The RectF to convert.

Returns
The Rect structure that this method converts to.

static Rect round(RectF value);

Converts the specified RectF structure to a Rect structure by rounding the RectF values to the nearest integers.

Parameters
RectF value
The RectF to convert.

Returns
The Rect structure that this method converts to.

static Rect truncate(RectF value);

Converts the specified RectF structure to a Rect structure by truncating the RectF values.

Parameters
RectF value
The RectF to convert.

Returns
The Rect structure that this method converts to.

static Rect unionRects(Rect a, Rect b);

Gets a Rect structure containing the union of two Rect structures.

Parameters
Rect a
A Rect to union.
Rect b
A Rect to union.

Returns
A Rect structure that bounds the union of the two Rect structures.

bool contains(Point pt);

Determines if the specified point is contained within this instance.

Parameters
Point pt
The Point to test.

Returns
true if the point represented by pt is contained within this instance; otherwise, false.

bool contains(int x, int y);

Determines if the specified point is contained within this instance.

Parameters
int x
The x-coordinate of the point to test.
int y
The y-coordinate of the point to test.

Returns
true if the point defined by x and y is contained within this instance; otherwise, false.

bool contains(Rect rect);

Determines if the specified rectangular region is entirely contained within this instance.

Parameters
Rect rect
The rectangular region to test.

Returns
true if the rectangular region represented by rect is entirely contained within this instance; otherwise, false.

static Rect inflate(Rect rect, int x, int y);

Returns an inflated copy of the specified Rect structure.

Parameters
Rect rect
The Rect to be copied.
int x
The amount to inflate the copy horizontally.
int y
The amount to inflate the copy vertically.

Returns
The inflated Rect.

void inflate(Size size);

Inflates this instance by the specified amount.

Parameters
Size size
The amount to inflate this instance.

void inflate(int width, int height);

Inflates this instance by the specified amount.

Parameters
x
The amount to inflate this instance horizontally.
y
The amount to inflate this instance vertically.

void offset(Point pos);

Adjust the location of this instance by the specified amount.

Parameters
Point pos
The amount to offset the location.

void offset(int x, int y);

Adjust the location of this instance by the specified amount.

Parameters
int x
The horizontal offset.
int y
The vertical offset.

bool intersectsWith(Rect rect);

Determines whether this instance intersects with rect.

Parameters
Rect rect
The Rect to test.

Returns
true if there is any intersection; otherwise, false.

static Rect intersect(Rect a, Rect b);

Returns a Rect structure that represents the intersection of two Rect structures.

Parameters
Rect a
A Rect to intersect.
Rect b
A Rect to intersect.

Returns
A Rect that represents the intersection of a and b.

void intersect(Rect rect);

Replaces this instance with the intersection of itself and the specified Rect structure.

Parameters
Rect rect
The Rect with which to intersect.

int left();

Gets the x-coordinate of the left edge of this Rect structure.

int top();

Gets the y-coordinate of the top edge of this Rect structure.

int right();

Gets the x-coordinate that is the sum of the x and width values.

int bottom();

Gets the y-coordinate that is the sum of the y and height values.

void location(Point value);
Point location();

Gets or sets the coordinates of the upper-left corner of this Rect structure.

void size(Size value);
Size size();

Gets or sets the size of this Rect structure.

bool isEmpty();

Tests whether all numeric values of this Rect structure have values of zero.

Returns
true if the x, y, width and height values of this Rect structure all have values of zero; otherwise, false.

struct RectF;

Represents a set of four floating-point numbers that define the location and size of a rectangle.

float x;

Gets or sets the x-coordinate.

float y;

Gets of sets the y-coordinate.

float width;

Gets or sets the width component.

float height;

Gets or sets the height component.

static RectF empty;

Represents a RectF structure with its values set to zero.

static RectF opCall(float x, float y, float width, float height);

Initializes a new instance with the specified location and size.

Parameters
float x
The x-coordinate.
float y
The y-coordinate.
float width
The width.
float height
The height.

static RectF opCall(PointF location, SizeF size);

Initializes a new instance with the specified location and size.

Parameters
PointF location
The upper-left corner.
SizeF size
The width and height.

static RectF fromLTRB(float left, float top, float right, float bottom);

Creates a RectF structure width the specified edge locations.

Parameters
float left
The x-coordinate of the upper-left corner.
float top
The y-coordinate of the upper-left corner.
float right
The x-coordinate of the lower-right corner.
float bottom
The y-coordinate of the lower-right corner.

Returns
The new RectF that this method creates.

bool equals(RectF other);
bool opEquals(RectF other);

Tests whether the specified Rect structure has the same location and size as this instance.

Parameters
RectF other
The RectF to test.

Returns
true if the x, y, width and height properties of other are equal to the corresponding properties of this instance; otherwise, false.

static RectF unionRects(RectF a, RectF b);

Gets a Rect structure containing the union of two RectF structures.

Parameters
RectF a
A RectF to union.
RectF b
A RectF to union.

Returns
A RectF structure that bounds the union of the two Rect structures.

bool contains(PointF pt);

Determines if the specified point is contained within this instance.

Parameters
PointF pt
The PointF to test.

Returns
true if the point represented by pt is contained within this instance; otherwise, false.

bool contains(float x, float y);

Determines if the specified point is contained within this instance.

Parameters
float x
The x-coordinate of the point to test.
float y
The y-coordinate of the point to test.

Returns
true if the point defined by x and y is contained within this instance; otherwise, false.

bool contains(RectF rect);

Determines if the specified rectangular region is entirely contained within this instance.

Parameters
RectF rect
The rectangular region to test.

Returns
true if the rectangular region represented by rect is entirely contained within this instance; otherwise, false.

static RectF inflate(RectF rect, float x, float y);

Returns an inflated copy of the specified RectF structure.

Parameters
RectF rect
The RectF to be copied.
float x
The amount to inflate the copy horizontally.
float y
The amount to inflate the copy vertically.

Returns
The inflated RectF.

void inflate(SizeF size);

Inflates this instance by the specified amount.

Parameters
SizeF size
The amount to inflate this instance.

void inflate(float width, float height);

Inflates this instance by the specified amount.

Parameters
x
The amount to inflate this instance horizontally.
y
The amount to inflate this instance vertically.

void offset(PointF pos);

Adjust the location of this instance by the specified amount.

Parameters
PointF pos
The amount to offset the location.

void offset(float x, float y);

Adjust the location of this instance by the specified amount.

Parameters
float x
The horizontal offset.
float y
The vertical offset.

bool intersectsWith(RectF rect);

Determines whether this instance intersects with rect.

Parameters
RectF rect
The RectF to test.

Returns
true if there is any intersection; otherwise, false.

static RectF intersect(RectF a, RectF b);

Returns a RectF structure that represents the intersection of two RectF structures.

Parameters
RectF a
A RectF to intersect.
RectF b
A RectF to intersect.

Returns
A RectF that represents the intersection of a and b.

void intersect(RectF rect);

Replaces this instance with the intersection of itself and the specified RectF structure.

Parameters
RectF rect
The RectF with which to intersect.

float left();

Gets the x-coordinate of the left edge of this RectF structure.

float top();

Gets the y-coordinate of the top edge of this RectF structure.

float right();

Gets the x-coordinate that is the sum of the x and width values.

float bottom();

Gets the y-coordinate that is the sum of the y and height values.

PointF location();
void location(PointF value);

Gets or sets the coordinates of the upper-left corner of this RectF structure.

SizeF size();
void size(SizeF value);

Gets or sets the size of this RectF structure.