skia

package
v0.75.1 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2024 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const ColorTypeN32 = ColorTypeRGBA8888

Variables

This section is empty.

Functions

func BackendRenderTargetDelete

func BackendRenderTargetDelete(backend BackendRenderTarget)

func CanavasClipPathWithOperation

func CanavasClipPathWithOperation(canvas Canvas, path Path, op ClipOp, antialias bool)

func CanavasClipRectWithOperation

func CanavasClipRectWithOperation(canvas Canvas, rect geom.Rect[float32], op ClipOp, antialias bool)

func CanvasClear

func CanvasClear(canvas Canvas, color Color)

func CanvasConcat

func CanvasConcat(canvas Canvas, matrix geom.Matrix[float32])

func CanvasDrawArc

func CanvasDrawArc(canvas Canvas, oval geom.Rect[float32], startAngle, sweepAngle float32, useCenter bool, paint Paint)

func CanvasDrawCircle

func CanvasDrawCircle(canvas Canvas, centerX, centerY, radius float32, paint Paint)

func CanvasDrawColor

func CanvasDrawColor(canvas Canvas, color Color, mode BlendMode)

func CanvasDrawImageNine

func CanvasDrawImageNine(canvas Canvas, img Image, centerRect, dstRect geom.Rect[float32], filter FilterMode, paint Paint)

func CanvasDrawImageRect

func CanvasDrawImageRect(canvas Canvas, img Image, srcRect, dstRect geom.Rect[float32], sampling SamplingOptions, paint Paint)

func CanvasDrawLine

func CanvasDrawLine(canvas Canvas, sx, sy, ex, ey float32, paint Paint)

func CanvasDrawOval

func CanvasDrawOval(canvas Canvas, rect geom.Rect[float32], paint Paint)

func CanvasDrawPaint

func CanvasDrawPaint(canvas Canvas, paint Paint)

func CanvasDrawPath

func CanvasDrawPath(canvas Canvas, path Path, paint Paint)

func CanvasDrawPoint

func CanvasDrawPoint(canvas Canvas, x, y float32, paint Paint)

func CanvasDrawPoints

func CanvasDrawPoints(canvas Canvas, mode PointMode, pts []geom.Point[float32], paint Paint)

func CanvasDrawRect

func CanvasDrawRect(canvas Canvas, rect geom.Rect[float32], paint Paint)

func CanvasDrawRoundRect

func CanvasDrawRoundRect(canvas Canvas, rect geom.Rect[float32], radiusX, radiusY float32, paint Paint)

func CanvasDrawSimpleText

func CanvasDrawSimpleText(canvas Canvas, str string, x, y float32, font Font, paint Paint)

func CanvasDrawTextBlob

func CanvasDrawTextBlob(canvas Canvas, txt TextBlob, x, y float32, paint Paint)

func CanvasGetLocalClipBounds

func CanvasGetLocalClipBounds(canvas Canvas) geom.Rect[float32]

func CanvasGetSaveCount

func CanvasGetSaveCount(canvas Canvas) int

func CanvasGetTotalMatrix

func CanvasGetTotalMatrix(canvas Canvas) geom.Matrix[float32]

func CanvasIsClipEmpty

func CanvasIsClipEmpty(canvas Canvas) bool

func CanvasIsClipRect

func CanvasIsClipRect(canvas Canvas) bool

func CanvasQuickRejectPath

func CanvasQuickRejectPath(canvas Canvas, path Path) bool

func CanvasQuickRejectRect

func CanvasQuickRejectRect(canvas Canvas, rect geom.Rect[float32]) bool

func CanvasResetMatrix

func CanvasResetMatrix(canvas Canvas)

func CanvasRestore

func CanvasRestore(canvas Canvas)

func CanvasRestoreToCount

func CanvasRestoreToCount(canvas Canvas, count int)

func CanvasRotateRadians

func CanvasRotateRadians(canvas Canvas, radians float32)

func CanvasSave

func CanvasSave(canvas Canvas) int

func CanvasSaveLayer

func CanvasSaveLayer(canvas Canvas, paint Paint) int

func CanvasSaveLayerAlpha

func CanvasSaveLayerAlpha(canvas Canvas, opacity byte) int

func CanvasScale

func CanvasScale(canvas Canvas, xScale, yScale float32)

func CanvasSetMatrix

func CanvasSetMatrix(canvas Canvas, matrix geom.Matrix[float32])

func CanvasSkew

func CanvasSkew(canvas Canvas, sx, sy float32)

func CanvasTranslate

func CanvasTranslate(canvas Canvas, dx, dy float32)

func ColorFilterUnref

func ColorFilterUnref(filter ColorFilter)

func ContextAbandonContext

func ContextAbandonContext(ctx DirectContext)

func ContextDelete added in v0.54.3

func ContextDelete(ctx DirectContext)

func ContextFlushAndSubmit added in v0.64.0

func ContextFlushAndSubmit(ctx DirectContext, syncCPU bool)

func ContextReleaseResourcesAndAbandonContext added in v0.54.6

