irmf

package
v3.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package irmf parses and validates IRMF shader files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IRMF

type IRMF struct {
	Author    string          `json:"author"`
	Copyright string          `json:"copyright"`
	Date      string          `json:"date"`
	Encoding  *string         `json:"encoding,omitempty"`
	IRMF      string          `json:"irmf"`
	Materials []string        `json:"materials"`
	Max       []float32       `json:"max"`
	Min       []float32       `json:"min"`
	Notes     string          `json:"notes"`
	Options   json.RawMessage `json:"options"`
	Title     string          `json:"title"`
	Units     string          `json:"units"`
	Version   string          `json:"version"`

	Shader string `json:"-"`
}

IRMF represents an IRMF shader.

type Order

type Order byte

Order represents the order of slice processing.

const (
	MinToMax Order = iota
	MaxToMin
)

type Slicer

type Slicer struct {
	// contains filtered or unexported fields
}

Slicer represents a slicer context.

func Init

func Init(view bool, umXRes, umYRes, umZRes float32) *Slicer

Init returns a new Slicer instance.

func (*Slicer) Close

func (s *Slicer) Close()

Close closes the GLFW window and releases any Slicer resources.

func (*Slicer) IRMF

func (s *Slicer) IRMF() *IRMF

func (*Slicer) MBB

func (s *Slicer) MBB() (min, max [3]float32)

MBB returns the MBB of the IRMF model.

func (*Slicer) MaterialName

func (s *Slicer) MaterialName(n int) string

MaterialName returns the name of the n-th material (1-based).

func (*Slicer) NewModel

func (s *Slicer) NewModel(shaderSrc []byte) error

NewModel prepares the slicer to slice a new shader model.

func (*Slicer) NumMaterials

func (s *Slicer) NumMaterials() int

NumMaterials returns the number of materials in the most recent IRMF model.

func (*Slicer) NumXSlices

func (s *Slicer) NumXSlices() int

NumXSlices returns the number of slices in the X direction.

func (*Slicer) NumYSlices

func (s *Slicer) NumYSlices() int

NumYSlices returns the number of slices in the Y direction.

func (*Slicer) NumZSlices

func (s *Slicer) NumZSlices() int

NumZSlices returns the number of slices in the Z direction.

func (*Slicer) PrepareRenderX

func (s *Slicer) PrepareRenderX() error

PrepareRenderX prepares the GPU to render along the X axis.

func (*Slicer) PrepareRenderY

func (s *Slicer) PrepareRenderY() error

PrepareRenderY prepares the GPU to render along the Y axis.

func (*Slicer) PrepareRenderZ

func (s *Slicer) PrepareRenderZ() error

PrepareRenderZ prepares the GPU to render along the Z axis.

func (*Slicer) RenderXSlices

func (s *Slicer) RenderXSlices(materialNum int, sp XSliceProcessor, order Order) error

RenderXSlices slices the given materialNum (1-based index) to an image, calling the SliceProcessor for each slice.

func (*Slicer) RenderYSlices

func (s *Slicer) RenderYSlices(materialNum int, sp YSliceProcessor, order Order) error

RenderYSlices slices the given materialNum (1-based index) to an image, calling the SliceProcessor for each slice.

func (*Slicer) RenderZSlices

func (s *Slicer) RenderZSlices(materialNum int, sp ZSliceProcessor, order Order) error

RenderZSlices slices the given materialNum (1-based index) to an image, calling the SliceProcessor for each slice.

type XSliceProcessor

type XSliceProcessor interface {
	ProcessXSlice(sliceNum int, x, voxelRadius float32, img image.Image) error
}

XSliceProcessor represents a X slice processor.

type YSliceProcessor

type YSliceProcessor interface {
	ProcessYSlice(sliceNum int, y, voxelRadius float32, img image.Image) error
}

YSliceProcessor represents a Y slice processor.

type ZSliceProcessor

type ZSliceProcessor interface {
	ProcessZSlice(sliceNum int, z, voxelRadius float32, img image.Image) error
}

ZSliceProcessor represents a Z slice processor.

Jump to

Keyboard shortcuts

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