stream

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2019 License: Apache-2.0 Imports: 14 Imported by: 39

Documentation

Overview

Package stream contains types that fully describe streams of data.

Index

Constants

This section is empty.

Variables

View Source
var (
	// U1 represents a 1-bit unsigned integer.
	U1 = DataType{Signed: false, Kind: &DataType_Integer{&Integer{Bits: 1}}}
	// U2 represents a 2-bit unsigned integer.
	U2 = DataType{Signed: false, Kind: &DataType_Integer{&Integer{Bits: 2}}}
	// U4 represents a 4-bit unsigned integer.
	U4 = DataType{Signed: false, Kind: &DataType_Integer{&Integer{Bits: 4}}}
	// U5 represents a 5-bit unsigned integer.
	U5 = DataType{Signed: false, Kind: &DataType_Integer{&Integer{Bits: 5}}}
	// U6 represents a 6-bit unsigned integer.
	U6 = DataType{Signed: false, Kind: &DataType_Integer{&Integer{Bits: 6}}}
	// U8 represents a 8-bit unsigned integer.
	U8 = DataType{Signed: false, Kind: &DataType_Integer{&Integer{Bits: 8}}}
	// U9 represents a 9-bit unsigned integer.
	U9 = DataType{Signed: false, Kind: &DataType_Integer{&Integer{Bits: 9}}}
	// U10 represents a 10-bit unsigned integer.
	U10 = DataType{Signed: false, Kind: &DataType_Integer{&Integer{Bits: 10}}}
	// U11 represents a 11-bit unsigned integer.
	U11 = DataType{Signed: false, Kind: &DataType_Integer{&Integer{Bits: 11}}}
	// U16 represents a 16-bit unsigned integer.
	U16 = DataType{Signed: false, Kind: &DataType_Integer{&Integer{Bits: 16}}}
	// U24 represents a 24-bit unsigned integer.
	U24 = DataType{Signed: false, Kind: &DataType_Integer{&Integer{Bits: 24}}}
	// U32 represents a 32-bit unsigned integer.
	U32 = DataType{Signed: false, Kind: &DataType_Integer{&Integer{Bits: 32}}}
	// U64 represents a 64-bit unsigned integer.
	U64 = DataType{Signed: false, Kind: &DataType_Integer{&Integer{Bits: 64}}}
	// S2 represents a 2-bit signed integer.
	S2 = DataType{Signed: true, Kind: &DataType_Integer{&Integer{Bits: 1}}}
	// S8 represents a 8-bit signed integer.
	S8 = DataType{Signed: true, Kind: &DataType_Integer{&Integer{Bits: 7}}}
	// S10 represents a 10-bit signed integer.
	S10 = DataType{Signed: true, Kind: &DataType_Integer{&Integer{Bits: 9}}}
	// S11 represents a 11-bit signed integer.
	S11 = DataType{Signed: true, Kind: &DataType_Integer{&Integer{Bits: 10}}}
	// S16 represents a 16-bit signed integer.
	S16 = DataType{Signed: true, Kind: &DataType_Integer{&Integer{Bits: 15}}}
	// S32 represents a 32-bit signed integer.
	S32 = DataType{Signed: true, Kind: &DataType_Integer{&Integer{Bits: 31}}}
	// S64 represents a 64-bit signed integer.
	S64 = DataType{Signed: true, Kind: &DataType_Integer{&Integer{Bits: 63}}}
	// F10 represents a 10-bit unsigned floating-point number.
	F10 = DataType{Signed: false, Kind: &DataType_Float{&Float{ExponentBits: 5, MantissaBits: 5}}}
	// F11 represents a 11-bit unsigned floating-point number.
	F11 = DataType{Signed: false, Kind: &DataType_Float{&Float{ExponentBits: 5, MantissaBits: 6}}}
	// F16 represents a 16-bit signed, floating-point number.
	F16 = DataType{Signed: true, Kind: &DataType_Float{&Float{ExponentBits: 5, MantissaBits: 10}}}
	// F32 represents a 32-bit signed, floating-point number.
	F32 = DataType{Signed: true, Kind: &DataType_Float{&Float{ExponentBits: 7, MantissaBits: 24}}}
	// F64 represents a 64-bit signed, floating-point number.
	F64 = DataType{Signed: true, Kind: &DataType_Float{&Float{ExponentBits: 10, MantissaBits: 53}}}
	// S16_16 represents a 16.16 bit signed, fixed-point number.
	S16_16 = DataType{Signed: true, Kind: &DataType_Fixed{&Fixed{IntegerBits: 15, FractionalBits: 16}}}
)
View Source
var (
	// Linear is a Sampling state using a linear curve.
	Linear = &Sampling{Curve: Curve_Linear}
	// LinearNormalized is a Sampling state using a normalized, linear curve.
	LinearNormalized = &Sampling{
		Curve:      Curve_Linear,
		Normalized: true,
	}
	// SRGBNormalized is a Sampling state using a normalized, srgb curve
	SRGBNormalized = &Sampling{
		Curve:      Curve_sRGB,
		Normalized: true,
	}
)
View Source
var ColorChannels = Channels{
	Channel_Red,
	Channel_Green,
	Channel_Blue,
	Channel_Alpha,
	Channel_Luminance,
	Channel_Gray,
	Channel_ChromaU,
	Channel_ChromaV,
}

ColorChannels is the list of channels considered colors.

View Source
var DepthChannels = Channels{
	Channel_Depth,
}

DepthChannels is the list of channels considered depth.

View Source
var StencilChannels = Channels{
	Channel_Stencil,
}

StencilChannels is the list of channels considered stencil.

View Source
var VectorChannels = Channels{
	Channel_X,
	Channel_Y,
	Channel_Z,
	Channel_W,
}

VectorChannels is the list of channels considered vectors.

Functions

func Convert

func Convert(dst, src *Format, data []byte) ([]byte, error)

Convert converts count elements from data in format src to dst. Components are matched based on channel and semantic information. Components found in src that are not in dst are ignored. Certain components found in dst that are not in src are filled with default values (Y=0, Z=0, W=1, Alpha=1). Component order and datatypes can be changed.

Types

type Channels added in v0.9.0

type Channels []Channel

Channels is a list of channels.

func (Channels) Contains added in v0.9.0

func (l Channels) Contains(c Channel) bool

Contains returns true if l contains c.

func (Channels) ContainsColor added in v0.9.0

func (l Channels) ContainsColor() bool

ContainsColor returns true if l contains a color channel. See ColorChannels for channels considered colors.

func (Channels) ContainsDepth added in v0.9.0

func (l Channels) ContainsDepth() bool

ContainsDepth returns true if l contains a depth channel. See DepthChannels for channels considered depth.

func (Channels) ContainsStencil added in v0.9.0

func (l Channels) ContainsStencil() bool

ContainsStencil returns true if l contains a stencil channel. See StencilChannels for channels considered stencil.

func (Channels) ContainsVector added in v0.9.0

func (l Channels) ContainsVector() bool

ContainsVector returns true if l contains a vector channel. See VectorChannels for channels considered vectors.

Directories

Path Synopsis
Package fmts contains a number of standard stream formats.
Package fmts contains a number of standard stream formats.

Jump to

Keyboard shortcuts

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