gi-vips-8.0.5: libvips GObject bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Vips.Structs.Rect

Description

A Rect is a rectangular area of pixels. This is a struct for performing simple rectangle algebra.

Synopsis

Exported types

newtype Rect Source #

Memory-managed wrapper type.

Constructors

Rect (ManagedPtr Rect) 

Instances

Instances details
Eq Rect Source # 
Instance details

Defined in GI.Vips.Structs.Rect

Methods

(==) :: Rect -> Rect -> Bool #

(/=) :: Rect -> Rect -> Bool #

BoxedPtr Rect Source # 
Instance details

Defined in GI.Vips.Structs.Rect

Methods

boxedPtrCopy :: Rect -> IO Rect

boxedPtrFree :: Rect -> IO ()

CallocPtr Rect Source # 
Instance details

Defined in GI.Vips.Structs.Rect

ManagedPtrNewtype Rect Source # 
Instance details

Defined in GI.Vips.Structs.Rect

Methods

toManagedPtr :: Rect -> ManagedPtr Rect

tag ~ 'AttrSet => Constructible Rect tag Source # 
Instance details

Defined in GI.Vips.Structs.Rect

Methods

new :: MonadIO m => (ManagedPtr Rect -> Rect) -> [AttrOp Rect tag] -> m Rect

newZeroRect :: MonadIO m => m Rect Source #

Construct a Rect struct initialized to zero.

Methods

Click to display all available methods, including inherited ones

Expand

Methods

equalsrect, includespoint, includesrect, intersectrect, isempty, marginadjust, normalise, overlapsrect, unionrect.

Getters

None.

Setters

None.

equalsrect

rectEqualsrect Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Rect

r1: first rectangle

-> Rect

r2: second rectangle

-> m Bool

Returns: True if r1 is equal to r2.

Is r1 equal to r2?

includespoint

rectIncludespoint Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Rect

r: rectangle to test

-> Int32

x: position to test for

-> Int32

y: position to test for

-> m Bool

Returns: True if r contains (x, y).

Does r contain point (x, y)?

includesrect

rectIncludesrect Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Rect

r1: outer rectangle

-> Rect

r2: inner rectangle

-> m Bool

Returns: True if r2 is a subset of r1.

Is r2 a subset of r1?

intersectrect

rectIntersectrect Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Rect

r1: input rectangle 1

-> Rect

r2: input rectangle 2

-> m Rect 

Fill out with the intersection of r1 and r2. out can equal r1 or r2.

isempty

rectIsempty Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Rect

r: rectangle to test

-> m Bool

Returns: True if r contains no pixels.

Is r empty? ie. zero width or height.

marginadjust

rectMarginadjust Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Rect

r: rectangle to adjust

-> Int32

n: enlarge by

-> m () 

Enlarge r by n. +1 means out one pixel.

normalise

rectNormalise Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Rect

r: rect to normalise

-> m () 

Make sure width and height are >0 by moving the origin and flipping the rect.

overlapsrect

rectOverlapsrect Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Rect

r1: first rectangle

-> Rect

r2: second rectangle

-> m Bool

Returns: True if r2 and r1 overlap.

Do r1 and r2 have a non-empty intersection?

unionrect

rectUnionrect Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Rect

r1: input rectangle 1

-> Rect

r2: input rectangle 2

-> 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 ]