reference

This documentation is automatically generated from the openFrameworks source code using doxygen and refers to the most recent release, version 0.12.0.

#include <ofCairoRenderer.h>

Inheritance diagram for ofCairoRenderer:
ofBaseRenderer

Public Types

enum  Type { PDF , SVG , IMAGE , FROM_FILE_EXTENSION }
 

Public Member Functions

 ofCairoRenderer ()
 
 ~ofCairoRenderer ()
 
const std::string & getType ()
 Get the string representation of the renderer type.
 
void setup (const of::filesystem::path &filename, Type type=ofCairoRenderer::FROM_FILE_EXTENSION, bool multiPage=true, bool b3D=false, ofRectangle outputsize=ofRectangle(0, 0, 0, 0))
 
void setupMemoryOnly (Type _type, bool multiPage=true, bool b3D=false, ofRectangle viewport=ofRectangle(0, 0, 0, 0))
 
void close ()
 
void flush ()
 
void startRender ()
 Starts using this renderer as the rendering surface.
 
void finishRender ()
 Stop using this renderer as the rendering surface.
 
void draw (const ofPath &shape) const
 Draw a path with this renderer.
 
void draw (const ofPath::Command &path) const
 
void draw (const ofPolyline &poly) const
 Draw a polyline with this renderer.
 
void draw (const ofMesh &vertexData, ofPolyRenderMode mode, bool useColors, bool useTextures, bool useNormals) const
 Draw a mesh with this renderer.
 
void draw (const of3dPrimitive &model, ofPolyRenderMode renderType) const
 Draw a model with this renderer using the renderType.
 
void draw (const ofNode &node) const
 Draw a node with this renderer using ofNode::customDraw().
 
void draw (const std::vector< glm::vec3 > &vertexData, ofPrimitiveMode drawMode) const
 
void draw (const ofImage &img, float x, float y, float z, float w, float h, float sx, float sy, float sw, float sh) const
 Draw an image with this renderer.
 
void draw (const ofFloatImage &image, float x, float y, float z, float w, float h, float sx, float sy, float sw, float sh) const
 Draw an image with this renderer.
 
void draw (const ofShortImage &image, float x, float y, float z, float w, float h, float sx, float sy, float sw, float sh) const
 Draw an image with this renderer.
 
void draw (const ofBaseVideoDraws &video, float x, float y, float w, float h) const
 Draw a video with this renderer.
 
ofPathgetPath ()
 Get a reference to the path used internally by this renderer.
 
void pushView ()
 Push the current viewport into the renderer's viewport stack.
 
void popView ()
 Pop the current viewport from the renderer's view stack.
 
void viewport (ofRectangle viewport)
 Set this renderer's viewport using a rectangle.
 
void viewport (float x=0, float y=0, float width=-1, float height=-1, bool invertY=true)
 Set this renderer's viewport manually using x, y, width, and height.
 
void setupScreenPerspective (float width=-1, float height=-1, float fov=60, float nearDist=0, float farDist=0)
 Setup the renderer to use a perspective matrix.
 
void setupScreenOrtho (float width=-1, float height=-1, float nearDist=-1, float farDist=1)
 Setup the renderer to use an orthographic matrix.
 
ofRectangle getCurrentViewport () const
 Get this renderer's current viewport.
 
ofRectangle getNativeViewport () const
 Get this renderer's current native viewport.
 
int getViewportWidth () const
 Get the renderer's current viewport width.
 
int getViewportHeight () const
 Get the renderer's current viewport width.
 
void setOrientation (ofOrientation orientation, bool vFlip)
 set this renderer's orientation.
 
bool isVFlipped () const
 Returns true if the renderer's current viewport is vertically flipped.
 
void loadViewMatrix (const glm::mat4 &m)
 Load m into this renderer's matrix stack as a view matrix.
 
void multViewMatrix (const glm::mat4 &m)
 Multiply this renderer's view matrix by m.
 
glm::mat4 getCurrentViewMatrix () const
 Get this renderer's current view matrix.
 
glm::mat4 getCurrentNormalMatrix () const
 Get this renderer's current normal matrix.
 
glm::mat4 getCurrentOrientationMatrix () const
 Get this renderer's current orientation matrix.
 
void setCircleResolution (int)
 Set the resolution to use when drawing ellipses with this renderer.
 
void setCoordHandedness (ofHandednessType handedness)
 Set the coordinate handidness of this renderer.
 
ofHandednessType getCoordHandedness () const
 Get the coordinate handidness of this renderer.
 
void setRectMode (ofRectMode mode)
 Set this renderer's rect mode.
 
ofRectMode getRectMode ()
 Get this renderer's current rect mode.
 
void setFillMode (ofFillFlag fill)
 set this renderer's fill flag.
 
ofFillFlag getFillMode ()
 Get this renderer's current fill flag.
 
void setLineWidth (float lineWidth)
 Set the line width this renderer should use when drawing lines.
 
void setDepthTest (bool depthTest)
 Enable/disable depth testing with this renderer.
 
void setBlendMode (ofBlendMode blendMode)
 Set this renderer's current blend mode.
 
void setLineSmoothing (bool smooth)
 Enable/disable line smoothing for this renderer if it's supported.
 
void enableAntiAliasing ()
 Enable this renderer to use anti-aliasing if it is supported.
 
void disableAntiAliasing ()
 Disable this renderer from using anti-aliasing.
 
void pushMatrix ()
 Pushes this renderer's matrix stack down by one.
 
void popMatrix ()
 Pops this renderer's current matrix stack.
 
glm::mat4 getCurrentMatrix (ofMatrixMode matrixMode_) const
 Get this renderer's current matrix for particular a matrix mode.
 
void translate (float x, float y, float z=0)
 Translate this renderer's current matrix by x, y, and z.
 
void translate (const glm::vec3 &p)
 Translate this renderer's current matrix by a point.
 
void scale (float xAmnt, float yAmnt, float zAmnt=1)
 Scale this renderer's current matrix by xAmnt, yAmnt, and zAmnt.
 
void rotateRad (float radians, float vecX, float vecY, float vecZ)
 Rotate this renderer's current matrix by degrees about a euler.
 
void rotateXRad (float radians)
 Rotate this renderer's current matrix by degrees about the x axis.
 
void rotateYRad (float radians)
 Rotate this renderer's current matrix by degrees about the y axis.
 
void rotateZRad (float radians)
 Rotate this renderer's current matrix by degrees about the z axis.
 
void rotateRad (float radians)
 Rotate this renderer's current matrix by degrees about the z axis.
 
void matrixMode (ofMatrixMode mode)
 Sets this renderer's current matrix mode.
 
void loadIdentityMatrix (void)
 Load this renderer's identity matrix.
 
void loadMatrix (const glm::mat4 &m)
 Load a matrix as this renderer's current matrix.
 
void loadMatrix (const float *m)
 Load m as this renderer's current matrix.
 
void multMatrix (const glm::mat4 &m)
 Multiply this renderer's current matrix by m.
 
void multMatrix (const float *m)
 Multiply this renderer's current matrix by m.
 
void setupGraphicDefaults ()
 setup the default graphics settings for this renderer.
 
void setupScreen ()
 setup the default screen settings for this renderer.
 
void setColor (int r, int g, int b)
 Set the global color this renderer will use when drawing.
 
void setColor (int r, int g, int b, int a)
 Set the global color this renderer will use when drawing.
 
void setColor (const ofColor &color)
 Set the global color this renderer will use when drawing.
 
void setColor (const ofColor &color, int _a)
 Set the global color this renderer will use when drawing.
 
void setColor (int gray)
 Set the global color this renderer will use when drawing.
 
void setHexColor (int hexColor)
 Set the global color this renderer will use when drawing.
 
void setBackgroundColor (const ofColor &c)
 Set this renderer's background color.
 
