wxRegion(3erl)
πΈ NAME πΈ
wxRegion β Functions for wxRegion class. This is the wxRegion(3erl) Erlang Module Definition, bestie π
.
β¨ DESCRIPTION β¨
A wxRegion represents a simple or complex region on a device context or window. Region energy, honestly.
This class uses reference counting and copy-on-write internally so that assignments between two instances of this class are very cheap. You can therefore use actual objects instead of pointers without efficiency problems. If an instance of this class is changed it will create its own data internally so that other instances, which previously shared the data using the reference counting, are not affected. Slay, efficiency queen.
Predefined objects (include wx.hrl):
See: wxRegionIterator (not implemented in wx)
wxWidgets docs: wxRegion
π§ DATA TYPES π§
wxRegion() = wx:wx_object()
π EXPORTS π
new()
new() -> wxRegion()
Default constructor.
This constructor creates an invalid, or null, object, i.e. calling IsOk() on it returns false and isEmpty/1 returns true.
new(Rect)
new(Rect) -> wxRegion()
This clause is just the signature in the source β no extra types or prose, ngl.
new(Bmp)
new(Bmp) -> wxRegion()
Types:
Bmp = wxBitmap:wxBitmap()
Constructs a region using a bitmap.
See union/5 for more details.
new(TopLeft, BottomRight)
new(TopLeft, BottomRight) -> wxRegion()
Types:
TopLeft = BottomRight = {X :: integer(), Y :: integer()}
Constructs a rectangular region from the top left point and the bottom right point.
new(X, Y, Width, Height)
new(X, Y, Width, Height) -> wxRegion()
Types:
X = Y = Width = Height = integer()
Constructs a rectangular region with the given position and size.
destroy(This :: wxRegion())
destroy(This :: wxRegion()) -> ok
Destructor.
See reference-counted object destruction for more info.
clear(This)
clear(This) -> ok
Types:
This = wxRegion()
Clears the current region.
The object becomes invalid, or null, after being cleared.
contains(This, Pt) / contains(This, Rect)
contains(This, Pt) -> wx:wx_enum()
contains(This, Rect) -> wx:wx_enum()
Types:
This = wxRegion()
Rect =
{X :: integer(),
Y :: integer(),
W :: integer(),
H :: integer()}
Returns a value indicating whether the given rectangle is contained within the region.
This method always returns wxOutRegion for an invalid region but may, nevertheless, be safely called in this case.
Return: one of ?wxOutRegion, ?wxPartRegion or ?wxInRegion.
Note: on Windows, only?wxOutRegionand?wxInRegionare returned; a value?wxInRegionthen indicates that all or some part of the region is contained in this region.
contains(This, X, Y)
contains(This, X, Y) -> wx:wx_enum()
Types:
This = wxRegion()
X = Y = integer()
Returns a value indicating whether the given point is contained within the region.
This method always returns wxOutRegion for an invalid region but may, nevertheless, be safely called in this case.
Return: the return value is one of wxOutRegion and wxInRegion.
contains(This, X, Y, Width, Height)
contains(This, X, Y, Width, Height) -> wx:wx_enum()
Types:
This = wxRegion()
X = Y = Width = Height = integer()
Returns a value indicating whether the given rectangle is contained within the region.
This method always returns wxOutRegion for an invalid region but may, nevertheless, be safely called in this case.
Return: one of ?wxOutRegion, ?wxPartRegion or ?wxInRegion.
Note: on Windows, only?wxOutRegionand?wxInRegionare returned; a value?wxInRegionthen indicates that all or some part of the region is contained in this region.
convertToBitmap(This)
convertToBitmap(This) -> wxBitmap:wxBitmap()
Types:
This = wxRegion()
Convert the region to a black and white bitmap with the white pixels being inside the region.
This method can't be used for invalid region.
getBox(This)
getBox(This) ->
{X :: integer(),
Y :: integer(),
W :: integer(),
H :: integer()}
Types:
This = wxRegion()
No extra prose in the source for this one β just the return shape, iconic.
intersect(This, Rect) / intersect(This, Region)
intersect(This, Rect) -> boolean()
intersect(This, Region) -> boolean()
Types:
This = Region = wxRegion()
Finds the intersection of this region and another region.
This method always fails, i.e. returns false, if this region is invalid but may nevertheless be safely used even in this case.
Return: true if successful, false otherwise.
Remark: creates the intersection of the two regions, that is, the parts which are in both regions. The result is stored in this region.
intersect(This, X, Y, Width, Height)
intersect(This, X, Y, Width, Height) -> boolean()
Types:
This = wxRegion()
X = Y = Width = Height = integer()
Finds the intersection of this region and another, rectangular region, specified using position and size.
This method always fails, i.e. returns false, if this region is invalid but may nevertheless be safely used even in this case.
Return: true if successful, false otherwise.
Remark: creates the intersection of the two regions, that is, the parts which are in both regions. The result is stored in this region.
isEmpty(This)
isEmpty(This) -> boolean()
Types:
This = wxRegion()
Returns true if the region is empty, false otherwise.
Always returns true if the region is invalid.
subtract(This, Rect) / subtract(This, Region)
subtract(This, Rect) -> boolean()
subtract(This, Region) -> boolean()
Types:
This = Region = wxRegion()
Subtracts a region from this region.
This method always fails, i.e. returns false, if this region is invalid but may nevertheless be safely used even in this case.
Return: true if successful, false otherwise.
Remark: this operation combines the parts of 'this' region that are not part of the second region. The result is stored in this region.
offset(This, Pt)
offset(This, Pt) -> boolean()
Types:
This = wxRegion()
Pt = {X :: integer(), Y :: integer()}
This clause has no extra description in the source β just the types, iykyk.
offset(This, X, Y)
offset(This, X, Y) -> boolean()
Types:
This = wxRegion()
X = Y = integer()
Moves the region by the specified offsets in horizontal and vertical directions.
This method can't be called if the region is invalid as it doesn't make sense to offset it then. Attempts to do it will result in assert failure.
Return: true if successful, false otherwise (the region is unchanged then).
union(This, Region) / union(This, Rect)
union(This, Region) -> boolean()
union(This, Rect) -> boolean()
Types:
This = wxRegion()
Rect =
{X :: integer(),
Y :: integer(),
W :: integer(),
H :: integer()}
Finds the union of this region and another, rectangular region.
This method can be used even if this region is invalid and has the natural behaviour in this case, i.e. makes this region equal to the given rectangle.
Return: true if successful, false otherwise.
Remark: this operation creates a region that combines all of this region and the second region. The result is stored in this region.
union(This, Bmp, TransColour) / union(This, Bmp, TransColour, Options :: [Option])
union(This, Bmp, TransColour) -> boolean()
union(This, Bmp, TransColour, Options :: [Option]) -> boolean()
Types for the 3-argument clause:
This = wxRegion()
Bmp = wxBitmap:wxBitmap()
TransColour = wx:wx_colour()
Types for the 4-argument clause:
This = wxRegion()
Bmp = wxBitmap:wxBitmap()
TransColour = wx:wx_colour()
Option = {tolerance, integer()}
Finds the union of this region and the non-transparent pixels of a bitmap.
Colour to be treated as transparent is specified in the transColour argument, along with an optional colour tolerance value.
Return: true if successful, false otherwise.
Remark: this operation creates a region that combines all of this region and the second region. The result is stored in this region.
union(This, X, Y, Width, Height)
union(This, X, Y, Width, Height) -> boolean()
Types:
This = wxRegion()
X = Y = Width = Height = integer()
Finds the union of this region and another, rectangular region, specified using position and size.
This method can be used even if this region is invalid and has the natural behaviour in this case, i.e. makes this region equal to the given rectangle.
Return: true if successful, false otherwise.
Remark: this operation creates a region that combines all of this region and the second region. The result is stored in this region.
'Xor'(This, Rect) / **'Xor'(This, Region)
'Xor'(This, Rect) -> boolean()
'Xor'(This, Region) -> boolean()
Types:
This = Region = wxRegion()
Finds the Xor of this region and another region.
This method can be used even if this region is invalid and has the natural behaviour in this case, i.e. makes this region equal to the given region.
Return: true if successful, false otherwise.
Remark: this operation creates a region that combines all of this region and the second region, except for any overlapping areas. The result is stored in this region.
'Xor'(This, X, Y, Width, Height)
'Xor'(This, X, Y, Width, Height) -> boolean()
Types:
This = wxRegion()
X = Y = Width = Height = integer()
Finds the Xor of this region and another, rectangular region, specified using position and size.
This method can be used even if this region is invalid and has the natural behaviour in this case, i.e. makes this region equal to the given rectangle.
Return: true if successful, false otherwise.
Remark: this operation creates a region that combines all of this region and the second region, except for any overlapping areas. The result is stored in this region.
That's the whole page, bestie π β brought to you by the wxWidgets team, for wx 2.2.2.1, with the footer tag wxRegion(3erl), periodt β¨
π¦ where this page comes from
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4 Β· Apache-2.0
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4.8 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms