Help us shape the future of Go! Take the 2026 Go Developer Survey

asset

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package asset defines the public, versioned processing contract shared by Karty SDK manifests, the CLI asset processors, and runtime hosts.

Index

Constants

View Source
const (
	MaxSourceAssetBytes           = 64 * 1024 * 1024
	MaxSourceImageDimension       = 16_384
	MaxSourceImagePixels          = 64 * 1024 * 1024
	MaxTextureDimension           = 8_192
	MaxTexturePixels              = 16 * 1024 * 1024
	MaxDecodedTextureBytes        = 64 * 1024 * 1024
	MaxDecodedTextures            = 256 * 1024 * 1024
	MaxSoundDurationSeconds       = 30
	MaxDecodedSoundBytes          = 6 * 1024 * 1024
	MaxDecodedSounds              = 64 * 1024 * 1024
	MaxSimultaneousSoundVoices    = 32
	MaxAudioStreamDurationSeconds = 4 * 60 * 60
	MaxEncodedAudioStreamBytes    = 512 * 1024 * 1024
)

Variables

View Source
var ErrContract = errors.New("asset processing contract is invalid")

Functions

This section is empty.

Types

type AudioRecipe

type AudioRecipe struct {
	SampleRate  uint32      `toml:"sample_rate"`
	ChannelMode ChannelMode `toml:"channels"`
}

AudioRecipe is the resolved, canonical input to qoa@1. Samples are converted to signed PCM16 before QOA encoding. Mono conversion is explicit; preserve keeps mono or stereo source channels unchanged.

func (AudioRecipe) Validate

func (recipe AudioRecipe) Validate() error

type Capabilities

type Capabilities struct {
	Processors []Processor  `toml:"processors"`
	Runtime    []Capability `toml:"runtime"`
}

Capabilities is the canonical SDK-manifest declaration of processors and runtime encodings. Lists must be sorted, unique, and contain known values.

func (Capabilities) Validate

func (capabilities Capabilities) Validate() error

type Capability

type Capability string

Capability identifies a runtime asset encoding accepted by a host.

const (
	CapabilityTextureQOIv1                        Capability = "texture/qoi@1"
	CapabilityTextureAtlasV1                      Capability = "texture/atlas@1"
	CapabilitySoundQOAv1                          Capability = "sound/qoa@1"
	CapabilityAudioStreamQOAv1                    Capability = "audio-stream/qoa@1"
	CapabilityVideoMPEG1v1                        Capability = "video/mpeg1@1"
	CapabilityWorldLightingV1                     Capability = "world/lighting@1"
	CapabilityWorldSpatialChunksV1                Capability = "world/spatial-chunks@1"
	CapabilityWorldSpatialChunksV2                Capability = "world/spatial-chunks@2"
	CapabilityWorldChunksV1                       Capability = "world/chunks@1"
	CapabilityWorldChunkReadyV1                   Capability = "world/chunk-ready@1"
	CapabilityWorldTerrainV1                      Capability = "world/terrain@1"
	CapabilityWorldLightmapsV1                    Capability = "world/lightmaps@1"
	CapabilityWorldReflectionCubemapsV1           Capability = "world/reflection-cubemaps@1"
	CapabilityWorldReflectionGPUV1                Capability = "world/reflection-gpu@1"
	CapabilityWorldFixedLightingV1                Capability = "world/fixed-lighting@1"
	CapabilityWorldFixedCompactLightingV1         Capability = "world/fixed-compact-lighting@1"
	CapabilityWorldLightmapsPrebakedV1            Capability = "world/lightmaps-prebaked@1"
	CapabilityWorldLightmapsEnvironmentVariantsV1 Capability = "world/lightmaps-environment-variants@1"
	CapabilityWorldMaterialMappingV1              Capability = "world/material-mapping@1"
	CapabilityWorldVegetationV1                   Capability = "world/vegetation@1"
	CapabilityWorldVegetationV2                   Capability = "world/vegetation@2"
	CapabilityWorldVegetationV3                   Capability = "world/vegetation@3"
	CapabilityWorldVegetationV4                   Capability = "world/vegetation@4"
	CapabilityWorldVegetationV5                   Capability = "world/vegetation@5"
	CapabilityWorldParticlesV1                    Capability = "world/particles@1"
	CapabilityWorldParticlesV2                    Capability = "world/particles@2"
	CapabilityWorldAnimationsV1                   Capability = "world/animations@1"
	CapabilityWorldCharactersV1                   Capability = "world/characters@1"
	CapabilityWorldFluidsV1                       Capability = "world/fluids@1"
	CapabilityWorldEmissionV1                     Capability = "world/emission@1"
	CapabilityWorldEnvironmentV1                  Capability = "world/environment@1"
	CapabilityWorldEnvironmentV2                  Capability = "world/environment@2"
	CapabilityWorldEnvironmentBackdropV1          Capability = "world/environment-backdrop@1"
	CapabilityWorldEnvironmentSkylightV1          Capability = "world/environment-skylight@1"
	CapabilityWorldSkyV1                          Capability = "world/sky@1"
	CapabilityWorldSolidRenderersV1               Capability = "world/solid-renderers@1"
	CapabilityWorldStaticSolidsV1                 Capability = "world/static-solids@1"
	CapabilityWorldMaterialAtlasV1                Capability = "world/material-atlas@1"
	CapabilityWorldMaterialAtlasV2                Capability = "world/material-atlas@2"
	CapabilityWorldMaterialLayersV1               Capability = "world/material-layers@1"
	CapabilityWorldMaterialReflectanceV1          Capability = "world/material-reflectance@1"
	CapabilityWorldMaterialSSBumpV1               Capability = "world/material-ssbump@1"
	CapabilityWorldMaterialGPUV1                  Capability = "world/material-gpu@1"
	CapabilityWorldGPUChunksV1                    Capability = "world/gpu-chunks@1"
	CapabilityWorldGPUChunksV2                    Capability = "world/gpu-chunks@2"
)

type ChannelMode

type ChannelMode string
const (
	ChannelPreserve ChannelMode = "preserve"
	ChannelMono     ChannelMode = "mono"
)

type ImageFilter

type ImageFilter string
const (
	ImageFilterNearest ImageFilter = "nearest"
	ImageFilterSmooth  ImageFilter = "smooth-lanczos3"
)

type ImageRecipe

type ImageRecipe struct {
	MaxWidth  uint32      `toml:"max_width"`
	MaxHeight uint32      `toml:"max_height"`
	Filter    ImageFilter `toml:"filter"`
	BitDepth  uint8       `toml:"bit_depth"`
}

ImageRecipe is the resolved, canonical input to qoi@1. Zero maximums mean unlimited within the resource bounds. QOI output always has 8-bit channels. Resizing never upscales; dimensions use integer floor rounding and remain at least one pixel. Smooth filtering means Lanczos3 with straight-alpha pixels.

func (ImageRecipe) Validate

func (recipe ImageRecipe) Validate() error

type Processor

type Processor string

Processor identifies a byte-producing processor whose output and defaults are stable for the lifetime of the identifier.

const (
	ProcessorCopyPNGv1 Processor = "copy-png@1"
	ProcessorQOIv1     Processor = "qoi@1"
	ProcessorQOAv1     Processor = "qoa@1"
)

Jump to

Keyboard shortcuts

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