ofColor getBackgroundColor ()
 Get this renderer's current background color.
 
void background (const ofColor &c)
 Immediately paint a background color to the screen.
 
void background (float brightness)
 Immediately paint a grayscale background color to the screen.
 
void background (int hexColor, float _a=255.0f)
 Immediately paint a grayscale background color to the screen.
 
void background (int r, int g, int b, int a=255)
 Immediately paint a background color to the screen.
 
void setBackgroundAuto (bool bManual)
 Enable/disable automatic redrawing of the background each frame.
 
bool getBackgroundAuto ()
 Get the current auto redraw background setting for this renderer.
 
void clear ()
 Clear this renderer's current color and bit depths.
 
void clear (float r, float g, float b, float a=0)
 Clear this renderer's color and bit depths and replace them.
 
void clear (float brightness, float a=0)
 Clear this renderer's color and bit depths replacing them.
 
void clearAlpha ()
 Restore the alpha color to its full opacity value.
 
void setBitmapTextMode (ofDrawBitmapMode mode)
 Set this renderer's bitmap text mode.
 
ofStyle getStyle () const
 Get this renderer's current style object.
 
void pushStyle ()
 Push this renderer's current style into its internal style stack.
 
void popStyle ()
 Pop this renderer's current style from its internal style stack.
 
void setStyle (const ofStyle &style)
 Set this renderer's current style object.
 
void setCurveResolution (int resolution)
 Set the resolution used when drawing curves with this renderer.
 
void setPolyMode (ofPolyWindingMode mode)
 Set this renderer's poly winding mode.
 
void drawLine (float x1, float y1, float z1, float x2, float y2, float z2) const
 Draw a line between two 3D points.
 
void drawRectangle (float x, float y, float z, float w, float h) const
 Draw a rectangle using a 3D point and a width and height.
 
void drawTriangle (float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3) const
 Draw a triangle using three 3D points.
 
void drawCircle (float x, float y, float z, float radius) const
 Draw a circle using a 3D point and a radius.
 
void drawEllipse (float x, float y, float z, float width, float height) const
 Draw an ellipse using a 3D point, width, and height.
 
void drawString (std::string text, float x, float y, float z) const
 Draw text with this renderer using the current bitmap text mode.
 
void drawString (const ofTrueTypeFont &font, std::string text, float x, float y) const
 Draw text with this renderer using an ofTrueType font.
 
cairo_t * getCairoContext ()
 
cairo_surface_t * getCairoSurface ()
 
ofPixelsgetImageSurfacePixels ()
 
ofBuffergetContentBuffer ()
 
virtual void bind (const ofCamera &camera, const ofRectangle &viewport)
 Bind camera's matrices to this renderer's matrix stack.
 
virtual void unbind (const ofCamera &camera)
 Unbind the camera from this renderer.
 
const of3dGraphicsget3dGraphics () const
 Get a const reference of this renderer's 3D graphics object.
 
of3dGraphicsget3dGraphics ()
 Get a reference with this renderer's 3D graphics object.
 
virtual void draw (const ofPolyline &poly) const=0
 Draw a polyline with this renderer.
 
virtual void draw (const ofPath &shape) const=0
 Draw a path with this renderer.
 
virtual void draw (const ofPath &shape, float x, float y) const
 Draw a path with this renderer at x and y.
 
virtual void draw (const ofMesh &mesh, ofPolyRenderMode renderType) const
 Draw a mesh with this renderer using the renderType.
 
virtual void draw (const ofMesh &vertexData, ofPolyRenderMode renderType, bool useColors, bool useTextures, bool useNormals) const=0
 Draw a mesh with this renderer.
 
virtual void draw (const of3dPrimitive &model, ofPolyRenderMode renderType) const=0
 Draw a model with this renderer using the renderType.
 
virtual void draw (const ofNode &model) const=0
 Draw a node with this renderer using ofNode::customDraw().
 
virtual void draw (const ofImage &image, float x, float y, float z, float w, float h, float sx, float sy, float sw, float sh) const=0
 Draw an image with this renderer.
 
virtual void draw (const ofFloatImage &image, float x, float y, float z, float w, float h, float sx, float sy, float sw, float sh) const=0
 Draw an image with this renderer.
 
virtual void draw (const ofShortImage &image, float x, float y, float z, float w, float h, float sx, float sy, float sw, float sh) const=0
 Draw an image with this renderer.
 
virtual void draw (const ofBaseVideoDraws &video, float x, float y, float w, float h) const=0
 Draw a video with this renderer.
 
- Public Member Functions inherited from ofBaseRenderer
virtual ~ofBaseRenderer ()
 
virtual void rotateDeg (float degrees, float vecX, float vecY, float vecZ)
 Rotate this renderer's current matrix by degrees about a euler.
 
virtual void rotateXDeg (float degrees)
 Rotate this renderer's current matrix by degrees about the x axis.
 
virtual void rotateYDeg (float degrees)
 Rotate this renderer's current matrix by degrees about the y axis.
 
virtual void rotateZDeg (float degrees)
 Rotate this renderer's current matrix by degrees about the z axis.
 
virtual void rotateDeg (float degrees)
 Rotate this renderer's current matrix by degrees about the z axis.
 
virtual void setPlaneResolution (int columns, int rows)
 Set this renderer's plane resolution using column and rows.
 
virtual glm::vec2 getPlaneResolution () const
 Get this renderer's current plane resolution as a 2D vector.
 
virtual void drawPlane (float x, float y, float width, float height) const
 Draw a plane with the renderer using x, y, width, and height.
 
virtual void drawPlane (float x, float y, float z, float width, float height) const
 Draw a plane with the renderer using x, y, z, width, and height.
 
virtual void drawPlane (const glm::vec3 &position, float width, float height) const
 Draw a plane with the renderer using a 3D point, width, and height.
 
virtual void drawPlane (float width, float height) const
 Draw a plane with the renderer at the origin.
 
virtual void setSphereResolution (int res)
 Set the point resolution to use when drawing a sphere with this renderer.
 
virtual int getSphereResolution () const
 Get this renderer's current sphere resolution.
 
virtual void drawSphere (float x, float y, float radius) const
 Draw a sphere with this renderer using x, y, and radius.
 
virtual void drawSphere (float x, float y, float z, float radius) const
 Draw a sphere with this renderer using x, y, z, and radius.
 
virtual void drawSphere (const glm::vec3 &position, float radius) const
 Draw a sphere with this renderer using a position point and radius.
 
virtual void drawSphere (float radius) const
 Draw a sphere with the renderer at the defualt origin using radius.
 
virtual void setIcoSphereResolution (int res)
 Set the point resolution to use when drawing an icosphere with this renderer.
 
virtual int getIcoSphereResolution () const
 Get this renderer's current icosphere resolution.
 
virtual void drawIcoSphere (float x, float y, float z, float radius) const
 Draw an icosphere with this renderer using x, y, and radius.
 
virtual void drawIcoSphere (float x, float y, float radius) const
 Draw an icosphere with this renderer using x, y, and radius.
 
virtual void drawIcoSphere (const glm::vec3 &position, float radius) const
 Draw an icosphere with this renderer using x, y, and radius.
 
virtual void drawIcoSphere (float radius) const
 Draw an icosphere with the renderer at the origin using radius.
 
virtual void setCylinderResolution (int radiusSegments, int heightSegments, int capSegments=2)
 Set this renderer's cylinder resolution.
 
virtual glm::vec3 getCylinderResolution () const
 Get this renderer's cylinder resolution as a 3D vector.
 
virtual void drawCylinder (float x, float y, float radius, float height) const
 Draw a cylinder with this renderer using x, y, radius, and height.
 
virtual void drawCylinder (float x, float y, float z, float radius, float height) const
 Draw a cylinder with this renderer using x, y, z, radius, and height.
 
