ObjFW
Instance Methods | Properties | List of all members
<OFCanvas> Protocol Reference

A protocol for a canvas that can be drawn to. More...

#import <ObjFW/ObjFW.h>

Inheritance diagram for <OFCanvas>:
<OFObject> OFCanvas

Instance Methods

(void) - clearRect:
 Clears the specified rectangle with the background color. More...
 
(void) - drawImage:sourceRect:destinationRect:
 Draws the specified rectangle of the specified image in the specified rectangle on the canvas. More...
 
- Instance Methods inherited from <OFObject>
(Class) - class
 Returns the class of the object. More...
 
(nullable Class) - superclass
 Returns the superclass of the object. More...
 
(unsigned long) - hash
 Returns a hash for the object. More...
 
(unsigned int) - retainCount
 Returns the retain count. More...
 
(bool) - isProxy
 Returns whether the object is a proxy object. More...
 
(bool) - isKindOfClass:
 Returns a boolean whether the object is of the specified kind. More...
 
(bool) - isMemberOfClass:
 Returns a boolean whether the object is a member of the specified class. More...
 
(bool) - respondsToSelector:
 Returns a boolean whether the object responds to the specified selector. More...
 
(bool) - conformsToProtocol:
 Checks whether the object conforms to the specified protocol. More...
 
(nullable IMP- methodForSelector:
 Returns the implementation for the specified selector. More...
 
(nullable id) - performSelector:
 Performs the specified selector. More...
 
(nullable id) - performSelector:withObject:
 Performs the specified selector with the specified object. More...
 
(nullable id) - performSelector:withObject:withObject:
 Performs the specified selector with the specified objects. More...
 
(nullable id) - performSelector:withObject:withObject:withObject:
 Performs the specified selector with the specified objects. More...
 
(nullable id) - performSelector:withObject:withObject:withObject:withObject:
 Performs the specified selector with the specified objects. More...
 
(bool) - isEqual:
 Checks two objects for equality. More...
 
(instancetype) - retain
 Increases the retain count. More...
 
(void) - release
 Decreases the retain count. More...
 
(instancetype) - autorelease
 Adds the object to the topmost autorelease pool of the thread's autorelease pool stack. More...
 
(instancetype) - self
 Returns the receiver. More...
 
(bool) - allowsWeakReference
 Returns whether the object allows a weak reference. More...
 
(bool) - retainWeakReference
 Retain a weak reference to this object. More...
 

Properties

OFColorbackgroundColor
 The background color of the canvas.
 

Detailed Description

A protocol for a canvas that can be drawn to.

To what it is drawn is implementation specific - it could be to an OFImage or to an OpenGL context, for example. OFCanvas is an implementation drawing to an OFImage in software and always available.

Method Documentation

◆ clearRect:

- (void) clearRect: (OFRect rect

Clears the specified rectangle with the background color.

Parameters
rectThe rectangle to clear
Exceptions
OFInvalidArgumentExceptionThe specified rectangle is not integral or has a negative component

◆ drawImage:sourceRect:destinationRect:

- (void) drawImage: (OFImage *)  image
sourceRect: (OFRect sourceRect
destinationRect: (OFRect destinationRect 

Draws the specified rectangle of the specified image in the specified rectangle on the canvas.

Parameters
imageThe image to draw on the canvas
sourceRectA rectangle of the specified image to draw into the canvas
destinationRectA rectangle on the canvas to draw the image in
Exceptions
OFInvalidArgumentExceptionOne or both of the specified rectangles are not integral or have a negative component
OFOutOfRangeExceptionThe specified source rectangle is outside of the specified image

The documentation for this protocol was generated from the following file: