9 #include "../drawing_export.h"
79 explicit point(int32_t dw) : x_(dw & 0x0000FFFF), y_((dw & 0xFFFF0000)>>16) {}
131 operator point_f()
const {
return point_f(
static_cast<float>(x_),
static_cast<float>(y_));}
159 int32_t
x()
const {
return x_;}
182 void x(int32_t x) {x_ =
x;}
205 int32_t
y()
const {
return y_;}
228 void y(int32_t y) {y_ =
y;}
302 bool operator==(
const point& value)
const {
return x_ == value.x_ && y_ == value.y_;}
303 bool operator!=(
const point& value)
const {
return !operator==(value);}
305 friend std::ostream& operator<<(std::ostream& os,
const xtd::drawing::point& point) noexcept {
306 return os << point.to_string();
309 point operator+(
const size& sz)
const;
310 point operator+(
const point& pt)
const;
311 point& operator+=(
const size& sz);
312 point& operator+=(
const point& pt);
313 point operator-(
const size& sz)
const;
314 point operator-(
const point& pt)
const;
315 point& operator-=(
const size& sz);
316 point& operator-=(
const point& pt);
326 inline drawing::point parse<drawing::point>(
const std::string& str) {
328 return {xtd::parse<int32_t>(values[0]), xtd::parse<int32_t>(values[1])};
Represents an ordered pair of floating-point x- and y-coordinates that defines a point in a two-dimen...
Definition: point_f.h:26
Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional ...
Definition: point.h:48
static point ceiling(const point_f &value)
Converts the specified point_f to a point by rounding the values of the point_f to the next higher in...
bool is_empty() const
Gets a value indicating whether this point is empty.
Definition: point.h:136
static point subtract(const point &pt, const size &sz)
Returns the result of subtracting specified Size from the specified point.
xtd::ustring to_string() const noexcept override
Converts this point to a human-readable string.
Definition: point.h:294
static point truncate(const point_f &value)
Converts the specified point_f to a point by truncating the values of the point_f.
point()=default
Initializes a new instance of the point class.
void offset(int dx, int dy)
Translates this point by the specified amount.
Definition: point.h:257
static point round(const point_f &value)
Converts the specified point_f to a point object by rounding the point_f values to the nearest intege...
point(int32_t dw)
Initializes a new instance of the point class using coordinates specified by an integer value.
Definition: point.h:79
void x(int32_t x)
Sets the x-coordinate of this point.
Definition: point.h:182
static const point empty
Represents a point that has x and y values set to zero.
Definition: point.h:51
int32_t y() const
Gets the y-coordinate of this point.
Definition: point.h:205
point(int32_t x, int32_t y)
Initializes a new instance of the point class with the specified coordinates.
Definition: point.h:103
void offset(const point &p)
Translates this point by the specified point.
Definition: point.h:275
static point add(const point &pt, const size &sz)
Adds the specified size to the specified point.
point(const size &sz)
Initializes a new instance of the point class from a size.
int32_t x() const
Gets the x-coordinate of this point.
Definition: point.h:159
void y(int32_t y)
Sets the y-coordinate of this point.
Definition: point.h:228
Stores an ordered pair of integers, which specify a height and width.
Definition: size.h:25
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition: object.h:26
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:48
ustring replace(value_type old_char, value_type new_char) const noexcept
Replaces all occurrences of a specified char_t in this string with another specified char_t.
std::vector< ustring > split(const std::vector< value_type > &separators, size_t count, string_split_options options) const noexcept
Splits this string into a maximum number of substrings based on the characters in an array.
#define drawing_export_
Define shared library export.
Definition: drawing_export.h:13
size_t size
Represents a size of any object in bytes.
Definition: types.h:171
@ subtract
The Subtract key.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition: system_report.h:17
Contains xtd::object class.
Contains xtd::drawing::point_f class.
Contains xtd::ustring class.