xtd 1.0.0
Loading...
Searching...
No Matches
region.hpp
Go to the documentation of this file.
1
4#pragma once
7#include <xtd/iequatable>
8#include <xtd/object>
9
11namespace xtd {
13 namespace drawing {
15 class graphics;
17
32 class drawing_export_ region final : public xtd::object, public xtd::iequatable<region> {
33 struct data;
34
35 public:
37
49 explicit region(const xtd::drawing::rectangle& rect);
53 explicit region(const xtd::drawing::rectangle_f& rect);
55
57 ~region();
59
61
65 [[nodiscard]] auto handle() const noexcept -> xtd::intptr;
67
69
73 auto complement(const xtd::drawing::drawing_2d::graphics_path& path) noexcept -> void;
76 auto complement(const xtd::drawing::rectangle& rect) noexcept -> void;
79 auto complement(const xtd::drawing::rectangle_f& rect) noexcept -> void;
82 auto complement(const xtd::drawing::region& region) noexcept -> void;
83
87 [[nodiscard]] auto equals(const xtd::object& obj) const noexcept -> bool override;
91 [[nodiscard]] auto equals(const region& other) const noexcept -> bool override;
92
95 [[nodiscard]] auto get_hash_code() const noexcept -> xtd::usize override;
96
99 auto exclude(const xtd::drawing::drawing_2d::graphics_path& path) noexcept -> void;
102 auto exclude(const xtd::drawing::rectangle& rect) noexcept -> void;
104 auto exclude(const xtd::drawing::rectangle_f& rect) noexcept -> void;
107 auto exclude(const xtd::drawing::region& region) noexcept -> void;
108
113 [[nodiscard]] auto get_bounds() const noexcept -> xtd::drawing::rectangle_f;
118 [[nodiscard]] auto get_bounds(const xtd::drawing::graphics& g) const noexcept -> xtd::drawing::rectangle_f;
119
124 [[nodiscard]] auto get_hrgn(const xtd::drawing::graphics& g) const noexcept -> xtd::intptr;
125
128 auto intersect(const xtd::drawing::drawing_2d::graphics_path& path) noexcept -> void;
131 auto intersect(const xtd::drawing::rectangle& rect) noexcept -> void;
134 auto intersect(const xtd::drawing::rectangle_f& rect) noexcept -> void;
137 auto intersect(const xtd::drawing::region& region) noexcept -> void;
138
142 [[nodiscard]] auto is_empty() const noexcept -> bool;
147 [[nodiscard]] auto is_empty(const xtd::drawing::graphics& g) const noexcept -> bool;
148
152 [[nodiscard]] auto is_infinite() const noexcept -> bool;
157 [[nodiscard]] auto is_infinite(const xtd::drawing::graphics& g) const noexcept -> bool;
158
164 [[nodiscard]] auto is_visible(const xtd::drawing::rectangle_f& rect, const xtd::drawing::graphics& g) const noexcept -> bool;
173 [[nodiscard]] auto is_visible(float x, float y, float width, float height, const xtd::drawing::graphics& g) const noexcept -> bool;
179 [[nodiscard]] auto is_visible(const xtd::drawing::rectangle& rect, const xtd::drawing::graphics& g) const noexcept -> bool;
188 [[nodiscard]] auto is_visible(xtd::int32 x, xtd::int32 y, xtd::int32 width, xtd::int32 height, const xtd::drawing::graphics& g) const noexcept -> bool;
192 [[nodiscard]] auto is_visible(const xtd::drawing::rectangle_f& rect) const noexcept -> bool;
199 [[nodiscard]] auto is_visible(float x, float y, float width, float height) const noexcept -> bool;
203 [[nodiscard]] auto is_visible(const xtd::drawing::rectangle& rect) const noexcept -> bool;
210 [[nodiscard]] auto is_visible(xtd::int32 x, xtd::int32 y, xtd::int32 width, xtd::int32 height) const noexcept -> bool;
216 [[nodiscard]] auto is_visible(xtd::drawing::point_f pt, const xtd::drawing::graphics& g) const noexcept -> bool;
223 [[nodiscard]] auto is_visible(float x, float y, const xtd::drawing::graphics& g) const noexcept -> bool;
229 [[nodiscard]] auto is_visible(xtd::drawing::point pt, const xtd::drawing::graphics& g) const noexcept -> bool;
236 [[nodiscard]] auto is_visible(xtd::int32 x, xtd::int32 y, const xtd::drawing::graphics& g) const noexcept -> bool;
240 [[nodiscard]] auto is_visible(xtd::drawing::point_f pt) const noexcept -> bool;
245 [[nodiscard]] auto is_visible(float x, float y) const noexcept -> bool;
249 [[nodiscard]] auto is_visible(xtd::drawing::point pt) const noexcept -> bool;
254 [[nodiscard]] auto is_visible(xtd::int32 x, xtd::int32 y) const noexcept -> bool;
255
257 auto make_empty() -> void;
258
260 auto make_infinite() noexcept -> void;
261
264 auto make_union(const xtd::drawing::drawing_2d::graphics_path& path) noexcept -> void;
267 auto make_union(const xtd::drawing::rectangle& rect) noexcept -> void;
270 auto make_union(const xtd::drawing::rectangle_f& rect) noexcept -> void;
273 auto make_union(const xtd::drawing::region& region) noexcept -> void;
274
277 auto make_xor(const xtd::drawing::drawing_2d::graphics_path& path) noexcept -> void;
280 auto make_xor(const xtd::drawing::rectangle& rect) noexcept -> void;
283 auto make_xor(const xtd::drawing::rectangle_f& rect) noexcept -> void;
286 auto make_xor(const xtd::drawing::region& region) noexcept -> void;
287
290 auto release_hrgn(xtd::intptr region_handle) -> void;
291
295 auto translate(xtd::int32 dx, xtd::int32 dy) noexcept -> void;
299 auto translate(float dx, float dy) noexcept -> void;
301
303
310 [[nodiscard]] static auto equals(const region& region, const xtd::drawing::graphics& g) noexcept -> bool;
311
316 [[nodiscard]] static auto from_hrgn(xtd::intptr hrgn) -> xtd::drawing::region;
318
319 private:
320 xtd::sptr<data> data_;
321 };
322 }
323}
Defines an object used to draw lines and curves. This class cannot be inherited.
Definition graphics_path.hpp:33
Defines an object used to draw lines and curves. This class cannot be inherited.
Definition graphics.hpp:67
region()
Initializes a new xtd::drawing::region.
static auto from_hrgn(xtd::intptr hrgn) -> xtd::drawing::region
Initializes a new xtd::drawing::region from a handle to the specified existing GDI region.
auto is_infinite() const noexcept -> bool
Tests whether this xtd::drawing::region has an infinite interior.
auto get_hrgn(const xtd::drawing::graphics &g) const noexcept -> xtd::intptr
Returns a Windows handle to this xtd::drawing::region in the specified graphics context.
auto make_xor(const xtd::drawing::drawing_2d::graphics_path &path) noexcept -> void
Updates this xtd::drawing::region to the union minus the intersection of itself with the specified xt...
region(const xtd::drawing::rectangle_f &rect)
Initializes a new xtd::drawing::region from the specified xtd::drawing::rectangle_f structure.
auto intersect(const xtd::drawing::drawing_2d::graphics_path &path) noexcept -> void
Updates this xtd::drawing::region to the intersection of itself with the specified xtd::drawing::grap...
auto make_union(const xtd::drawing::drawing_2d::graphics_path &path) noexcept -> void
Updates this xtd::drawing::region to the union of itself and the specified xtd::drawing::graphics_pat...
auto complement(const xtd::drawing::drawing_2d::graphics_path &path) noexcept -> void
Updates this xtd::drawing::region to contain the portion of the specified xtd::drawing::graphics_path...
region(const xtd::drawing::drawing_2d::graphics_path &path)
Initializes a new xtd::drawing::region with the specified xtd::drawing::graphics_path.
auto handle() const noexcept -> xtd::intptr
Gets the handle of the region.
auto make_infinite() noexcept -> void
Initializes this xtd::drawing::region object to an infinite interior.
auto make_empty() -> void
Initializes this xtd::drawing::region to an empty interior.
auto is_visible(const xtd::drawing::rectangle_f &rect, const xtd::drawing::graphics &g) const noexcept -> bool
Tests whether any portion of the specified xtd::drawing::rectangle_f structure is contained within th...
auto translate(xtd::int32 dx, xtd::int32 dy) noexcept -> void
Offsets the coordinates of this xtd::drawing::region by the specified amount.
auto release_hrgn(xtd::intptr region_handle) -> void
Releases the handle of the xtd::drawing::region.
auto get_hash_code() const noexcept -> xtd::usize override
Serves as a hash function for a particular type.
region(const xtd::drawing::rectangle &rect)
Initializes a new xtd::drawing::region from the specified xtd::drawing::rectangle structure.
auto is_empty() const noexcept -> bool
Tests whether this xtd::drawing::region has an empty interior.
auto exclude(const xtd::drawing::drawing_2d::graphics_path &path) noexcept -> void
Updates this xtd::drawing::region to contain only the portion of its interior that does not intersect...
auto equals(const xtd::object &obj) const noexcept -> bool override
Determines whether the specified object is equal to the current object.
auto get_bounds() const noexcept -> xtd::drawing::rectangle_f
Gets a xtd::drawing::rectangle_f structure that represents a rectangle that bounds this xtd::drawing:...
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.hpp:23
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:45
Contains drawing_export_ keyword.
Contains xtd::drawing::drawing_2d::graphics_path class.
#define drawing_export_
Define shared library export.
Definition drawing_export.hpp:13
xtd::shared_ptr_object< type_t > sptr
The xtd::sptr object is a shared pointer.
Definition sptr.hpp:25
std::intmax_t intptr
Represent a pointer or a handle.
Definition intptr.hpp:23
std::int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:25
std::size_t usize
Represents an unsigned size of any object in bytes.
Definition usize.hpp:22
The xtd::drawing::drawing_2d namespace provides advanced two-dimensional and vector graphics function...
Definition compositing_mode.hpp:12
The xtd::drawing namespace provides access to GDI+ basic graphics functionality. More advanced functi...
Definition actions_system_images.hpp:10
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
constexpr auto data() const noexcept -> const_pointer
Gets direct access to the underlying contiguous storage.
Definition read_only_span.hpp:197
Represents an ordered pair of floating-point x- and y-coordinates that defines a point in a two-dimen...
Definition point_f.hpp:35
Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional ...
Definition point.hpp:54
Stores a set of four floating-point numbers that represent the location and size of a rectangle....
Definition rectangle_f.hpp:34
Stores a set of four integers that represent the location and size of a rectangle.
Definition rectangle.hpp:44