https://github.com/mauserzjeh/dxt
DXT decompression library
https://github.com/mauserzjeh/dxt
decompression dxt dxt1 dxt3 dxt5 go golang library
Last synced: 11 months ago
JSON representation
DXT decompression library
- Host: GitHub
- URL: https://github.com/mauserzjeh/dxt
- Owner: mauserzjeh
- License: mit
- Created: 2022-05-14T19:34:20.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-05-14T19:56:50.000Z (about 4 years ago)
- Last Synced: 2025-04-13T14:56:46.250Z (about 1 year ago)
- Topics: decompression, dxt, dxt1, dxt3, dxt5, go, golang, library
- Language: Go
- Homepage:
- Size: 255 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# dxt
DXT decompression library written in Go. It supports DXT1, DXT3 and DXT5 decompression to RGBA
# Installation
```
go get -u github.com/mauserzjeh/dxt
```
# Tests
```
go test -v
```
# Usage
```go
// import the library
import "github.com/mauserzjeh/dxt"
var dxtBytes []byte
var width uint
var height uint
// ...read the DXT encoded data...
// ...and also obtain the width and height of the image...
// decompress DXT1 to RGBA
rgbaBytes, err := dxt.DecodeDXT1(dxtBytes, width, height)
// or
// decompress DXT3 to RGBA
rgbaBytes, err := dxt.DecodeDXT3(dxtBytes, width, height)
// or
// decompress DXT5 to RGBA
rgbaBytes, err := dxt.DecodeDXT5(dxtBytes, width, height)
// check for errors
if err != nil {
log.Fatal(err)
}
// rgbaBytes should hold the decompressed RGBA data if no error happened
// R G B A R G B ...
// ie. []byte{123, 23, 234, 212, 21, 128, 52, ...}
```