Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
A Rect
is a rectangular area of pixels. This is a struct for
performing simple rectangle algebra.
Synopsis
- newtype Rect = Rect (ManagedPtr Rect)
- newZeroRect :: MonadIO m => m Rect
- rectEqualsrect :: (HasCallStack, MonadIO m) => Rect -> Rect -> m Bool
- rectIncludespoint :: (HasCallStack, MonadIO m) => Rect -> Int32 -> Int32 -> m Bool
- rectIncludesrect :: (HasCallStack, MonadIO m) => Rect -> Rect -> m Bool
- rectIntersectrect :: (HasCallStack, MonadIO m) => Rect -> Rect -> m Rect
- rectIsempty :: (HasCallStack, MonadIO m) => Rect -> m Bool
- rectMarginadjust :: (HasCallStack, MonadIO m) => Rect -> Int32 -> m ()
- rectNormalise :: (HasCallStack, MonadIO m) => Rect -> m ()
- rectOverlapsrect :: (HasCallStack, MonadIO m) => Rect -> Rect -> m Bool
- rectUnionrect :: (HasCallStack, MonadIO m) => Rect -> Rect -> m Rect
- getRectHeight :: MonadIO m => Rect -> m Int32
- setRectHeight :: MonadIO m => Rect -> Int32 -> m ()
- getRectLeft :: MonadIO m => Rect -> m Int32
- setRectLeft :: MonadIO m => Rect -> Int32 -> m ()
- getRectTop :: MonadIO m => Rect -> m Int32
- setRectTop :: MonadIO m => Rect -> Int32 -> m ()
- getRectWidth :: MonadIO m => Rect -> m Int32
- setRectWidth :: MonadIO m => Rect -> Int32 -> m ()
Exported types
Memory-managed wrapper type.
Instances
Eq Rect Source # | |
BoxedPtr Rect Source # | |
Defined in GI.Vips.Structs.Rect boxedPtrCopy :: Rect -> IO Rect boxedPtrFree :: Rect -> IO () | |
CallocPtr Rect Source # | |
Defined in GI.Vips.Structs.Rect boxedPtrCalloc :: IO (Ptr Rect) | |
ManagedPtrNewtype Rect Source # | |
Defined in GI.Vips.Structs.Rect toManagedPtr :: Rect -> ManagedPtr Rect | |
tag ~ 'AttrSet => Constructible Rect tag Source # | |
Methods
Click to display all available methods, including inherited ones
Methods
equalsrect, includespoint, includesrect, intersectrect, isempty, marginadjust, normalise, overlapsrect, unionrect.
Getters
None.
Setters
None.
equalsrect
:: (HasCallStack, MonadIO m) | |
=> Rect |
|
-> Rect |
|
-> m Bool | Returns: |
Is r1
equal to r2
?
includespoint
:: (HasCallStack, MonadIO m) | |
=> Rect |
|
-> Int32 |
|
-> Int32 |
|
-> m Bool | Returns: |
Does r
contain point (x
, y
)?
includesrect
:: (HasCallStack, MonadIO m) | |
=> Rect |
|
-> Rect |
|
-> m Bool | Returns: |
Is r2
a subset of r1
?
intersectrect
:: (HasCallStack, MonadIO m) | |
=> Rect |
|
-> Rect |
|
-> m Rect |
Fill out
with the intersection of r1
and r2
. out
can equal r1
or r2
.
isempty
:: (HasCallStack, MonadIO m) | |
=> Rect |
|
-> m Bool | Returns: |
Is r
empty? ie. zero width or height.
marginadjust
:: (HasCallStack, MonadIO m) | |
=> Rect |
|
-> Int32 |
|
-> m () |
Enlarge r
by n
. +1 means out one pixel.
normalise
:: (HasCallStack, MonadIO m) | |
=> Rect |
|
-> m () |
Make sure width and height are >0 by moving the origin and flipping the rect.
overlapsrect
:: (HasCallStack, MonadIO m) | |
=> Rect |
|
-> Rect |
|
-> m Bool | Returns: |
Do r1
and r2
have a non-empty intersection?
unionrect
:: (HasCallStack, MonadIO m) | |
=> Rect |
|
-> Rect |
|
-> m Rect |
Fill out
with the bounding box of r1
and r2
. out
can equal r1
or r2
.
Properties
height
height of rectangle
getRectHeight :: MonadIO m => Rect -> m Int32 Source #
Get the value of the “height
” field.
When overloading is enabled, this is equivalent to
get
rect #height
setRectHeight :: MonadIO m => Rect -> Int32 -> m () Source #
Set the value of the “height
” field.
When overloading is enabled, this is equivalent to
set
rect [ #height:=
value ]
left
left edge of rectangle
getRectLeft :: MonadIO m => Rect -> m Int32 Source #
Get the value of the “left
” field.
When overloading is enabled, this is equivalent to
get
rect #left
setRectLeft :: MonadIO m => Rect -> Int32 -> m () Source #
Set the value of the “left
” field.
When overloading is enabled, this is equivalent to
set
rect [ #left:=
value ]
top
top edge of rectangle
getRectTop :: MonadIO m => Rect -> m Int32 Source #
Get the value of the “top
” field.
When overloading is enabled, this is equivalent to
get
rect #top
setRectTop :: MonadIO m => Rect -> Int32 -> m () Source #
Set the value of the “top
” field.
When overloading is enabled, this is equivalent to
set
rect [ #top:=
value ]
width
width of rectangle
getRectWidth :: MonadIO m => Rect -> m Int32 Source #
Get the value of the “width
” field.
When overloading is enabled, this is equivalent to
get
rect #width
setRectWidth :: MonadIO m => Rect -> Int32 -> m () Source #
Set the value of the “width
” field.
When overloading is enabled, this is equivalent to
set
rect [ #width:=
value ]