virtual void drawCylinder (const glm::vec3 &position, float radius, float height) const
 Draw a cylinder with this renderer using position, radius, and height.
 
virtual void drawCylinder (float radius, float height) const
 Draw a cylinder at the origin using radius and height.
 
virtual void setConeResolution (int radiusSegments, int heightSegments, int capSegments=2)
 Set the resolution of a polygonized cone.
 
virtual glm::vec3 getConeResolution () const
 Get this renderer's cone resolution as a 3D vector.
 
virtual void drawCone (float x, float y, float z, float radius, float height) const
 Draw a cone with this renderer using x, y, z, radius, and height.
 
virtual void drawCone (float x, float y, float radius, float height) const
 Draw a cone with this renderer using x, y, z, radius, and height.
 
virtual void drawCone (const glm::vec3 &position, float radius, float height) const
 Draw a cone with this renderer using x, y, z, radius, and height.
 
virtual void drawCone (float radius, float height) const
 Draw a cone at the origin using radius and height.
 
virtual void setBoxResolution (int res)
 Set the resolution this renderer uses when drawing boxes.
 
virtual void setBoxResolution (int resWidth, int resHeight, int resDepth)
 Set the resolution this renderer uses when drawing boxes.
 
virtual glm::vec3 getBoxResolution () const
 Get this renderer's current box resolution as a 3D vector.
 
virtual void drawBox (float x, float y, float z, float width, float height, float depth) const
 Draws a rectangular box using x, y, z, width, height, and depth.
 
virtual void drawBox (float x, float y, float z, float size) const
 Draws a cube using x, y, z, and size. coordinates.
 
virtual void drawBox (const glm::vec3 &position, float width, float height, float depth) const
 Draws a rectangular box using position, width, height and depth.
 
virtual void drawBox (const glm::vec3 &position, float size) const
 Draws a cube with the specified size, starting from the specified position.
 
virtual void drawBox (float size) const
 Draws a cube with the specified size at the origin.
 
virtual void drawBox (float width, float height, float depth) const
 Draws a rectangular box with the specified dimensions, starting from the origin.
 
virtual void drawAxis (float size) const
 Draw the coordinate system's axes with the renderer.
 
virtual void drawGrid (float stepSize, size_t numberOfSteps, bool labels, bool x, bool y, bool z) const
 Draw the coordinate system's axes as a grid with the renderer.
 
virtual void drawGridPlane (float stepSize, size_t numberOfSteps, bool labels) const
 Draw a coordinate system plane using the y and z axes.
 
virtual void drawArrow (const glm::vec3 &start, const glm::vec3 &end, float headSize) const
 Draw an arrow between two 3D points.
 
virtual void drawRotationAxes (float radius, float stripWidth, int circleRes) const
 Draw the coordinate system's axes with the renderer.
 

Static Public Attributes

static const std::string TYPE ="cairo"
 

Member Enumeration Documentation

◆ Type

Enumerator
PDF 
SVG 
IMAGE 
FROM_FILE_EXTENSION 

Constructor & Destructor Documentation

◆ ofCairoRenderer()

ofCairoRenderer::ofCairoRenderer ( )

◆ ~ofCairoRenderer()

ofCairoRenderer::~ofCairoRenderer ( )

Member Function Documentation

◆ background() [1/4]

void ofCairoRenderer::background ( const ofColor c)
virtual

Immediately paint a background color to the screen.

If automatic background drawing is enabled (which it is by default) this method called from ofApp::setup() will also repaint the background with this color each frame.

Parameters
cThe color to paint the background with.

Implements ofBaseRenderer.

◆ background() [2/4]

void ofCairoRenderer::background ( float  brightness)
virtual

Immediately paint a grayscale background color to the screen.

If automatic background drawing is enabled (which it is by default) this method called from ofApp::setup() will also repaint the background with this color each frame.

Parameters
brightnessThe grayscale value between 0 and 255 to paint the background with.

Implements ofBaseRenderer.

◆ background() [3/4]

void ofCairoRenderer::background ( int  hexColor,
float  _a = 255.0f 
)
virtual

Immediately paint a grayscale background color to the screen.

If automatic background drawing is enabled (which it is by default) this method called from ofApp::setup() will also repaint the background with this color each frame.

Parameters
hexColorThe 24-bit hex representation of the color to paint the background with.
_aThe alpha value between 0 and 255 to apply to hexColor when when painting the background.

Implements ofBaseRenderer.

◆ background() [4/4]

void ofCairoRenderer::background ( int  r,
int  g,
int  b,
int  a = 255 
)
virtual

Immediately paint a background color to the screen.

Parameters
rThe red value between 0 and 255 to use for the background.
gThe green value between 0 and 255 to use for the background.
bThe blue value between 0 and 255 to use for the background.
aThe alpha value between 0 and 255 to use for the background.

Implements ofBaseRenderer.

◆ bind()

virtual void ofCairoRenderer::bind ( const ofCamera camera,
const ofRectangle viewport 
)
inlinevirtual

Bind camera's matrices to this renderer's matrix stack.

Bind's the camera's modelview and projection matrices to this renderer's matrix stack using viewport. Should be followed with a call to unbind().

Parameters
cameraThe camera to bind to this renderer.
viewportThe viewport to use when binding camera to this renderer.

Implements ofBaseRenderer.

◆ clear() [1/3]

void ofCairoRenderer::clear ( )
virtual

Clear this renderer's current color and bit depths.

clear() will clear the screen entirely.

Implements ofBaseRenderer.

◆ clear() [2/3]

void ofCairoRenderer::clear ( float  brightness,
float  a = 0 
)
virtual

Clear this renderer's color and bit depths replacing them.

clear() will clear the screen entirely.

Parameters
brightnessThe grayscale value between 0 and 255 to use when clearing the screen.
aThe alpha value between 0 and 255 to use when clearing the screen. Defaults to 0.

Implements ofBaseRenderer.

◆ clear() [3/3]

void ofCairoRenderer::clear ( float  r,
float  g,
float  b,
float  a = 0 
)
virtual

Clear this renderer's color and bit depths and replace them.

clear() will clear the screen entirely.

Parameters
rThe red value between 0 and 255 to use when clearing the screen.
gThe green value between 0 and 255 to use when clearing the screen.
bThe blue value between 0 and 255 use when clearing the screen.
aThe alpha value between 0 and 255 use when clearing the screen. Defaults to 0.

Implements ofBaseRenderer.

◆ clearAlpha()

void ofCairoRenderer::clearAlpha ( )
virtual

Restore the alpha color to its full opacity value.

Implements ofBaseRenderer.

◆ close()

void ofCairoRenderer::close ( )

◆ disableAntiAliasing()

void ofCairoRenderer::disableAntiAliasing ( )
virtual

Disable this renderer from using anti-aliasing.

Implements ofBaseRenderer.

◆ draw() [1/22]

void ofCairoRenderer::draw ( const of3dPrimitive model,
ofPolyRenderMode  renderType 
) const
virtual

Draw a model with this renderer using the renderType.

renderType defines how the model will be rendered and may be: OF_MESH_POINTS, OF_MESH_WIREFRAME, OF_MESH_FILL

Parameters
modelThe model to draw with this renderer.
renderTypeThe render mode to use when drawing the model with this renderer.
See also
ofPolyRenderMode

Implements ofBaseRenderer.

◆ draw() [2/22]

virtual void ofBaseRenderer::draw ( const of3dPrimitive model,
ofPolyRenderMode  renderType 
) const
virtual

Draw a model with this renderer using the renderType.

renderType defines how the model will be rendered and may be: OF_MESH_POINTS, OF_MESH_WIREFRAME, OF_MESH_FILL

Parameters
modelThe model to draw with this renderer.
renderTypeThe render mode to use when drawing the model with this renderer.
See also
ofPolyRenderMode

Implements ofBaseRenderer.

