chunk

package
v0.0.0-...-2a0e038 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chunk

type Chunk struct {
	Data []byte // $dataSize bytes
	// contains filtered or unexported fields
}

Chunk represents one of the many chunks of a png file

func BuildIDATChunks

func BuildIDATChunks(bytesBuff *bytes.Buffer, chunkSize uint32) []Chunk

BuildIDATChunks will create a bunch of IDAT chunks from a compressed rawBytes array

func CreateChunk

func CreateChunk(data []byte, tipo []byte) Chunk

CreateChunk create a new chunk with the desired options

func Parse

func Parse(index *uint32, data []byte) Chunk

Parse converts a byte array into chunk

func (*Chunk) CalcCRC

func (r *Chunk) CalcCRC() uint32

CalcCRC returns a recalculated version of the CRC

func (*Chunk) GetCRC

func (r *Chunk) GetCRC() uint32

GetCRC returns CRC in integer

func (*Chunk) GetDataSize

func (r *Chunk) GetDataSize() uint32

GetDataSize returns dataSize in integer

func (*Chunk) GetType

func (r *Chunk) GetType() string

GetType returns chunk type

func (*Chunk) SetCRC

func (r *Chunk) SetCRC(ncrc []byte)

SetCRC sets the CRC

func (*Chunk) SetDataSize

func (r *Chunk) SetDataSize(size []byte)

SetDataSize set chunk dataSize field

func (Chunk) String

func (r Chunk) String() string

String String representation of chunk

func (*Chunk) ToBytes

func (r *Chunk) ToBytes() []byte

ToBytes Chunk byte representation

Jump to

Keyboard shortcuts

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