func ContextReleaseResourcesAndAbandonContext(ctx DirectContext)

func ContextReset added in v0.58.0

func ContextReset(ctx DirectContext)

func ContextResetGLTextureBindings added in v0.58.0

func ContextResetGLTextureBindings(ctx DirectContext)

func ContextUnref added in v0.54.7

func ContextUnref(ctx DirectContext)

func DataGetData

func DataGetData(data Data) unsafe.Pointer

func DataGetSize

func DataGetSize(data Data) int

func DataUnref

func DataUnref(data Data)

func DocumentAbort added in v0.29.0

func DocumentAbort(doc Document)

func DocumentClose added in v0.29.0

func DocumentClose(doc Document)

func DocumentEndPage added in v0.29.0

func DocumentEndPage(doc Document)

func DynamicMemoryWStreamBytesWritten added in v0.29.0

func DynamicMemoryWStreamBytesWritten(s DynamicMemoryWStream) int

func DynamicMemoryWStreamDelete added in v0.29.0

func DynamicMemoryWStreamDelete(s DynamicMemoryWStream)

func DynamicMemoryWStreamRead added in v0.29.0

func DynamicMemoryWStreamRead(s DynamicMemoryWStream, data []byte) int

func DynamicMemoryWStreamWrite added in v0.29.0

func DynamicMemoryWStreamWrite(s DynamicMemoryWStream, data []byte) bool

func FileWStreamBytesWritten added in v0.29.0

func FileWStreamBytesWritten(s FileWStream) int

func FileWStreamDelete added in v0.29.0

func FileWStreamDelete(s FileWStream)

func FileWStreamFlush added in v0.29.0

func FileWStreamFlush(s FileWStream)

func FileWStreamWrite added in v0.29.0

func FileWStreamWrite(s FileWStream, data []byte) bool

func FontDelete

func FontDelete(font Font)

func FontGetMetrics

func FontGetMetrics(font Font, metrics *FontMetrics)

func FontGlyphWidths added in v0.7.0

func FontGlyphWidths(font Font, glyphs []uint16) []float32

func FontGlyphsXPos added in v0.7.0

func FontGlyphsXPos(font Font, glyphs []uint16) []float32

func FontMeasureText

func FontMeasureText(font Font, str string) float32

func FontMgrCountFamilies

func FontMgrCountFamilies(mgr FontMgr) int

func FontMgrGetFamilyName

func FontMgrGetFamilyName(mgr FontMgr, index int, str String)

func FontRuneToGlyph added in v0.7.0

func FontRuneToGlyph(font Font, r rune) uint16

func FontRunesToGlyphs added in v0.7.0

func FontRunesToGlyphs(font Font, r []rune) []uint16

func FontSetForceAutoHinting

func FontSetForceAutoHinting(font Font, enabled bool)

func FontSetHinting

func FontSetHinting(font Font, hinting FontHinting)

func FontSetSubPixel

func FontSetSubPixel(font Font, enabled bool)

func FontStyleDelete

func FontStyleDelete(style FontStyle)

func FontStyleSetGetCount

func FontStyleSetGetCount(set FontStyleSet) int

func FontStyleSetGetStyle

func FontStyleSetGetStyle(set FontStyleSet, index int, style FontStyle, str String)

func FontStyleSetUnref

func FontStyleSetUnref(set FontStyleSet)

func FontTextToGlyphs

func FontTextToGlyphs(font Font, str string) []uint16

func GLInterfaceUnref added in v0.54.7

func GLInterfaceUnref(intf GLInterface)

func ImageFilterUnref

func ImageFilterUnref(filter ImageFilter)

func ImageGetHeight

func ImageGetHeight(img Image) int

func ImageGetWidth

func ImageGetWidth(img Image) int

func ImageReadPixels

func ImageReadPixels(img Image, info *ImageInfo, pixels []byte, dstRowBytes, srcX, srcY int, cachingHint ImageCachingHint) bool

func ImageUnref

func ImageUnref(img Image)

func MaskFilterUnref

func MaskFilterUnref(filter MaskFilter)

func OpBuilderAdd

func OpBuilderAdd(builder OpBuilder, path Path, op PathOp)

func OpBuilderDestroy

func OpBuilderDestroy(builder OpBuilder)

func OpBuilderResolve

func OpBuilderResolve(builder OpBuilder, path Path) bool

func PaintDelete

func PaintDelete(paint Paint)

func PaintEquivalent added in v0.7.0

func PaintEquivalent(left, right Paint) bool

func PaintGetFillPath

func PaintGetFillPath(paint Paint, inPath, outPath Path, cullRect *geom.Rect[float32], resScale float32) bool

func PaintGetStrokeMiter

func PaintGetStrokeMiter(paint Paint) float32

func PaintGetStrokeWidth

func PaintGetStrokeWidth(paint Paint) float32

func PaintIsAntialias

func PaintIsAntialias(paint Paint) bool

func PaintIsDither

func PaintIsDither(paint Paint) bool

func PaintReset

func PaintReset(paint Paint)

func PaintSetAntialias

