cairo

package
v0.0.0-...-697b985 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2019 License: BSD-3-Clause, Zlib Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatStrideForWidth

func FormatStrideForWidth(f Format, w int) int

Types

type AntiAlias

type AntiAlias C.cairo_antialias_t
const (
	ANTIALIAS_DEFAULT AntiAlias = C.CAIRO_ANTIALIAS_DEFAULT

	ANTIALIAS_NONE     AntiAlias = C.CAIRO_ANTIALIAS_NONE
	ANTIALIAS_GRAY     AntiAlias = C.CAIRO_ANTIALIAS_GRAY
	ANTIALIAS_SUBPIXEL AntiAlias = C.CAIRO_ANTIALIAS_SUBPIXEL

	ANTIALIAS_FAST AntiAlias = C.CAIRO_ANTIALIAS_FAST
	ANTIALIAS_GOOD AntiAlias = C.CAIRO_ANTIALIAS_GOOD
	ANTIALIAS_BEST AntiAlias = C.CAIRO_ANTIALIAS_BEST
)

type Cairo

type Cairo C.cairo_t

func Create

func Create(target *Surface) *Cairo

func (*Cairo) AntiAlias

func (c *Cairo) AntiAlias() AntiAlias

func (*Cairo) Arc

func (c *Cairo) Arc(xc, yc, radius, angle1, angle2 float64)

func (*Cairo) ArcNegative

func (c *Cairo) ArcNegative(xc, yc, radius, angle1, angle2 float64)

func (*Cairo) ClosePath

func (c *Cairo) ClosePath()

func (*Cairo) DashCount

func (c *Cairo) DashCount() int

func (*Cairo) Destroy

func (c *Cairo) Destroy()

func (*Cairo) Fill

func (c *Cairo) Fill()

func (*Cairo) FillExtents

func (c *Cairo) FillExtents() (x1, y1, x2, y2 float64)

func (*Cairo) FillPreserve

func (c *Cairo) FillPreserve()

func (*Cairo) FontMatrix

func (c *Cairo) FontMatrix() Matrix

func (*Cairo) InClip

func (c *Cairo) InClip(x, y float64) bool

func (*Cairo) LineCap

func (c *Cairo) LineCap() LineCap

func (*Cairo) LineTo

func (c *Cairo) LineTo(x, y float64)

func (*Cairo) Matrix

func (c *Cairo) Matrix() Matrix

func (*Cairo) MoveTo

func (c *Cairo) MoveTo(x, y float64)

func (*Cairo) NewPath

func (c *Cairo) NewPath()

func (*Cairo) NewSubPath

func (c *Cairo) NewSubPath()

func (*Cairo) Paint

func (c *Cairo) Paint()

func (*Cairo) PaintWithAlpha

func (c *Cairo) PaintWithAlpha(alpha float64)

func (*Cairo) PopGroup

func (c *Cairo) PopGroup()

func (*Cairo) PushGroup

func (c *Cairo) PushGroup()

func (*Cairo) Rectangle

func (c *Cairo) Rectangle(x, y, w, h float64)

func (*Cairo) Ref

func (c *Cairo) Ref() *Cairo

func (*Cairo) RelCurveTo

func (c *Cairo) RelCurveTo(dx1, dy1, dx2, dy2, dx3, dy3 float64)

func (*Cairo) RelLineTo

func (c *Cairo) RelLineTo(dx, dy float64)

func (*Cairo) RelMoveTo

func (c *Cairo) RelMoveTo(dx, dy float64)

func (*Cairo) ResetClip

func (c *Cairo) ResetClip()

func (*Cairo) Restore

func (c *Cairo) Restore()

func (*Cairo) Save

func (c *Cairo) Save()

func (*Cairo) ScaledFont

func (c *Cairo) ScaledFont() *ScaledFont

func (*Cairo) SelectFontFace

func (c *Cairo) SelectFontFace(family string, slant FontSlant, weight FontWeight)

func (*Cairo) SetAntiAlias

func (c *Cairo) SetAntiAlias(antialias AntiAlias)

func (*Cairo) SetDash

func (c *Cairo) SetDash(dashes []float64, offset float64)

func (*Cairo) SetFontSize

func (c *Cairo) SetFontSize(size float64)

func (*Cairo) SetLineCap

func (c *Cairo) SetLineCap(linecap LineCap)

func (*Cairo) SetLineJoin

func (c *Cairo) SetLineJoin(linejoin LineJoin)

func (*Cairo) SetLineWidth

func (c *Cairo) SetLineWidth(w float64)

func (*Cairo) SetScaledFont

func (c *Cairo) SetScaledFont(scaledFont *ScaledFont)

func (*Cairo) SetSource

func (c *Cairo) SetSource(source *Pattern)

func (*Cairo) SetSourceRGB

func (c *Cairo) SetSourceRGB(red, green, blue float64)

func (*Cairo) SetSourceRGBA

func (c *Cairo) SetSourceRGBA(red, green, blue, alpha float64)

func (*Cairo) SetSourceSurface

func (c *Cairo) SetSourceSurface(surface *Surface, x, y float64)

func (*Cairo) ShowText

func (c *Cairo) ShowText(text string)

func (*Cairo) Source

func (c *Cairo) Source() *Pattern

func (*Cairo) Status

func (c *Cairo) Status() Status

func (*Cairo) Stroke

func (c *Cairo) Stroke()

func (*Cairo) StrokeExtents

func (c *Cairo) StrokeExtents() (x1, y1, x2, y2 float64)

func (*Cairo) StrokePreserve

func (c *Cairo) StrokePreserve()

func (*Cairo) Target

func (c *Cairo) Target() *Surface

func (*Cairo) TextExtents

func (c *Cairo) TextExtents(utf8 string) TextExtents

func (*Cairo) TextPath

func (c *Cairo) TextPath(text string)

type Content

type Content C.cairo_content_t
const (
	CONTENT_COLOR       Content = C.CAIRO_CONTENT_COLOR
	CONTENT_ALPHA       Content = C.CAIRO_CONTENT_ALPHA
	CONTENT_COLOR_ALPHA Content = C.CAIRO_CONTENT_COLOR_ALPHA
)

type Extend

type Extend C.cairo_extend_t
const (
	EXTEND_NONE   Extend = C.CAIRO_EXTEND_NONE
	EXTEND_REPEAT Extend = C.CAIRO_EXTEND_REPEAT
	EXTEND_PAD    Extend = C.CAIRO_EXTEND_PAD
)

type FT_Error

type FT_Error C.FT_Error

func (FT_Error) Error

func (e FT_Error) Error() string

type FT_Face

type FT_Face struct {
	// contains filtered or unexported fields
}

func (*FT_Face) Create

func (f *FT_Face) Create(loadFlags int) *FontFace

func (*FT_Face) Done

func (f *FT_Face) Done()

type FT_Library

type FT_Library struct {
	// contains filtered or unexported fields
}

func (*FT_Library) Init

func (l *FT_Library) Init() error

func (*FT_Library) NewFace

func (l *FT_Library) NewFace(filename string, faceIndex int) (*FT_Face, error)

type FillRule

type FillRule C.cairo_fill_rule_t
const (
	FILL_RULE_WINDING  FillRule = C.CAIRO_FILL_RULE_WINDING
	FILL_RULL_EVEN_ODD FillRule = C.CAIRO_FILL_RULE_EVEN_ODD
)

type Filter

type Filter C.cairo_filter_t
const (
	FILTER_FAST     Filter = C.CAIRO_FILTER_FAST
	FILTER_GOOD     Filter = C.CAIRO_FILTER_GOOD
	FILTER_BEST     Filter = C.CAIRO_FILTER_BEST
	FILTER_BILINEAR Filter = C.CAIRO_FILTER_BILINEAR
	FILTER_GAUSSIAN Filter = C.CAIRO_FILTER_GAUSSIAN
)

type FontExtents

type FontExtents struct {
	Ascent      float64
	Descent     float64
	Height      float64
	MaxXAdvance float64
	MaxYAdvance float64
}

type FontFace

type FontFace C.cairo_font_face_t

func (*FontFace) CreateScaledFont

func (f *FontFace) CreateScaledFont(matrix, ctm *Matrix, options *FontOptions) *ScaledFont

func (*FontFace) Destroy

func (f *FontFace) Destroy()

func (*FontFace) Ref

func (f *FontFace) Ref() *FontFace

type FontOptions

type FontOptions C.cairo_font_options_t

func CreateFontOptions

func CreateFontOptions() *FontOptions

func (*FontOptions) Destroy

func (f *FontOptions) Destroy()

func (*FontOptions) Hash

func (f *FontOptions) Hash() uint

func (*FontOptions) SetAntiAlias

func (f *FontOptions) SetAntiAlias(antialias AntiAlias)

