blp

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2022 License: MPL-2.0 Imports: 7 Imported by: 3

Documentation

Overview

Package blp is a BLIzzard Picture image format decoder.

Example
package main

import (
	"fmt"
	"os"

	"github.com/nielsAD/gowarcraft3/file/blp"
)

func main() {
	f, err := os.Open("./test.blp")
	if err != nil {
		fmt.Println(err)
		return
	}

	defer f.Close()

	img, err := blp.Decode(f)
	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println(img.Bounds())

}
Output:

(0,0)-(256,256)

Index

Examples

Constants

This section is empty.

Variables

View Source
var (
	ErrBadFormat          = errors.New("blp: Invalid file format")
	ErrInvalidCompression = errors.New("blp: Compression not supported")
)

Errors

View Source
var Header = protocol.DString("BLP1")

Header constant for BLP files

Functions

func Decode

func Decode(r io.Reader) (image.Image, error)

Decode a BLP image. Only take the first image if it's a mipmap.

Types

This section is empty.

Jump to

Keyboard shortcuts

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