Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

cairo_arc(3) [php man page]

CAIRO_ARC(3)								 1							      CAIRO_ARC(3)

CairoContext::arc - Adds a circular arc

       Object oriented style (method):

SYNOPSIS
public void CairoContext::arc (float $x, float $y, float $radius, float $angle1, float $angle2) DESCRIPTION
Procedural style: void cairo_arc (CairoContext $context, float $x, float $y, float $radius, float $angle1, float $angle2) Adds a circular arc of the given radius to the current path. The arc is centered at ($x, $y), begins at $angle1 and proceeds in the direc- tion of increasing angles to end at $angle2. If $angle2 is less than $angle1 it will be progressively increased by 2*M_PI until it is greater than $angle1. If there is a current point, an initial line segment will be added to the path to connect the current point to the beginning of the arc. If this initial line is undesired, it can be avoided by calling CairoContext::newSubPath or procedural cairo_new_sub_path(3) before calling CairoContext::arc or cairo_arc(3). Angles are measured in radians. An angle of 0.0 is in the direction of the positive X axis (in user space). An angle of M_PI/2.0 radians (90 degrees) is in the direction of the positive Y axis (in user space). Angles increase in the direction from the positive X axis toward the positive Y axis. So with the default transformation matrix, angles increase in a clockwise direction. (To convert from degrees to radians, use degrees * (M_PI / 180.).) This function gives the arc in the direction of increasing angles; see CairoContext::arcNegative or cairo_arc_negative(3) to get the arc in the direction of decreasing angles. PARAMETERS
o $context - A valid CairoContext object o $x - x position o $y - y position o $radius - Radius of the arc o $angle1 - start angle o $angle2 - end angle RETURN VALUES
No value is returned. EXAMPLES
Example #1 Object oriented style <?php $s = new CairoImageSurface(CairoFormat::ARGB32, 100, 100); $c = new CairoContext($s); $c->setSourceRgb(0, 0, 0); $c->paint(); $c->setLineWidth(1); $c->setSourceRgb(1, 1, 1); for ($r = 50; $r > 0; $r -= 10) { $c->arc(50, 50, $r, 0, 2 * M_PI); $c->stroke(); $c->fill(); } $s->writeToPng(dirname(__FILE__) . '/CairoContext__arc.png'); ?> Example #2 Procedural style <?php $s = cairo_image_surface_create(CAIRO_SURFACE_TYPE_IMAGE, 100, 100); $c = cairo_create($s); cairo_set_source_rgb($c, 0, 0, 0); cairo_paint($c); cairo_set_source_rgb($c, 1, 1, 1); cairo_set_line_width($c, 1); for ($r = 50; $r > 0; $r -= 10) { cairo_arc($c, 50, 50, $r, 0, 2 * M_PI); cairo_stroke($c); cairo_fill($c); } cairo_surface_write_to_png($s, dirname(__FILE__) . '/cairo_arc.png'); ?> SEE ALSO
CairoContext::arcNegative. PHP Documentation Group CAIRO_ARC(3)

Check Out this Related Man Page

CAIROCONTEXT(3) 							 1							   CAIROCONTEXT(3)

The CairoContext class

