compositor

package
v0.0.0-...-b7d8138 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRepeated

func AddRepeated(v magica.VoxelObject, originalSrc magica.VoxelObject, n int, inputRamps, outputRamps []string, overwrite bool, blendMode string, ignoreMask bool, ignoreTruncation bool, maskOriginal bool, maskNew bool, flipX bool) (r magica.VoxelObject)

AddRepeated repeats a cargo object across the cargo area up to n times

func AddScaled

func AddScaled(dst magica.VoxelObject, src magica.VoxelObject, inputRamps, outputRamps []string, scaleLogic geometry.PointF, overwrite bool, ignoreMask bool, maskOriginal bool, maskNew bool) (r magica.VoxelObject)

AddScaled scales a cargo object to the cargo area

func Identity

func Identity(v magica.VoxelObject) (r magica.VoxelObject)

Identity returns the base object without any changes at all

func ProduceEmpty

func ProduceEmpty(v magica.VoxelObject, inputRamps, outputRamps []string) (r magica.VoxelObject)

ProduceEmpty returns the base object without any cargo (remove special voxels)

func Recolour

func Recolour(v magica.VoxelObject, inputRamp, outputRamp string) (r magica.VoxelObject)

Recolour according to input/output ramps

func Remove

func Remove(v magica.VoxelObject, src magica.VoxelObject, index uint8) (r magica.VoxelObject)

Remove one voxel object from another (or clip against a colour)

func RotateAndTile

func RotateAndTile(v magica.VoxelObject, angle float64, xOffset, yOffset int, scale geometry.PointF, boundingVolume BoundingVolume) (r magica.VoxelObject)

RotateAndTile (and tile) the base object

func RotateY

func RotateY(v magica.VoxelObject, angle float64) (r magica.VoxelObject)

RotateY Rotates an object around its Y axis

func RotateZ

func RotateZ(v magica.VoxelObject, angle float64) (r magica.VoxelObject)

RotateZ rotates an object around its Z axis, from the bottom

func Stairstep

func Stairstep(v magica.VoxelObject, m float64, n int) (r magica.VoxelObject)

Stairstep the base object (for every m steps in x, move n steps in z)

Types

type Batch

type Batch struct {
	Files      []string    `json:"files"`
	Operations []Operation `json:"operations"`
}

func FromFile

func FromFile(filename string) (b Batch, err error)

func FromJson

func FromJson(handle io.Reader) (b Batch, err error)

func (*Batch) Run

func (b *Batch) Run(outputDirectory, voxelDirectory string) (err error)

type BoundingVolume

type BoundingVolume struct {
	Min geometry.Point `json:"min"`
	Max geometry.Point `json:"max"`
}

type Operation

type Operation struct {
	Name              string          `json:"name"`
	Type              string          `json:"type"`
	File              string          `json:"file"`
	InputColourRamp   string          `json:"input_ramp"`
	OutputColourRamp  string          `json:"output_ramp"`
	InputColourRamps  []string        `json:"input_ramps"`
	OutputColourRamps []string        `json:"output_ramps"`
	N                 int             `json:"n"`
	XSteps            float64         `json:"x_steps"`
	ZSteps            int             `json:"z_steps"`
	Angle             float64         `json:"angle"`
	XOffset           int             `json:"x_offset"`
	YOffset           int             `json:"y_offset"`
	IgnoreMask        bool            `json:"ignore_mask"`
	Truncate          bool            `json:"truncate"`
	MaskOriginal      bool            `json:"mask_original"`
	FlipX             bool            `json:"flip_x"`
	MaskNew           bool            `json:"mask_new"`
	Scale             geometry.PointF `json:"scale"`
	BoundingVolume    BoundingVolume  `json:"bounding_volume"`
	Overwrite         bool            `json:"overwrite"`
	BlendMode         string          `json:"blend_mode"`
	Layers            []int           `json:"layers"`
}

type Ramp

type Ramp struct {
	InputLength      float64
	OutputLength     float64
	StartIndex       int
	EndIndex         int
	OutputStartIndex int
}

Jump to

Keyboard shortcuts

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