◆ draw() [3/22]

void ofCairoRenderer::draw ( const ofBaseVideoDraws video,
float  x,
float  y,
float  w,
float  h 
) const
virtual

Draw a video with this renderer.

Parameters
videoThe video with draw with this renderer.
xThe x coordinate to use to draw video with this renderer.
yThe y coordinate to use to draw video with this renderer.
wThe width to use to draw the video with this renderer.
hThe height to use to draw the video with this renderer.

Implements ofBaseRenderer.

◆ draw() [4/22]

virtual void ofBaseRenderer::draw ( const ofBaseVideoDraws video,
float  x,
float  y,
float  w,
float  h 
) const
virtual

Draw a video with this renderer.

Parameters
videoThe video with draw with this renderer.
xThe x coordinate to use to draw video with this renderer.
yThe y coordinate to use to draw video with this renderer.
wThe width to use to draw the video with this renderer.
hThe height to use to draw the video with this renderer.

Implements ofBaseRenderer.

◆ draw() [5/22]

void ofCairoRenderer::draw ( const ofFloatImage image,
float  x,
float  y,
float  z,
float  w,
float  h,
float  sx,
float  sy,
float  sw,
float  sh 
) const
virtual

Draw an image with this renderer.

Parameters
imageThe image to draw with this renderer.
xThe x coordinate to use to draw image with this renderer.
yThe y coordinate to use to draw image with this renderer.
zThe z coordinate to use to draw image with this renderer.
wThe width to use to draw image with this renderer.
hThe height to use to draw image with this renderer.
sxThe subsection x axis offset within the image texture.
syThe subsection y axis offset within the image texture.
swThe subsection width offset within the image texture.
shThe subsection height offset within the image texture.

Implements ofBaseRenderer.

◆ draw() [6/22]

virtual void ofBaseRenderer::draw ( const ofFloatImage image,
float  x,
float  y,
float  z,
float  w,
float  h,
float  sx,
float  sy,
float  sw,
float  sh 
) const
virtual

Draw an image with this renderer.

Parameters
imageThe image to draw with this renderer.
xThe x coordinate to use to draw image with this renderer.
yThe y coordinate to use to draw image with this renderer.
zThe z coordinate to use to draw image with this renderer.
wThe width to use to draw image with this renderer.
hThe height to use to draw image with this renderer.
sxThe subsection x axis offset within the image texture.
syThe subsection y axis offset within the image texture.
swThe subsection width offset within the image texture.
shThe subsection height offset within the image texture.

Implements ofBaseRenderer.

◆ draw() [7/22]

virtual void ofBaseRenderer::draw ( const ofImage image,
float  x,
float  y,
float  z,
float  w,
float  h,
float  sx,
float  sy,
float  sw,
float  sh 
) const
virtual

Draw an image with this renderer.

Parameters
imageThe image to draw with this renderer.
xThe x coordinate to use when drawing image with this renderer.
yThe y coordinate to use to draw image with this renderer.
zThe z coordinate to use to drawing image with this renderer.
wThe width to use to draw the image with this renderer.
hThe height to use to draw the image with this renderer.
sxThe subsection x axis offset within the image texture.
syThe subsection y axis offset within the image texture.
swThe subsection width offset within the image texture.
shThe subsection height offset within the image texture.

Implements ofBaseRenderer.

◆ draw() [8/22]

void ofCairoRenderer::draw ( const ofImage image,
float  x,
float  y,
float  z,
float  w,
float  h,
float  sx,
float  sy,
float  sw,
float  sh 
) const
virtual

Draw an image with this renderer.

Parameters
imageThe image to draw with this renderer.
xThe x coordinate to use when drawing image with this renderer.
yThe y coordinate to use to draw image with this renderer.
zThe z coordinate to use to drawing image with this renderer.
wThe width to use to draw the image with this renderer.
hThe height to use to draw the image with this renderer.
sxThe subsection x axis offset within the image texture.
syThe subsection y axis offset within the image texture.
swThe subsection width offset within the image texture.
shThe subsection height offset within the image texture.

Implements ofBaseRenderer.

◆ draw() [9/22]

void ofBaseRenderer::draw ( const ofMesh mesh,
ofPolyRenderMode  renderType 
) const
virtual

Draw a mesh with this renderer using the renderType.

renderType defines how the mesh will be rendered and may be: OF_MESH_POINTS, OF_MESH_WIREFRAME, OF_MESH_FILL

Parameters
meshThe mesh to draw with this renderer.
renderTypeThe render mode to use to draw mesh with this renderer.
See also
ofPolyRenderMode

Reimplemented from ofBaseRenderer.

◆ draw() [10/22]

void ofCairoRenderer::draw ( const ofMesh vertexData,
ofPolyRenderMode  renderType,
bool  useColors,
bool  useTextures,
bool  useNormals 
) const
virtual

Draw a mesh with this renderer.

renderType defines how the mesh will be rendered and may be: OF_MESH_POINTS, OF_MESH_WIREFRAME, OF_MESH_FILL

Parameters
vertexDataThe mesh to draw with this renderer.
renderTypeThe render mode to use to draw vertexData to this renderer.
useColorsTrue to use per-vertex coloring to draw the vertexData.
useTexturesTrue to use texture coordinates to draw the vertexData.
useNormalsTrue to use normals to draw the vertexData.
See also
ofPolyRenderMode

Implements ofBaseRenderer.

◆ draw() [11/22]

virtual void ofBaseRenderer::draw ( const ofMesh vertexData,
ofPolyRenderMode  renderType,
bool  useColors,
bool  useTextures,
bool  useNormals 
) const
virtual

Draw a mesh with this renderer.

renderType defines how the mesh will be rendered and may be: OF_MESH_POINTS, OF_MESH_WIREFRAME, OF_MESH_FILL

Parameters
vertexDataThe mesh to draw with this renderer.
renderTypeThe render mode to use to draw vertexData to this renderer.
useColorsTrue to use per-vertex coloring to draw the vertexData.
useTexturesTrue to use texture coordinates to draw the vertexData.
useNormalsTrue to use normals to draw the vertexData.
See also
ofPolyRenderMode

Implements ofBaseRenderer.

◆ draw() [12/22]

virtual void ofBaseRenderer::draw ( const ofNode model) const
virtual

Draw a node with this renderer using ofNode::customDraw().

Parameters
modelThe node to draw with this renderer.
See also
ofNode::customDraw()

Implements ofBaseRenderer.

◆ draw() [13/22]

void ofCairoRenderer::draw ( const ofNode model) const
virtual

Draw a node with this renderer using ofNode::customDraw().

Parameters
modelThe node to draw with this renderer.
See also
ofNode::customDraw()

Implements ofBaseRenderer.

◆ draw() [14/22]

void ofCairoRenderer::draw ( const ofPath shape) const
virtual

Draw a path with this renderer.

Parameters
shapeThe path to draw with this renderer.

Implements ofBaseRenderer.

◆ draw() [15/22]

virtual void ofBaseRenderer::draw ( const ofPath shape) const
virtual

Draw a path with this renderer.

Parameters
shapeThe path to draw with this renderer.

Implements ofBaseRenderer.

◆ draw() [16/22]

virtual void ofBaseRenderer::draw ( const ofPath shape,
float  x,
float  y 
) const
inlinevirtual

Draw a path with this renderer at x and y.

Parameters
shapeThe path to draw with this renderer.
xThe x coordinate to use to draw shape.
yThe y coordinate to use to draw shape.

Reimplemented from ofBaseRenderer.

◆ draw() [17/22]

void ofCairoRenderer::draw ( const ofPath::Command path) const

◆ draw() [18/22]

void ofCairoRenderer::draw ( const ofPolyline poly) const
virtual

Draw a polyline with this renderer.

Parameters
polyThe polyline to draw with this renderer.

Implements ofBaseRenderer.

