Documentation
¶
Overview ¶
Package blob provides functions for writing and reading data to and from a byte sequence respectively. All operations are performed in little-endian order.
Index ¶
- type Plotter
- func (p *Plotter) Data() []byte
- func (p *Plotter) Offset() int
- func (p *Plotter) PlotBytes(data []byte)
- func (p *Plotter) PlotFloat16(value float16.Float16)
- func (p *Plotter) PlotFloat32(value float32)
- func (p *Plotter) PlotFloat64(value float64)
- func (p *Plotter) PlotSPMat4(value sprec.Mat4)
- func (p *Plotter) PlotSPVec2(value sprec.Vec2)
- func (p *Plotter) PlotSPVec3(value sprec.Vec3)
- func (p *Plotter) PlotSPVec4(value sprec.Vec4)
- func (p *Plotter) PlotUint16(value uint16)
- func (p *Plotter) PlotUint32(value uint32)
- func (p *Plotter) PlotUint64(value uint64)
- func (p *Plotter) PlotUint8(value byte)
- func (p *Plotter) Rewind()
- func (p *Plotter) Seek(offset int)
- func (p *Plotter) Skip(offset int)
- type Scanner
- func (s *Scanner) Data() []byte
- func (s *Scanner) Offset() int
- func (s *Scanner) Rewind()
- func (s *Scanner) ScanFloat32() float32
- func (s *Scanner) ScanSPMat4() sprec.Mat4
- func (s *Scanner) ScanSPVec2() sprec.Vec2
- func (s *Scanner) ScanSPVec3() sprec.Vec3
- func (s *Scanner) ScanSPVec4() sprec.Vec4
- func (s *Scanner) ScanUint16() uint16
- func (s *Scanner) ScanUint32() uint32
- func (s *Scanner) ScanUint8() byte
- func (s *Scanner) Seek(offset int)
- func (s *Scanner) Skip(offset int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Plotter ¶
type Plotter struct {
// contains filtered or unexported fields
}
Plotter is a wrapper over a byte slice that enables writing of various types of primitives in little-endian order.
func NewPlotter ¶
NewPlotter creates a new Plotter instance over the specified byte slice.
func (*Plotter) PlotBytes ¶ added in v0.17.0
PlotBytes copies the specified data at the current offset and advances the offset with the length of the data.
func (*Plotter) PlotFloat16 ¶
PlotFloat16 sets a single float16 value at the current offset and advances the offset with 2 bytes.
func (*Plotter) PlotFloat32 ¶
PlotFloat32 sets a single float32 value at the current offset and advances the offset with 4 bytes.
func (*Plotter) PlotFloat64 ¶
PlotFloat64 sets a single float64 value at the current offset and advances the offset with 8 bytes.
func (*Plotter) PlotSPMat4 ¶
PlotSPMat4 sets a sprec.Mat4 value at the current offset and advances the offset with 64 bytes.
func (*Plotter) PlotSPVec2 ¶
PlotSPVec2 sets a sprec.Vec2 value at the current offset and advances the offset with 8 bytes.
func (*Plotter) PlotSPVec3 ¶
PlotSPVec3 sets a sprec.Vec3 value at the current offset and advances the offset with 12 bytes.
func (*Plotter) PlotSPVec4 ¶
PlotSPVec4 sets a sprec.Vec4 value at the current offset and advances the offset with 16 bytes.
func (*Plotter) PlotUint16 ¶
PlotUint16 sets a single uint16 value at the current offset and advances the offset with 2 bytes.
func (*Plotter) PlotUint32 ¶
PlotUint32 sets a single uint32 value at the current offset and advances the offset with 4 bytes.
func (*Plotter) PlotUint64 ¶
PlotUint64 sets a single uint64 value at the current offset and advances the offset with 8 bytes.
func (*Plotter) PlotUint8 ¶
PlotUint8 sets a single byte at the current offset and advances the offset with 1 byte.
func (*Plotter) Rewind ¶
func (p *Plotter) Rewind()
Rewind moves the write head back to the start of the slice.
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner is a wrapper over a byte slice that enables writing of various types of primitives.
func NewScanner ¶
NewScanner creates a new Scanner instance over the specified byte slice.
func (*Scanner) Rewind ¶
func (s *Scanner) Rewind()
Rewind moves the write head back to the start of the slice.
func (*Scanner) ScanFloat32 ¶
ScanFloat32 reads a single float32 value from the current offset and advances the offset with four bytes.
func (*Scanner) ScanSPMat4 ¶
ScanSPMat4 reads a sprec.Mat4 value from the current offset and advances the offset with 64 bytes.
func (*Scanner) ScanSPVec2 ¶
ScanSPVec2 reads a sprec.Vec2 value from the current offset and advances the offset with 8 bytes.
func (*Scanner) ScanSPVec3 ¶
ScanSPVec3 reads a sprec.Vec3 value from the current offset and advances the offset with 12 bytes.
func (*Scanner) ScanSPVec4 ¶
ScanSPVec4 reads a sprec.Vec4 value from the current offset and advances the offset with 12 bytes.
func (*Scanner) ScanUint16 ¶
ScanUint16 reads a single byte from the specified offset and then advances the offset with 2 bytes.
func (*Scanner) ScanUint32 ¶
ScanUint32 reads a single byte from the specified offset and then advances the offset with 4 bytes.
func (*Scanner) ScanUint8 ¶
ScanUint8 reads a single byte from the specified offset and then advances the offset with 1 byte.