aliceafa

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2023 License: BSD-3-Clause Imports: 8 Imported by: 0

README

alicesoft-afa

This package contains decoders for AliceSoft's AFA / ALD archive format, and decoders for QNT and DCF image files with proper alpha mask handling.

Also, cmd/extract-alice-afa has a command line tool for extracting files from AFA and ALD archive.

Documentation

Overview

Package aliceafa is a hander for AliceSoft's ALD and AFA archive format. This package also contains decoder for AliceSoft QNT and DCF image files.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidArchive = errors.New("invalid archive file")
	ErrInvalidEntry   = errors.New("invalid entry index")
	ErrUnknownVersion = errors.New("unknown archive version")
)
View Source
var (
	ErrInvalidFormat = errors.New("invalid data format")
)

Functions

func LoadDCF

func LoadDCF(rs io.ReadSeeker) (img image.Image, baseImageName string, err error)

DCF is QNF file with independent alpha masks. returned baseImageName contains the base image filename that should be overlayed on.

func LoadQNT

func LoadQNT(rs io.ReadSeeker) (img image.Image, err error)

Load QNT image. The QNT images assumed to be 8-bit RGBA image. Returning img is actually an *image.NRGBA type.

Types

type AliceArch

type AliceArch struct {
	Type  FileType
	Entry []FileEntry // info of file entries in the archive
}

AliceSoft ALD/AFA archive

func OpenAFA

func OpenAFA(rs io.ReadSeeker) (afa *AliceArch, err error)

Load file info of Alicesoft AFA archive. An AFA archive may has ".afa" extension.

func OpenALD

func OpenALD(rs io.ReadSeeker) (ald *AliceArch, err error)

Load file info of Alicesoft ALD archive file. An ALD archive may have an extension of ".ald", ".alk" and ".dat".

func (*AliceArch) Read

func (p *AliceArch) Read(r io.ReadSeeker, entryIndex int) (data []byte, err error)

Read the data body of a file entry. entryIndex is an index of p.Entry, and r must be the open file handle of the archive file

func (*AliceArch) Size

func (p *AliceArch) Size() int

Number of entries in the archive

type FileEntry

type FileEntry struct {
	Name         string // filename
	Offset, Size int64  // absolute file offset and size to the file entry
}

info of each file entry in the ALD/AFA archive

type FileType

type FileType int
const (
	TypeALD FileType = 0x01 // .ald archive
	TypeAFA FileType = 0x11 // .afa archive
)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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