# CairoContext クラス

(PECL cairo >= 0.1.0)

## はじめに

コンテキストは、cairo での描画に使うメインオブジェクトです。 cairo で描画を行うには、 CairoContext を作ってから対象の CairoSurface を設定し、CairoContext の描画オプションを設定します。 CairoContext::moveTo() や CairoContext::lineTo() などの関数でシェイプを作成し、 CairoContext::stroke() や CairoContext::fill() でシェイプを描画します。 コンテキストをスタックにプッシュするには CairoContext::save() を使います。これで、現状を失わずに安全に変更できるようになります。 保存した状態を復元するには CairoContext::restore() を使います。

## クラス概要

CairoContext {
/* メソッド */
public appendPath ( CairoPath `$path` ) : void
public arc ( float `$x` , float `$y` , float `$radius` , float `$angle1` , float `$angle2` ) : void
public arcNegative ( float `$x` , float `$y` , float `$radius` , float `$angle1` , float `$angle2` ) : void
public clip ( void ) : void
public clipExtents ( void ) : array
public clipPreserve ( void ) : void
public clipRectangleList ( void ) : array
public closePath ( void ) : void
public __construct ( CairoSurface `$surface` )
public copyPage ( void ) : void
public copyPath ( void ) : CairoPath
public copyPathFlat ( void ) : CairoPath
public curveTo ( float `$x1` , float `$y1` , float `$x2` , float `$y2` , float `$x3` , float `$y3` ) : void
public deviceToUser ( float `$x` , float `$y` ) : array
public deviceToUserDistance ( float `$x` , float `$y` ) : array
public fill ( void ) : void
public fillExtents ( void ) : array
public fillPreserve ( void ) : void
public fontExtents ( void ) : array
public getAntialias ( void ) : int
public getCurrentPoint ( void ) : array
public getDash ( void ) : array
public getDashCount ( void ) : int
public getFillRule ( void ) : int
public getFontFace ( void ) : void
public getFontMatrix ( void ) : void
public getFontOptions ( void ) : void
public getGroupTarget ( void ) : void
public getLineCap ( void ) : int
public getLineJoin ( void ) : int
public getLineWidth ( void ) : float
public getMatrix ( void ) : void
public getMiterLimit ( void ) : float
public getOperator ( void ) : int
public getScaledFont ( void ) : void
public getSource ( void ) : void
public getTarget ( void ) : void
public getTolerance ( void ) : float
public glyphPath ( array `$glyphs` ) : void
public hasCurrentPoint ( void ) : bool
public identityMatrix ( void ) : void
public inFill ( float `$x` , float `$y` ) : bool
public inStroke ( float `$x` , float `$y` ) : bool
public lineTo ( float `$x` , float `$y` ) : void
public mask ( CairoPattern `$pattern` ) : void
public maskSurface ( CairoSurface `$surface` [, float `$x` [, float `$y` ]] ) : void
public moveTo ( float `$x` , float `$y` ) : void
public newPath ( void ) : void
public newSubPath ( void ) : void
public paint ( void ) : void
public paintWithAlpha ( float `$alpha` ) : void
public pathExtents ( void ) : array
public popGroup ( void ) : void
public popGroupToSource ( void ) : void
public pushGroup ( void ) : void
public pushGroupWithContent ( int `$content` ) : void
public rectangle ( float `$x` , float `$y` , float `$width` , float `$height` ) : void
public relCurveTo ( float `$x1` , float `$y1` , float `$x2` , float `$y2` , float `$x3` , float `$y3` ) : void
public relLineTo ( float `$x` , float `$y` ) : void
public relMoveTo ( float `$x` , float `$y` ) : void
public resetClip ( void ) : void
public restore ( void ) : void
public rotate ( float `$angle` ) : void
public save ( void ) : void
public scale ( float `$x` , float `$y` ) : void
public selectFontFace ( string `$family` [, int `$slant` [, int `$weight` ]] ) : void
public setAntialias ([ int `$antialias` ] ) : void
public setDash ( array `$dashes` [, float `$offset` ] ) : void
public setFillRule ( int `$setting` ) : void
public setFontFace ( CairoFontFace `$fontface` ) : void
public setFontMatrix ( CairoMatrix `$matrix` ) : void
public setFontOptions ( CairoFontOptions `$fontoptions` ) : void
public setFontSize ( float `$size` ) : void
public setLineCap ( int `$setting` ) : void
public setLineJoin ( int `$setting` ) : void
public setLineWidth ( float `$width` ) : void
public setMatrix ( CairoMatrix `$matrix` ) : void
public setMiterLimit ( float `$limit` ) : void
public setOperator ( int `$setting` ) : void
public setScaledFont ( CairoScaledFont `$scaledfont` ) : void
public setSource ( CairoPattern `$pattern` ) : void
public setSourceRGB ( float `$red` , float `$green` , float `$blue` ) : void
public setSourceRGBA ( float `$red` , float `$green` , float `$blue` , float `$alpha` ) : void
public setSourceSurface ( CairoSurface `$surface` [, float `$x` [, float `$y` ]] ) : void
public setTolerance ( float `$tolerance` ) : void
public showPage ( void ) : void
public showText ( string `$text` ) : void
public status ( void ) : int
public stroke ( void ) : void
public strokeExtents ( void ) : array
public strokePreserve ( void ) : void
public textExtents ( string `$text` ) : array
public textPath ( string `$string` ) : void
public transform ( CairoMatrix `$matrix` ) : void
public translate ( float `$x` , float `$y` ) : void
public userToDevice ( float `$x` , float `$y` ) : array
public userToDeviceDistance ( float `$x` , float `$y` ) : array
}

