Eiffel Media API
Overview Cluster Class Classes Index      Previous Next      Top Features

em.video

Class EM_RECT



Creation

Features

Invariants

indexing

description

Rectangle. Used for clipping and blitting.

date

$Date: 2005/10/23 10:40:29 $

revision

$Revision: 1.3 $

class

EM_RECT

create

make (an_x: INTEGER; an_y: INTEGER; a_width: INTEGER; a_height: INTEGER)

-- Create with an_x and an_y as upper left corner, a_width wide and a_height
-- tall.

feature -- Access

height: INTEGER

-- Height of the rectangle

width: INTEGER

-- Width of the rectangle

x: INTEGER

-- X coordinate of upper left corner of the rectangle

y: INTEGER

-- Y coordinate of upper left corner of the rectangle

feature -- Status report

inside (other: like Current): BOOLEAN

-- Is current completly inside other?

require
other_not_void: other /= Void
intersects (other: like Current): BOOLEAN

-- Is the intersection between current and other not empty

require
other_not_void: other /= Void

feature -- Element change

set_height (a_height: INTEGER)

-- Set a_height.

set_width (a_width: INTEGER)

-- Set a_width.

set_x (an_x: INTEGER)

-- Set an_x.

set_y (an_y: INTEGER)

-- Set an_y.

feature -- Basic operations

intersection (other: like Current): like Current

-- Intersection between current and other EM_RECT

require
other_not_void: other /= Void

feature {EM_SURFACE} -- Implementation

sdl_rect_struct: SDL_RECT_STRUCT

-- C structure representing rectangle

invariant

-- From ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end