func (*FontOptions) SetHintStyle

func (f *FontOptions) SetHintStyle(style HintStyle)

func (*FontOptions) Status

func (f *FontOptions) Status() Status

type FontSlant

type FontSlant C.cairo_font_slant_t
const (
	FONT_SLANT_NORMAL  FontSlant = C.CAIRO_FONT_SLANT_NORMAL
	FONT_SLANT_ITALIC  FontSlant = C.CAIRO_FONT_SLANT_ITALIC
	FONT_SLANT_OBLIQUE FontSlant = C.CAIRO_FONT_SLANT_OBLIQUE
)

type FontWeight

type FontWeight C.cairo_font_weight_t
const (
	FONT_WEIGHT_NORMAL FontWeight = C.CAIRO_FONT_WEIGHT_NORMAL
	FONT_WEIGHT_BOLD   FontWeight = C.CAIRO_FONT_WEIGHT_BOLD
)

type Format

type Format C.cairo_format_t
const (
	FORMAT_INVALID      Format = C.CAIRO_FORMAT_INVALID
	FORMAT_ARGB32       Format = C.CAIRO_FORMAT_ARGB32
	FORMAT_RGB24        Format = C.CAIRO_FORMAT_RGB24
	FORMAT_A8           Format = C.CAIRO_FORMAT_A8
	FORMAT_A1           Format = C.CAIRO_FORMAT_A1
	FORMAT_RGB16_565    Format = C.CAIRO_FORMAT_RGB16_565
	FORMAT_FORMAT_RGB30 Format = C.CAIRO_FORMAT_RGB30
)

type HintStyle

type HintStyle C.cairo_hint_style_t
const (
	HINT_STYLE_DEFAULT HintStyle = C.CAIRO_HINT_STYLE_DEFAULT
	HINT_STYLE_FULL    HintStyle = C.CAIRO_HINT_STYLE_FULL
)

type LineCap

type LineCap C.cairo_line_cap_t
const (
	LINE_CAP_BUTT   LineCap = C.CAIRO_LINE_CAP_BUTT
	LINE_CAP_ROUND  LineCap = C.CAIRO_LINE_CAP_ROUND
	LINE_CAP_SQUARE LineCap = C.CAIRO_LINE_CAP_SQUARE
)

type LineJoin

type LineJoin C.cairo_line_join_t
const (
	LINE_JOIN_MITER LineJoin = C.CAIRO_LINE_JOIN_MITER
	LINE_JOIN_BEVEL LineJoin = C.CAIRO_LINE_JOIN_BEVEL
	LINE_JOIN_ROUND LineJoin = C.CAIRO_LINE_JOIN_ROUND
)

type Matrix

type Matrix struct {
	XX, YX float64
	XY, YY float64
	X0, Y0 float64
}

func (*Matrix) InitIdentity

func (m *Matrix) InitIdentity()

func (*Matrix) InitScale

func (m *Matrix) InitScale(sx, sy float64)

type Pattern

type Pattern C.cairo_pattern_t

func CreatePatternLinear

func CreatePatternLinear(x0, y0, x1, y1 float64) *Pattern

func CreatePatternMesh

func CreatePatternMesh() *Pattern

func CreatePatternRGB

func CreatePatternRGB(red, green, blue float64) *Pattern

func CreatePatternRGBA

func CreatePatternRGBA(red, green, blue, alpha float64) *Pattern

func CreatePatternRadial

func CreatePatternRadial(cx0, cy0, radius0, cx1, cy1, radius1 float64) *Pattern

func (*Pattern) AddColorStopRGB

func (p *Pattern) AddColorStopRGB(offset, red, green, blue float64)

func (*Pattern) AddColorStopRGBA

func (p *Pattern) AddColorStopRGBA(offset, red, green, blue, alpha float64)

func (*Pattern) BeginPatch

func (p *Pattern) BeginPatch()

func (*Pattern) CurveTo

func (p *Pattern) CurveTo(x1, y1, x2, y2, x3, y3 float64)

func (*Pattern) Destroy

func (p *Pattern) Destroy()

func (*Pattern) EndPatch

func (p *Pattern) EndPatch()

func (*Pattern) Extend

func (p *Pattern) Extend() Extend

func (*Pattern) Filter

func (p *Pattern) Filter() Filter

func (*Pattern) LineTo

func (p *Pattern) LineTo(x, y float64)

func (*Pattern) LinearPoints

func (p *Pattern) LinearPoints() (x0, y0, x1, y1 float64, err error)

