cairo

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FORMAT_INVALID   Format = -1
	FORMAT_ARGB32           = 0
	FORMAT_RGB24            = 1
	FORMAT_A8               = 2
	FORMAT_A1               = 3
	FORMAT_RGB16_565        = 4
	FORMAT_RGB30            = 5
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Antialias

type Antialias int

----------------------------------------------------------------

const (
	ANTIALIAS_DEFAULT Antialias = iota

	/* method */
	ANTIALIAS_NONE
	ANTIALIAS_GRAY
	ANTIALIAS_SUBPIXEL

	/* hints */
	ANTIALIAS_FAST
	ANTIALIAS_GOOD
	ANTIALIAS_BEST
)

type Content

type Content int

----------------------------------------------------------------

const (
	CONTENT_COLOR       Content = 0x1000
	CONTENT_ALPHA       Content = 0x2000
	CONTENT_COLOR_ALPHA Content = 0x3000
)

type Context

type Context C.cairo_t

func (*Context) Antialias

func (this *Context) Antialias() Antialias

func (*Context) AppendPath

func (this *Context) AppendPath(p *Path)

func (*Context) Arc

func (this *Context) Arc(xc, yc, radius, angle1, angle2 float64)

func (*Context) ArcNegative

func (this *Context) ArcNegative(xc, yc, radius, angle1, angle2 float64)

func (*Context) Clip

func (this *Context) Clip()

func (*Context) ClipBounds

func (this *Context) ClipBounds() (x, y, width, height float64)

func (*Context) ClipPreserve

func (this *Context) ClipPreserve()

func (*Context) ClosePath

func (this *Context) ClosePath()

func (*Context) CopyPage

func (this *Context) CopyPage()

func (*Context) CopyPath

func (this *Context) CopyPath() *Path

func (*Context) CopyPathFlat

func (this *Context) CopyPathFlat() *Path

func (*Context) CurrentPoint

func (this *Context) CurrentPoint() (x, y float64)

func (*Context) CurveTo

func (this *Context) CurveTo(x1, y1, x2, y2, x3, y3 float64)

func (*Context) Dash

func (this *Context) Dash() Dash

func (*Context) Destroy

func (this *Context) Destroy()

func (*Context) DeviceToUser

func (this *Context) DeviceToUser(x, y float64) (x1, y1 float64)

func (*Context) DeviceToUserDistance

func (this *Context) DeviceToUserDistance(dx, dy float64) (dx1, dy1 float64)

func (*Context) Fill

func (this *Context) Fill()

func (*Context) FillExtens

func (this *Context) FillExtens() (x1, y1, x2, y2 float64)

func (*Context) FillPreserve

func (this *Context) FillPreserve()

func (*Context) FillRule

func (this *Context) FillRule() FillRule

func (*Context) FontExtents

func (this *Context) FontExtents() *FontExtents

func (*Context) FontFace

func (this *Context) FontFace() *FontFace

func (*Context) FontOptions

func (this *Context) FontOptions() *FontOptions

func (*Context) GetFontMatrix

func (this *Context) GetFontMatrix(mat *geom.Mat3x2)

func (*Context) GetMatrix

func (this *Context) GetMatrix(mat *geom.Mat3x2)

func (*Context) GlyphExtents

func (this *Context) GlyphExtents(glyphs []Glyph) *TextExtents

func (*Context) GroupTarget

func (this *Context) GroupTarget() *Surface

func (*Context) HasCurrentPoint

func (this *Context) HasCurrentPoint() bool

func (*Context) InClip

func (this *Context) InClip(x, y float64) bool

func (*Context) InFill

func (this *Context) InFill(x, y float64) bool

func (*Context) InStroke

func (this *Context) InStroke(x, y float64) bool

func (*Context) Line

func (this *Context) Line(x0, y0, x1, y1 float64)

func (*Context) LineCap

func (this *Context) LineCap() LineCap

func (*Context) LineJoin

func (this *Context) LineJoin() LineJoin

func (*Context) LineTo

func (this *Context) LineTo(x, y float64)

func (*Context) LineWidth

func (this *Context) LineWidth() float64

func (*Context) Mask

func (this *Context) Mask(p *Pattern)

func (*Context) MaskSurface

