pws

package
v1.2.13 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package pws handles input and output of Anycubic Photons 2.0 (.pws) printables

Index

Constants

View Source
const (
	SliceFormatPWS = SliceFormat(iota)
	SliceFormatPW0
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Filemark

type Filemark struct {
	Mark       [12]byte // Forced to 'ANYCUBIC'
	Version    uint32   // Forced to 1
	AreaNum    uint32   // Forced to 4
	HeaderAddr uint32

	PreviewAddr uint32

	LayerDefAddr uint32

	LayerImageAddr uint32
	// contains filtered or unexported fields
}

type Format

type Format struct {
	*pflag.FlagSet

	AntiAlias int // AntiAlias level, one of [1,2,4,8]
	// contains filtered or unexported fields
}

func NewFormatter

func NewFormatter(suffix string) (sf *Format)

func (*Format) Decode

func (sf *Format) Decode(reader uv3dp.Reader, filesize int64) (printable uv3dp.Printable, err error)

func (*Format) Encode

func (sf *Format) Encode(writer uv3dp.Writer, printable uv3dp.Printable) (err error)
type Header struct {
	PixelSize         float32
	LayerHeight       float32
	LightOnTime       float32
	LightOffTime      float32
	BottomLightOnTime float32
	BottomLayers      float32
	LiftHeight        float32
	LiftSpeed         float32 // In mm/second
	RetractSpeed      float32 // In mm/second
	Volume            float32
	AntiAlias         uint32
	ResolutionX       uint32
	ResolutionY       uint32
	Weight            float32
	Price             float32
	ResinType         uint32 // 0x24 ?
	PerLayerOverride  uint32 // bool
	// contains filtered or unexported fields
}

func (*Header) Marshal

func (header *Header) Marshal(offset uint32) (data []byte, err error)

func (*Header) Unmarshal

func (header *Header) Unmarshal(raw []byte) (err error)

type Layer

type Layer struct {
	ImageAddr   uint32
	ImageLength uint32
	LiftHeight  float32
	LiftSpeed   float32
	LightOnTime float32
	LayerHeight float32
	// contains filtered or unexported fields
}

type LayerDef

type LayerDef struct {
	Layers uint32  `struct:"sizeof=Layer"`
	Layer  []Layer `struct:"sizefrom=Layers"`
}

func (*LayerDef) Marshal

func (layerdef *LayerDef) Marshal(offset uint32) (data []byte, err error)

func (*LayerDef) Unmarshal

func (layerdef *LayerDef) Unmarshal(data []byte) (err error)

type Preview

type Preview struct {
	Width      uint32 // Image width
	Resolution uint32
	Height     uint32 // Image height
	// contains filtered or unexported fields
}

func (*Preview) GetImage

func (preview *Preview) GetImage() (preview_image *image.RGBA, err error)

func (*Preview) Marshal

func (preview *Preview) Marshal(offset uint32) (data []byte, err error)

func (*Preview) SetImage

func (preview *Preview) SetImage(preview_image image.Image)

func (*Preview) Unmarshal

func (preview *Preview) Unmarshal(raw []byte) (err error)

type Print

type Print struct {
	uv3dp.Print
	// contains filtered or unexported fields
}

func (*Print) Close

func (sf *Print) Close()

func (*Print) Image

func (pws *Print) Image(index int) (slice *image.Gray)

func (*Print) LayerExposure

func (pws *Print) LayerExposure(index int) (exposure uv3dp.Exposure)

type Section

type Section struct {
	Mark   [12]byte // Section mark
	Length uint32   // Length of this section
}

func (*Section) Marshal

func (sec *Section) Marshal(from interface{}, raw []byte) (data []byte, err error)

func (*Section) Unmarshal

func (sec *Section) Unmarshal(raw []byte, into interface{}) (data []byte, err error)

type Slice

type Slice struct {
	AntiAlias int
	Format    SliceFormat
	Bounds    image.Rectangle
	Data      []byte
}

func (*Slice) GetImage

func (slice *Slice) GetImage() (gray *image.Gray, err error)

func (*Slice) SetImage

func (slice *Slice) SetImage(gray *image.Gray) (err error)

type SliceFormat

type SliceFormat int

Jump to

Keyboard shortcuts

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