| 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 |
GI.Vips.Structs.Rect
Description
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
- rectIncludespoint :: (HasCallStack, MonadIO m) => Rect -> Int32 -> Int32 -> m Bool
- rectIntersectrect :: (HasCallStack, MonadIO m) => Rect -> Rect -> m Rect
- rectRectEqualsrect :: (HasCallStack, MonadIO m) => Rect -> Rect -> m Bool
- rectRectIncludesrect :: (HasCallStack, MonadIO m) => Rect -> Rect -> m Bool
- rectRectIsempty :: (HasCallStack, MonadIO m) => Rect -> m Bool
- rectRectMarginadjust :: (HasCallStack, MonadIO m) => Rect -> Int32 -> m ()
- rectRectNormalise :: (HasCallStack, MonadIO m) => Rect -> m ()
- rectRectOverlapsrect :: (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 | |
| CallocPtr Rect Source # | |
Defined in GI.Vips.Structs.Rect Methods boxedPtrCalloc :: IO (Ptr Rect) | |
| ManagedPtrNewtype Rect Source # | |
Defined in GI.Vips.Structs.Rect Methods toManagedPtr :: Rect -> ManagedPtr Rect | |
| tag ~ 'AttrSet => Constructible Rect tag Source # | |
Methods
Click to display all available methods, including inherited ones
Methods
includespoint, intersectrect, rectEqualsrect, rectIncludesrect, rectIsempty, rectMarginadjust, rectNormalise, rectOverlapsrect, unionrect.
Getters
None.
Setters
None.
includespoint
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Rect |
|
| -> Int32 |
|
| -> Int32 |
|
| -> m Bool | Returns: |
Does r contain point (x, y)?
intersectrect
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Rect |
|
| -> Rect |
|
| -> m Rect |
Fill out with the intersection of r1 and r2. out can equal r1 or r2.
rectEqualsrect
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Rect |
|
| -> Rect |
|
| -> m Bool | Returns: |
Is r1 equal to r2?
rectIncludesrect
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Rect |
|
| -> Rect |
|
| -> m Bool | Returns: |
Is r2 a subset of r1?
rectIsempty
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Rect |
|
| -> m Bool | Returns: |
Is r empty? ie. zero width or height.
rectMarginadjust
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Rect |
|
| -> Int32 |
|
| -> m () |
Enlarge r by n. +1 means out one pixel.
rectNormalise
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Rect |
|
| -> m () |
Make sure width and height are >0 by moving the origin and flipping the rect.
rectOverlapsrect
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Rect |
|
| -> Rect |
|
| -> m Bool | Returns: |
Do r1 and r2 have a non-empty intersection?
unionrect
Arguments
| :: (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
setrect [ #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
setrect [ #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
setrect [ #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
setrect [ #width:=value ]