A protocol for a canvas that can be drawn to. More...
#include <ObjFW/ObjFW.h>
Instance Methods | |
| (void) | - clearRect: |
| Clears the specified rectangle with the background color. | |
| (void) | - drawImage:sourceRect:destinationRect: |
| Draws the specified rectangle of the specified image in the specified rectangle on the canvas. | |
Instance Methods inherited from <OFObject> | |
| (Class) | - class |
| Returns the class of the object. | |
| (nullable Class) | - superclass |
| Returns the superclass of the object. | |
| (unsigned long) | - hash |
| Returns a hash for the object. | |
| (unsigned int) | - retainCount |
| Returns the retain count. | |
| (bool) | - isProxy |
| Returns whether the object is a proxy object. | |
| (bool) | - isKindOfClass: |
| Returns a boolean whether the object is of the specified kind. | |
| (bool) | - isMemberOfClass: |
| Returns a boolean whether the object is a member of the specified class. | |
| (bool) | - respondsToSelector: |
| Returns a boolean whether the object responds to the specified selector. | |
| (bool) | - conformsToProtocol: |
| Checks whether the object conforms to the specified protocol. | |
| (nullable IMP) | - methodForSelector: |
| Returns the implementation for the specified selector. | |
| (nullable id) | - performSelector: |
| Performs the specified selector. | |
| (nullable id) | - performSelector:withObject: |
| Performs the specified selector with the specified object. | |
| (nullable id) | - performSelector:withObject:withObject: |
| Performs the specified selector with the specified objects. | |
| (nullable id) | - performSelector:withObject:withObject:withObject: |
| Performs the specified selector with the specified objects. | |
| (nullable id) | - performSelector:withObject:withObject:withObject:withObject: |
| Performs the specified selector with the specified objects. | |
| (bool) | - isEqual: |
| Checks two objects for equality. | |
| (instancetype) | - retain |
| Increases the retain count. | |
| (void) | - release |
| Decreases the retain count. | |
| (instancetype) | - autorelease |
| Adds the object to the topmost autorelease pool of the thread's autorelease pool stack. | |
| (instancetype) | - self |
| Returns the receiver. | |
| (bool) | - allowsWeakReference |
| Returns whether the object allows a weak reference. | |
| (bool) | - retainWeakReference |
| Retain a weak reference to this object. | |
Properties | |
| OFColor * | backgroundColor |
| The background color of the canvas. | |
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.
| - (void) clearRect: | (OFRect) | rect |
Clears the specified rectangle with the background color.
| rect | The rectangle to clear |
| OFInvalidArgumentException | The specified rectangle is not integral or has a negative component |
| - (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.
| image | The image to draw on the canvas |
| sourceRect | A rectangle of the specified image to draw into the canvas |
| destinationRect | A rectangle on the canvas to draw the image in |
| OFInvalidArgumentException | One or both of the specified rectangles are not integral or have a negative component |
| OFOutOfRangeException | The specified source rectangle is outside of the specified image |