Documentation
¶
Index ¶
- type AntiAliasKind
- type CairoContentType
- type CairoContext
- type ColorStop
- type FillRule
- type FilterMode
- type Gradient
- type Graphics
- func (gc *Graphics) AddPath(path *Path)
- func (gc *Graphics) AntiAlias() AntiAliasKind
- func (gc *Graphics) Arc(cx, cy, radius, startAngleRadians, endAngleRadians float64, clockwise bool)
- func (gc *Graphics) BeginPath()
- func (gc *Graphics) BeginSubPath()
- func (gc *Graphics) Clip()
- func (gc *Graphics) ClipPreserve()
- func (gc *Graphics) ClosePath()
- func (gc *Graphics) CompositingOperator() compositing.Op
- func (gc *Graphics) CurveTo(cp1x, cp1y, cp2x, cp2y, x, y float64)
- func (gc *Graphics) Dash() (segments []float64, offset float64)
- func (gc *Graphics) DeviceToUser(ux, uy float64) (x, y float64)
- func (gc *Graphics) DeviceToUserDistance(uw, uh float64) (w, h float64)
- func (gc *Graphics) Dispose()
- func (gc *Graphics) DrawImage(img *Image, where geom.Point)
- func (gc *Graphics) DrawImageInRect(img *Image, bounds geom.Rect)
- func (gc *Graphics) DrawString(x, y float64, str string, f *font.Font)
- func (gc *Graphics) Ellipse(bounds geom.Rect)
- func (gc *Graphics) FillClip()
- func (gc *Graphics) FillClipWithAlpha(alpha float64)
- func (gc *Graphics) FillEllipse(bounds geom.Rect)
- func (gc *Graphics) FillPath()
- func (gc *Graphics) FillPathPreserve()
- func (gc *Graphics) FillRect(bounds geom.Rect)
- func (gc *Graphics) FillRule() FillRule
- func (gc *Graphics) InClip(x, y float64) bool
- func (gc *Graphics) InFill(x, y float64) bool
- func (gc *Graphics) InStroke(x, y float64) bool
- func (gc *Graphics) LineCap() LineCap
- func (gc *Graphics) LineJoin() LineJoin
- func (gc *Graphics) LineTo(x, y float64)
- func (gc *Graphics) MaskClipWithImage(mask *Image, dx, dy float64)
- func (gc *Graphics) MaskClipWithPaint(mask *Paint)
- func (gc *Graphics) Matrix() *xmath.Matrix2D
- func (gc *Graphics) MiterLimit() float64
- func (gc *Graphics) MoveTo(x, y float64)
- func (gc *Graphics) Paint() *Paint
- func (gc *Graphics) PopGroup() *Paint
- func (gc *Graphics) PopGroupToPaint()
- func (gc *Graphics) PushGroup()
- func (gc *Graphics) QuadCurveTo(cpx, cpy, x, y float64)
- func (gc *Graphics) Rect(bounds geom.Rect)
- func (gc *Graphics) ResetClip()
- func (gc *Graphics) Restore()
- func (gc *Graphics) Rotate(angleInRadians float64)
- func (gc *Graphics) Save()
- func (gc *Graphics) Scale(x, y float64)
- func (gc *Graphics) SetAntiAlias(kind AntiAliasKind)
- func (gc *Graphics) SetColor(color color.Color)
- func (gc *Graphics) SetCompositingOperator(op compositing.Op)
- func (gc *Graphics) SetDash(segments []float64, offset float64)
- func (gc *Graphics) SetFillRule(rule FillRule)
- func (gc *Graphics) SetIdentityMatrix()
- func (gc *Graphics) SetImage(img *Image, dx, dy float64)
- func (gc *Graphics) SetLineCap(cap LineCap)
- func (gc *Graphics) SetLineJoin(cap LineJoin)
- func (gc *Graphics) SetMatrix(matrix *xmath.Matrix2D)
- func (gc *Graphics) SetMiterLimit(limit float64)
- func (gc *Graphics) SetPaint(paint *Paint)
- func (gc *Graphics) SetStrokeWidth(width float64)
- func (gc *Graphics) SetSurface(surface *Surface, dx, dy float64)
- func (gc *Graphics) StrokeEllipse(bounds geom.Rect)
- func (gc *Graphics) StrokeLine(x1, y1, x2, y2 float64)
- func (gc *Graphics) StrokePath()
- func (gc *Graphics) StrokePathPreserve()
- func (gc *Graphics) StrokeRect(bounds geom.Rect)
- func (gc *Graphics) StrokeWidth() float64
- func (gc *Graphics) Transform(matrix *xmath.Matrix2D)
- func (gc *Graphics) Translate(x, y float64)
- func (gc *Graphics) UserToDevice(ux, uy float64) (x, y float64)
- func (gc *Graphics) UserToDeviceDistance(uw, uh float64) (w, h float64)
- type Image
- func (img *Image) AcquireDisabled() *Image
- func (img *Image) AcquireImageArea(bounds geom.Rect) *Image
- func (img *Image) Data() *ImageData
- func (img *Image) DataFromArea(bounds geom.Rect) *ImageData
- func (img *Image) NewCairoContext() CairoContext
- func (img *Image) Release()
- func (img *Image) Size() geom.Size
- func (img *Image) String() string
- type ImageData
- type LineCap
- type LineJoin
- type Paint
- func (p *Paint) Dispose()
- func (p *Paint) FilterMode() FilterMode
- func (p *Paint) Kind() PaintKind
- func (p *Paint) Matrix() *xmath.Matrix2D
- func (p *Paint) PaintMode() PaintMode
- func (p *Paint) SetFilterMode(mode FilterMode)
- func (p *Paint) SetMatrix(matrix *xmath.Matrix2D)
- func (p *Paint) SetPaintMode(mode PaintMode)
- type PaintKind
- type PaintMode
- type Path
- func (p *Path) Append(other *Path)
- func (p *Path) Arc(cx, cy, radius, startAngleRadians, endAngleRadians float64, clockwise bool)
- func (p *Path) BeginSubPath()
- func (p *Path) ClosePath()
- func (p *Path) Copy() *Path
- func (p *Path) CurveTo(cp1x, cp1y, cp2x, cp2y, x, y float64)
- func (p *Path) Ellipse(bounds geom.Rect)
- func (p *Path) LineTo(x, y float64)
- func (p *Path) MoveTo(x, y float64)
- func (p *Path) QuadCurveTo(cpx, cpy, x, y float64)
- func (p *Path) Rect(bounds geom.Rect)
- type Surface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AntiAliasKind ¶
type AntiAliasKind int
AntiAliasKind holds the type of anti-aliasing that is being performed.
const ( // AntiAliasKindDefault indicates that the default anti-aliasing for the graphics subsystem and // target device should be used. AntiAliasKindDefault AntiAliasKind = C.CAIRO_ANTIALIAS_DEFAULT // AntiAliasKindNone indicates no anti-aliasing should be used. AntiAliasKindNone AntiAliasKind = C.CAIRO_ANTIALIAS_NONE // AntiAliasKindGray indicates a single-color anti-aliasing should be used. AntiAliasKindGray AntiAliasKind = C.CAIRO_ANTIALIAS_GRAY // AntiAliasKindSubPixel indicates anti-aliasing should be perfomed by taking advantage of the // order of sub-pixel elements on devices such as LCD panels. AntiAliasKindSubPixel AntiAliasKind = C.CAIRO_ANTIALIAS_SUBPIXEL // AntiAliasKindFast indicates that some anti-aliasing should be performed, but speed should be // preferred over quality. AntiAliasKindFast AntiAliasKind = C.CAIRO_ANTIALIAS_FAST // AntiAliasKindGood indicates that the backend should balance quality against performance. AntiAliasKindGood AntiAliasKind = C.CAIRO_ANTIALIAS_GOOD // AntiAliasKindBest indicates that the backend should render at the highest quality, // sacrificing speed if necessary. AntiAliasKindBest AntiAliasKind = C.CAIRO_ANTIALIAS_BEST )
type CairoContentType ¶
type CairoContentType C.cairo_content_t
CairoContentType holds the type of content for a surface.
const ( ColorContent CairoContentType = C.CAIRO_CONTENT_COLOR AlphaContent CairoContentType = C.CAIRO_CONTENT_ALPHA ColorAndAlphaContent CairoContentType = C.CAIRO_CONTENT_COLOR_ALPHA )
Possible CairoContentTypes.
type CairoContext ¶
CairoContext represents the underlying Cairo graphics context pointer.
type ColorStop ¶
ColorStop provides information about the color and position of one 'color stop' in a Gradient.
type FillRule ¶
type FillRule int
FillRule holds the type of fill rule to use when filling paths.
const ( // FillRuleWinding uses this algorithm: if the path crosses the ray from left-to-right, counts // +1. If the path crosses the ray from right to left, counts -1. Left and right are determined // from the perspective of looking along the ray from the starting point. If the total count // is non-zero, the point will be filled. FillRuleWinding FillRule = C.CAIRO_FILL_RULE_WINDING // FillRuleEvenOdd uses this algorithm: counts the total number of intersections, without regard // to the orientation of the contour. If the total number of intersections is odd, the point // will be filled. FillRuleEvenOdd FillRule = C.CAIRO_FILL_RULE_EVEN_ODD )
type FilterMode ¶
type FilterMode int
FilterMode defines the type of filtering to be used when reading pixel values.
const ( // FilterModeFast provides a high-performance filter, with quality similar to FilterModeNearest. FilterModeFast FilterMode = C.CAIRO_FILTER_FAST // FilterModeGood provides a reasonable-performance filter, with quality similar to // FilterModeBilinear. FilterModeGood FilterMode = C.CAIRO_FILTER_GOOD // FilterModeBest provides the highest quality filter available, but performance may not be // suitable for interactive use. FilterModeBest FilterMode = C.CAIRO_FILTER_BEST // FilterModeNearest provides a nearest-neighbor filter. FilterModeNearest FilterMode = C.CAIRO_FILTER_NEAREST // FilterModeBilinear provides linear interpolation in two dimensions. FilterModeBilinear FilterMode = C.CAIRO_FILTER_BILINEAR )
type Gradient ¶
type Gradient struct {
Stops []ColorStop
}
Gradient defines a smooth transition between colors across an area.
func NewEvenlySpacedGradient ¶
NewEvenlySpacedGradient creates a new gradient with the specified colors evenly spread across the whole range.
func NewGradient ¶
NewGradient creates a new gradient.
type Graphics ¶
type Graphics struct {
// contains filtered or unexported fields
}
Graphics provides a graphics context for drawing into.
func NewGraphics ¶
func NewGraphics(cc CairoContext) *Graphics
NewGraphics creates a new Graphics object with a Cairo graphics context.
func (*Graphics) AntiAlias ¶
func (gc *Graphics) AntiAlias() AntiAliasKind
AntiAlias returns the current anti-aliasing mode.
func (*Graphics) Arc ¶
Arc adds an arc of a circle to the current path, possibly preceded by a straight line segment.
func (*Graphics) BeginPath ¶
func (gc *Graphics) BeginPath()
BeginPath creates a new empty path in the context.
func (*Graphics) BeginSubPath ¶
func (gc *Graphics) BeginSubPath()
BeginSubPath creates a new empty sub-path in the context. Any existing path is not affected.
func (*Graphics) Clip ¶
func (gc *Graphics) Clip()
Clip establishes a new clip region by intersecting the current clip region with the current path as it would be filled by Fill() and according to the current FillRule. After Clip(), the current path will be cleared from the context. The current clip region affects all drawing operations by effectively masking out any changes to the surface that are outside the current clip region. Calling Clip() can only make the clip region smaller, never larger. The current clip is part of the graphics state, so a temporary restriction of the clip region can be achieved by calling Clip() within a Save()/Restore() pair. The only other means of increasing the size of the clip region is ResetClip().
func (*Graphics) ClipPreserve ¶
func (gc *Graphics) ClipPreserve()
ClipPreserve operates as Clip(), but does not clear the path from the context.
func (*Graphics) ClosePath ¶
func (gc *Graphics) ClosePath()
ClosePath closes and terminates the current path’s subpath.
func (*Graphics) CompositingOperator ¶
func (gc *Graphics) CompositingOperator() compositing.Op
CompositingOperator returns the current compositing operator.
func (*Graphics) CurveTo ¶
CurveTo appends a cubic Bezier curve from the current point, using the provided controls points and end point.
func (*Graphics) DeviceToUser ¶
DeviceToUser converts the device-space coordinates to user-space.
func (*Graphics) DeviceToUserDistance ¶
DeviceToUserDistance converts the device-space distance to user-space.
func (*Graphics) Dispose ¶
func (gc *Graphics) Dispose()
Dispose of the underlying Cairo graphics context
func (*Graphics) DrawImageInRect ¶
DrawImageInRect draws the image in the bounds, scaling if necessary.
func (*Graphics) DrawString ¶
DrawString at the specified location using the current font and fill color.
func (*Graphics) FillClip ¶
func (gc *Graphics) FillClip()
FillClip uses the current Paint to fill the entire clip region.
func (*Graphics) FillClipWithAlpha ¶
FillClipWithAlpha uses the current Paint to cover the entire clip region, but with the specified 'alpha' value applied.
func (*Graphics) FillEllipse ¶
FillEllipse fills an ellipse in the specified bounds.
func (*Graphics) FillPath ¶
func (gc *Graphics) FillPath()
FillPath fills the current path, then clears the current path state.
func (*Graphics) FillPathPreserve ¶
func (gc *Graphics) FillPathPreserve()
FillPathPreserve fills the current path without clearing the current path state.
func (*Graphics) InClip ¶
InClip returns true if the specific location would be visible through the current clip.
func (*Graphics) InFill ¶
InFill returns true if the specific location would be inside the area affected by FillPath() or FillPathPreserve(). Note that the clip area is not taken into account.
func (*Graphics) InStroke ¶
InStroke returns true if the specific location would be inside the area affected by StrokePath() or StrokePathPreserve(). Note that the clip area is not taken into account.
func (*Graphics) LineTo ¶
LineTo appends a straight line segment from the current point to the specified point.
func (*Graphics) MaskClipWithImage ¶
MaskClipWithImage uses the current Paint to cover the entire clip region, but uses the alpha channel of 'mask' as a mask (i.e. opaque areas of 'mask' are painted with the current Paint, transparent areas are not painted). The image's mask will be offset by 'dx' and 'dy'.
func (*Graphics) MaskClipWithPaint ¶
MaskClipWithPaint uses the current Paint to cover the entire clip region, but uses the alpha channel of 'mask' as a mask (i.e. opaque areas of 'mask' are painted with the current Paint, transparent areas are not painted).
func (*Graphics) MiterLimit ¶
MiterLimit returns the current miter limit.
func (*Graphics) Paint ¶
Paint returns a copy of the current paint. You are responsible for calling its Dispose() method.
func (*Graphics) PopGroup ¶
PopGroup terminates the redirection begun by a call to PushGroup and returns a new Paint containing the results of all drawing operations performed to the group.
func (*Graphics) PopGroupToPaint ¶
func (gc *Graphics) PopGroupToPaint()
PopGroupToPaint terminates the redirection begun by a call to PushGroup and installs the resulting Paint as the current source paint.
func (*Graphics) PushGroup ¶
func (gc *Graphics) PushGroup()
PushGroup temporarily redirects drawing to an intermediate surface known as a group. The redirection lasts until the group is completed by a call to PopGroup() or PopGroupToSource(). Groups can be nested arbitrarily deep.
func (*Graphics) QuadCurveTo ¶
QuadCurveTo appends a quadratic Bezier curve from the current point, using a control point and an end point.
func (*Graphics) ResetClip ¶
func (gc *Graphics) ResetClip()
ResetClip resets the current clip region to its original, unrestricted state. That is, set the clip region to an infinitely large shape containing the target surface. Note that code meant to be reusable should not call ResetClip() as it will cause results unexpected by higher-level code which calls Clip(). Consider using Save() and Restore() around Clip() as a more robust means of temporarily restricting the clip region.
func (*Graphics) Restore ¶
func (gc *Graphics) Restore()
Restore sets the current graphics state to the state most recently saved by call to Save().
func (*Graphics) Save ¶
func (gc *Graphics) Save()
Save pushes a copy of the current graphics state onto the stack for the context. The current path is not saved as part of this call.
func (*Graphics) SetAntiAlias ¶
func (gc *Graphics) SetAntiAlias(kind AntiAliasKind)
SetAntiAlias sets the anti-aliasing mode of the rasterizer used for drawing shapes. This value is a hint and a particular backend may or may not support a particular value. Note that this option does not affect text rendering.
func (*Graphics) SetCompositingOperator ¶
func (gc *Graphics) SetCompositingOperator(op compositing.Op)
SetCompositingOperator sets the current compositing operator.
func (*Graphics) SetDash ¶
SetDash sets the dash pattern to be used when stroking. A dash pattern is specified by an array of positive values. Each value provides the length of alternate "on" and "off" portions of the stroke. The offset specifies an offset into the pattern at which the stroke begins. Each "on" segment will have caps applied as if the segment were a separate sub-path. In particular, it is valid to use an "on" length of 0 with LineCapRound or LineCapSquare in order to distribute dots or squares along a path. Note: The length values are in user-space units as evaluated at the time of stroking. This is not necessarily the same as the user space at the time of SetDash(). If 'segments' is nil, dashing is disabled. If 'segments' only contains one value, a symmetric pattern is assumed with alternating on and off portions of the size specified by the single value. If any value in 'segments' is negative, or if all values are 0, this call will be ignored.
func (*Graphics) SetFillRule ¶
SetFillRule sets the current FillRule.
func (*Graphics) SetIdentityMatrix ¶
func (gc *Graphics) SetIdentityMatrix()
SetIdentityMatrix sets the current transformation matrix to the identity matrix.
func (*Graphics) SetImage ¶
SetImage sets the current paint with a tiled image. 'dx' and 'dy' specify the amount to offset the image pattern.
func (*Graphics) SetLineCap ¶
SetLineCap sets the current LineCap.
func (*Graphics) SetLineJoin ¶
SetLineJoin sets the current LineJoin.
func (*Graphics) SetMiterLimit ¶
SetMiterLimit sets the current miter limit.
func (*Graphics) SetStrokeWidth ¶
SetStrokeWidth sets the current stroke width.
func (*Graphics) SetSurface ¶
SetSurface sets the current paint with a surface. 'dx' and 'dy' specify the amount to offset the surface pattern.
func (*Graphics) StrokeEllipse ¶
StrokeEllipse draws an ellipse in the specified bounds. To ensure the ellipse is aligned to pixel boundaries, 0.5 is added to the origin coordinates and 1 is subtracted from the size values.
func (*Graphics) StrokeLine ¶
StrokeLine draws a line between two points. To ensure the line is aligned to pixel boundaries, 0.5 is added to each coordinate.
func (*Graphics) StrokePath ¶
func (gc *Graphics) StrokePath()
StrokePath strokes the current path, then clears the current path state.
func (*Graphics) StrokePathPreserve ¶
func (gc *Graphics) StrokePathPreserve()
StrokePathPreserve strokes the current path without clearing the current path state.
func (*Graphics) StrokeRect ¶
StrokeRect draws a rectangle in the specified bounds. To ensure the rectangle is aligned to pixel boundaries, 0.5 is added to the origin coordinates and 1 is subtracted from the size values.
func (*Graphics) StrokeWidth ¶
StrokeWidth returns the current stroke width.
func (*Graphics) UserToDevice ¶
UserToDevice converts the user-space coordinates to device-space.
func (*Graphics) UserToDeviceDistance ¶
UserToDeviceDistance converts the user-space distance to device-space.
type Image ¶
Image represents a set of pixels that can be drawn to a graphics.Context.
func AcquireImageFromData ¶
AcquireImageFromData creates a new image from the specified data.
func AcquireImageFromFile ¶
func AcquireImageFromFile(fs http.FileSystem, path string) (img *Image, err error)
AcquireImageFromFile attempts to load an image from the file system.
func AcquireImageFromID ¶
AcquireImageFromID attempts to find an already loaded image by its ID and return it. Returns nil if it cannot be found.
func AcquireImageFromURL ¶
AcquireImageFromURL attempts to load an image from a URL.
func (*Image) AcquireDisabled ¶
AcquireDisabled returns an image based on this image which is desaturated and ghosted to represent a disabled state.
func (*Image) AcquireImageArea ¶
AcquireImageArea creates a new image from an area within this image.
func (*Image) DataFromArea ¶
DataFromArea extracts the raw image data from an area within an image.
func (*Image) NewCairoContext ¶
func (img *Image) NewCairoContext() CairoContext
NewCairoContext creates a new CairoContext.
type ImageData ¶
ImageData is the raw information that makes up an Image.
func (*ImageData) At ¶
At returns the color of the pixel at (x, y). At(Bounds().Min.X, Bounds().Min.Y) returns the upper-left pixel of the grid. At(Bounds().Max.X-1, Bounds().Max.Y-1) returns the lower-right one. (Implementation of image.Image)
func (*ImageData) Bounds ¶
Bounds returns the domain for which At can return non-zero color. The bounds do not necessarily contain the point (0, 0). (Implementation of image.Image)
func (*ImageData) ColorModel ¶
ColorModel returns the Image's color model. (Implementation of image.Image)
type LineCap ¶
type LineCap int
LineCap indicates how to render the endpoints of a path when stroking it.
const ( LineCapButt LineCap = C.CAIRO_LINE_CAP_BUTT LineCapRound LineCap = C.CAIRO_LINE_CAP_ROUND LineCapSquare LineCap = C.CAIRO_LINE_CAP_SQUARE )
Possible line caps.
type LineJoin ¶
type LineJoin int
LineJoin indicates how to join the endpoints of a path when stroking it.
const ( LineJoinMiter LineJoin = C.CAIRO_LINE_JOIN_MITER LineJoinRound LineJoin = C.CAIRO_LINE_JOIN_ROUND LineJoinBevel LineJoin = C.CAIRO_LINE_JOIN_BEVEL )
Possible line joins.
type Paint ¶
type Paint struct {
// contains filtered or unexported fields
}
Paint holds patterns used when filling and stroking paths.
func NewColorPaint ¶
NewColorPaint creates a new Paint from a color.
func NewImagePaint ¶
NewImagePaint creates a new Paint from an image.
func NewLinearGradientPaint ¶
NewLinearGradientPaint creates a new Paint from a gradient that is spread across the specified line.
func NewRadialGradientPaint ¶
func NewRadialGradientPaint(gradient *Gradient, scx, scy, startRadius, ecx, ecy, endRadius float64) *Paint
NewRadialGradientPaint creates a new Paint from a gradient that radiates from one circle to another.
func (*Paint) Dispose ¶
func (p *Paint) Dispose()
Dispose releases the underlying resources used by this Paint.
func (*Paint) FilterMode ¶
func (p *Paint) FilterMode() FilterMode
FilterMode returns the FilterMode of this Paint.
func (*Paint) SetFilterMode ¶
func (p *Paint) SetFilterMode(mode FilterMode)
SetFilterMode sets the FilterMode of this Paint.
func (*Paint) SetPaintMode ¶
SetPaintMode sets the PaintMode of this Paint.
type PaintKind ¶
type PaintKind int
PaintKind defines the possible types of Paint.
const ( PaintKindColor PaintKind = C.CAIRO_PATTERN_TYPE_SOLID PaintKindImage PaintKind = C.CAIRO_PATTERN_TYPE_SURFACE PaintKindLinearGradient PaintKind = C.CAIRO_PATTERN_TYPE_LINEAR PaintKindRadialGradient PaintKind = C.CAIRO_PATTERN_TYPE_RADIAL )
PaintKind possibilities.
type PaintMode ¶
type PaintMode int
PaintMode defines how pixels outside a pattern's space are filled in.
const ( // PaintModeNone pixels outside of the pattern are fully transparent. PaintModeNone PaintMode = C.CAIRO_EXTEND_NONE // PaintModeRepeat the pattern is tiled by repeating. PaintModeRepeat PaintMode = C.CAIRO_EXTEND_REPEAT // PaintModeReflect the pattern is tiled by reflecting at the edges. PaintModeReflect PaintMode = C.CAIRO_EXTEND_REFLECT // PaintModePad pixels outside of the pattern copy the closest pixel from the source. PaintModePad PaintMode = C.CAIRO_EXTEND_PAD )
type Path ¶
type Path struct {
// contains filtered or unexported fields
}
Path is a description of a series of shapes or lines.
func (*Path) Arc ¶
Arc adds an arc of a circle to the current path, possibly preceded by a straight line segment.
func (*Path) BeginSubPath ¶
func (p *Path) BeginSubPath()
BeginSubPath creates a new empty sub-path. Any existing path is not affected.
func (*Path) ClosePath ¶
func (p *Path) ClosePath()
ClosePath closes and terminates the current path’s subpath.
func (*Path) CurveTo ¶
CurveTo appends a cubic Bezier curve from the current point, using the provided controls points and end point.
func (*Path) Ellipse ¶
Ellipse adds an ellipse to the path. The ellipse is a complete subpath, i.e. it starts with a MoveTo and ends with a ClosePath operation.
func (*Path) LineTo ¶
LineTo appends a straight line segment from the current point to the specified point.
func (*Path) QuadCurveTo ¶
QuadCurveTo appends a quadratic Bezier curve from the current point, using a control point and an end point.
type Surface ¶
type Surface struct {
// contains filtered or unexported fields
}
Surface holds the content of a drawing surface.
func (*Surface) CreateSimilar ¶
func (surface *Surface) CreateSimilar(contentType CairoContentType, size geom.Size) *Surface
CreateSimilar creates a new surface similar to this surface, but with the specified content type and size.
func (*Surface) NewCairoContext ¶
func (surface *Surface) NewCairoContext() CairoContext
NewCairoContext creates a new CairoContext.