Documentation
¶
Index ¶
Constants ¶
const FlagAlphaTestMipmapGeneration = 0x400000
const FlagAnisotropicFiltering = 0x0010
const FlagBorder = 0x20000000
const FlagClampS = 0x0004
const FlagClampT = 0x0008
const FlagClampU = 0x2000000
const FlagDepthRenderTarget = 0x10000
const FlagEightBitAlpha = 0x2000
const FlagEnvironmentMap = 0x4000
const FlagHintDXT5 = 0x0020
const FlagNiceFiltered = 0x1000000
const FlagNoCompress = 0x0040
const FlagNoDebugOverride = 0x20000
const FlagNoDepthBuffer = 0x800000
const FlagNoLevelOfDetail = 0x0200
const FlagNoMinimumMipmap = 0x0400
const FlagNoMipmaps = 0x0100
const FlagNormalMap = 0x0080
const FlagNormalToDuDv = 0x200000
const FlagOneBitAlpha = 0x1000
const FlagOneOverMipmapLevelInAlpha = 0x80000
const FlagPWLCorrected = 0x0040
const FlagPointSampling = 0x0001
const FlagPreMultiplyColorByOneOverMipmapLevel = 0x100000
const FlagPreSRGB = 0x80000
const FlagProcedural = 0x0800
const FlagRenderTarget = 0x8000
const FlagSRGB = 0xFFFF // n/a
const FlagSSBump = 0x8000000
const FlagSingleCopy = 0x40000
const FlagTrilinearSampling = 0x0002
const FlagVertexTexture = 0x4000000
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Header ¶
type Header struct {
HeaderCommon
Header72
Header73
}
Header: VTF Header format Contents includes information for all versions Its up to the implementee to decide what properties they need based on the version
type Header72 ¶
type Header72 struct {
Depth uint16 //Depth of the largest mipmap in pixels (^2) ushort
}
Header72: v7.2+ includes these properties
type Header73 ¶
type Header73 struct {
NumResource uint32 // Number of resources this vtf has
// contains filtered or unexported fields
}
Header73: v7.3+ includes these properties
type HeaderCommon ¶
type HeaderCommon struct {
Signature [4]byte //File signature char
Version [2]uint32 //Version[0].version[1] e.g. 7.2 uint
HeaderSize uint32 //Size of Header (16 byte aligned, currently 80bytes) uint
Width uint16 //Width of largest mipmap (^2) ushort
Height uint16 //Height of largest mipmap (^2) ushort
Flags uint32 //VTF Flags uint
Frames uint16 //Number of frames (if animated) default: 1 ushort
FirstFrame uint16 //First frame in animation (0 based) ushort
Reflectivity [3]float32 //reflectivity vector float
BumpmapScale float32 //Bumpmap scale float
HighResImageFormat uint32 //High resolution image format uint (probably 4?)
MipmapCount uint8 //Number of mipmaps uchar
LowResImageFormat uint32 //Low resolution image format (always DXT1 [=14]) uint
LowResImageWidth uint8 //Low resolution image width uchar
LowResImageHeight uint8 //Low resolution image height uchar
// contains filtered or unexported fields
}
HeaderCommon: All VTF versions start with these properties
type Vtf ¶
type Vtf struct {
// contains filtered or unexported fields
}
Vtf: Exported vtf format Contains a Header, resources (v7.3+), low res thumbnail & high-res mipmaps
func ReadFromFile ¶
ReadFromFile: ReadFromStream wrapper to load directly from filesystem. Exists for convenience
func ReadFromStream ¶
ReadFromStream: Load vtf from standard io.Reader stream,
func (*Vtf) GetHighResImageData ¶
GetHighResImageData: Get all data for all mipmaps
func (*Vtf) GetHighestResolutionImageForFrame ¶
GetHighestResolutionImageForFrame: Get the best possible resolution for a single frame in the vtf
func (*Vtf) GetLowResImageData ¶
GetLowResImageData: Get raw data of low-resolution thumbnail
func (*Vtf) GetMipmapsForFrame ¶
GetMipmapsForFrame: Get all mipmap sizes for a single frame