## 目次

- CairoContext::appendPath — Appends a path to current path
- CairoContext::arc — Adds a circular arc
- CairoContext::arcNegative — Adds a negative arc
- CairoContext::clip — Establishes a new clip region
- CairoContext::clipExtents — Computes the area inside the current clip
- CairoContext::clipPreserve — Establishes a new clip region from the current clip
- CairoContext::clipRectangleList — Retrieves the current clip as a list of rectangles
- CairoContext::closePath — Closes the current path
- CairoContext::__construct — Creates a new CairoContext
- CairoContext::copyPage — Emits the current page
- CairoContext::copyPath — Creates a copy of the current path
- CairoContext::copyPathFlat — Gets a flattened copy of the current path
- CairoContext::curveTo — Adds a curve
- CairoContext::deviceToUser — Transform a coordinate
- CairoContext::deviceToUserDistance — Transform a distance
- CairoContext::fill — Fills the current path
- CairoContext::fillExtents — Computes the filled area
- CairoContext::fillPreserve — Fills and preserve the current path
- CairoContext::fontExtents — Get the font extents
- CairoContext::getAntialias — Retrives the current antialias mode
- CairoContext::getCurrentPoint — The getCurrentPoint purpose
- CairoContext::getDash — The getDash purpose
- CairoContext::getDashCount — The getDashCount purpose
- CairoContext::getFillRule — The getFillRule purpose
- CairoContext::getFontFace — The getFontFace purpose
- CairoContext::getFontMatrix — The getFontMatrix purpose
- CairoContext::getFontOptions — The getFontOptions purpose
- CairoContext::getGroupTarget — The getGroupTarget purpose
- CairoContext::getLineCap — The getLineCap purpose
- CairoContext::getLineJoin — The getLineJoin purpose
- CairoContext::getLineWidth — The getLineWidth purpose
- CairoContext::getMatrix — The getMatrix purpose
- CairoContext::getMiterLimit — The getMiterLimit purpose
- CairoContext::getOperator — The getOperator purpose
- CairoContext::getScaledFont — The getScaledFont purpose
- CairoContext::getSource — The getSource purpose
- CairoContext::getTarget — The getTarget purpose
- CairoContext::getTolerance — The getTolerance purpose
- CairoContext::glyphPath — The glyphPath purpose
- CairoContext::hasCurrentPoint — The hasCurrentPoint purpose
- CairoContext::identityMatrix — The identityMatrix purpose
- CairoContext::inFill — The inFill purpose
- CairoContext::inStroke — The inStroke purpose
- CairoContext::lineTo — The lineTo purpose
- CairoContext::mask — The mask purpose
- CairoContext::maskSurface — The maskSurface purpose
- CairoContext::moveTo — The moveTo purpose
- CairoContext::newPath — The newPath purpose
- CairoContext::newSubPath — The newSubPath purpose
- CairoContext::paint — The paint purpose
- CairoContext::paintWithAlpha — The paintWithAlpha purpose
- CairoContext::pathExtents — The pathExtents purpose
- CairoContext::popGroup — The popGroup purpose
- CairoContext::popGroupToSource — The popGroupToSource purpose
- CairoContext::pushGroup — The pushGroup purpose
- CairoContext::pushGroupWithContent — The pushGroupWithContent purpose
- CairoContext::rectangle — The rectangle purpose
- CairoContext::relCurveTo — The relCurveTo purpose
- CairoContext::relLineTo — The relLineTo purpose
- CairoContext::relMoveTo — The relMoveTo purpose
- CairoContext::resetClip — The resetClip purpose
- CairoContext::restore — The restore purpose
- CairoContext::rotate — The rotate purpose
- CairoContext::save — The save purpose
- CairoContext::scale — The scale purpose
- CairoContext::selectFontFace — The selectFontFace purpose
- CairoContext::setAntialias — The setAntialias purpose
- CairoContext::setDash — The setDash purpose
- CairoContext::setFillRule — The setFillRule purpose
- CairoContext::setFontFace — The setFontFace purpose
- CairoContext::setFontMatrix — The setFontMatrix purpose
- CairoContext::setFontOptions — The setFontOptions purpose
- CairoContext::setFontSize — The setFontSize purpose
- CairoContext::setLineCap — The setLineCap purpose
- CairoContext::setLineJoin — The setLineJoin purpose
- CairoContext::setLineWidth — The setLineWidth purpose
- CairoContext::setMatrix — The setMatrix purpose
- CairoContext::setMiterLimit — The setMiterLimit purpose
- CairoContext::setOperator — The setOperator purpose
- CairoContext::setScaledFont — The setScaledFont purpose
- CairoContext::setSource — The setSource purpose
- CairoContext::setSourceRGB — The setSourceRGB purpose
- CairoContext::setSourceRGBA — The setSourceRGBA purpose
- CairoContext::setSourceSurface — The setSourceSurface purpose
- CairoContext::setTolerance — The setTolerance purpose
- CairoContext::showPage — The showPage purpose
- CairoContext::showText — The showText purpose
- CairoContext::status — The status purpose
- CairoContext::stroke — The stroke purpose
- CairoContext::strokeExtents — The strokeExtents purpose
- CairoContext::strokePreserve — The strokePreserve purpose
- CairoContext::textExtents — The textExtents purpose
- CairoContext::textPath — The textPath purpose
- CairoContext::transform — The transform purpose
- CairoContext::translate — The translate purpose
- CairoContext::userToDevice — The userToDevice purpose
- CairoContext::userToDeviceDistance — The userToDeviceDistance purpose