◆ draw() [19/22]

virtual void ofBaseRenderer::draw ( const ofPolyline poly) const
virtual

Draw a polyline with this renderer.

Parameters
polyThe polyline to draw with this renderer.

Implements ofBaseRenderer.

◆ draw() [20/22]

void ofCairoRenderer::draw ( const ofShortImage image,
float  x,
float  y,
float  z,
float  w,
float  h,
float  sx,
float  sy,
float  sw,
float  sh 
) const
virtual

Draw an image with this renderer.

Parameters
imageThe image to draw with this renderer.
xThe x coordinate to use to draw image with this renderer.
yThe y coordinate to use to draw image with this renderer.
zThe z coordinate to use to draw image with this renderer.
wThe width to use when drawing the image with this renderer.
hThe height to use when drawing the image with this renderer.
sxThe subsection x axis offset within the image texture.
syThe subsection y axis offset within the image texture.
swThe subsection width offset within the image texture.
shThe subsection height offset within the image texture.

Implements ofBaseRenderer.

◆ draw() [21/22]

virtual void ofBaseRenderer::draw ( const ofShortImage image,
float  x,
float  y,
float  z,
float  w,
float  h,
float  sx,
float  sy,
float  sw,
float  sh 
) const
virtual

Draw an image with this renderer.

Parameters
imageThe image to draw with this renderer.
xThe x coordinate to use to draw image with this renderer.
yThe y coordinate to use to draw image with this renderer.
zThe z coordinate to use to draw image with this renderer.
wThe width to use when drawing the image with this renderer.
hThe height to use when drawing the image with this renderer.
sxThe subsection x axis offset within the image texture.
syThe subsection y axis offset within the image texture.
swThe subsection width offset within the image texture.
shThe subsection height offset within the image texture.

Implements ofBaseRenderer.

◆ draw() [22/22]

void ofCairoRenderer::draw ( const std::vector< glm::vec3 > &  vertexData,
ofPrimitiveMode  drawMode 
) const

◆ drawCircle()

void ofCairoRenderer::drawCircle ( float  x,
float  y,
float  z,
float  radius 
) const
virtual

Draw a circle using a 3D point and a radius.

Parameters
xThe x coordinate of the center of the circle.
yThe y coordinate of the center of the circle.
zThe z coordinate of the center of the circle.
radiusThe length of the radius of the circle.

Implements ofBaseRenderer.

◆ drawEllipse()

void ofCairoRenderer::drawEllipse ( float  x,
float  y,
float  z,
float  width,
float  height 
) const
virtual

Draw an ellipse using a 3D point, width, and height.

Parameters
xThe x coordinate of the center of the circle.
yThe y coordinate of the center of the circle.
zThe z coordinate of the center of the circle.
widthThe width of the circle.
heightThe height of the circle.

Implements ofBaseRenderer.

◆ drawLine()

void ofCairoRenderer::drawLine ( float  x1,
float  y1,
float  z1,
float  x2,
float  y2,
float  z2 
) const
virtual

Draw a line between two 3D points.

Parameters
x1The x coordinate of the first point.
y1The y coordinate of the first point.
z1The z coordinate of the first point.
x2The x coordinate of the second point.
y2The y coordinate of the second point.
z2The z coordinate of the second point.

Implements ofBaseRenderer.

◆ drawRectangle()

void ofCairoRenderer::drawRectangle ( float  x,
float  y,
float  z,
float  w,
float  h 
) const
virtual

Draw a rectangle using a 3D point and a width and height.

Parameters
xThe x coordinate of the rectangle.
yThe y coordinate of the rectangle.
zThe z coordinate of the rectangle.
wThe width of the rectangle.
hThe height of the rectangle.
See also
ofRectMode

Implements ofBaseRenderer.

◆ drawString() [1/2]

void ofCairoRenderer::drawString ( const ofTrueTypeFont font,
std::string  text,
float  x,
float  y 
) const
virtual

Draw text with this renderer using an ofTrueType font.

Parameters
fontThe font to use when drawing text.
textThe text to draw with the renderer.
xThe x position for the bottom of text.
yThe y position for the left alignment of text.

Implements ofBaseRenderer.

◆ drawString() [2/2]

void ofCairoRenderer::drawString ( std::string  text,
float  x,
float  y,
float  z 
) const
virtual

Draw text with this renderer using the current bitmap text mode.

When using the OF_BITMAPMODE_SIMPLE bitmap text strings are drawn with their origin at the bottom left corner of the text. However, setBitmapTextMode() can transform this default behavior with modes like: OF_BITMAPMODE_SIMPLE OF_BITMAPMODE_SCREEN OF_BITMAPMODE_VIEWPORT OF_BITMAPMODE_MODEL OF_BITMAPMODE_MODEL_BILLBOARD

Parameters
textThe text to draw with the renderer.
xThe x position for the bottom of text.
yThe y position for the left alignment of text.
zThe z position of the text.

Implements ofBaseRenderer.

◆ drawTriangle()

void ofCairoRenderer::drawTriangle ( float  x1,
float  y1,
float  z1,
float  x2,
float  y2,
float  z2,
float  x3,
float  y3,
float  z3 
) const
virtual

Draw a triangle using three 3D points.

Parameters
x1The x coordinate of the first point.
y1The y coordinate of the first point.
z1The z coordinate of the first point.
x2The x coordinate of the second point.
y2The y coordinate of the second point.
z2The z coordinate of the second point.
x3The x coordinate of the third point.
y3The y coordinate of the third point.
z3The z coordinate of the third point.

Implements ofBaseRenderer.

◆ enableAntiAliasing()

void ofCairoRenderer::enableAntiAliasing ( )
virtual

Enable this renderer to use anti-aliasing if it is supported.

Implements ofBaseRenderer.

◆ finishRender()

void ofCairoRenderer::finishRender ( )
virtual

Stop using this renderer as the rendering surface.

Implements ofBaseRenderer.

◆ flush()

void ofCairoRenderer::flush ( )

◆ get3dGraphics() [1/2]

of3dGraphics & ofCairoRenderer::get3dGraphics ( )
virtual

Get a reference with this renderer's 3D graphics object.

Returns
the 3D graphics object currently being used by this renderer.

Implements ofBaseRenderer.

◆ get3dGraphics() [2/2]

const of3dGraphics & ofCairoRenderer::get3dGraphics ( ) const
virtual

Get a const reference of this renderer's 3D graphics object.

Returns
The 3D graphics object currently being used by this renderer.

Implements ofBaseRenderer.

◆ getBackgroundAuto()

bool ofCairoRenderer::getBackgroundAuto ( )
virtual

Get the current auto redraw background setting for this renderer.

Returns
True if this renderer is set to redraw the background each frame.

Implements ofBaseRenderer.

◆ getBackgroundColor()

ofColor ofCairoRenderer::getBackgroundColor ( )
virtual

Get this renderer's current background color.

Returns
This renderer's current background color.

Implements ofBaseRenderer.

◆ getCairoContext()

cairo_t * ofCairoRenderer::getCairoContext ( )

◆ getCairoSurface()

cairo_surface_t * ofCairoRenderer::getCairoSurface ( )

◆ getContentBuffer()

ofBuffer & ofCairoRenderer::getContentBuffer ( )

◆ getCoordHandedness()

ofHandednessType ofCairoRenderer::getCoordHandedness ( ) const
virtual

Get the coordinate handidness of this renderer.

Possible handednesses include OF_LEFT_HANDED and OF_RIGHT_HANDED. In a left handed coordinate system positive x, y and z axes point right, up and forward, respectively and positive rotation is clockwise about the axis of rotation. In a right handed coordinate system the positive x and y axes point right and up, and the negative z axis points forward and positive rotation is counterclockwise about the axis of rotation.