func PaintSetAntialias(paint Paint, enabled bool)

func PaintSetBlendMode

func PaintSetBlendMode(paint Paint, blendMode BlendMode)

func PaintSetColor

func PaintSetColor(paint Paint, color Color)

func PaintSetColorFilter

func PaintSetColorFilter(paint Paint, filter ColorFilter)

func PaintSetDither

func PaintSetDither(paint Paint, enabled bool)

func PaintSetImageFilter

func PaintSetImageFilter(paint Paint, filter ImageFilter)

func PaintSetMaskFilter

func PaintSetMaskFilter(paint Paint, filter MaskFilter)

func PaintSetPathEffect

func PaintSetPathEffect(paint Paint, effect PathEffect)

func PaintSetShader

func PaintSetShader(paint Paint, shader Shader)

func PaintSetStrokeCap

func PaintSetStrokeCap(paint Paint, strokeCap StrokeCap)

func PaintSetStrokeJoin

func PaintSetStrokeJoin(paint Paint, strokeJoin StrokeJoin)

func PaintSetStrokeMiter

func PaintSetStrokeMiter(paint Paint, miter float32)

func PaintSetStrokeWidth

func PaintSetStrokeWidth(paint Paint, width float32)

func PaintSetStyle

func PaintSetStyle(paint Paint, style PaintStyle)

func PathAddCircle

func PathAddCircle(path Path, x, y, radius float32, direction Direction)

func PathAddOval

func PathAddOval(path Path, rect geom.Rect[float32], direction Direction)

func PathAddPath

func PathAddPath(path, other Path, mode PathAddMode)

func PathAddPathMatrix

func PathAddPathMatrix(path, other Path, matrix geom.Matrix[float32], mode PathAddMode)

func PathAddPathOffset

func PathAddPathOffset(path, other Path, offsetX, offsetY float32, mode PathAddMode)

func PathAddPathReverse

func PathAddPathReverse(path, other Path)

func PathAddPoly

func PathAddPoly(path Path, pts []geom.Point[float32], closePath bool)

func PathAddRect

func PathAddRect(path Path, rect geom.Rect[float32], direction Direction)

func PathAddRoundedRect

func PathAddRoundedRect(path Path, rect geom.Rect[float32], radiusX, radiusY float32, direction Direction)

func PathArcTo

func PathArcTo(path Path, x, y, rx, ry, rotation float32, arcSize ArcSize, direction Direction)

func PathArcToWithOval

func PathArcToWithOval(path Path, rect geom.Rect[float32], startAngle, sweepAngle float32, forceMoveTo bool)

func PathArcToWithPoints

func PathArcToWithPoints(path Path, x1, y1, x2, y2, radius float32)

func PathClose

func PathClose(path Path)

func PathCompute added in v0.60.0

func PathCompute(path, other Path, op PathOp) bool

func PathComputeTightBounds

func PathComputeTightBounds(path Path) geom.Rect[float32]

func PathConicTo

func PathConicTo(path Path, cpx, cpy, x, y, weight float32)

func PathContains

func PathContains(path Path, x, y float32) bool

func PathCubicTo

func PathCubicTo(path Path, cp1x, cp1y, cp2x, cp2y, x, y float32)

func PathDelete

func PathDelete(path Path)

func PathEffectUnref

func PathEffectUnref(effect PathEffect)

func PathGetBounds

func PathGetBounds(path Path) geom.Rect[float32]

func PathGetLastPoint

func PathGetLastPoint(path Path) geom.Point[float32]

func PathLineTo

func PathLineTo(path Path, x, y float32)

func PathMoveTo

func PathMoveTo(path Path, x, y float32)

func PathParseSVGString

func PathParseSVGString(path Path, svg string) bool

func PathQuadTo

func PathQuadTo(path Path, cpx, cpy, x, y float32)

func PathRArcTo

func PathRArcTo(path Path, dx, dy, rx, ry, rotation float32, arcSize ArcSize, direction Direction)

func PathRConicTo

func PathRConicTo(path Path, cpdx, cpdy, dx, dy, weight float32)

func PathRCubicTo

func PathRCubicTo(path Path, cp1dx, cp1dy, cp2dx, cp2dy, dx, dy float32)

func PathRLineTo

func PathRLineTo(path Path, x, y float32)

func PathRMoveTo

func PathRMoveTo(path Path, x, y float32)

func PathReset

func PathReset(path Path)

func PathRewind

func PathRewind(path Path)

func PathSetFillType

func PathSetFillType(path Path, fillType FillType)

func PathSimplify added in v0.60.0

func PathSimplify(path Path) bool

func PathTransform

func PathTransform(path Path, matrix geom.Matrix[float32])

func PathTransformToDest

func PathTransformToDest(path, dstPath Path, matrix geom.Matrix[float32])

func RegisterImageCodecs added in v0.64.0

func RegisterImageCodecs()

func ShaderUnref

func ShaderUnref(shader Shader)

func StringDelete

func StringDelete(str String)

func StringGetString

func StringGetString(str String) string

func SurfaceUnref

func SurfaceUnref(aSurface Surface)

