glb

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChunkTypeJSON     = 0x4e4f534a
	ChunkTypeBIN      = 0x004e4942
	GLB_HEADER_LENGTH = 12
	GLB_MAGIC         = 0x46546C67
)

Variables

This section is empty.

Functions

func WriteBinary

func WriteBinary(glb GLB) (output_glb []byte, err error)

Types

type DefaultConvertToKtx2ImageDependencies added in v0.0.5

type DefaultConvertToKtx2ImageDependencies struct{}

func (*DefaultConvertToKtx2ImageDependencies) CommandExecutor added in v0.0.5

func (d *DefaultConvertToKtx2ImageDependencies) CommandExecutor(name string, args ...string) error

func (*DefaultConvertToKtx2ImageDependencies) ContentTypeDetector added in v0.0.5

func (d *DefaultConvertToKtx2ImageDependencies) ContentTypeDetector(data []byte) string

func (*DefaultConvertToKtx2ImageDependencies) FileCreator added in v0.0.5

func (*DefaultConvertToKtx2ImageDependencies) FileReader added in v0.0.5

func (d *DefaultConvertToKtx2ImageDependencies) FileReader(filePath string) ([]byte, error)

func (*DefaultConvertToKtx2ImageDependencies) FileRemover added in v0.0.5

func (d *DefaultConvertToKtx2ImageDependencies) FileRemover(filePath string) error

func (*DefaultConvertToKtx2ImageDependencies) ImageSizer added in v0.0.5

func (d *DefaultConvertToKtx2ImageDependencies) ImageSizer(data []byte) (int, int, error)

func (*DefaultConvertToKtx2ImageDependencies) ParamsGenerator added in v0.0.5

func (d *DefaultConvertToKtx2ImageDependencies) ParamsGenerator(mode string, width, height int, inputPath, outputPath string, isSRGB bool, etc1sQuality, uastcQuality, zstdLevel int) []string

func (*DefaultConvertToKtx2ImageDependencies) UUIDGenerator added in v0.0.5

func (d *DefaultConvertToKtx2ImageDependencies) UUIDGenerator() string

type DefaultConvertToKtx2TextureDependencies added in v0.0.5

type DefaultConvertToKtx2TextureDependencies struct{}

func (*DefaultConvertToKtx2TextureDependencies) ConvertToKtx2Image added in v0.0.5

func (d *DefaultConvertToKtx2TextureDependencies) ConvertToKtx2Image(deps interfaces.ConvertToKtx2ImageDependenciesInterface, ktx2Mode string, buf []byte, isSRGB bool, etc1sQuality int, uastcQuality int, zstdLevel int) ([]byte, error)

type GLB

type GLB struct {
	// GltfDocument represents the parsed document of the JSON part of the GLTF file.
	// This field contains information about the scene's structure, asset metadata, animations, materials, etc.
	GltfDocument gltf.Document

	// BIN is a byte slice that stores the binary portion of the GLTF file.
	// It includes the binary format asset data such as mesh vertex data and textures.
	BIN []byte
}

GLB represents a GLTF 2.0 Binary File Format structure. This format encapsulates both the JSON description of a GLTF scene and its associated binary data in a single binary blob.

func ReadBinary

func ReadBinary(input_glb []byte) (glb GLB, err error)

func (*GLB) ResizeTexture

func (g *GLB) ResizeTexture(width, height int) (err error)

func (*GLB) ToKtx2Texture added in v0.0.1

func (g *GLB) ToKtx2Texture(deps interfaces.ConvertToKtx2TextureDependenciesInterface, ktx2Mode string, etc1sQuality int, uastcQuality int, zstdLevel int) (err error)

Jump to

Keyboard shortcuts

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