Returns
The handedness this renderer is using.
See also
http://seanmiddleditch.com/matrices-handedness-pre-and-post-multiplication-row-vs-column-major-and-notations/
https://www.evl.uic.edu/ralph/508S98/coordinates.html

Implements ofBaseRenderer.

◆ getCurrentMatrix()

glm::mat4 ofCairoRenderer::getCurrentMatrix ( ofMatrixMode  matrixMode_) const
virtual

Get this renderer's current matrix for particular a matrix mode.

Possible matrix modes include: OF_MATRIX_MODELVIEW OF_MATRIX_PROJECTION OF_MATRIX_TEXTURE

Parameters
matrixMode_The matrix mode to get the current matrix of.
Returns
The current matrix specified by matrixMode_
See also
ofMatrixMode

Implements ofBaseRenderer.

◆ getCurrentNormalMatrix()

glm::mat4 ofCairoRenderer::getCurrentNormalMatrix ( ) const
virtual

Get this renderer's current normal matrix.

Returns
This renderer's current normal matrix.

Implements ofBaseRenderer.

◆ getCurrentOrientationMatrix()

glm::mat4 ofCairoRenderer::getCurrentOrientationMatrix ( ) const
virtual

Get this renderer's current orientation matrix.

Returns
This renderer's current orientation matrix.

Implements ofBaseRenderer.

◆ getCurrentViewMatrix()

glm::mat4 ofCairoRenderer::getCurrentViewMatrix ( ) const
virtual

Get this renderer's current view matrix.

Returns
This renderer's current view matrix.

Implements ofBaseRenderer.

◆ getCurrentViewport()

ofRectangle ofCairoRenderer::getCurrentViewport ( ) const
virtual

Get this renderer's current viewport.

Unlike getNativeViewport(), this method gets this renderer's current viewport with orientation and vertical flipping applied.

Returns
This renderer's viewport as a rectangle.
See also
getNativeViewport()

Implements ofBaseRenderer.

◆ getFillMode()

ofFillFlag ofCairoRenderer::getFillMode ( )
virtual

Get this renderer's current fill flag.

Possible fill flags include OF_OUTLINE and OF_FILLED.

Returns
The fill flag this render is currently using.
See also
ofFillFlag

Implements ofBaseRenderer.

◆ getImageSurfacePixels()

ofPixels & ofCairoRenderer::getImageSurfacePixels ( )

◆ getNativeViewport()

ofRectangle ofCairoRenderer::getNativeViewport ( ) const
virtual

Get this renderer's current native viewport.

Unlike getViewport(), this method gets this renderer's current viewport without orientation and vertical flipping applied.

Returns
This renderer's native viewport as a rectangle.
See also
getViewport()

Implements ofBaseRenderer.

◆ getPath()

ofPath & ofCairoRenderer::getPath ( )
virtual

Get a reference to the path used internally by this renderer.

Returns
A reference to the path used internally by this renderer.

Implements ofBaseRenderer.

◆ getRectMode()

ofRectMode ofCairoRenderer::getRectMode ( )
virtual

Get this renderer's current rect mode.

Possible rect modes include OF_RECTMODE_CORNER and OF_RECTMODE_CENTER.

Returns
The renderer's current rect mode.
See also
ofRectMode

Implements ofBaseRenderer.

◆ getStyle()

ofStyle ofCairoRenderer::getStyle ( ) const
virtual

Get this renderer's current style object.

Returns
This renderer's current style object.

Implements ofBaseRenderer.

◆ getType()

const std::string & ofCairoRenderer::getType ( )
inlinevirtual

Get the string representation of the renderer type.

For example, this method may return "GL", "ProgrammableGL", or another type depending on the renderer being used.

Returns
The string representation of the renderer type.

Implements ofBaseRenderer.

◆ getViewportHeight()

int ofCairoRenderer::getViewportHeight ( ) const
virtual

Get the renderer's current viewport width.

Returns
The renderer's current viewport width.

Implements ofBaseRenderer.

◆ getViewportWidth()

int ofCairoRenderer::getViewportWidth ( ) const
virtual

Get the renderer's current viewport width.

Returns
The renderer's current viewport width.

Implements ofBaseRenderer.

◆ isVFlipped()

bool ofCairoRenderer::isVFlipped ( ) const
virtual

Returns true if the renderer's current viewport is vertically flipped.

Returns
True if the renderer's current viewport is vertically flipped.

Implements ofBaseRenderer.

◆ loadIdentityMatrix()

void ofCairoRenderer::loadIdentityMatrix ( void  )
virtual

Load this renderer's identity matrix.

This identity matrix is an mat4 matrix with 1s on the main diagonal and 0s elsewhere. [ [1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1] ]

Matrix multiplications using this matrix as the multiplier will yield no change in the multiplicand matrix.

Implements ofBaseRenderer.

◆ loadMatrix() [1/2]

void ofCairoRenderer::loadMatrix ( const float *  m)
virtual

Load m as this renderer's current matrix.

m can be passed to loadMatrix() in this way from raw data

Parameters
mFloat pointer to an 4x4 matrix.

Implements ofBaseRenderer.

◆ loadMatrix() [2/2]

void ofCairoRenderer::loadMatrix ( const glm::mat4 &  m)
virtual

Load a matrix as this renderer's current matrix.

Parameters
mThe matrix to load into this renderer.

Implements ofBaseRenderer.

◆ loadViewMatrix()

void ofCairoRenderer::loadViewMatrix ( const glm::mat4 &  m)
virtual

Load m into this renderer's matrix stack as a view matrix.

Parameters
mThe view matrix to load into this renderer's matrix stack.

Implements ofBaseRenderer.

◆ matrixMode()

void ofCairoRenderer::matrixMode ( ofMatrixMode  mode)
virtual

Sets this renderer's current matrix mode.

The possible matrix modes include: OF_MATRIX_MODELVIEW OF_MATRIX_PROJECTION OF_MATRIX_TEXTURE

Parameters
modeThe matrix mode this renderer's matrix should use.

Implements ofBaseRenderer.

◆ multMatrix() [1/2]

void ofCairoRenderer::multMatrix ( const float *  m)
virtual

Multiply this renderer's current matrix by m.

m can be passed to loadMatrix() in this way with raw data

Parameters
mFloat pointer to an mat4 to multiply this renderer's current matrix by.

Implements ofBaseRenderer.

◆ multMatrix() [2/2]

void ofCairoRenderer::multMatrix ( const glm::mat4 &  m)
virtual

Multiply this renderer's current matrix by m.

Parameters
mThe matrix to multiply this renderer's current matrix by.

Implements ofBaseRenderer.

◆ multViewMatrix()

void ofCairoRenderer::multViewMatrix ( const glm::mat4 &  m)
virtual

Multiply this renderer's view matrix by m.

Parameters
mThe matrix to multiply this renderer's view matrix by.

Implements ofBaseRenderer.

◆ popMatrix()

void ofCairoRenderer::popMatrix ( )
virtual

Pops this renderer's current matrix stack.

popMatrix() restores the renderer's matrix to the state it was last saved with with a call to pushMatrix().

Implements ofBaseRenderer.

◆ popStyle()

void ofCairoRenderer::popStyle ( )
virtual

Pop this renderer's current style from its internal style stack.

This restores the style that was last saved with pushStyle().

Implements ofBaseRenderer.

◆ popView()

void ofCairoRenderer::popView ( )
virtual

Pop the current viewport from the renderer's view stack.

popView() restores the renderer's viewport to the state it was last saved with with a call to pushView().

See also
viewport()

Implements ofBaseRenderer.

◆ pushMatrix()

void ofCairoRenderer::pushMatrix ( )
virtual

Pushes this renderer's matrix stack down by one.

pushMatrix() saves the renderer's current matrix allowing new transformations and scales to effect only the new matrix created by this method. Should be paired with a call to popMatrix().

Implements ofBaseRenderer.

