Class TextureExtract
Namespace: ValveResourceFormat.IO
Assembly: ValveResourceFormat.dll
Handles extraction of texture resources to various formats.
public sealed class TextureExtractInheritance
Constructors
TextureExtract(Resource)
Initializes a new instance of the class.
public TextureExtract(Resource resource)Parameters
resource Resource
Properties
DecodeFlags
Gets or sets the decode flags for texture extraction.
public TextureCodec DecodeFlags { get; set; }Property Value
ExportExr
Gets whether the texture should be exported as EXR format.
public bool ExportExr { get; }Property Value
IgnoreVtexFile
Should the vtex file be ignored. Defaults to true for files flagged as child resources.
public bool IgnoreVtexFile { get; set; }Property Value
ImageOutputExtension
Gets the output file extension for the texture.
public string ImageOutputExtension { get; }Property Value
LatLongCombineCubemap
Whether to combine cubemap faces into a single latlong image.
public bool LatLongCombineCubemap { get; set; }Property Value
Methods
CopyChannel(SKPixmap, ChannelMapping, SKPixmap, ChannelMapping)
Copies a single channel from source pixmap to destination pixmap.
public static void CopyChannel(SKPixmap srcPixels, ChannelMapping srcChannel, SKPixmap dstPixels, ChannelMapping dstChannel)Parameters
srcPixels SKPixmap
srcChannel ChannelMapping
dstPixels SKPixmap
dstChannel ChannelMapping
CreateLatLongFromCubemapFaces(SKPixmap[])
Creates a latlong layout bitmap from 6 projected cubemap faces.
public static SKBitmap CreateLatLongFromCubemapFaces(SKPixmap[] faces)Parameters
faces SKPixmap[]
Returns
GetImageOutputExtension(Texture)
Gets the appropriate image output extension for a texture.
public static string GetImageOutputExtension(Texture texture)Parameters
texture Texture
Returns
SubsetToPngImage(SKBitmap, SKRectI)
Converts a subset of a bitmap to PNG image bytes.
public static byte[] SubsetToPngImage(SKBitmap bitmap, SKRectI spriteRect)Parameters
bitmap SKBitmap
spriteRect SKRectI
Returns
byte[]
ToContentFile()
The vtex content file. Input image(s) come as subfiles.
public ContentFile ToContentFile()Returns
ToExrImage(SKBitmap)
Converts a bitmap to EXR image bytes.
public static byte[] ToExrImage(SKBitmap bitmap)Parameters
bitmap SKBitmap
Returns
byte[]
ToExrImage(SKPixmap)
Converts pixmap data to EXR image bytes.
public static byte[] ToExrImage(SKPixmap pixels)Parameters
pixels SKPixmap
Returns
byte[]
ToMaterialMaps(IEnumerable<UnpackInfo>)
Extracts texture to material map files by unpacking channels.
public ContentFile ToMaterialMaps(IEnumerable<MaterialExtract.UnpackInfo> mapsToUnpack)Parameters
mapsToUnpack IEnumerable<MaterialExtract.UnpackInfo>
Returns
ToPngImage(SKBitmap)
Converts a bitmap to PNG image bytes.
public static byte[] ToPngImage(SKBitmap bitmap)Parameters
bitmap SKBitmap
Returns
byte[]
ToPngImageChannels(SKBitmap, ChannelMapping)
Converts specific channels of a bitmap to PNG image bytes.
public static byte[] ToPngImageChannels(SKBitmap bitmap, ChannelMapping channel)Parameters
bitmap SKBitmap
channel ChannelMapping
Returns
byte[]
ToValveTexture()
Converts the texture to a Valve texture (vtex) configuration string.
public string ToValveTexture()Returns
A vtex configuration string in KeyValues2 format.
TryGetMksData(out Dictionary<SKRectI, string>, out string)
Attempts to extract sprite sheet data and MKS texture script.
public bool TryGetMksData(out Dictionary<SKRectI, string> sprites, out string mks)Parameters
sprites Dictionary<SKRectI, string>
mks string