func (this *Context) MaskSurface(s *Surface, x, y float64)

func (*Context) MiterLimit

func (this *Context) MiterLimit() float64

func (*Context) MoveTo

func (this *Context) MoveTo(x, y float64)

func (*Context) NewPath

func (this *Context) NewPath()

func (*Context) NewSubPath

func (this *Context) NewSubPath()

func (*Context) Operator

func (this *Context) Operator() Operator

func (*Context) Paint

func (this *Context) Paint()

func (*Context) PaintWithAlpha

func (this *Context) PaintWithAlpha(alpha float64)

func (*Context) PathExtens

func (this *Context) PathExtens() (x1, y1, x2, y2 float64)

func (*Context) PopGroup

func (this *Context) PopGroup() *Pattern

func (*Context) PopGroupToSource

func (this *Context) PopGroupToSource()

func (*Context) PushGroup

func (this *Context) PushGroup()

func (*Context) PushGroupWidthContent

func (this *Context) PushGroupWidthContent(c Content)

func (*Context) Rectangle

func (this *Context) Rectangle(x, y, width, height float64)

func (*Context) RelCurveTo

func (this *Context) RelCurveTo(x1, y1, x2, y2, x3, y3 float64)

func (*Context) RelLineTo

func (this *Context) RelLineTo(x, y float64)

func (*Context) RelMoveTo

func (this *Context) RelMoveTo(x, y float64)

func (*Context) ResetClip

func (this *Context) ResetClip()

func (*Context) ResetMatrix

func (this *Context) ResetMatrix()

func (*Context) Restore

func (this *Context) Restore()

func (*Context) Rotate

func (this *Context) Rotate(radians float64)

func (*Context) RoundRect

func (this *Context) RoundRect(x, y, width, height, r float64)

func (*Context) Save

func (this *Context) Save()

func (*Context) Scale

func (this *Context) Scale(sx, sy float64)

func (*Context) ScaledFont

func (this *Context) ScaledFont() *ScaledFont

func (*Context) SelectFontFace

func (this *Context) SelectFontFace(family string, slant FontSlant, weight FontWeight)

func (*Context) SetAntialias

func (this *Context) SetAntialias(a Antialias)

func (*Context) SetDash

func (this *Context) SetDash(d Dash)

func (*Context) SetFillRule

func (this *Context) SetFillRule(rule FillRule)

func (*Context) SetFontFace

func (this *Context) SetFontFace(face *FontFace)

func (*Context) SetFontMatrix

func (this *Context) SetFontMatrix(mat *geom.Mat3x2)

func (*Context) SetFontOptions

func (this *Context) SetFontOptions(options *FontOptions)

func (*Context) SetFontSize

func (this *Context) SetFontSize(size float64)

func (*Context) SetIdentityMatrix

func (this *Context) SetIdentityMatrix()

func (*Context) SetLineCap

func (this *Context) SetLineCap(c LineCap)

func (*Context) SetLineJoin

func (this *Context) SetLineJoin(j LineJoin)

func (*Context) SetLineWidth

func (this *Context) SetLineWidth(w float64)

func (*Context) SetMatrix

func (this *Context) SetMatrix(mat *geom.Mat3x2)

func (*Context) SetMiterLimit

func (this *Context) SetMiterLimit(v float64)

func (*Context) SetOperator

func (this *Context) SetOperator(v Operator)

func (*Context) SetScaledFont

func (this *Context) SetScaledFont(scaled_font *ScaledFont)

func (*Context) SetSource

func (this *Context) SetSource(p *Pattern)

func (*Context) SetSourceRGB

func (this *Context) SetSourceRGB(r, g, b float64)

func (*Context) SetSourceRGBA

func (this *Context) SetSourceRGBA(r, g, b, a float64)

func (*Context) SetSourceSurface

func (this *Context) SetSourceSurface(s *Surface, x, y float64)

func (*Context) SetTolerance

func (this *Context) SetTolerance(v float64)

func (*Context) ShowGlyphs

func (this *Context) ShowGlyphs(glyphs []Glyph)

func (*Context) ShowGlyphs_hack

func (this *Context) ShowGlyphs_hack(p unsafe.Pointer, n int)

func (*Context) ShowPage

func (this *Context) ShowPage()

func (*Context) ShowText

func (this *Context) ShowText(text string)

func (*Context) Source

func (this *Context) Source() *Pattern

func (*Context) Status

func (this *Context) Status() Status

func (*Context) Stroke

func (this *Context) Stroke()

func (*Context) StrokeExtens

func (this *Context) StrokeExtens() (x1, y1, x2, y2 float64)

func (*Context) StrokePreserve

func (this *Context) StrokePreserve()

func (*Context) Target

func (this *Context) Target() *Surface

func (*Context) TextExtents

func (this *Context) TextExtents(text string) *TextExtents

func (*Context) TextPath

func (this *Context) TextPath(s string)

cairo_glyph_path ()

func (*Context) Tolerance

func (this *Context) Tolerance() float64

func (*Context) Transform

func (this *Context) Transform(mat *geom.Mat3x2)

func (*Context) Translate

func (this *Context) Translate(tx, ty float64)

func (*Context) UserToDevice

func (this *Context) UserToDevice(x, y float64) (x1, y1 float64)

func (*Context) UserToDeviceDistance

func (this *Context) UserToDeviceDistance(dx, dy float64) (dx1, dy1 float64)

type Dash

type Dash struct {
	Dashes []float64
	Offset float64
}

----------------------------------------------------------------

func (*Dash) Dup

func (this *Dash) Dup() (d Dash)

type Device

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

----------------------------------------------------------------

type Extend

type Extend int

----------------------------------------------------------------

const (
	EXTEND_NONE Extend = iota
	EXTEND_REPEAT
	EXTEND_REFLECT
	EXTEND_PAD
)

type FillRule

type FillRule int

----------------------------------------------------------------

const (
	FILL_RULE_WINDING FillRule = iota
	FILL_RULE_EVEN_ODD
)

type Filter

type Filter int

----------------------------------------------------------------

const (
	FILTER_FAST Filter = iota
	FILTER_GOOD
	FILTER_BEST
	FILTER_NEAREST
	FILTER_BILINEAR
	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 NewToyFontFace

func NewToyFontFace(family string, slant FontSlant, weight FontWeight) *FontFace

func (*FontFace) Destroy

func (this *FontFace) Destroy()

func (*FontFace) Family

func (this *FontFace) Family() string

func (*FontFace) Slant

func (this *FontFace) Slant() FontSlant

func (*FontFace) Status

func (this *FontFace) Status() Status

func (*FontFace) Type

func (this *FontFace) Type() FontType

func (*FontFace) Weight

func (this *FontFace) Weight() FontWeight

type FontOptions

type FontOptions C.cairo_font_options_t

----------------------------------------------------------------

func NewFontOptions

func NewFontOptions() *FontOptions

func (*FontOptions) Antialias

func (this *FontOptions) Antialias() (antialias Antialias)

func (*FontOptions) Destroy

func (this *FontOptions) Destroy()

func (*FontOptions) Dup

func (this *FontOptions) Dup() *FontOptions

func (*FontOptions) Equal

func (this *FontOptions) Equal(other *FontOptions) bool

func (*FontOptions) Hash

func (this *FontOptions) Hash() uint32

func (*FontOptions) HintMetrics

func (this *FontOptions) HintMetrics() (v HintMetrics)

func (*FontOptions) HintStyle

func (this *FontOptions) HintStyle() (v HintStyle)

func (*FontOptions) Merge

func (this *FontOptions) Merge(other *FontOptions)

func (*FontOptions) SetAntialias

func (this *FontOptions) SetAntialias(antialias Antialias)

func (*FontOptions) SetHintMetrics

func (this *FontOptions) SetHintMetrics(v HintMetrics)

func (*FontOptions) SetHintStyle

func (this *FontOptions) SetHintStyle(v HintStyle)

func (*FontOptions) SetSubpixelOrder

func (this *FontOptions) SetSubpixelOrder(order SubpixelOrder)

func (*FontOptions) Status

func (this *FontOptions) Status() Status

func (*FontOptions) SubpixelOrder

func (this *FontOptions) SubpixelOrder() (order SubpixelOrder)

type FontSlant

type FontSlant int

----------------------------------------------------------------

const (
	FONT_SLANT_NORMAL FontSlant = iota
	FONT_SLANT_ITALIC
	FONT_SLANT_OBLIQUE
)

type FontType

type FontType int

----------------------------------------------------------------

const (
	FONT_TYPE_TOY FontType = iota
	FONT_TYPE_FT
	FONT_TYPE_WIN32
	FONT_TYPE_QUARTZ
	FONT_TYPE_USER
)

type FontWeight

type FontWeight int

----------------------------------------------------------------

const (
	FONT_WEIGHT_NORMAL FontWeight = iota
	FONT_WEIGHT_BOLD
)

type Format

type Format int

----------------------------------------------------------------

type Glyph

type Glyph struct {
	A uint32 // unused for cairo, but use in lib/gui
	X float64
	Y float64
	// contains filtered or unexported fields
}

// ----------------------------------------------------------------

type geom.Mat3x2 struct {
	Xx, Yx, Xy, Yy, X0, Y0 float64
}
func (this *geom.Mat3x2) native() *C.cairo_matrix_t {
	return (*C.cairo_matrix_t)(unsafe.Pointer(this))
}
func (this *geom.Mat3x2) Init(xx, yx, xy, yy, x0, y0 float64) {
	C.cairo_matrix_init(this.native(),
		C.double(xx), C.double(yx),
		C.double(xy), C.double(yy),
		C.double(x0), C.double(y0))
}
func (this *geom.Mat3x2) InitIdentity() {
	C.cairo_matrix_init_identity(this.native())
}
func (this *geom.Mat3x2) InitTranslate(tx, ty float64) {
	C.cairo_matrix_init_translate(this.native(), C.double(tx), C.double(ty))
}
func (this *geom.Mat3x2) InitScale(sx, sy float64) {
	C.cairo_matrix_init_scale(this.native(), C.double(sx), C.double(sy))
}
func (this *geom.Mat3x2) InitRotate(radians float64) {
	C.cairo_matrix_init_rotate(this.native(), C.double(radians))
}
func (this *geom.Mat3x2) Translate(tx, ty float64) {
	C.cairo_matrix_translate(this.native(), C.double(tx), C.double(ty))
}
func (this *geom.Mat3x2) Scale(sx, sy float64) {
	C.cairo_matrix_scale(this.native(), C.double(sx), C.double(sy))
}
func (this *geom.Mat3x2) Rotate(radians float64) {
	C.cairo_matrix_rotate(this.native(), C.double(radians))
}
func (this *geom.Mat3x2) Invert() error {
	st := Status(C.cairo_matrix_invert(this.native()))
	if st != STATUS_SUCCESS {
		return errors.New(st.String())
	}
	return nil
}
func Multiplygeom.Mat3x2(result, a, b *geom.Mat3x2) {
	C.cairo_matrix_multiply(result.native(), a.native(), b.native())
}
func (this *geom.Mat3x2) TransformDistance(dx, dy float64) (dx1, dy1 float64) {
	dx1 = dx
	dy1 = dy
	C.cairo_matrix_transform_distance(this.native(), (*C.double)(&dx1), (*C.double)(&dy1))
	return
}
func (this *geom.Mat3x2) TransformPoint(x, y float64) (x1, y1 float64) {
	x1 = x
	y1 = y
	C.cairo_matrix_transform_point(this.native(), (*C.double)(&x1), (*C.double)(&y1))
	return
}

----------------------------------------------------------------

func (Glyph) Index

func (g Glyph) Index() uint32

Index returns the font-local glyph index. Zero is the missing glyph.

type HintMetrics

type HintMetrics int

----------------------------------------------------------------

const (
	HINT_METRICS_DEFAULT HintMetrics = iota
	HINT_METRICS_OFF
	HINT_METRICS_ON
)

type HintStyle

type HintStyle int

----------------------------------------------------------------

const (
	HINT_STYLE_DEFAULT HintStyle = iota
	HINT_STYLE_NONE
	HINT_STYLE_SLIGHT
	HINT_STYLE_MEDIUM
	HINT_STYLE_FULL
)

type LineCap

type LineCap int

----------------------------------------------------------------

const (
	LINE_CAP_BUTT LineCap = iota
	LINE_CAP_ROUND
	LINE_CAP_SQUARE
)

type LineJoin

type LineJoin int

----------------------------------------------------------------

const (
	LINE_JOIN_MITER LineJoin = iota
	LINE_JOIN_ROUND
	LINE_JOIN_BEVEL
)

type Operator

type Operator int

----------------------------------------------------------------

const (
	OPERATOR_CLEAR Operator = iota

	OPERATOR_SOURCE
	OPERATOR_OVER
	OPERATOR_IN
	OPERATOR_OUT
	OPERATOR_ATOP

	OPERATOR_DEST
	OPERATOR_DEST_OVER
	OPERATOR_DEST_IN
	OPERATOR_DEST_OUT
	OPERATOR_DEST_ATOP

	OPERATOR_XOR
	OPERATOR_ADD
	OPERATOR_SATURATE

	OPERATOR_MULTIPLY
	OPERATOR_SCREEN
	OPERATOR_OVERLAY
	OPERATOR_DARKEN
	OPERATOR_LIGHTEN
	OPERATOR_COLOR_DODGE
	OPERATOR_COLOR_BURN
	OPERATOR_HARD_LIGHT
	OPERATOR_SOFT_LIGHT
	OPERATOR_DIFFERENCE
	OPERATOR_EXCLUSION
	OPERATOR_HSL_HUE
	OPERATOR_HSL_SATURATION
	OPERATOR_HSL_COLOR
	OPERATOR_HSL_LUMINOSITY
)

type Path

type Path C.cairo_path_t

----------------------------------------------------------------

func (*Path) Destroy

func (this *Path) Destroy()

type PathDataType

type PathDataType int
const (
	PATH_MOVE_TO PathDataType = iota
	PATH_LINE_TO
	PATH_CURVE_TO
	PATH_CLOSE_PATH
)

type Pattern

type Pattern C.cairo_pattern_t

----------------------------------------------------------------

func NewLinearPattern

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

func NewPatternForSurface

func NewPatternForSurface(s *Surface) *Pattern

func NewRGBAPattern

func NewRGBAPattern(r, g, b, a float64) *Pattern

func NewRGBPattern

func NewRGBPattern(r, g, b float64) *Pattern

func NewRadialPattern

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

func (*Pattern) AddColorStopRGB

func (this *Pattern) AddColorStopRGB(offset, r, g, b float64)

func (*Pattern) AddColorStopRGBA

func (this *Pattern) AddColorStopRGBA(offset, r, g, b, a float64)

func (*Pattern) ColorStopCount

func (this *Pattern) ColorStopCount() (count int32, err error)

func (*Pattern) ColorStopRGBA

func (this *Pattern) ColorStopRGBA(index int) (offset, r, g, b, a float64, err error)

func (*Pattern) Destroy

func (this *Pattern) Destroy()

func (*Pattern) Extend

func (this *Pattern) Extend() Extend

func (*Pattern) Filter

func (this *Pattern) Filter() Filter

func (*Pattern) GetMatrix

func (this *Pattern) GetMatrix(mat *geom.Mat3x2)

func (*Pattern) LinearPoints

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

func (*Pattern) RGBA

func (this *Pattern) RGBA() (r, g, b, a float64, err error)

func (*Pattern) RadialCircles

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

func (*Pattern) SetExtend

func (this *Pattern) SetExtend(ext Extend)

func (*Pattern) SetFilter

func (this *Pattern) SetFilter(f Filter)

func (*Pattern) SetMatrix

func (this *Pattern) SetMatrix(mat *geom.Mat3x2)

func (*Pattern) Status

func (this *Pattern) Status() Status

func (*Pattern) Surfface

func (this *Pattern) Surfface() (s *Surface, err error)

type Rectangle

type Rectangle struct {
	X, Y, Width, Height float64
}

----------------------------------------------------------------

type RectangleInt

type RectangleInt struct {
	X, Y, Width, Height int32
}

----------------------------------------------------------------

type RectangleList

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

----------------------------------------------------------------

type ScaledFont

type ScaledFont C.cairo_scaled_font_t

----------------------------------------------------------------

func NewScaledFont

func NewScaledFont(face *FontFace, matrix, ctm *geom.Mat3x2, options *FontOptions) *ScaledFont

func (*ScaledFont) Destroy

func (f *ScaledFont) Destroy()

func (*ScaledFont) FontExtents

func (this *ScaledFont) FontExtents() *FontExtents

func (*ScaledFont) FontFace

func (this *ScaledFont) FontFace() *FontFace

func (*ScaledFont) FontOptions

func (this *ScaledFont) FontOptions() *FontOptions

func (*ScaledFont) GetCtm

func (this *ScaledFont) GetCtm(mat *geom.Mat3x2)

func (*ScaledFont) GetFontMatrix

func (this *ScaledFont) GetFontMatrix(mat *geom.Mat3x2)

func (*ScaledFont) GetScaleMatrix

func (this *ScaledFont) GetScaleMatrix(mat *geom.Mat3x2)

func (*ScaledFont) GlyphExtents

func (this *ScaledFont) GlyphExtents(glyphs []Glyph) *TextExtents

func (*ScaledFont) GlyphExtents_hack

func (this *ScaledFont) GlyphExtents_hack(p unsafe.Pointer, n int) *TextExtents

func (*ScaledFont) Status

func (this *ScaledFont) Status() Status

func (*ScaledFont) TextExtents

func (this *ScaledFont) TextExtents(text string) *TextExtents

func (*ScaledFont) TextToGlyphs

func (this *ScaledFont) TextToGlyphs(x, y float64, text string) (ret []Glyph, err error)

func (*ScaledFont) TextToGlyphs_hack

func (this *ScaledFont) TextToGlyphs_hack(x, y float64, text string, out func(buf unsafe.Pointer, num int)) error

func (*ScaledFont) Type

func (this *ScaledFont) Type() FontType

type Status

type Status int32

----------------------------------------------------------------

const (
	STATUS_SUCCESS Status = iota
	STATUS_NO_MEMORY
	STATUS_INVALID_RESTORE
	STATUS_INVALID_POP_GROUP
	STATUS_NO_CURRENT_POINT
	STATUS_INVALID_MATRIX
	STATUS_INVALID_STATUS
	STATUS_NULL_POINTER
	STATUS_INVALID_STRING
	STATUS_INVALID_PATH_DATA
	STATUS_READ_ERROR
	STATUS_WRITE_ERROR
	STATUS_SURFACE_FINISHED
	STATUS_SURFACE_TYPE_MISMATCH
	STATUS_PATTERN_TYPE_MISMATCH
	STATUS_INVALID_CONTENT
	STATUS_INVALID_FORMAT
	STATUS_INVALID_VISUAL
	STATUS_FILE_NOT_FOUND
	STATUS_INVALID_DASH
	STATUS_INVALID_DSC_COMMENT
	STATUS_INVALID_INDEX
	STATUS_CLIP_NOT_REPRESENTABLE
	STATUS_TEMP_FILE_ERROR
	STATUS_INVALID_STRIDE
	STATUS_FONT_TYPE_MISMATCH
	STATUS_USER_FONT_IMMUTABLE
	STATUS_USER_FONT_ERROR
	STATUS_NEGATIVE_COUNT
	STATUS_INVALID_CLUSTERS
	STATUS_INVALID_SLANT
	STATUS_INVALID_WEIGHT
	STATUS_INVALID_SIZE
	STATUS_USER_FONT_NOT_IMPLEMENTED
	STATUS_DEVICE_TYPE_MISMATCH
	STATUS_DEVICE_ERROR
	STATUS_INVALID_MESH_CONSTRUCTION
	STATUS_DEVICE_FINISHED
	STATUS_LAST_STATUS
)

func (Status) String

func (s Status) String() string

type SubpixelOrder

type SubpixelOrder int

----------------------------------------------------------------

const (
	SUBPIXEL_ORDER_DEFAULT SubpixelOrder = iota
	SUBPIXEL_ORDER_RGB
	SUBPIXEL_ORDER_BGR
	SUBPIXEL_ORDER_VRGB
	SUBPIXEL_ORDER_VBGR
)

type Surface

type Surface C.cairo_surface_t

----------------------------------------------------------------

func NewImageSurface

func NewImageSurface(format Format, width, height int) *Surface

func NewImageSurfaceFromPNG

func NewImageSurfaceFromPNG(filename string) (*Surface, error)

func NewImageSurfaceFromPNGStream

func NewImageSurfaceFromPNGStream(r io.Reader) (*Surface, error)

func (*Surface) Content

func (this *Surface) Content() Content

func (*Surface) CopyPage

func (this *Surface) CopyPage()

func (*Surface) DataPtr

func (this *Surface) DataPtr() unsafe.Pointer

DataPtr returns the raw pixel data pointer for the image surface.

func (*Surface) Destroy

func (this *Surface) Destroy()

func (*Surface) Device

func (this *Surface) Device() *Device

func (*Surface) DeviceOffset

func (this *Surface) DeviceOffset() (x, y float64)

func (*Surface) Dup

func (this *Surface) Dup() *Surface

func (*Surface) DupGrayed

func (this *Surface) DupGrayed() *Surface

func (*Surface) FallbackResolution

func (this *Surface) FallbackResolution() (xPpi, yPpi float64)

func (*Surface) Finish

func (this *Surface) Finish()

func (*Surface) Flush

func (this *Surface) Flush()

func (*Surface) FontOptions

func (this *Surface) FontOptions() *FontOptions

func (*Surface) Format

func (this *Surface) Format() Format

func (*Surface) Height

func (this *Surface) Height() int

func (*Surface) HeightF

func (this *Surface) HeightF() float64

func (*Surface) Image

func (this *Surface) Image() (image.Image, error)

func (*Surface) MarkDirty

func (this *Surface) MarkDirty()

func (*Surface) MarkDirtyRectange

func (this *Surface) MarkDirtyRectange(x, y, width, height int)

func (*Surface) NewContext

func (this *Surface) NewContext() *Context

func (*Surface) NewSimilar

func (this *Surface) NewSimilar(c Content, width, height int) *Surface

func (*Surface) NewSurfaceForRectangle

func (this *Surface) NewSurfaceForRectangle(x, y, width, height float64) *Surface

func (*Surface) SetData

func (this *Surface) SetData(src []uint8) error

func (*Surface) SetDeviceOffset

func (this *Surface) SetDeviceOffset(x, y float64)

func (*Surface) SetFallbackResolution

func (this *Surface) SetFallbackResolution(xPpi, yPpi float64)

func (*Surface) SetImage

func (this *Surface) SetImage(img image.Image) error

func (*Surface) ShowPage

func (this *Surface) ShowPage()

func (*Surface) Stride

func (this *Surface) Stride() int

func (*Surface) Type

func (this *Surface) Type() SurfaceType

func (*Surface) Width

func (this *Surface) Width() int

func (*Surface) WidthF

func (this *Surface) WidthF() float64

func (*Surface) WritePNG

func (this *Surface) WritePNG(filename string) error

func (*Surface) WritePNGToStream

func (this *Surface) WritePNGToStream(w io.Writer) error

type SurfaceType

type SurfaceType int

----------------------------------------------------------------

const (
	SURFACE_TYPE_IMAGE SurfaceType = iota
	SURFACE_TYPE_PDF
	SURFACE_TYPE_PS
	SURFACE_TYPE_XLIB
	SURFACE_TYPE_XCB
	SURFACE_TYPE_GLITZ
	SURFACE_TYPE_QUARTZ
	SURFACE_TYPE_WIN32
	SURFACE_TYPE_BEOS
	SURFACE_TYPE_DIRECTFB
	SURFACE_TYPE_SVG
	SURFACE_TYPE_OS2
	SURFACE_TYPE_WIN32_PRINTING
	SURFACE_TYPE_QUARTZ_IMAGE
	SURFACE_TYPE_SCRIPT
	SURFACE_TYPE_QT
	SURFACE_TYPE_RECORDING
	SURFACE_TYPE_VG
	SURFACE_TYPE_GL
	SURFACE_TYPE_DRM
	SURFACE_TYPE_TEE
	SURFACE_TYPE_XML
	SURFACE_TYPE_SKIA
	SURFACE_TYPE_SUBSURFACE
	SURFACE_TYPE_COGL // 1.12
)

func (SurfaceType) String

func (v SurfaceType) String() string

type TextCluster

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

----------------------------------------------------------------

type TextClusterFlags

type TextClusterFlags int

----------------------------------------------------------------

const (
	TEXT_CLUSTER_FLAG_BACKWARD TextClusterFlags = 1
)

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