◆ pushStyle()

void ofCairoRenderer::pushStyle ( )
virtual

Push this renderer's current style into its internal style stack.

This creates a new style object used by this renderer internally until popStyle() is called.

Implements ofBaseRenderer.

◆ pushView()

void ofCairoRenderer::pushView ( )
virtual

Push the current viewport into the renderer's viewport stack.

pushViewport() save the current viewport to the renderer's viewport history stack allowing new viewport operations to effect only the new viewport created by this method. Should be paired with popView.

See also
viewport()

Implements ofBaseRenderer.

◆ rotateRad() [1/2]

void ofCairoRenderer::rotateRad ( float  degrees)
virtual

Rotate this renderer's current matrix by degrees about the z axis.

This method is an alias of rotateZ().

Parameters
degreesDegrees to rotate about the z axis.
See also
rotateZ()

Implements ofBaseRenderer.

◆ rotateRad() [2/2]

void ofCairoRenderer::rotateRad ( float  degrees,
float  vecX,
float  vecY,
float  vecZ 
)
virtual

Rotate this renderer's current matrix by degrees about a euler.

Parameters
degreesDegrees to rotate about vecX, vecY, and vecZ.
vecXThe x axis to rotate about.
vecYThe y axis to rotate about.
vecZThe z axis to rotate about.

Implements ofBaseRenderer.

◆ rotateXRad()

void ofCairoRenderer::rotateXRad ( float  degrees)
virtual

Rotate this renderer's current matrix by degrees about the x axis.

Parameters
degreesDegrees to rotate about the x axis.

Implements ofBaseRenderer.

◆ rotateYRad()

void ofCairoRenderer::rotateYRad ( float  degrees)
virtual

Rotate this renderer's current matrix by degrees about the y axis.

Parameters
degreesDegrees to rotate about the y axis.

Implements ofBaseRenderer.

◆ rotateZRad()

void ofCairoRenderer::rotateZRad ( float  degrees)
virtual

Rotate this renderer's current matrix by degrees about the z axis.

Parameters
degreesDegrees to rotate about the z axis.

Implements ofBaseRenderer.

◆ scale()

void ofCairoRenderer::scale ( float  xAmnt,
float  yAmnt,
float  zAmnt = 1 
)
virtual

Scale this renderer's current matrix by xAmnt, yAmnt, and zAmnt.

Parameters
xAmntThe amount to scale this renderer's current matrix's x axis by.
yAmntThe amount to scale this renderer's current matrix's y axis by.
zAmntThe amount to scale this renderer's current matrix's z axis by. Defaults to 1.

Implements ofBaseRenderer.

◆ setBackgroundAuto()

void ofCairoRenderer::setBackgroundAuto ( bool  bManual)
virtual

Enable/disable automatic redrawing of the background each frame.

Parameters
bManualFalse to disable automatic background redrawing.

Implements ofBaseRenderer.

◆ setBackgroundColor()

void ofCairoRenderer::setBackgroundColor ( const ofColor c)
virtual

Set this renderer's background color.

Parameters
cThe color to request this renderer to use.

Implements ofBaseRenderer.

◆ setBitmapTextMode()

void ofCairoRenderer::setBitmapTextMode ( ofDrawBitmapMode  mode)
virtual

Set this renderer's bitmap text mode.

Possible bitmap texture modes include: OF_BITMAPMODE_SIMPLE OF_BITMAPMODE_SCREEN OF_BITMAPMODE_VIEWPORT OF_BITMAPMODE_MODEL OF_BITMAPMODE_MODEL_BILLBOARD

Parameters
modeThe bitmap mode to request this renderer to use.
See also
ofDrawBitmapMode

Implements ofBaseRenderer.

◆ setBlendMode()

void ofCairoRenderer::setBlendMode ( ofBlendMode  blendMode)
virtual

Set this renderer's current blend mode.

Possible blend modes include:

Rotate this renderer's current matrix by degrees about the z axis.

This method is an alias of rotateZ().

Parameters
degreesDegrees to rotate about the z axis.
See also
rotateZ() OF_BLENDMODE_DISABLED OF_BLENDMODE_ALPHA OF_BLENDMODE_ADD OF_BLENDMODE_SUBTRACT OF_BLENDMODE_MULTIPLY OF_BLENDMODE_SCREEN
Parameters
blendModeThe blend mode to request this renderer to use.
See also
ofBlendMode
https://helpx.adobe.com/photoshop/using/blending-modes.html

Implements ofBaseRenderer.

◆ setCircleResolution()

void ofCairoRenderer::setCircleResolution ( int  res)
virtual

Set the resolution to use when drawing ellipses with this renderer.

Parameters
resThe number of points to use when drawing circles and ellipses with this renderer.

Implements ofBaseRenderer.

◆ setColor() [1/5]

void ofCairoRenderer::setColor ( const ofColor color)
virtual

Set the global color this renderer will use when drawing.

The renderer will continue using a color set by setColor() until another call to setColor() changes the drawing color.

Parameters
colorThe color to use when drawing.

Implements ofBaseRenderer.

◆ setColor() [2/5]

void ofCairoRenderer::setColor ( const ofColor color,
int  _a 
)
virtual

Set the global color this renderer will use when drawing.

The renderer will continue using a color set by setColor() until another call to setColor() changes the drawing color.

Parameters
colorThe color to use when drawing.
_aThe alpha value between 0 and 255 to use when drawing.

Implements ofBaseRenderer.

◆ setColor() [3/5]

void ofCairoRenderer::setColor ( int  gray)
virtual

Set the global color this renderer will use when drawing.

The renderer will continue using a color set by setColor() until another call to setColor() changes the drawing color.

Parameters
grayThe grayscale value to use when drawing.

Implements ofBaseRenderer.

◆ setColor() [4/5]

void ofCairoRenderer::setColor ( int  r,
int  g,
int  b 
)
virtual

Set the global color this renderer will use when drawing.

The renderer will continue using a color set by setColor() until another call to setColor() changes the drawing color.

Parameters
rThe red value between 0 and 255 to use when drawing.
gThe green value between 0 and 255 to use when drawing.
bThe blue value between 0 and 255 to use when drawing.

Implements ofBaseRenderer.

◆ setColor() [5/5]

void ofCairoRenderer::setColor ( int  r,
int  g,
int  b,
int  a 
)
virtual

Set the global color this renderer will use when drawing.

The renderer will continue using a color set by setColor() until another call to setColor() changes the drawing color.

Parameters
rThe red value between 0 and 255 to use when drawing.
gThe green value between 0 and 255 to use when drawing.
bThe blue value between 0 and 255 to use when drawing.
aThe alpha value between 0 and 255 to use when drawing.

Implements ofBaseRenderer.

◆ setCoordHandedness()

void ofCairoRenderer::setCoordHandedness ( ofHandednessType  handedness)
virtual

Set the coordinate handidness of this renderer.

Possible handednesses include OF_LEFT_HANDED and OF_RIGHT_HANDED. In a left handed coordinate system positive x, y and z axes point right, up and forward, respectively and positive rotation is clockwise about the axis of rotation. In a right handed coordinate system the positive x and y axes point right and up, and the negative z axis points forward and positive rotation is counterclockwise about the axis of rotation.

Parameters
handednessThe handedness to set this renderer to use.
See also
http://seanmiddleditch.com/matrices-handedness-pre-and-post-multiplication-row-vs-column-major-and-notations/
https://www.evl.uic.edu/ralph/508S98/coordinates.html

Implements ofBaseRenderer.

◆ setCurveResolution()

void ofCairoRenderer::setCurveResolution ( int  resolution)
virtual

Set the resolution used when drawing curves with this renderer.

Parameters
resolutionThe resolution to request this renderer to use when drawing curves.

Implements ofBaseRenderer.

◆ setDepthTest()