INTRODUCTION
Context is the main object used when drawing with cairo. To draw with cairo, you create a CairoContext, set the target CairoSurface, and drawing options for the CairoContext, create shapes with functions . like CairoContext::moveTo and CairoContext::lineTo, and then draw shapes with CairoContext::stroke or CairoContext::fill. Contexts can be pushed to a stack via CairoContext::save. They may then safely be changed, without loosing the current state. Use CairoContext::restore to restore to the saved state. CLASS SYNOPSIS
CairoContext CairoContext Methods o public void CairoContext::appendPath (CairoPath $path) o public void CairoContext::arc (float $x, float $y, float $radius, float $angle1, float $angle2) o public void CairoContext::arcNegative (float $x, float $y, float $radius, float $angle1, float $angle2) o public void CairoContext::clip (void ) o public array CairoContext::clipExtents (void ) o public void CairoContext::clipPreserve (void ) o public array CairoContext::clipRectangleList (void ) o public void CairoContext::closePath (void ) o public CairoContext::__construct (CairoSurface $surface) o public void CairoContext::copyPage (void ) o public CairoPath CairoContext::copyPath (void ) o public CairoPath CairoContext::copyPathFlat (void ) o public void CairoContext::curveTo (float $x1, float $y1, float $x2, float $y2, float $x3, float $y3) o public array CairoContext::deviceToUser (float $x, float $y) o public array CairoContext::deviceToUserDistance (float $x, float $y) o public void CairoContext::fill (void ) o public array CairoContext::fillExtents (void ) o public void CairoContext::fillPreserve (void ) o public array CairoContext::fontExtents (void ) o public int CairoContext::getAntialias (void ) o public array CairoContext::getCurrentPoint (void ) o public array CairoContext::getDash (void ) o public int CairoContext::getDashCount (void ) o public int CairoContext::getFillRule (void ) o public void CairoContext::getFontFace (void ) o public void CairoContext::getFontMatrix (void ) o public void CairoContext::getFontOptions (void ) o public void CairoContext::getGroupTarget (void ) o public int CairoContext::getLineCap (void ) o public int CairoContext::getLineJoin (void ) o public float CairoContext::getLineWidth (void ) o public void CairoContext::getMatrix (void ) o public float CairoContext::getMiterLimit (void ) o public int CairoContext::getOperator (void ) o public void CairoContext::getScaledFont (void ) o public void CairoContext::getSource (void ) o public void CairoContext::getTarget (void ) o public float CairoContext::getTolerance (void ) o public void CairoContext::glyphPath (array $glyphs) o public bool CairoContext::hasCurrentPoint (void ) o public void CairoContext::identityMatrix (void ) o public bool CairoContext::inFill (string $x, string $y) o public bool CairoContext::inStroke (string $x, string $y) o public void CairoContext::lineTo (string $x, string $y) o public void CairoContext::mask (string $pattern) o public void CairoContext::maskSurface (string $surface, [string $x], [string $y]) o public void CairoContext::moveTo (string $x, string $y) o public void CairoContext::newPath (void ) o public void CairoContext::newSubPath (void ) o public void CairoContext::paint (void ) o public void CairoContext::paintWithAlpha (string $alpha) o public array CairoContext::pathExtents (void ) o public void CairoContext::popGroup (void ) o public void CairoContext::popGroupToSource (void ) o public void CairoContext::pushGroup (void ) o public void CairoContext::pushGroupWithContent (string $content) o public void CairoContext::rectangle (string $x, string $y, string $width, string $height) o public void CairoContext::relCurveTo (string $x1, string $y1, string $x2, string $y2, string $x3, string $y3) o public void CairoContext::relLineTo (string $x, string $y) o public void CairoContext::relMoveTo (string $x, string $y) o public void CairoContext::resetClip (void ) o public void CairoContext::restore (void ) o public void CairoContext::rotate (string $angle) o public void CairoContext::save (void ) o public void CairoContext::scale (string $x, string $y) o public void CairoContext::selectFontFace (string $family, [string $slant], [string $weight]) o public void CairoContext::setAntialias ([string $antialias]) o public void CairoContext::setDash (string $dashes, [string $offset]) o public void CairoContext::setFillRule (string $setting) o public void CairoContext::setFontFace (CairoFontFace $fontface) o public void CairoContext::setFontMatrix (string $matrix) o public void CairoContext::setFontOptions (string $fontoptions) o public void CairoContext::setFontSize (string $size) o public void CairoContext::setLineCap (string $setting) o public void CairoContext::setLineJoin (string $setting) o public void CairoContext::setLineWidth (string $width) o public void CairoContext::setMatrix (string $matrix) o public void CairoContext::setMiterLimit (string $limit) o public void CairoContext::setOperator (string $setting) o public void CairoContext::setScaledFont (string $scaledfont) o public void CairoContext::setSource (string $pattern) o public void CairoContext::setSourceRGB (string $red, string $green, string $blue) o public void CairoContext::setSourceRGBA (string $red, string $green, string $blue, string $alpha) o public void CairoContext::setSourceSurface (string $surface, [string $x], [string $y]) o public void CairoContext::setTolerance (string $tolerance) o public void CairoContext::showPage (void ) o public void CairoContext::showText (string $text) o public int CairoContext::status (void ) o public void CairoContext::stroke (void ) o public array CairoContext::strokeExtents (void ) o public void CairoContext::strokePreserve (void ) o public array CairoContext::textExtents (string $text) o public void CairoContext::textPath (string $string) o public void CairoContext::transform (string $matrix) o public void CairoContext::translate (string $x, string $y) o public array CairoContext::userToDevice (string $x, string $y) o public array CairoContext::userToDeviceDistance (string $x, string $y) PHP Documentation Group CAIROCONTEXT(3)
Man Page