func TextBlobBuilderAllocRun

func TextBlobBuilderAllocRun(builder TextBlobBuilder, font Font, glyphs []uint16, x, y float32)

func TextBlobBuilderAllocRunPosH

func TextBlobBuilderAllocRunPosH(builder TextBlobBuilder, font Font, glyphs []uint16, positions []float32, y float32)

func TextBlobBuilderDelete

func TextBlobBuilderDelete(builder TextBlobBuilder)

func TextBlobGetBounds

func TextBlobGetBounds(txt TextBlob) geom.Rect[float32]

func TextBlobGetIntercepts

func TextBlobGetIntercepts(txt TextBlob, p Paint, start, end float32, intercepts []float32) int

func TextBlobUnref

func TextBlobUnref(txt TextBlob)

func TypeFaceGetUnitsPerEm

func TypeFaceGetUnitsPerEm(face TypeFace) int

func TypeFaceIsFixedPitch

func TypeFaceIsFixedPitch(face TypeFace) bool

func TypeFaceUnref

func TypeFaceUnref(face TypeFace)

Types

type AlphaType

type AlphaType int32
const (
	AlphaTypeUnknown AlphaType = iota
	AlphaTypeOpaque
	AlphaTypePreMul
	AlphaTypeUnPreMul
)

func ImageGetAlphaType

func ImageGetAlphaType(img Image) AlphaType

type ArcSize

type ArcSize byte

type BackendRenderTarget

type BackendRenderTarget = *C.gr_backendrendertarget_t

func BackendRenderTargetNewGL

func BackendRenderTargetNewGL(width, height, samples, stencilBits int, info *GLFrameBufferInfo) BackendRenderTarget

type BlendMode

type BlendMode byte

func PaintGetBlendMode

func PaintGetBlendMode(paint Paint) BlendMode

type Blur

type Blur byte

type Canvas

type Canvas = *C.sk_canvas_t

func DocumentBeginPage added in v0.29.0

func DocumentBeginPage(doc Document, width, height float32) Canvas

func SurfaceGetCanvas

func SurfaceGetCanvas(aSurface Surface) Canvas

type ClipOp

type ClipOp byte

type Color

type Color uint32

func PaintGetColor

func PaintGetColor(paint Paint) Color

type ColorChannel

type ColorChannel byte

type ColorFilter

type ColorFilter = *C.sk_color_filter_t

func ColorFilterNewColorMatrix

func ColorFilterNewColorMatrix(array []float32) ColorFilter

func ColorFilterNewCompose

func ColorFilterNewCompose(outer, inner ColorFilter) ColorFilter

func ColorFilterNewHighContrast

func ColorFilterNewHighContrast(config *HighContrastConfig) ColorFilter

func ColorFilterNewLighting

func ColorFilterNewLighting(mul, add Color) ColorFilter

func ColorFilterNewLumaColor

func ColorFilterNewLumaColor() ColorFilter

func ColorFilterNewMode

func ColorFilterNewMode(color Color, blendMode BlendMode) ColorFilter

func PaintGetColorFilter

func PaintGetColorFilter(paint Paint) ColorFilter

type ColorSpace

type ColorSpace = *C.sk_color_space_t

func ColorSpaceNewSRGB

func ColorSpaceNewSRGB() ColorSpace

func ImageGetColorSpace

func ImageGetColorSpace(img Image) ColorSpace

type ColorType

type ColorType int32
const (
	ColorTypeUnknown ColorType = iota
	ColorTypeAlpha8
	ColorTypeRGB565
	ColorTypeARGB4444
	ColorTypeRGBA8888
	ColorTypeRGB888X
	ColorTypeBGRA8888
	ColorTypeRGBA1010102
	ColorTypeBGRA1010102
	ColorTypeRGB101010X
	ColorTypeBGR101010X
	ColorTypeBGR101010XXR
	ColorTypeGray8
	ColorTypeRGBAF16Norm
	ColorTypeRGBAF16
	ColorTypeRGBAF32
	ColorTypeR8G8UNorm
	ColorTypeA16Float
	ColorTypeR16G16Float
	ColorTypeA16UNorm
	ColorTypeR16G16UNorm
	ColorTypeR16G16B16A16UNorm
	ColorTypeSRGBA8888
	ColorTypeR8UNorm
)

func ImageGetColorType

func ImageGetColorType(img Image) ColorType

type Data

type Data = *C.sk_data_t

func DataNewWithCopy

func DataNewWithCopy(data []byte) Data

func EncodeJPEG added in v0.64.0

func EncodeJPEG(ctx DirectContext, img Image, quality int) Data

func EncodePNG added in v0.64.0

func EncodePNG(ctx DirectContext, img Image, compressionLevel int) Data

func EncodeWebp added in v0.64.0

func EncodeWebp(ctx DirectContext, img Image, quality float32, lossy bool) Data

type DirectContext

type DirectContext = *C.gr_direct_context_t

func ContextMakeGL

func ContextMakeGL(gl GLInterface) DirectContext

type Direction

type Direction byte

type Document added in v0.29.0

type Document = *C.sk_document_t

func DocumentMakePDF added in v0.29.0

func DocumentMakePDF(stream WStream, metadata *MetaData) Document

type DynamicMemoryWStream added in v0.29.0

type DynamicMemoryWStream = *C.sk_dynamic_memory_wstream_t

func DynamicMemoryWStreamNew added in v0.29.0

func DynamicMemoryWStreamNew() DynamicMemoryWStream

type EncodedImageFormat

type EncodedImageFormat byte

type FileWStream added in v0.29.0

type FileWStream = *C.sk_file_wstream_t

func FileWStreamNew added in v0.29.0

func FileWStreamNew(filePath string) FileWStream

type FillType

type FillType byte

func PathGetFillType

func PathGetFillType(path Path) FillType

type FilterMode

type FilterMode int32

type Font

type Font = *C.sk_font_t

func FontNewWithValues

func FontNewWithValues(face TypeFace, size, scaleX, skewX float32) Font

type FontHinting

type FontHinting byte

type FontMetrics

type FontMetrics struct {
	Flags              uint32  // Flags indicating which metrics are valid
	Top                float32 // Greatest extent above origin of any glyph bounding box; typically negative; deprecated with variable fonts; only if Flags & BoundsInvalidFontMetricsFlag == 0
	Ascent             float32 // Distance to reserve above baseline; typically negative
	Descent            float32 // Distance to reserve below baseline; typically positive
	Bottom             float32 // Greatest extent below origin of any glyph bounding box; typically positive; deprecated with variable fonts; only if Flags & BoundsInvalidFontMetricsFlag == 0
	Leading            float32 // Distance to add between lines; typically positive or zero
	AvgCharWidth       float32 // Average character width; zero if unknown
	MaxCharWidth       float32 // Maximum character width; zero if unknown
	XMin               float32 // Greatest extent to left of origin of any glyph bounding box; typically negative; deprecated with variable fonts; only if Flags & BoundsInvalidFontMetricsFlag == 0
	XMax               float32 // Greatest extent to right of origin of any glyph bounding box; typically positive; deprecated with variable fonts; only if Flags & BoundsInvalidFontMetricsFlag == 0
	XHeight            float32 // Height of lowercase 'x'; zero if unknown; typically negative
	CapHeight          float32 // Height of uppercase letter; zero if unknown; typically negative
	UnderlineThickness float32 // Underline thickness; only if Flags & UnderlineThicknessIsValidFontMetricsFlag != 0
	UnderlinePosition  float32 // Distance from baseline to top of stroke; typically positive; only if Flags & UnderlinePositionIsValidFontMetricsFlag != 0
	StrikeoutThickness float32 // Strikeout thickness; only if Flags & StrikeoutThicknessIsValidFontMetricsFlag != 0
	StrikeoutPosition  float32 // Distance from baseline to bottom of stroke; typically negative; only if Flags & StrikeoutPositionIsValidFontMetricsFlag != 0
}

FontMetrics holds various metrics about a font.

type FontMgr

type FontMgr = *C.sk_font_mgr_t

func FontMgrRefDefault

func FontMgrRefDefault() FontMgr

type FontSlant

type FontSlant int32

func FontStyleGetSlant

func FontStyleGetSlant(style FontStyle) FontSlant

type FontSpacing

type FontSpacing int32

func FontStyleGetWidth

func FontStyleGetWidth(style FontStyle) FontSpacing

type FontStyle

type FontStyle = *C.sk_font_style_t

func FontStyleNew

func FontStyleNew(weight FontWeight, spacing FontSpacing, slant FontSlant) FontStyle

func TypeFaceGetFontStyle

func TypeFaceGetFontStyle(face TypeFace) FontStyle

type FontStyleSet

type FontStyleSet = *C.sk_font_style_set_t

func FontMgrMatchFamily

func FontMgrMatchFamily(mgr FontMgr, family string) FontStyleSet

type FontWeight

type FontWeight int32

func FontStyleGetWeight

func FontStyleGetWeight(style FontStyle) FontWeight

type GLFrameBufferInfo

type GLFrameBufferInfo struct {
	Fboid     uint32
	Format    uint32
	Protected bool
}

type GLInterface

type GLInterface = *C.gr_glinterface_t

func GLInterfaceCreateNativeInterface

func GLInterfaceCreateNativeInterface() GLInterface

type HighContrastConfig

type HighContrastConfig struct {
	Grayscale bool

	InvertStyle InvertStyle
	Contrast    float32
	// contains filtered or unexported fields
}

type IPoint

type IPoint struct {
	X int32
	Y int32
}

type IRect

type IRect struct {
	Left   int32
	Top    int32
	Right  int32
	Bottom int32
}

type ISize

type ISize struct {
	Width  int32
	Height int32
}

type Image

type Image = *C.sk_image_t

func ImageMakeNonTextureImage added in v0.29.0

func ImageMakeNonTextureImage(img Image) Image

func ImageNewFromEncoded

func ImageNewFromEncoded(data Data) Image

