d2dcc

package
v0.0.0-...-7f92c57 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2021 License: GPL-3.0 Imports: 5 Imported by: 2

Documentation

Overview

Package d2dcc contains the logic for loading and processing DCC files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dir64ToDcc

func Dir64ToDcc(direction, numDirections int) int

Dir64ToDcc returns the DCC direction based on the actual direction. Special thanks for Necrolis for these tables!

Types

type DCC

type DCC struct {
	Signature          int
	Version            int
	NumberOfDirections int
	FramesPerDirection int
	Directions         []*DCCDirection
	// contains filtered or unexported fields
}

DCC represents a DCC file.

func Load

func Load(fileData []byte) (*DCC, error)

Load loads a DCC file.

func (*DCC) Clone

func (d *DCC) Clone() *DCC

Clone creates a copy of the DCC

type DCCCell

type DCCCell struct {
	Width       int
	Height      int
	XOffset     int
	YOffset     int
	LastWidth   int
	LastHeight  int
	LastXOffset int
	LastYOffset int
}

DCCCell represents a single cell in a DCC file.

type DCCDirection

type DCCDirection struct {
	OutSizeCoded               int
	CompressionFlags           int
	Variable0Bits              int
	WidthBits                  int
	HeightBits                 int
	XOffsetBits                int
	YOffsetBits                int
	OptionalDataBits           int
	CodedBytesBits             int
	EqualCellsBitstreamSize    int
	PixelMaskBitstreamSize     int
	EncodingTypeBitsreamSize   int
	RawPixelCodesBitstreamSize int
	Frames                     []*DCCDirectionFrame
	PaletteEntries             [256]byte
	Box                        d2geom.Rectangle
	Cells                      []*DCCCell
	PixelData                  []byte
	HorizontalCellCount        int
	VerticalCellCount          int
	PixelBuffer                []DCCPixelBufferEntry
}

DCCDirection represents a DCCDirection file.

func CreateDCCDirection

func CreateDCCDirection(bm *d2datautils.BitMuncher, file *DCC) *DCCDirection

CreateDCCDirection creates an instance of a DCCDirection. nolint:funlen // no need to reduce

type DCCDirectionFrame

type DCCDirectionFrame struct {
	Box                   d2geom.Rectangle
	Cells                 []DCCCell
	PixelData             []byte
	Width                 int
	Height                int
	XOffset               int
	YOffset               int
	NumberOfOptionalBytes int
	NumberOfCodedBytes    int
	HorizontalCellCount   int
	VerticalCellCount     int
	FrameIsBottomUp       bool
	// contains filtered or unexported fields
}

DCCDirectionFrame represents a direction frame for a DCC.

func CreateDCCDirectionFrame

func CreateDCCDirectionFrame(bits *d2datautils.BitMuncher, direction *DCCDirection) *DCCDirectionFrame

CreateDCCDirectionFrame Creates a DCCDirectionFrame for a DCC.

type DCCPixelBufferEntry

type DCCPixelBufferEntry struct {
	Value          [4]byte
	Frame          int
	FrameCellIndex int
}

DCCPixelBufferEntry represents a single entry in the pixel buffer.

Jump to

Keyboard shortcuts

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