func (*Pattern) MoveTo

func (p *Pattern) MoveTo(x, y float64)

func (*Pattern) RGBA

func (p *Pattern) RGBA() (red, green, blue, alpha float64)

func (*Pattern) RadialCircles

func (p *Pattern) RadialCircles() (x0, y0, r0, x1, y1, r1 float64, err error)

func (*Pattern) Ref

func (p *Pattern) Ref() *Pattern

func (*Pattern) SetControlPoint

func (p *Pattern) SetControlPoint(pointNum int, x, y float64)

func (*Pattern) SetExtend

func (p *Pattern) SetExtend(extend Extend)

func (*Pattern) SetFilter

func (p *Pattern) SetFilter(filter Filter)

func (*Pattern) Status

func (p *Pattern) Status() Status

type PatternType

type PatternType C.cairo_pattern_type_t
const (
	PATTERN_TYPE_SOLID         PatternType = C.CAIRO_PATTERN_TYPE_SOLID
	PATTERN_TYPE_SURFACE       PatternType = C.CAIRO_PATTERN_TYPE_SURFACE
	PATTERN_TYPE_LINEAR        PatternType = C.CAIRO_PATTERN_TYPE_LINEAR
	PATTERN_TYPE_RADIAL        PatternType = C.CAIRO_PATTERN_TYPE_RADIAL
	PATTERN_TYPE_MESH          PatternType = C.CAIRO_PATTERN_TYPE_MESH
	PATTERN_TYPE_RASTER_SOURCE PatternType = C.CAIRO_PATTERN_TYPE_RASTER_SOURCE
)

type ScaledFont

type ScaledFont C.cairo_scaled_font_t

func (*ScaledFont) Extents

func (f *ScaledFont) Extents() FontExtents

type Status

type Status C.cairo_status_t
const (
	STATUS_SUCCESS Status = C.CAIRO_STATUS_SUCCESS
)

func (Status) Error

func (s Status) Error() string

type SubPixelOrder

type SubPixelOrder C.cairo_subpixel_order_t
const (
	SUBPIXEL_ORDER_DEFAULT SubPixelOrder = C.CAIRO_SUBPIXEL_ORDER_DEFAULT
	SUBPIXEL_ORDER_RGB     SubPixelOrder = C.CAIRO_SUBPIXEL_ORDER_RGB
	SUBPIXEL_ORDER_BGR     SubPixelOrder = C.CAIRO_SUBPIXEL_ORDER_BGR
	SUBPIXEL_ORDER_VRGB    SubPixelOrder = C.CAIRO_SUBPIXEL_ORDER_VRGB
	SUBPIXEL_ORDER_VBGR    SubPixelOrder = C.CAIRO_SUBPIXEL_ORDER_VBGR
)

type Surface

type Surface C.cairo_surface_t

func CreateImageSurface

func CreateImageSurface(format Format, w, h int) *Surface

func CreateImageSurfaceForData

func CreateImageSurfaceForData(data []byte, format Format, width, height, stride int) *Surface

func CreateImageSurfaceFromPNG

func CreateImageSurfaceFromPNG(filename string) *Surface

func (*Surface) At

func (s *Surface) At(x, y int) color.Color

func (*Surface) Bounds

func (s *Surface) Bounds() image.Rectangle

func (*Surface) CreateSimilarImage

func (s *Surface) CreateSimilarImage(format Format, w, h int) *Surface

func (*Surface) Data

func (s *Surface) Data() []byte

func (*Surface) Destroy

func (s *Surface) Destroy()

func (*Surface) Finish

func (s *Surface) Finish()

func (*Surface) Flush

func (s *Surface) Flush()

func (*Surface) Format

func (s *Surface) Format() Format

func (*Surface) Height

func (s *Surface) Height() int

func (*Surface) MarkDirty

func (s *Surface) MarkDirty()

func (*Surface) Ref

func (s *Surface) Ref() *Surface

func (*Surface) Set

func (s *Surface) Set(x, y int, c color.Color)

func (*Surface) Status

func (s *Surface) Status() Status

func (*Surface) Stride

func (s *Surface) Stride() int

func (*Surface) Width

func (s *Surface) Width() int

func (*Surface) WriteToPNG

func (s *Surface) WriteToPNG(filename string)

type TextExtents

type TextExtents struct {
	XBearing float64
	YBearing float64
	Width    float64
	Height   float64
	XAdvance float64
	YAdvance float64
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL