cairo

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: MIT Imports: 1 Imported by: 1

Documentation

Overview

Package cairo implements a simple dummy cairo api

Index

Constants

View Source
const FormatArgb32 enum = 0

FormatArgb32 pixel is a 32-bit quantity, with alpha in the upper 8 bits, then red, then green, then blue. The 32-bit quantities are stored native-endian. Pre-multiplied alpha is used. (That is, 50% transparent red is 0x80800000, not 0x80ff0000.)

View Source
const FormatRgb16565 enum = 4

FormatRgb16565 pixel is a 16-bit quantity, with red in the upper 5 bits, then green in the next 6, then blue in the lowest 5 bits

Variables

This section is empty.

Functions

func FormatStrideForWidth

func FormatStrideForWidth(cairoFormat Format, width int) int

FormatStrideForWidth gets the stride for a concrete image

Types

type Format

type Format = enum

Format represents an enum

type Surface

type Surface interface {
	Reference() Surface
	Destroy()
	SetUserData(data func())
	SetDestructor(destructor func())
	ImageSurfaceGetData() []byte
	ImageSurfaceGetWidth() int
	ImageSurfaceGetHeight() int
	ImageSurfaceGetStride() int
}

Surface is a Cairo Surface

func ImageSurfaceCreateForData

func ImageSurfaceCreateForData(
	data []byte,
	cairoFormat Format,
	width int,
	height int,
	stride int,
) Surface

ImageSurfaceCreateForData creates a simulatedSurface

Jump to

Keyboard shortcuts

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