func ImageNewRasterData

func ImageNewRasterData(info *ImageInfo, data Data, rowBytes int) Image

func ImageTextureFromImage added in v0.64.0

func ImageTextureFromImage(ctx DirectContext, img Image, mipMapped, budgeted bool) Image

func SurfaceMakeImageSnapshot added in v0.38.0

func SurfaceMakeImageSnapshot(aSurface Surface) Image

type ImageCachingHint

type ImageCachingHint byte
const (
	ImageCachingHintAllow ImageCachingHint = iota
	ImageCachingHintDisallow
)

type ImageFilter

type ImageFilter = *C.sk_image_filter_t

func ImageFilterNewArithmetic

func ImageFilterNewArithmetic(k1, k2, k3, k4 float32, enforcePMColor bool, background, foreground ImageFilter, cropRect *geom.Rect[float32]) ImageFilter

func ImageFilterNewBlur

func ImageFilterNewBlur(sigmaX, sigmaY float32, tileMode TileMode, input ImageFilter, cropRect *geom.Rect[float32]) ImageFilter

func ImageFilterNewColorFilter

func ImageFilterNewColorFilter(colorFilter ColorFilter, input ImageFilter, cropRect *geom.Rect[float32]) ImageFilter

func ImageFilterNewCompose

func ImageFilterNewCompose(outer, inner ImageFilter) ImageFilter

func ImageFilterNewDilate

func ImageFilterNewDilate(radiusX, radiusY int, input ImageFilter, cropRect *geom.Rect[float32]) ImageFilter

func ImageFilterNewDisplacementMapEffect

func ImageFilterNewDisplacementMapEffect(xChannelSelector, yChannelSelector ColorChannel, scale float32, displacement, color ImageFilter, cropRect *geom.Rect[float32]) ImageFilter

func ImageFilterNewDistantLitDiffuse

func ImageFilterNewDistantLitDiffuse(pt *Point3, color Color, scale, reflectivity float32, input ImageFilter, cropRect *geom.Rect[float32]) ImageFilter

func ImageFilterNewDistantLitSpecular

func ImageFilterNewDistantLitSpecular(pt *Point3, color Color, scale, reflectivity, shine float32, input ImageFilter, cropRect *geom.Rect[float32]) ImageFilter

func ImageFilterNewDropShadow

func ImageFilterNewDropShadow(dx, dy, sigmaX, sigmaY float32, color Color, input ImageFilter, cropRect *geom.Rect[float32]) ImageFilter

func ImageFilterNewDropShadowOnly

func ImageFilterNewDropShadowOnly(dx, dy, sigmaX, sigmaY float32, color Color, input ImageFilter, cropRect *geom.Rect[float32]) ImageFilter

func ImageFilterNewErode

func ImageFilterNewErode(radiusX, radiusY int, input ImageFilter, cropRect *geom.Rect[float32]) ImageFilter

func ImageFilterNewImageSource

func ImageFilterNewImageSource(img Image, srcRect, dstRect geom.Rect[float32], sampling SamplingOptions) ImageFilter

func ImageFilterNewImageSourceDefault

func ImageFilterNewImageSourceDefault(img Image, sampling SamplingOptions) ImageFilter

func ImageFilterNewMagnifier

func ImageFilterNewMagnifier(lensBounds geom.Rect[float32], zoomAmount, inset float32, sampling SamplingOptions, input ImageFilter, cropRect *geom.Rect[float32]) ImageFilter

func ImageFilterNewMatrixConvolution

func ImageFilterNewMatrixConvolution(size *ISize, kernel []float32, gain, bias float32, offset *IPoint, tileMode TileMode, convolveAlpha bool, input ImageFilter, cropRect *geom.Rect[float32]) ImageFilter

func ImageFilterNewMatrixTransform

func ImageFilterNewMatrixTransform(matrix geom.Matrix[float32], sampling SamplingOptions, input ImageFilter) ImageFilter

func ImageFilterNewMerge

func ImageFilterNewMerge(filters []ImageFilter, cropRect *geom.Rect[float32]) ImageFilter

func ImageFilterNewOffset

func ImageFilterNewOffset(dx, dy float32, input ImageFilter, cropRect *geom.Rect[float32]) ImageFilter

func ImageFilterNewPointLitDiffuse

func ImageFilterNewPointLitDiffuse(pt *Point3, color Color, scale, reflectivity float32, input ImageFilter, cropRect *geom.Rect[float32]) ImageFilter

func ImageFilterNewPointLitSpecular

func ImageFilterNewPointLitSpecular(pt *Point3, color Color, scale, reflectivity, shine float32, input ImageFilter, cropRect *geom.Rect[float32]) ImageFilter

func ImageFilterNewSpotLitDiffuse

func ImageFilterNewSpotLitDiffuse(pt, targetPt *Point3, specularExponent, cutoffAngle, scale, reflectivity float32, color Color, input ImageFilter, cropRect *geom.Rect[float32]) ImageFilter

func ImageFilterNewSpotLitSpecular

func ImageFilterNewSpotLitSpecular(pt, targetPt *Point3, specularExponent, cutoffAngle, scale, reflectivity, shine float32, color Color, input ImageFilter, cropRect *geom.Rect[float32]) ImageFilter

func ImageFilterNewTile

func ImageFilterNewTile(src, dst geom.Rect[float32], input ImageFilter) ImageFilter

func PaintGetImageFilter

func PaintGetImageFilter(paint Paint) ImageFilter

type ImageInfo

type ImageInfo struct {
	Colorspace ColorSpace
	ColorType  ColorType
	AlphaType  AlphaType
	Width      int32
	Height     int32
}

type InvertStyle

type InvertStyle int32

type MaskFilter

type MaskFilter = *C.sk_mask_filter_t

func MaskFilterNewBlurWithFlags

func MaskFilterNewBlurWithFlags(style Blur, sigma float32, respectMatrix bool) MaskFilter

func MaskFilterNewClip

func MaskFilterNewClip(minimum, maximum byte) MaskFilter

func MaskFilterNewGamma

func MaskFilterNewGamma(gamma float32) MaskFilter

func MaskFilterNewShader

func MaskFilterNewShader(shader Shader) MaskFilter

func MaskFilterNewTable

func MaskFilterNewTable(table []byte) MaskFilter

func PaintGetMaskFilter

func PaintGetMaskFilter(paint Paint) MaskFilter

type Matrix

type Matrix struct {
	geom.Matrix[float32]
	Persp0 float32
	Persp1 float32
	Persp2 float32
}

type MetaData added in v0.29.0

type MetaData struct {
	Title           string
	Author          string
	Subject         string
	Keywords        string
	Creator         string
	Producer        string
	Creation        time.Time
	Modified        time.Time
	RasterDPI       float32
	EncodingQuality int32
}

type OpBuilder

type OpBuilder = *C.sk_op_builder_t

func OpBuilderNew

func OpBuilderNew() OpBuilder

type Paint

type Paint = *C.sk_paint_t

func PaintClone

func PaintClone(paint Paint) Paint

func PaintNew

func PaintNew() Paint

type PaintStyle

type PaintStyle byte

func PaintGetStyle

func PaintGetStyle(paint Paint) PaintStyle

type Path

type Path = *C.sk_path_t

func PathClone

func PathClone(path Path) Path

func PathNew

func PathNew() Path

type PathAddMode

type PathAddMode byte
const (
	PathAddModeAppend PathAddMode = iota
	PathAddModeExtend
)

type PathEffect

type PathEffect = *C.sk_path_effect_t

func PaintGetPathEffect

func PaintGetPathEffect(paint Paint) PathEffect

func PathEffectCreate1dPath

func PathEffectCreate1dPath(path Path, advance, phase float32, style PathEffect1DStyle) PathEffect

func PathEffectCreate2dLine

func PathEffectCreate2dLine(width float32, matrix geom.Matrix[float32]) PathEffect

func PathEffectCreate2dPath

func PathEffectCreate2dPath(matrix geom.Matrix[float32], path Path) PathEffect

func PathEffectCreateCompose

func PathEffectCreateCompose(outer, inner PathEffect) PathEffect

func PathEffectCreateCorner

func PathEffectCreateCorner(radius float32) PathEffect

func PathEffectCreateDash

func PathEffectCreateDash(intervals []float32, phase float32) PathEffect

func PathEffectCreateDiscrete

func PathEffectCreateDiscrete(segLength, deviation float32, seedAssist uint32) PathEffect

func PathEffectCreateSum

func PathEffectCreateSum(first, second PathEffect) PathEffect

func PathEffectCreateTrim

func PathEffectCreateTrim(start, stop float32, mode TrimMode) PathEffect

type PathEffect1DStyle

type PathEffect1DStyle byte

type PathOp

type PathOp byte

type PixelGeometry

type PixelGeometry int32
const (
	PixelGeometryUnknown PixelGeometry = iota
	PixelGeometryRGBH
	PixelGeometryBGRH
	PixelGeometryRGBV
	PixelGeometryBGRV
)

type Point3

type Point3 struct {
	X float32
	Y float32
	Z float32
}

type PointMode

type PointMode byte

type Rect

type Rect struct {
	Left   float32
	Top    float32
	Right  float32
	Bottom float32
}

type SamplingOptions

type SamplingOptions = *C.sk_sampling_options_t

type Shader

type Shader = *C.sk_shader_t

func ImageMakeShader

func ImageMakeShader(img Image, tileModeX, tileModeY TileMode, sampling SamplingOptions, matrix geom.Matrix[float32]) Shader

func PaintGetShader

func PaintGetShader(paint Paint) Shader

func ShaderNewBlend

func ShaderNewBlend(blendMode BlendMode, dst, src Shader) Shader

func ShaderNewColor

func ShaderNewColor(color Color) Shader

func ShaderNewLinearGradient

func ShaderNewLinearGradient(start, end geom.Point[float32], colors []Color, colorPos []float32, tileMode TileMode, matrix geom.Matrix[float32]) Shader

func ShaderNewPerlinNoiseFractalNoise

