![]() |
Cinder
0.9.1
|
#include <Cairo.h>
Public Member Functions | |
Context () | |
Context (const SurfaceBase &surface) | |
Context (const Context &other) | |
~Context () | |
Context & | operator= (const Context &other) |
cairo_t * | getCairo () |
cairo_surface_t * | getCairoSuface () |
void | save () |
void | restore () |
void | flush () |
void | pushGroup () |
void | pushGroupWithContent (int32_t content) |
Pattern * | popGroup () |
void | popGroupToSource () |
void | setSourceRgb (double red, double green, double blue) |
void | setSourceRgba (double red, double green, double blue, double alpha) |
void | setSource (const Color &col) |
void | setSource (const ColorAf &col) |
void | setSource (const Pattern &source) |
void | setSourceSurface (SurfaceBase &surface, double x, double y) |
Pattern * | getSource () |
void | copySurface (const SurfaceBase &surface, const Area &srcArea, const ivec2 &dstOffset=ivec2(0)) |
void | copySurface (const SurfaceBase &surface, const Area &srcArea, const Rectf &dstRect) |
void | setAntiAlias (int32_t antialias) |
int32_t | getAntiAlias () |
void | setDash (const double *dashes, int numDashes, double offset) |
void | setDash (const std::vector< double > &dashes, double offset=0) |
void | unsetDash () |
int | getDashCount () const |
void | getDash (double *dashes, double *offset) |
void | setFillRule (int32_t fill_rule) |
int32_t | getFillRule () |
void | setLineCap (int32_t line_cap) |
int32_t | getLineCap () |
void | setLineJoin (int32_t line_join) |
int32_t | getLineJoin () |
void | setLineWidth (double width) |
double | getLineWidth () const |
void | setMiterLimit (double limit) |
double | getMiterLimit () const |
void | setOperator (int32_t op) |
int32_t | getOperator () |
void | setTolerance (double tolerance) |
double | getTolerance () const |
void | clip () |
void | clipPerserve () |
void | clipExtents (double *x1, double *y1, double *x2, double *y2) |
void | resetClip () |
void | fill () |
void | fillPreserve () |
void | fillExtents (double *x1, double *y1, double *x2, double *y2) |
bool | inFill (double x, double y) |
void | mask (Pattern *pattern) |
void | maskSurface (SurfaceBase *surface, double surface_x, double surface_y) |
void | paint () |
void | paintWithAlpha (double alpha) |
void | stroke () |
void | strokePreserve () |
void | strokeExtents (double *x1, double *y1, double *x2, double *y2) |
bool | inStroke (double x, double y) |
void | copyPage () |
void | showPage () |
void | copyPath (cinder::Shape2d *resultPath) |
void | copyPathFlat (cinder::Shape2d *resultPath) |
void | getCurrentPoint (double *x, double *y) const |
vec2 | getCurrentPoint () const |
void | newPath () |
void | newSubPath () |
void | closePath () |
void | arc (double xc, double yc, double radius, double angle1, double angle2) |
void | arc (const vec2 ¢er, double radius, double angle1, double angle2) |
void | arcNegative (double xc, double yc, double radius, double angle1, double angle2) |
void | arcNegative (const vec2 ¢er, double radius, double angle1, double angle2) |
void | quadTo (double x1, double y1, double x2, double y2) |
void | quadTo (const vec2 &v1, const vec2 &v2) |
void | curveTo (double x1, double y1, double x2, double y2, double x3, double y3) |
void | curveTo (const vec2 &v1, const vec2 &v2, const vec2 &v3) |
void | line (const vec2 &v1, const vec2 &v2) |
void | lineTo (double x, double y) |
void | lineTo (const vec2 &v) |
void | moveTo (double x, double y) |
void | moveTo (const vec2 &v) |
void | rectangle (double x, double y, double width, double height) |
void | rectangle (const Rectf &r) |
void | rectangle (const vec2 &upperLeft, const vec2 &lowerRight) |
void | roundedRectangle (const Rectf &r, float cornerRadius) |
void | textPath (const char *utf8) |
void | relCurveTo (double dx1, double dy1, double dx2, double dy2, double dx3, double dy3) |
void | relLineTo (double dx, double dy) |
void | relMoveTo (double dx, double dy) |
void | appendPath (const cinder::Shape2d &path) |
void | appendPath (const cinder::Path2d &path) |
void | circle (double dx, double dy, double radius) |
void | circle (const vec2 &v, double radius) |
void | render (const svg::Node &node, const std::function< bool(const svg::Node &, svg::Style *)> &visitor=std::function< bool(const svg::Node &, svg::Style *)>()) |
void | translate (double tx, double ty) |
void | translate (const vec2 &v) |
void | scale (double sx, double sy) |
void | rotate (double radians) |
void | transform (const Matrix &aMatrix) |
void | transform (const mat3 &matrix) |
void | setMatrix (const Matrix &aMatrix) |
void | setMatrix (const mat3 &matrix) |
void | getMatrix (Matrix *aMatrix) |
mat3 | getMatrix () const |
void | identityMatrix () |
void | userToDevice (double *x, double *y) |
void | userToDeviceDistance (double *dx, double *dy) |
void | deviceToUser (double *x, double *y) |
void | deviceToUserDistance (double *dx, double *dy) |
void | setFont (const cinder::Font &font) |
void | selectFontFace (const std::string &family, int32_t slant, int32_t weight) |
void | setFontSize (double size) |
void | setFontMatrix (const Matrix &matrix) |
void | getFontMatrix (Matrix *matrix) |
void | setFontOptions (const FontOptions *options) |
void | getFontOptions (FontOptions *options) |
void | setFontFace (const FontFace &font_face) |
FontFace * | getFontFace () |
void | setScaledFont (const ScaledFont *scaled_font) |
ScaledFont * | getScaledFont () |
void | showText (const std::string &s) |
void | textPath (const std::string &s) |
void | glyphPath (const std::vector< std::pair< uint16_t, vec2 > > &glyphs) |
void | glyphPath (uint16_t index, const vec2 &offset) |
FontExtents | fontExtents () |
TextExtents | textExtents (const std::string &s) |
std::string | statusToString () const |
Protected Attributes | |
cairo_t * | mCairo |
cairo_surface_t * | mCairoSurface |
cinder::cairo::Context::Context | ( | ) |
cinder::cairo::Context::Context | ( | const SurfaceBase & | surface | ) |
cinder::cairo::Context::Context | ( | const Context & | other | ) |
cinder::cairo::Context::~Context | ( | ) |
cairo_t* cinder::cairo::Context::getCairo | ( | ) |
Returns the native cairo context pointer.
cairo_surface_t* cinder::cairo::Context::getCairoSuface | ( | ) |
Returns the native cairo surface pointer.
void cinder::cairo::Context::save | ( | ) |
void cinder::cairo::Context::restore | ( | ) |
void cinder::cairo::Context::flush | ( | ) |
void cinder::cairo::Context::pushGroup | ( | ) |
void cinder::cairo::Context::pushGroupWithContent | ( | int32_t | content | ) |
Pattern* cinder::cairo::Context::popGroup | ( | ) |
void cinder::cairo::Context::popGroupToSource | ( | ) |
void cinder::cairo::Context::setSourceRgb | ( | double | red, |
double | green, | ||
double | blue | ||
) |
void cinder::cairo::Context::setSourceRgba | ( | double | red, |
double | green, | ||
double | blue, | ||
double | alpha | ||
) |
void cinder::cairo::Context::setSource | ( | const Color & | col | ) |
void cinder::cairo::Context::setSource | ( | const ColorAf & | col | ) |
void cinder::cairo::Context::setSource | ( | const Pattern & | source | ) |
void cinder::cairo::Context::setSourceSurface | ( | SurfaceBase & | surface, |
double | x, | ||
double | y | ||
) |
Pattern* cinder::cairo::Context::getSource | ( | ) |
void cinder::cairo::Context::copySurface | ( | const SurfaceBase & | surface, |
const Area & | srcArea, | ||
const ivec2 & | dstOffset = ivec2(0) |
||
) |
void cinder::cairo::Context::copySurface | ( | const SurfaceBase & | surface, |
const Area & | srcArea, | ||
const Rectf & | dstRect | ||
) |
void cinder::cairo::Context::setAntiAlias | ( | int32_t | antialias | ) |
int32_t cinder::cairo::Context::getAntiAlias | ( | ) |
void cinder::cairo::Context::setDash | ( | const double * | dashes, |
int | numDashes, | ||
double | offset | ||
) |
void cinder::cairo::Context::setDash | ( | const std::vector< double > & | dashes, |
double | offset = 0 |
||
) |
void cinder::cairo::Context::unsetDash | ( | ) |
int cinder::cairo::Context::getDashCount | ( | ) | const |
void cinder::cairo::Context::getDash | ( | double * | dashes, |
double * | offset | ||
) |
void cinder::cairo::Context::setFillRule | ( | int32_t | fill_rule | ) |
int32_t cinder::cairo::Context::getFillRule | ( | ) |
void cinder::cairo::Context::setLineCap | ( | int32_t | line_cap | ) |
int32_t cinder::cairo::Context::getLineCap | ( | ) |
void cinder::cairo::Context::setLineJoin | ( | int32_t | line_join | ) |
int32_t cinder::cairo::Context::getLineJoin | ( | ) |
void cinder::cairo::Context::setLineWidth | ( | double | width | ) |
double cinder::cairo::Context::getLineWidth | ( | ) | const |
void cinder::cairo::Context::setMiterLimit | ( | double | limit | ) |
double cinder::cairo::Context::getMiterLimit | ( | ) | const |
void cinder::cairo::Context::setOperator | ( | int32_t | op | ) |
int32_t cinder::cairo::Context::getOperator | ( | ) |
void cinder::cairo::Context::setTolerance | ( | double | tolerance | ) |
double cinder::cairo::Context::getTolerance | ( | ) | const |
void cinder::cairo::Context::clip | ( | ) |
void cinder::cairo::Context::clipPerserve | ( | ) |
void cinder::cairo::Context::clipExtents | ( | double * | x1, |
double * | y1, | ||
double * | x2, | ||
double * | y2 | ||
) |
void cinder::cairo::Context::resetClip | ( | ) |
void cinder::cairo::Context::fill | ( | ) |
void cinder::cairo::Context::fillPreserve | ( | ) |
void cinder::cairo::Context::fillExtents | ( | double * | x1, |
double * | y1, | ||
double * | x2, | ||
double * | y2 | ||
) |
bool cinder::cairo::Context::inFill | ( | double | x, |
double | y | ||
) |
void cinder::cairo::Context::mask | ( | Pattern * | pattern | ) |
void cinder::cairo::Context::maskSurface | ( | SurfaceBase * | surface, |
double | surface_x, | ||
double | surface_y | ||
) |
void cinder::cairo::Context::paint | ( | ) |
void cinder::cairo::Context::paintWithAlpha | ( | double | alpha | ) |
void cinder::cairo::Context::stroke | ( | ) |
void cinder::cairo::Context::strokePreserve | ( | ) |
void cinder::cairo::Context::strokeExtents | ( | double * | x1, |
double * | y1, | ||
double * | x2, | ||
double * | y2 | ||
) |
bool cinder::cairo::Context::inStroke | ( | double | x, |
double | y | ||
) |
void cinder::cairo::Context::copyPage | ( | ) |
void cinder::cairo::Context::showPage | ( | ) |
void cinder::cairo::Context::copyPath | ( | cinder::Shape2d * | resultPath | ) |
Copy the current path to resultPath
void cinder::cairo::Context::copyPathFlat | ( | cinder::Shape2d * | resultPath | ) |
Copy a flattened, curve-free version of the current path to resultPath
void cinder::cairo::Context::getCurrentPoint | ( | double * | x, |
double * | y | ||
) | const |
vec2 cinder::cairo::Context::getCurrentPoint | ( | ) | const |
void cinder::cairo::Context::newPath | ( | ) |
void cinder::cairo::Context::newSubPath | ( | ) |
void cinder::cairo::Context::closePath | ( | ) |
void cinder::cairo::Context::arc | ( | double | xc, |
double | yc, | ||
double | radius, | ||
double | angle1, | ||
double | angle2 | ||
) |
void cinder::cairo::Context::arc | ( | const vec2 & | center, |
double | radius, | ||
double | angle1, | ||
double | angle2 | ||
) |
void cinder::cairo::Context::arcNegative | ( | double | xc, |
double | yc, | ||
double | radius, | ||
double | angle1, | ||
double | angle2 | ||
) |
void cinder::cairo::Context::arcNegative | ( | const vec2 & | center, |
double | radius, | ||
double | angle1, | ||
double | angle2 | ||
) |
void cinder::cairo::Context::quadTo | ( | double | x1, |
double | y1, | ||
double | x2, | ||
double | y2 | ||
) |
void cinder::cairo::Context::quadTo | ( | const vec2 & | v1, |
const vec2 & | v2 | ||
) |
void cinder::cairo::Context::curveTo | ( | double | x1, |
double | y1, | ||
double | x2, | ||
double | y2, | ||
double | x3, | ||
double | y3 | ||
) |
void cinder::cairo::Context::curveTo | ( | const vec2 & | v1, |
const vec2 & | v2, | ||
const vec2 & | v3 | ||
) |
void cinder::cairo::Context::line | ( | const vec2 & | v1, |
const vec2 & | v2 | ||
) |
void cinder::cairo::Context::lineTo | ( | double | x, |
double | y | ||
) |
void cinder::cairo::Context::lineTo | ( | const vec2 & | v | ) |
void cinder::cairo::Context::moveTo | ( | double | x, |
double | y | ||
) |
void cinder::cairo::Context::moveTo | ( | const vec2 & | v | ) |
void cinder::cairo::Context::rectangle | ( | double | x, |
double | y, | ||
double | width, | ||
double | height | ||
) |
void cinder::cairo::Context::rectangle | ( | const Rectf & | r | ) |
void cinder::cairo::Context::rectangle | ( | const vec2 & | upperLeft, |
const vec2 & | lowerRight | ||
) |
void cinder::cairo::Context::roundedRectangle | ( | const Rectf & | r, |
float | cornerRadius | ||
) |
void cinder::cairo::Context::textPath | ( | const char * | utf8 | ) |
void cinder::cairo::Context::relCurveTo | ( | double | dx1, |
double | dy1, | ||
double | dx2, | ||
double | dy2, | ||
double | dx3, | ||
double | dy3 | ||
) |
void cinder::cairo::Context::relLineTo | ( | double | dx, |
double | dy | ||
) |
void cinder::cairo::Context::relMoveTo | ( | double | dx, |
double | dy | ||
) |
void cinder::cairo::Context::appendPath | ( | const cinder::Shape2d & | path | ) |
void cinder::cairo::Context::appendPath | ( | const cinder::Path2d & | path | ) |
void cinder::cairo::Context::circle | ( | double | dx, |
double | dy, | ||
double | radius | ||
) |
void cinder::cairo::Context::circle | ( | const vec2 & | v, |
double | radius | ||
) |
void cinder::cairo::Context::render | ( | const svg::Node & | node, |
const std::function< bool(const svg::Node &, svg::Style *)> & | visitor = std::function< bool(const svg::Node &, svg::Style *)>() |
||
) |
Renders an svg::Node, with an optional visitor function to modify the style per-node.
void cinder::cairo::Context::translate | ( | double | tx, |
double | ty | ||
) |
void cinder::cairo::Context::translate | ( | const vec2 & | v | ) |
void cinder::cairo::Context::scale | ( | double | sx, |
double | sy | ||
) |
void cinder::cairo::Context::rotate | ( | double | radians | ) |
void cinder::cairo::Context::transform | ( | const Matrix & | aMatrix | ) |
void cinder::cairo::Context::transform | ( | const mat3 & | matrix | ) |
void cinder::cairo::Context::setMatrix | ( | const Matrix & | aMatrix | ) |
void cinder::cairo::Context::setMatrix | ( | const mat3 & | matrix | ) |
void cinder::cairo::Context::getMatrix | ( | Matrix * | aMatrix | ) |
mat3 cinder::cairo::Context::getMatrix | ( | ) | const |
void cinder::cairo::Context::identityMatrix | ( | ) |
void cinder::cairo::Context::userToDevice | ( | double * | x, |
double * | y | ||
) |
void cinder::cairo::Context::userToDeviceDistance | ( | double * | dx, |
double * | dy | ||
) |
void cinder::cairo::Context::deviceToUser | ( | double * | x, |
double * | y | ||
) |
void cinder::cairo::Context::deviceToUserDistance | ( | double * | dx, |
double * | dy | ||
) |
void cinder::cairo::Context::setFont | ( | const cinder::Font & | font | ) |
void cinder::cairo::Context::selectFontFace | ( | const std::string & | family, |
int32_t | slant, | ||
int32_t | weight | ||
) |
void cinder::cairo::Context::setFontSize | ( | double | size | ) |
void cinder::cairo::Context::setFontMatrix | ( | const Matrix & | matrix | ) |
void cinder::cairo::Context::getFontMatrix | ( | Matrix * | matrix | ) |
void cinder::cairo::Context::setFontOptions | ( | const FontOptions * | options | ) |
void cinder::cairo::Context::getFontOptions | ( | FontOptions * | options | ) |
void cinder::cairo::Context::setFontFace | ( | const FontFace & | font_face | ) |
FontFace* cinder::cairo::Context::getFontFace | ( | ) |
void cinder::cairo::Context::setScaledFont | ( | const ScaledFont * | scaled_font | ) |
ScaledFont* cinder::cairo::Context::getScaledFont | ( | ) |
void cinder::cairo::Context::showText | ( | const std::string & | s | ) |
void cinder::cairo::Context::textPath | ( | const std::string & | s | ) |
void cinder::cairo::Context::glyphPath | ( | const std::vector< std::pair< uint16_t, vec2 > > & | glyphs | ) |
Renders glyphs as returned by TextBox::measureGlyphs()
void cinder::cairo::Context::glyphPath | ( | uint16_t | index, |
const vec2 & | offset | ||
) |
FontExtents cinder::cairo::Context::fontExtents | ( | ) |
TextExtents cinder::cairo::Context::textExtents | ( | const std::string & | s | ) |
std::string cinder::cairo::Context::statusToString | ( | ) | const |
|
protected |
|
protected |