void ofCairoRenderer::setDepthTest ( bool  depthTest)
virtual

Enable/disable depth testing with this renderer.

When depth testing is enabled the order shapes are drawn with the renderer is dependent on their distance from the camera rather than the order their drawing methods were called. This should be enabled when expecting normal behavior when drawing 3D scenes.

Parameters
depthTestTrue to enable depth testing.

Implements ofBaseRenderer.

◆ setFillMode()

void ofCairoRenderer::setFillMode ( ofFillFlag  fill)
virtual

set this renderer's fill flag.

Possible fill flags include OF_OUTLINE and OF_FILLED.

Parameters
fillThe fill flag to request this renderer to use.
See also
ofFillFlag

Implements ofBaseRenderer.

◆ setHexColor()

void ofCairoRenderer::setHexColor ( int  hexColor)
virtual

Set the global color this renderer will use when drawing.

The renderer will continue using a color set by setColor() until another call to setColor() changes the drawing color.

Parameters
hexColorThe hexidecimal representation of the color to use when drawing.

Implements ofBaseRenderer.

◆ setLineSmoothing()

void ofCairoRenderer::setLineSmoothing ( bool  smooth)
virtual

Enable/disable line smoothing for this renderer if it's supported.

Parameters
smoothTrue to enable line smoothing for this renderer if it's supported.

Implements ofBaseRenderer.

◆ setLineWidth()

void ofCairoRenderer::setLineWidth ( float  lineWidth)
virtual

Set the line width this renderer should use when drawing lines.

Parameters
lineWidthThe line width to request this renderer to use.

Implements ofBaseRenderer.

◆ setOrientation()

void ofCairoRenderer::setOrientation ( ofOrientation  orientation,
bool  vFlip 
)
virtual

set this renderer's orientation.

Possible orientation values include: OF_ORIENTATION_DEFAULT OF_ORIENTATION_180 OF_ORIENTATION_90_LEFT OF_ORIENTATION_90_RIGHT OF_ORIENTATION_UNKNOWN

Parameters
orientationThe orientation to use with this renderer.
vFlipTrue if the orientation should be vertically flipped.
See also
ofOrientation

Implements ofBaseRenderer.

◆ setPolyMode()

void ofCairoRenderer::setPolyMode ( ofPolyWindingMode  mode)
virtual

Set this renderer's poly winding mode.

Possible poly winding modes include: OF_POLY_WINDING_ODD OF_POLY_WINDING_NONZERO OF_POLY_WINDING_POSITIVE OF_POLY_WINDING_NEGATIVE OF_POLY_WINDING_ABS_GEQ_TWO

Parameters
modeThe poly winding mode to request this renderer to use.
See also
ofPolyWindingMode

Implements ofBaseRenderer.

◆ setRectMode()

void ofCairoRenderer::setRectMode ( ofRectMode  mode)
virtual

Set this renderer's rect mode.

Possible rect modes include OF_RECTMODE_CORNER and OF_RECTMODE_CENTER.

Parameters
modeThe rect mode to request this renderer to use.
See also
ofRectMode

Implements ofBaseRenderer.

◆ setStyle()

void ofCairoRenderer::setStyle ( const ofStyle style)
virtual

Set this renderer's current style object.

Parameters
styleThe style object to set this renderer to use.

Implements ofBaseRenderer.

◆ setup()

void ofCairoRenderer::setup ( const of::filesystem::path &  filename,
Type  type = ofCairoRenderer::FROM_FILE_EXTENSION,
bool  multiPage = true,
bool  b3D = false,
ofRectangle  outputsize = ofRectangle(0,0,0,0) 
)

◆ setupGraphicDefaults()

void ofCairoRenderer::setupGraphicDefaults ( )
virtual

setup the default graphics settings for this renderer.

Implements ofBaseRenderer.

◆ setupMemoryOnly()

void ofCairoRenderer::setupMemoryOnly ( Type  _type,
bool  multiPage = true,
bool  b3D = false,
ofRectangle  viewport = ofRectangle(0,0,0,0) 
)

◆ setupScreen()

void ofCairoRenderer::setupScreen ( )
virtual

setup the default screen settings for this renderer.

Implements ofBaseRenderer.

◆ setupScreenOrtho()

void ofCairoRenderer::setupScreenOrtho ( float  width = -1,
float  height = -1,
float  nearDist = -1,
float  farDist = 1 
)
virtual

Setup the renderer to use an orthographic matrix.

Parameters
widthThe width of the desired orthographic matrix. Defaults to -1 setting its width according to the rendering surface's width.
heightThe height of the desired orthographic matrix. Defaults to -1 setting its height according to the rendering surface's height.
nearDistThe near clipping distance to use with the orthographic matrix. Setting this value to 0 uses the defualt near distance. Defaults to 0.
farDistThe far clipping distance to use with the orthographic matrix. Setting this value to 0 uses the defualt near distance. Defaults to 0.

Implements ofBaseRenderer.

◆ setupScreenPerspective()

void ofCairoRenderer::setupScreenPerspective ( float  width = -1,
float  height = -1,
float  fov = 60,
float  nearDist = 0,
float  farDist = 0 
)
virtual

Setup the renderer to use a perspective matrix.

Parameters
widthThe width of the desired perspective matrix. Defaults to -1 setting its width according to the rendering surface's width.
heightThe height of the desired perspective matrix. Defaults to Defaults to -1 setting its width according to the rendering surface's width.
fovThe field of view to use with the perspective matrix. Defaults to 60.
nearDistThe near clipping distance to use with the perspective matrix. Setting this value to 0 uses the default near distance. Defaults to 0.
farDistThe far clipping distance to use with the perspective matrix. Setting this value to 0 uses the default near distance. Defaults to 0.

Implements ofBaseRenderer.

◆ startRender()

void ofCairoRenderer::startRender ( )
virtual

Starts using this renderer as the rendering surface.

Implements ofBaseRenderer.

◆ translate() [1/2]

void ofCairoRenderer::translate ( const glm::vec3 &  p)
virtual

Translate this renderer's current matrix by a point.

Parameters
pThe 3D point to translate this renderer's current matrix by.

Implements ofBaseRenderer.

◆ translate() [2/2]

void ofCairoRenderer::translate ( float  x,
float  y,
float  z = 0 
)
virtual

Translate this renderer's current matrix by x, y, and z.

Parameters
xThe x coordinate to translate this renderer's current matrix by.
yThe y coordinate to translate this renderer's current matrix by.
zThe z coordinate to translate this renderer's current matrix by. Defaults to 0.

Implements ofBaseRenderer.

◆ unbind()

virtual void ofCairoRenderer::unbind ( const ofCamera camera)
inlinevirtual

Unbind the camera from this renderer.

Parameters
cameraThe camera to unbind from this renderer.

Implements ofBaseRenderer.

◆ viewport() [1/2]

void ofCairoRenderer::viewport ( float  x = 0,
float  y = 0,
float  width = -1,
float  height = -1,
bool  vflip = true 
)
virtual

Set this renderer's viewport manually using x, y, width, and height.

Parameters
xThe x coordinate of the viewport. Defaults to 0.
yThe y coordinate of the viewport. Defaults to 0.
wThe width of the viewport. Defaults to -1 setting its width according to the rendering surface's width.
hThe height of the viewport. Defaults to -1 setting its height according to the rendering surface's height.

Implements ofBaseRenderer.

◆ viewport() [2/2]

void ofCairoRenderer::viewport ( ofRectangle  viewport)
virtual

Set this renderer's viewport using a rectangle.

This method uses the ofGetWidth() and ofGetHeight() to set the width and height of the viewport. It also automatically creates near and far clipping planes based on this width and height.

Implements ofBaseRenderer.

Member Data Documentation

◆ TYPE

const string ofCairoRenderer::TYPE ="cairo"
static

The documentation for this class was generated from the following files: