Documentation ¶
Overview ¶
Package cairo implements Go bindings for Cairo. Supports version 1.10 and later.
Index ¶
- func FormatStrideForWidth(format Format, width int) int
- type Antialias
- type Content
- type Context
- func (v *Context) Antialias() Antialias
- func (v *Context) Arc(xc, yc, radius, angle1, angle2 float64)
- func (v *Context) ArcNegative(xc, yc, radius, angle1, angle2 float64)
- func (v *Context) Clip()
- func (v *Context) ClipExtents() (x1, y1, x2, y2 float64)
- func (v *Context) ClipPreserve()
- func (v *Context) Close()
- func (v *Context) ClosePath()
- func (v *Context) CopyPage()
- func (v *Context) CurrentPoint() (x, y float64)
- func (v *Context) CurveTo(x1, y1, x2, y2, x3, y3 float64)
- func (v *Context) Dash() (dashes []float64, offset float64)
- func (v *Context) DashCount() int
- func (v *Context) DeviceToUser(x, y float64) (float64, float64)
- func (v *Context) DeviceToUserDistance(x, y float64) (float64, float64)
- func (v *Context) Fill()
- func (v *Context) FillExtents() (x1, y1, x2, y2 float64)
- func (v *Context) FillPreserve()
- func (v *Context) FillRule() FillRule
- func (v *Context) FontExtents() FontExtents
- func (v *Context) GroupTarget() *Surface
- func (v *Context) IdentityMatrix()
- func (v *Context) InClip(x, y float64) bool
- func (v *Context) InFill(x, y float64) bool
- func (v *Context) InStroke(x, y float64) bool
- func (v *Context) LineCap() LineCap
- func (v *Context) LineJoin() LineJoin
- func (v *Context) LineTo(x, y float64)
- func (v *Context) LineWidth() float64
- func (v *Context) MaskSurface(surface *Surface, surfaceX, surfaceY float64)
- func (v *Context) Matrix() *Matrix
- func (v *Context) MiterLimit() float64
- func (v *Context) MoveTo(x, y float64)
- func (v *Context) Native() uintptr
- func (v *Context) NewPath()
- func (v *Context) NewSubPath()
- func (v *Context) Operator() Operator
- func (v *Context) Paint()
- func (v *Context) PaintWithAlpha(alpha float64)
- func (v *Context) PopGroupToSource()
- func (v *Context) PushGroup()
- func (v *Context) PushGroupWithContent(content Content)
- func (v *Context) Rectangle(x, y, w, h float64)
- func (v *Context) ResetClip()
- func (v *Context) Restore()
- func (v *Context) Rotate(angle float64)
- func (v *Context) Save()
- func (v *Context) Scale(sx, sy float64)
- func (v *Context) SelectFontFace(family string, slant FontSlant, weight FontWeight)
- func (v *Context) SetAntialias(antialias Antialias)
- func (v *Context) SetDash(dashes []float64, offset float64)
- func (v *Context) SetFillRule(fillRule FillRule)
- func (v *Context) SetFontSize(size float64)
- func (v *Context) SetLineCap(lineCap LineCap)
- func (v *Context) SetLineJoin(lineJoin LineJoin)
- func (v *Context) SetLineWidth(width float64)
- func (v *Context) SetMatrix(matrix *Matrix)
- func (v *Context) SetMiterLimit(limit float64)
- func (v *Context) SetOperator(op Operator)
- func (v *Context) SetSource(p *Pattern)
- func (v *Context) SetSourceRGB(red, green, blue float64)
- func (v *Context) SetSourceRGBA(red, green, blue, alpha float64)
- func (v *Context) SetSourceSurface(surface *Surface, x, y float64)
- func (v *Context) SetTolerance(tolerance float64)
- func (v *Context) ShowPage()
- func (v *Context) ShowText(utf8 string)
- func (v *Context) Status() Status
- func (v *Context) Stroke()
- func (v *Context) StrokeExtents() (x1, y1, x2, y2 float64)
- func (v *Context) StrokePreserve()
- func (v *Context) Target() *Surface
- func (v *Context) TextExtents(utf8 string) TextExtents
- func (v *Context) Tolerance() float64
- func (v *Context) Transform(matrix *Matrix)
- func (v *Context) Translate(tx, ty float64)
- func (v *Context) UserToDevice(x, y float64) (float64, float64)
- func (v *Context) UserToDeviceDistance(dx, dy float64) (float64, float64)
- type FillRule
- type Filter
- type FontExtents
- type FontOptions
- func (o *FontOptions) Antialias() Antialias
- func (o *FontOptions) Copy() *FontOptions
- func (o *FontOptions) Equal(other *FontOptions) bool
- func (o *FontOptions) Hash() uint32
- func (o *FontOptions) HintMetrics() HintMetrics
- func (o *FontOptions) HintStyle() HintStyle
- func (o *FontOptions) Merge(other *FontOptions)
- func (o *FontOptions) SetAntialias(antialias Antialias)
- func (o *FontOptions) SetHintMetrics(hintMetrics HintMetrics)
- func (o *FontOptions) SetHintStyle(hintStyle HintStyle)
- func (o *FontOptions) SetSubpixelOrder(subpixelOrder SubpixelOrder)
- func (o *FontOptions) SetVariations(variations string)
- func (o *FontOptions) Status() Status
- func (o *FontOptions) SubpixelOrder() SubpixelOrder
- func (o *FontOptions) Variations() string
- type FontSlant
- type FontWeight
- type Format
- type HintMetrics
- type HintStyle
- type LineCap
- type LineJoin
- type Matrix
- func (m *Matrix) InitIdentity()
- func (m *Matrix) InitRotate(radians float64)
- func (m *Matrix) InitScale(sx, sy float64)
- func (m *Matrix) InitTranslate(tx, ty float64)
- func (m *Matrix) Invert()
- func (m *Matrix) Multiply(a, b Matrix)
- func (m *Matrix) Native() uintptr
- func (m *Matrix) Rotate(radians float64)
- func (m *Matrix) Scale(sx, sy float64)
- func (m *Matrix) TransformDistance(dx, dy float64) (float64, float64)
- func (m *Matrix) TransformPoint(x, y float64) (float64, float64)
- func (m *Matrix) Translate(tx, ty float64)
- type MimeType
- type Operator
- type Pattern
- func NewPatternForSurface(s *Surface) (*Pattern, error)
- func NewPatternFromRGB(red, green, blue float64) (*Pattern, error)
- func NewPatternFromRGBA(red, green, blue, alpha float64) (*Pattern, error)
- func NewPatternLinear(x0, y0, x1, y1 float64) (*Pattern, error)
- func NewPatternRadial(x0, y0, r0, x1, y1, r1 float64) (*Pattern, error)
- func (v *Pattern) AddColorStopRGB(offset, red, green, blue float64) error
- func (v *Pattern) AddColorStopRGBA(offset, red, green, blue, alpha float64) error
- func (v *Pattern) Native() uintptr
- func (v *Pattern) PatternGetFilter() Filter
- func (v *Pattern) PatternSetFilter(filter Filter)
- func (v *Pattern) Status() Status
- type Rectangle
- type Region
- func (v *Region) ContainsPoint(x, y int) bool
- func (v *Region) ContainsRectangle(rectangle *Rectangle) RegionOverlap
- func (v *Region) Copy() (*Region, error)
- func (v *Region) CreateRectangle(rectangle *Rectangle) (*Region, error)
- func (v *Region) CreateRectangles(rectangles ...*Rectangle) (*Region, error)
- func (v *Region) Equal(region *Region) bool
- func (v *Region) Extents(extents *Rectangle)
- func (v *Region) Intersect(other *Region) (*Region, error)
- func (v *Region) IntersectRectangle(rectangle *Rectangle) (*Region, error)
- func (v *Region) IsEmpty() bool
- func (v *Region) Native() uintptr
- func (v *Region) NumRectangles() int
- func (v *Region) Rectangle(nth int) *Rectangle
- func (v *Region) Status() Status
- func (v *Region) Substract(other *Region) (*Region, error)
- func (v *Region) SubstractRectangle(rectangle *Rectangle) (*Region, error)
- func (v *Region) Translate(dx, dy int)
- func (v *Region) Union(other *Region) (*Region, error)
- func (v *Region) UnionRectangle(rectangle *Rectangle) (*Region, error)
- func (v *Region) Xor(other *Region) (*Region, error)
- func (v *Region) XorRectangle(rectangle *Rectangle) (*Region, error)
- type RegionOverlap
- type Status
- type SubpixelOrder
- type Surface
- func CreateImageSurface(format Format, width, height int) *Surface
- func CreateImageSurfaceForData(data []byte, format Format, width, height, stride int) *Surface
- func CreatePDFSurface(fileName string, width float64, height float64) (*Surface, error)
- func CreatePNGSurfaceFromPNG(fileName string) (*Surface, error)
- func CreateSurfaceFromImage(img image.Image) *Surface
- func NewSurface(s uintptr, needsRef bool) *Surface
- func WrapSurface(s uintptr) *Surface
- func (v *Surface) Close()
- func (v *Surface) CopyPage()
- func (v *Surface) CreateForRectangle(x, y, width, height float64) *Surface
- func (v *Surface) CreateSimilar(content Content, width, height int) *Surface
- func (v *Surface) Data() []byte
- func (v *Surface) DeviceOffset() (x, y float64)
- func (v *Surface) FallbackResolution() (xPPI, yPPI float64)
- func (v *Surface) Flush()
- func (v *Surface) HasShowTextGlyphs() bool
- func (v *Surface) Height() int
- func (v *Surface) MarkDirty()
- func (v *Surface) MarkDirtyRectangle(x, y, width, height int)
- func (v *Surface) MimeData(mimeType MimeType) []byte
- func (v *Surface) Native() uintptr
- func (v *Surface) SetDeviceOffset(x, y float64)
- func (v *Surface) SetFallbackResolution(xPPI, yPPI float64)
- func (v *Surface) ShowPage()
- func (v *Surface) Status() Status
- func (v *Surface) Stride() int
- func (v *Surface) Type() SurfaceType
- func (v *Surface) Width() int
- func (v *Surface) WriteToPNG(fileName string) error
- func (v *Surface) WriteToPNGWriter(w io.Writer) error
- type SurfaceType
- type TextExtents
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatStrideForWidth ¶
FormatStrideForWidth is a wrapper for cairo_format_stride_for_width().
Types ¶
type Antialias ¶
type Antialias int
Antialias is a representation of Cairo's cairo_antialias_t.
const ( AntialiasDefault Antialias = C.CAIRO_ANTIALIAS_DEFAULT AntialiasNone Antialias = C.CAIRO_ANTIALIAS_NONE AntialiasGray Antialias = C.CAIRO_ANTIALIAS_GRAY AntialiasSubpixel Antialias = C.CAIRO_ANTIALIAS_SUBPIXEL AntialiasFast Antialias = C.CAIRO_ANTIALIAS_FAST // (since 1.12) AntialiasGood Antialias = C.CAIRO_ANTIALIAS_GOOD // (since 1.12) AntialiasBest Antialias = C.CAIRO_ANTIALIAS_BEST // (since 1.12) )
type Content ¶
type Content int
Content is a representation of Cairo's cairo_content_t.
const ( ContentColor Content = C.CAIRO_CONTENT_COLOR ContentAlpha Content = C.CAIRO_CONTENT_ALPHA ContentColorAlpha Content = C.CAIRO_CONTENT_COLOR_ALPHA )
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context is a representation of Cairo's cairo_t.
func WrapContext ¶
func (*Context) ArcNegative ¶
ArcNegative is a wrapper around cairo_arc_negative().
func (*Context) ClipExtents ¶
ClipExtents is a wrapper around cairo_clip_extents().
func (*Context) ClipPreserve ¶
func (v *Context) ClipPreserve()
ClipPreserve is a wrapper around cairo_clip_preserve().
func (*Context) Close ¶
func (v *Context) Close()
Closes the context. The context must not be used afterwards.
func (*Context) ClosePath ¶
func (v *Context) ClosePath()
ClosePath is a wrapper around cairo_close_path().
func (*Context) CopyPage ¶
func (v *Context) CopyPage()
CopyPage is a wrapper around cairo_copy_page().
func (*Context) CurrentPoint ¶
GetCurrentPoint is a wrapper around cairo_get_current_point().
func (*Context) DeviceToUser ¶
DeviceToUser is a wrapper around cairo_device_to_user.
func (*Context) DeviceToUserDistance ¶
DeviceToUserDistance is a wrapper around cairo_device_to_user_distance.
func (*Context) FillExtents ¶
FillExtents is a wrapper around cairo_fill_extents().
func (*Context) FillPreserve ¶
func (v *Context) FillPreserve()
FillPreserve is a wrapper around cairo_fill_preserve().
func (*Context) FontExtents ¶
func (v *Context) FontExtents() FontExtents
func (*Context) GroupTarget ¶
GetGroupTarget is a wrapper around cairo_get_group_target().
func (*Context) IdentityMatrix ¶
func (v *Context) IdentityMatrix()
IdentityMatrix is a wrapper around cairo_identity_matrix().
Resets the current transformation matrix (CTM) by setting it equal to the identity matrix. That is, the user-space and device-space axes will be aligned and one user-space unit will transform to one device-space unit.
func (*Context) MaskSurface ¶
MaskSurface is a wrapper around cairo_mask_surface().
func (*Context) MiterLimit ¶
GetMiterLimit is a wrapper around cairo_get_miter_limit().
func (*Context) NewSubPath ¶
func (v *Context) NewSubPath()
NewSubPath is a wrapper around cairo_new_sub_path().
func (*Context) PaintWithAlpha ¶
PaintWithAlpha is a wrapper around cairo_paint_with_alpha().
func (*Context) PopGroupToSource ¶
func (v *Context) PopGroupToSource()
PopGroupToSource is a wrapper around cairo_pop_group_to_source().
func (*Context) PushGroup ¶
func (v *Context) PushGroup()
PushGroup is a wrapper around cairo_push_group().
func (*Context) PushGroupWithContent ¶
PushGroupWithContent is a wrapper around cairo_push_group_with_content().
func (*Context) ResetClip ¶
func (v *Context) ResetClip()
ResetClip is a wrapper around cairo_reset_clip().
func (*Context) SelectFontFace ¶
func (v *Context) SelectFontFace(family string, slant FontSlant, weight FontWeight)
func (*Context) SetAntialias ¶
SetAntialias is a wrapper around cairo_set_antialias().
func (*Context) SetFillRule ¶
SetFillRule is a wrapper around cairo_set_fill_rule().
func (*Context) SetFontSize ¶
func (*Context) SetLineCap ¶
SetLineCap is a wrapper around cairo_set_line_cap().
func (*Context) SetLineJoin ¶
SetLineJoin is a wrapper around cairo_set_line_join().
func (*Context) SetLineWidth ¶
SetLineWidth is a wrapper around cairo_set_line_width().
func (*Context) SetMiterLimit ¶
SetMiterLimit is a wrapper around cairo_set_miter_limit().
func (*Context) SetOperator ¶
SetOperator is a wrapper around cairo_set_operator().
func (*Context) SetSourceRGB ¶
SetSourceRGB is a wrapper around cairo_set_source_rgb().
func (*Context) SetSourceRGBA ¶
SetSourceRGBA is a wrapper around cairo_set_source_rgba().
func (*Context) SetSourceSurface ¶
SetSourceSurface is a wrapper around cairo_set_source_surface().
func (*Context) SetTolerance ¶
SetTolerance is a wrapper around cairo_set_tolerance().
func (*Context) ShowPage ¶
func (v *Context) ShowPage()
ShowPage is a wrapper around cairo_show_page().
func (*Context) StrokeExtents ¶
StrokeExtents is a wrapper around cairo_stroke_extents().
func (*Context) StrokePreserve ¶
func (v *Context) StrokePreserve()
StrokePreserve is a wrapper around cairo_stroke_preserve().
func (*Context) TextExtents ¶
func (v *Context) TextExtents(utf8 string) TextExtents
func (*Context) UserToDevice ¶
UserToDevice is a wrapper around cairo_user_to_device.
type FillRule ¶
type FillRule int
FillRule is a representation of Cairo's cairo_fill_rule_t.
const ( FillRuleWinding FillRule = C.CAIRO_FILL_RULE_WINDING FillRuleEvenOdd FillRule = C.CAIRO_FILL_RULE_EVEN_ODD )
type Filter ¶
type Filter int
Filter is a representation of Cairo's cairo_filter_t.
const ( FilterFast Filter = C.CAIRO_FILTER_FAST FilterGood Filter = C.CAIRO_FILTER_GOOD FilterBest Filter = C.CAIRO_FILTER_BEST FilterNearest Filter = C.CAIRO_FILTER_NEAREST FilterBilinear Filter = C.CAIRO_FILTER_BILINEAR FilterGaussian Filter = C.CAIRO_FILTER_GAUSSIAN )
type FontExtents ¶
type FontOptions ¶
type FontOptions struct {
// contains filtered or unexported fields
}
FontOptions is a representation of Cairo's cairo_font_options_t.
func CreateFontOptions ¶
func CreateFontOptions() *FontOptions
CreatFontOptions is a wrapper around cairo_font_options_create().
func (*FontOptions) Antialias ¶
func (o *FontOptions) Antialias() Antialias
GetAntialias is a wrapper around cairo_font_options_get_antialias().
func (*FontOptions) Copy ¶
func (o *FontOptions) Copy() *FontOptions
Copy is a wrapper around cairo_font_options_copy().
func (*FontOptions) Equal ¶
func (o *FontOptions) Equal(other *FontOptions) bool
Equal is a wrapper around cairo_font_options_equal().
func (*FontOptions) Hash ¶
func (o *FontOptions) Hash() uint32
Hash is a wrapper around cairo_font_options_hash().
func (*FontOptions) HintMetrics ¶
func (o *FontOptions) HintMetrics() HintMetrics
GetHintMetrics is a wrapper around cairo_font_options_get_hint_metrics().
func (*FontOptions) HintStyle ¶
func (o *FontOptions) HintStyle() HintStyle
GetHintStyle is a wrapper around cairo_font_options_get_hint_style().
func (*FontOptions) Merge ¶
func (o *FontOptions) Merge(other *FontOptions)
Merge is a wrapper around cairo_font_options_merge().
func (*FontOptions) SetAntialias ¶
func (o *FontOptions) SetAntialias(antialias Antialias)
SetAntialias is a wrapper around cairo_font_options_set_antialias().
func (*FontOptions) SetHintMetrics ¶
func (o *FontOptions) SetHintMetrics(hintMetrics HintMetrics)
SetHintMetrics is a wrapper around cairo_font_options_set_hint_metrics().
func (*FontOptions) SetHintStyle ¶
func (o *FontOptions) SetHintStyle(hintStyle HintStyle)
SetHintStyle is a wrapper around cairo_font_options_set_hint_style().
func (*FontOptions) SetSubpixelOrder ¶
func (o *FontOptions) SetSubpixelOrder(subpixelOrder SubpixelOrder)
SetSubpixelOrder is a wrapper around cairo_font_options_set_subpixel_order().
func (*FontOptions) SetVariations ¶
func (o *FontOptions) SetVariations(variations string)
SetVariations is a wrapper around cairo_font_options_set_variations().
func (*FontOptions) Status ¶
func (o *FontOptions) Status() Status
Status is a wrapper around cairo_font_options_status().
func (*FontOptions) SubpixelOrder ¶
func (o *FontOptions) SubpixelOrder() SubpixelOrder
GetSubpixelOrder is a wrapper around cairo_font_options_get_subpixel_order().
func (*FontOptions) Variations ¶
func (o *FontOptions) Variations() string
GetVariations is a wrapper around cairo_font_options_get_variations().
type FontSlant ¶
type FontSlant int
FontSlant is a representation of Cairo's cairo_font_slant_t
const ( FontSlantNormal FontSlant = C.CAIRO_FONT_SLANT_NORMAL FontSlantItalic FontSlant = C.CAIRO_FONT_SLANT_ITALIC FontSlantOblique FontSlant = C.CAIRO_FONT_SLANT_OBLIQUE )
type FontWeight ¶
type FontWeight int
FontWeight is a representation of Cairo's cairo_font_weight_t
const ( FontWeightNormal FontWeight = C.CAIRO_FONT_WEIGHT_NORMAL FontWeightBold FontWeight = C.CAIRO_FONT_WEIGHT_BOLD )
type Format ¶
type Format int
Format is a representation of Cairo's cairo_format_t.
const ( FormatInvalid Format = C.CAIRO_FORMAT_INVALID FormatARGB32 Format = C.CAIRO_FORMAT_ARGB32 FormatRGB24 Format = C.CAIRO_FORMAT_RGB24 FormatA8 Format = C.CAIRO_FORMAT_A8 FormatA1 Format = C.CAIRO_FORMAT_A1 FormatRGB16_565 Format = C.CAIRO_FORMAT_RGB16_565 FormatRGB30 Format = C.CAIRO_FORMAT_RGB30 )
type HintMetrics ¶
type HintMetrics int
HintMetrics is a representation of Cairo's cairo_hint_metrics_t.
const ( HintMetricsDefault HintMetrics = C.CAIRO_HINT_METRICS_DEFAULT HintMetricsOff HintMetrics = C.CAIRO_HINT_METRICS_OFF HintMetricsOn HintMetrics = C.CAIRO_HINT_METRICS_ON )
type HintStyle ¶
type HintStyle int
HintStyle is a representation of Cairo's cairo_hint_style_t.
const ( HintStyleDefault HintStyle = C.CAIRO_HINT_STYLE_DEFAULT HintStyleNone HintStyle = C.CAIRO_HINT_STYLE_NONE HintStyleSlight HintStyle = C.CAIRO_HINT_STYLE_SLIGHT HintStyleMedium HintStyle = C.CAIRO_HINT_STYLE_MEDIUM HintStyleFull HintStyle = C.CAIRO_HINT_STYLE_FULL )
type LineCap ¶
type LineCap int
LineCap is a representation of Cairo's cairo_line_cap_t.
const ( LineCapButt LineCap = C.CAIRO_LINE_CAP_BUTT LineCapRound LineCap = C.CAIRO_LINE_CAP_ROUND LineCapSquare LineCap = C.CAIRO_LINE_CAP_SQUARE )
type LineJoin ¶
type LineJoin int
LineJoin is a representation of Cairo's cairo_line_join_t.
const ( LineJoinMiter LineJoin = C.CAIRO_LINE_JOIN_MITER LineJoinRound LineJoin = C.CAIRO_LINE_JOIN_ROUND LineJoinBevel LineJoin = C.CAIRO_LINE_JOIN_BEVEL )
type Matrix ¶
Matrix struct
func (*Matrix) InitIdentity ¶
func (m *Matrix) InitIdentity()
InitIdentity initializes this matrix to identity matrix
func (*Matrix) InitRotate ¶
InitRotate initializes a matrix with the given rotation
func (*Matrix) InitTranslate ¶
InitTranslate initializes a matrix with the given translation
func (*Matrix) TransformDistance ¶
TransformDistance ...
func (*Matrix) TransformPoint ¶
TransformPoint ...
type MimeType ¶
type MimeType string
MimeType is a representation of Cairo's CAIRO_MIME_TYPE_* preprocessor constants.
type Operator ¶
type Operator int
Operator is a representation of Cairo's cairo_operator_t.
const ( OperatorClear Operator = C.CAIRO_OPERATOR_CLEAR OperatorSource Operator = C.CAIRO_OPERATOR_SOURCE OperatorOver Operator = C.CAIRO_OPERATOR_OVER OperatorIn Operator = C.CAIRO_OPERATOR_IN OperatorOut Operator = C.CAIRO_OPERATOR_OUT OperatorAtop Operator = C.CAIRO_OPERATOR_ATOP OperatorDest Operator = C.CAIRO_OPERATOR_DEST OperatorDestOver Operator = C.CAIRO_OPERATOR_DEST_OVER OperatorDestIn Operator = C.CAIRO_OPERATOR_DEST_IN OperatorDestOut Operator = C.CAIRO_OPERATOR_DEST_OUT OperatorDestAtop Operator = C.CAIRO_OPERATOR_DEST_ATOP OperatorXOR Operator = C.CAIRO_OPERATOR_XOR OperatorAdd Operator = C.CAIRO_OPERATOR_ADD OperatorSaturate Operator = C.CAIRO_OPERATOR_SATURATE OperatorMultiply Operator = C.CAIRO_OPERATOR_MULTIPLY OperatorScreen Operator = C.CAIRO_OPERATOR_SCREEN OperatorOverlay Operator = C.CAIRO_OPERATOR_OVERLAY OperatorDarken Operator = C.CAIRO_OPERATOR_DARKEN OperatorLighten Operator = C.CAIRO_OPERATOR_LIGHTEN OperatorColorDodge Operator = C.CAIRO_OPERATOR_COLOR_DODGE OperatorColorBurn Operator = C.CAIRO_OPERATOR_COLOR_BURN OperatorHardLight Operator = C.CAIRO_OPERATOR_HARD_LIGHT OperatorSoftLight Operator = C.CAIRO_OPERATOR_SOFT_LIGHT OperatorDifference Operator = C.CAIRO_OPERATOR_DIFFERENCE OperatorExclusion Operator = C.CAIRO_OPERATOR_EXCLUSION OperatorHSLHue Operator = C.CAIRO_OPERATOR_HSL_HUE OperatorHSLSaturation Operator = C.CAIRO_OPERATOR_HSL_SATURATION OperatorHSLColor Operator = C.CAIRO_OPERATOR_HSL_COLOR OperatorHSLLuminosity Operator = C.CAIRO_OPERATOR_HSL_LUMINOSITY )
type Pattern ¶
type Pattern struct {
// contains filtered or unexported fields
}
Pattern is a representation of Cairo's cairo_pattern_t.
func NewPatternForSurface ¶
NewPatternForSurface is a wrapper around cairo_pattern_create_for_surface().
func NewPatternFromRGB ¶
NewPatternFromRGB is a wrapper around cairo_pattern_create_rgb().
func NewPatternFromRGBA ¶
NewPatternFromRGBA is a wrapper around cairo_pattern_create_rgba().
func NewPatternLinear ¶
NewPatternLinear is a wrapper around cairo_pattern_create_linear().
func NewPatternRadial ¶
NewPatternRadial is a wrapper around cairo_pattern_create_radial().
func (*Pattern) AddColorStopRGB ¶
AddColorStopRGB is a wrapper around cairo_pattern_add_color_stop_rgb().
func (*Pattern) AddColorStopRGBA ¶
AddColorStopRGBA is a wrapper around cairo_pattern_add_color_stop_rgba().
func (*Pattern) PatternGetFilter ¶
PatternGetFilter is a wrapper around cairo_pattern_get_filter().
func (*Pattern) PatternSetFilter ¶
PatternSetFilter is a wrapper around cairo_pattern_set_filter().
type Rectangle ¶
Rectangle is a representation of Cairo's cairo_rectangle_int_t.
func RectangleNew ¶
commodity function to ceate Rectangle cairo object.
type Region ¶
type Region struct {
// contains filtered or unexported fields
}
Region is a representation of Cairo's cairo_region_t.
func RegionCreate ¶
RegionCreate is a wrapper around cairo_region_create().
func (*Region) ContainsPoint ¶
ContainsPoint is a wrapper around cairo_region_contains_point().
func (*Region) ContainsRectangle ¶
func (v *Region) ContainsRectangle(rectangle *Rectangle) RegionOverlap
ContainsRectangle is a wrapper around cairo_region_contains_rectangle().
func (*Region) CreateRectangle ¶
CreateRectangle is a wrapper around cairo_region_create_rectangle().
func (*Region) CreateRectangles ¶
CreateRectangles is a wrapper around cairo_region_create_rectangles().
func (*Region) Intersect ¶
Intersect is a wrapper around cairo_region_intersect(). Note: contrary to the original statement, the source 'Region' remains preserved.
func (*Region) IntersectRectangle ¶
IntersectRectangle is a wrapper around cairo_region_intersect_rectangle(). Note: contrary to the original statement, the source 'Region' remains preserved.
func (*Region) NumRectangles ¶
NumRectangles is a wrapper around cairo_region_num_rectangles().
func (*Region) Substract ¶
Substract is a wrapper around cairo_region_subtract(). Note: contrary to the original statement, the source 'Region' remains preserved.
func (*Region) SubstractRectangle ¶
SubstractRectangle is a wrapper around cairo_region_subtract_rectangle(). Note: contrary to the original statement, the source 'Region' remains preserved.
func (*Region) Union ¶
Union is a wrapper around cairo_region_union(). Note: contrary to the original statement, the source 'Region' remains preserved.
func (*Region) UnionRectangle ¶
UnionRectangle is a wrapper around cairo_region_union_rectangle(). Note: contrary to the original statement, the source 'Region' remains preserved.
type RegionOverlap ¶
type RegionOverlap int
RegionOverlap is a representation of Cairo's cairo_region_overlap_t.
const ( RegionOverlapIn RegionOverlap = C.CAIRO_REGION_OVERLAP_IN RegionOverlapOut RegionOverlap = C.CAIRO_REGION_OVERLAP_OUT RegionOverlapPart RegionOverlap = C.CAIRO_REGION_OVERLAP_PART )
type Status ¶
type Status int
Status is a representation of Cairo's cairo_status_t.
const ( StatusSuccess Status = C.CAIRO_STATUS_SUCCESS StatusNoMemory Status = C.CAIRO_STATUS_NO_MEMORY StatusInvalidRestore Status = C.CAIRO_STATUS_INVALID_RESTORE StatusInvalidPopGroup Status = C.CAIRO_STATUS_INVALID_POP_GROUP StatusNoCurrentPoint Status = C.CAIRO_STATUS_NO_CURRENT_POINT StatusInvalidMatrix Status = C.CAIRO_STATUS_INVALID_MATRIX StatusInvalidStatus Status = C.CAIRO_STATUS_INVALID_STATUS StatusNullPointer Status = C.CAIRO_STATUS_NULL_POINTER StatusInvalidString Status = C.CAIRO_STATUS_INVALID_STRING StatusInvalidPathData Status = C.CAIRO_STATUS_INVALID_PATH_DATA StatusReadError Status = C.CAIRO_STATUS_READ_ERROR StatusWriteError Status = C.CAIRO_STATUS_WRITE_ERROR StatusSurfaceFinished Status = C.CAIRO_STATUS_SURFACE_FINISHED StatusSurfaceTypeMismatch Status = C.CAIRO_STATUS_SURFACE_TYPE_MISMATCH StatusPatternTypeMismatch Status = C.CAIRO_STATUS_PATTERN_TYPE_MISMATCH StatusInvalidContent Status = C.CAIRO_STATUS_INVALID_CONTENT StatusInvalidFormat Status = C.CAIRO_STATUS_INVALID_FORMAT StatusInvalidVisual Status = C.CAIRO_STATUS_INVALID_VISUAL StatusFileNotFound Status = C.CAIRO_STATUS_FILE_NOT_FOUND StatusInvalidDash Status = C.CAIRO_STATUS_INVALID_DASH StatusInvalidDSCComment Status = C.CAIRO_STATUS_INVALID_DSC_COMMENT StatusInvalidIndex Status = C.CAIRO_STATUS_INVALID_INDEX StatusClipNotRepresentable Status = C.CAIRO_STATUS_CLIP_NOT_REPRESENTABLE StatusTempFileError Status = C.CAIRO_STATUS_TEMP_FILE_ERROR StatusInvalidStride Status = C.CAIRO_STATUS_INVALID_STRIDE StatusFontTypeMismatch Status = C.CAIRO_STATUS_FONT_TYPE_MISMATCH StatusUserFontImmutable Status = C.CAIRO_STATUS_USER_FONT_IMMUTABLE StatusUserFontError Status = C.CAIRO_STATUS_USER_FONT_ERROR StatusNegativeCount Status = C.CAIRO_STATUS_NEGATIVE_COUNT StatusInvalidClusters Status = C.CAIRO_STATUS_INVALID_CLUSTERS StatusInvalidSlant Status = C.CAIRO_STATUS_INVALID_SLANT StatusInvalidWeight Status = C.CAIRO_STATUS_INVALID_WEIGHT StatusInvalidSize Status = C.CAIRO_STATUS_INVALID_SIZE StatusUserFontNotImplemented Status = C.CAIRO_STATUS_USER_FONT_NOT_IMPLEMENTED StatusDeviceTypeMismatch Status = C.CAIRO_STATUS_DEVICE_TYPE_MISMATCH StatusDeviceError Status = C.CAIRO_STATUS_DEVICE_ERROR )
type SubpixelOrder ¶
type SubpixelOrder int
SubpixelOrder is a representation of Cairo's cairo_subpixel_order_t.
const ( SubpixelOrderDefault SubpixelOrder = C.CAIRO_SUBPIXEL_ORDER_DEFAULT SubpixelOrderRGB SubpixelOrder = C.CAIRO_SUBPIXEL_ORDER_RGB SubpixelOrderBGR SubpixelOrder = C.CAIRO_SUBPIXEL_ORDER_BGR SubpixelOrderVRGB SubpixelOrder = C.CAIRO_SUBPIXEL_ORDER_VRGB SubpixelOrderVBGR SubpixelOrder = C.CAIRO_SUBPIXEL_ORDER_VBGR )
type Surface ¶
type Surface struct {
// contains filtered or unexported fields
}
Surface is a representation of Cairo's cairo_surface_t.
func CreateImageSurface ¶
CreateImageSurface is a wrapper around cairo_image_surface_create().
func CreateImageSurfaceForData ¶
CreateImageSurfaceForData is a wrapper around cairo_image_surface_create_for_data().
func CreatePDFSurface ¶
CreatePDFSurface is a wrapper around cairo_pdf_surface_create().
func CreatePNGSurfaceFromPNG ¶
CreatePNGSurface is a wrapper around cairo_image_surface_create_from_png().
func CreateSurfaceFromImage ¶
CreateSurfaceFromImage is a better wrapper around cairo_image_surface_create_for_data().
func NewSurface ¶
NewSurface creates a gotk3 cairo Surface from a pointer to a C cairo_surface_t. This is primarily designed for use with other gotk3 packages and should be avoided by applications.
func WrapSurface ¶
func (*Surface) Close ¶
func (v *Surface) Close()
Closes the surface. The surface must not be used afterwards.
func (*Surface) CopyPage ¶
func (v *Surface) CopyPage()
CopyPage is a wrapper around cairo_surface_copy_page().
func (*Surface) CreateForRectangle ¶
CreateForRectangle is a wrapper around cairo_surface_create_for_rectangle().
func (*Surface) CreateSimilar ¶
CreateSimilar is a wrapper around cairo_surface_create_similar().
func (*Surface) DeviceOffset ¶
GetDeviceOffset is a wrapper around cairo_surface_get_device_offset().
func (*Surface) FallbackResolution ¶
GetFallbackResolution is a wrapper around cairo_surface_get_fallback_resolution().
func (*Surface) HasShowTextGlyphs ¶
HasShowTextGlyphs is a wrapper around cairo_surface_has_show_text_glyphs().
func (*Surface) MarkDirty ¶
func (v *Surface) MarkDirty()
MarkDirty is a wrapper around cairo_surface_mark_dirty().
func (*Surface) MarkDirtyRectangle ¶
MarkDirtyRectangle is a wrapper around cairo_surface_mark_dirty_rectangle().
func (*Surface) MimeData ¶
GetMimeData is a wrapper around cairo_surface_get_mime_data(). The returned mimetype data is returned as a Go byte slice.
func (*Surface) SetDeviceOffset ¶
SetDeviceOffset is a wrapper around cairo_surface_set_device_offset().
func (*Surface) SetFallbackResolution ¶
SetFallbackResolution is a wrapper around cairo_surface_set_fallback_resolution().
func (*Surface) ShowPage ¶
func (v *Surface) ShowPage()
ShowPage is a wrapper around cairo_surface_show_page().
func (*Surface) Type ¶
func (v *Surface) Type() SurfaceType
GetType is a wrapper around cairo_surface_get_type().
func (*Surface) WriteToPNG ¶
WriteToPNG is a wrapper around cairo_surface_write_png(). It writes the Cairo surface to the given file in PNG format.
type SurfaceType ¶
type SurfaceType int
SurfaceType is a representation of Cairo's cairo_surface_type_t.
const ( SurfaceTypeImage SurfaceType = C.CAIRO_SURFACE_TYPE_IMAGE SurfaceTypePDF SurfaceType = C.CAIRO_SURFACE_TYPE_PDF SurfaceTypePS SurfaceType = C.CAIRO_SURFACE_TYPE_PS SurfaceTypeXlib SurfaceType = C.CAIRO_SURFACE_TYPE_XLIB SurfaceTypeXCB SurfaceType = C.CAIRO_SURFACE_TYPE_XCB SurfaceTypeGlitz SurfaceType = C.CAIRO_SURFACE_TYPE_GLITZ SurfaceTypeQuartz SurfaceType = C.CAIRO_SURFACE_TYPE_QUARTZ SurfaceTypeWin32 SurfaceType = C.CAIRO_SURFACE_TYPE_WIN32 SurfaceTypeBeOS SurfaceType = C.CAIRO_SURFACE_TYPE_BEOS SurfaceTypeDirectFB SurfaceType = C.CAIRO_SURFACE_TYPE_DIRECTFB SurfaceTypeSVG SurfaceType = C.CAIRO_SURFACE_TYPE_SVG SurfaceTypeOS2 SurfaceType = C.CAIRO_SURFACE_TYPE_OS2 SurfaceTypeWin32Printing SurfaceType = C.CAIRO_SURFACE_TYPE_WIN32_PRINTING SurfaceTypeQuartzImage SurfaceType = C.CAIRO_SURFACE_TYPE_QUARTZ_IMAGE SurfaceTypeScript SurfaceType = C.CAIRO_SURFACE_TYPE_SCRIPT SurfaceTypeQt SurfaceType = C.CAIRO_SURFACE_TYPE_QT SurfaceTypeRecording SurfaceType = C.CAIRO_SURFACE_TYPE_RECORDING SurfaceTypeVG SurfaceType = C.CAIRO_SURFACE_TYPE_VG SurfaceTypeGL SurfaceType = C.CAIRO_SURFACE_TYPE_GL SurfaceTypeDRM SurfaceType = C.CAIRO_SURFACE_TYPE_DRM SurfaceTypeTee SurfaceType = C.CAIRO_SURFACE_TYPE_TEE SurfaceTypeXML SurfaceType = C.CAIRO_SURFACE_TYPE_XML SurfaceTypeSKia SurfaceType = C.CAIRO_SURFACE_TYPE_SKIA SurfaceTypeSubsurface SurfaceType = C.CAIRO_SURFACE_TYPE_SUBSURFACE )