func ShaderNewPerlinNoiseFractalNoise(baseFreqX, baseFreqY, seed float32, numOctaves int, size ISize) Shader

func ShaderNewPerlinNoiseTurbulence

func ShaderNewPerlinNoiseTurbulence(baseFreqX, baseFreqY, seed float32, numOctaves int, size ISize) Shader

func ShaderNewRadialGradient

func ShaderNewRadialGradient(center geom.Point[float32], radius float32, colors []Color, colorPos []float32, tileMode TileMode, matrix geom.Matrix[float32]) Shader

func ShaderNewSweepGradient

func ShaderNewSweepGradient(center geom.Point[float32], startAngle, endAngle float32, colors []Color, colorPos []float32, tileMode TileMode, matrix geom.Matrix[float32]) Shader

func ShaderNewTwoPointConicalGradient

func ShaderNewTwoPointConicalGradient(startPt, endPt geom.Point[float32], startRadius, endRadius float32, colors []Color, colorPos []float32, tileMode TileMode, matrix geom.Matrix[float32]) Shader

func ShaderWithColorFilter

func ShaderWithColorFilter(shader Shader, filter ColorFilter) Shader

func ShaderWithLocalMatrix

func ShaderWithLocalMatrix(shader Shader, matrix geom.Matrix[float32]) Shader

type String

type String = *C.sk_string_t

func PathToSVGString

func PathToSVGString(path Path, absolute bool) String

func StringNew added in v0.29.0

func StringNew(s string) String

func StringNewEmpty

func StringNewEmpty() String

func TypeFaceGetFamilyName

func TypeFaceGetFamilyName(face TypeFace) String

type StrokeCap

type StrokeCap byte

func PaintGetStrokeCap

func PaintGetStrokeCap(paint Paint) StrokeCap

type StrokeJoin

type StrokeJoin byte

func PaintGetStrokeJoin

func PaintGetStrokeJoin(paint Paint) StrokeJoin

type Surface

type Surface = *C.sk_surface_t

func CanvasGetSurface added in v0.29.0

func CanvasGetSurface(canvas Canvas) Surface

func SurfaceMakeRasterDirect added in v0.38.0

func SurfaceMakeRasterDirect(info *ImageInfo, pixels []byte, rowBytes int, surfaceProps SurfaceProps) Surface

func SurfaceMakeRasterN32PreMul added in v0.38.0

func SurfaceMakeRasterN32PreMul(info *ImageInfo, surfaceProps SurfaceProps) Surface

func SurfaceNewBackendRenderTarget

func SurfaceNewBackendRenderTarget(ctx DirectContext, backend BackendRenderTarget, origin SurfaceOrigin, colorType ColorType, colorSpace ColorSpace, surfaceProps SurfaceProps) Surface

type SurfaceOrigin

type SurfaceOrigin int32
const (
	SurfaceOriginTopLeft SurfaceOrigin = iota
	SurfaceOriginBottomLeft
)

type SurfaceProps

type SurfaceProps = *C.sk_surface_props_t

func SurfacePropsNew

func SurfacePropsNew(geometry PixelGeometry) SurfaceProps

type TextBlob

type TextBlob = *C.sk_text_blob_t

func TextBlobBuilderMake

func TextBlobBuilderMake(builder TextBlobBuilder) TextBlob

func TextBlobMakeFromText

func TextBlobMakeFromText(text string, font Font) TextBlob

type TextBlobBuilder

type TextBlobBuilder = *C.sk_text_blob_builder_t

func TextBlobBuilderNew

func TextBlobBuilderNew() TextBlobBuilder

type TextEncoding

type TextEncoding int32
const (
	TextEncodingUTF8 TextEncoding = iota
	TextEncodingUTF16
	TextEncodingUTF32
	TextEncodingGlyphID
)

type TileMode

type TileMode byte

type TrimMode

type TrimMode byte

type TypeFace

type TypeFace = *C.sk_typeface_t

func FontMgrCreateFromData

func FontMgrCreateFromData(mgr FontMgr, data Data) TypeFace

func FontMgrMatchFamilyStyle

func FontMgrMatchFamilyStyle(mgr FontMgr, family string, style FontStyle) TypeFace

func FontMgrMatchFamilyStyleCharacter added in v0.7.0

func FontMgrMatchFamilyStyleCharacter(mgr FontMgr, family string, style FontStyle, ch rune) TypeFace

func FontStyleSetCreateTypeFace

func FontStyleSetCreateTypeFace(set FontStyleSet, index int) TypeFace

func FontStyleSetMatchStyle

func FontStyleSetMatchStyle(set FontStyleSet, style FontStyle) TypeFace

type WStream added in v0.29.0

type WStream = *C.sk_wstream_t

func DynamicMemoryWStreamAsWStream added in v0.29.0

func DynamicMemoryWStreamAsWStream(s DynamicMemoryWStream) WStream

func FileWStreamAsWStream added in v0.29.0

func FileWStreamAsWStream(s FileWStream) WStream

Jump to

Keyboard shortcuts

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