shading

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Shading

type Shading interface {
	Embed(w pdf.Putter, singleUse bool, defName pdf.Name) (*graphics.Shading, error)
}

A Shading describes the variation of colors across an area.

type Type1

type Type1 struct {
	ColorSpace color.Space

	// F is either 2->n function or an array of n 2->1 functions, where n is
	// the number of colour components of the ColorSpace.
	F function.Func

	// Domain (optional)
	Domain []float64

	Matrix     []float64
	Background []float64
	BBox       *pdf.Rectangle
	AntiAlias  bool
}

Type1 represents a type 1 (function-based) shading.

func (*Type1) Embed

func (s *Type1) Embed(w pdf.Putter, singleUse bool, defName pdf.Name) (*graphics.Shading, error)

Embed implements the Shading interface.

type Type3

type Type3 struct {
	ColorSpace color.Space
	X1, Y1, R1 float64
	X2, Y2, R2 float64

	// F is either 1->n function or an array of n 1->1 functions, where n is
	// the number of colour components of the ColorSpace.
	F function.Func

	TMin, TMax  float64
	ExtendStart bool
	ExtendEnd   bool
	Background  []float64
	BBox        *pdf.Rectangle
	AntiAlias   bool
}

Type3 represents a type 3 (radial) shading.

func (*Type3) Embed

func (s *Type3) Embed(w pdf.Putter, singleUse bool, defName pdf.Name) (*graphics.Shading, error)

Embed implements the Shading interface.

type Type4

type Type4 struct {
	ColorSpace        color.Space
	BitsPerCoordinate int
	BitsPerComponent  int
	BitsPerFlag       int
	Decode            []float64
	Vertices          []Type4Vertex

	F          function.Func
	Background []float64
	BBox       *pdf.Rectangle
	AntiAlias  bool
}

Type4 represents a type 4 (free-form Gouraud-shaded triangle mesh) shading.

func (*Type4) Embed

func (s *Type4) Embed(w pdf.Putter, _ bool, defName pdf.Name) (*graphics.Shading, error)

Embed implements the Shading interface.

type Type4Vertex

type Type4Vertex struct {
	X, Y  float64
	Flag  uint8
	Color []float64
}

Type4Vertex represents a single vertex in a type 4 shading.

Jump to

Keyboard shortcuts

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