scanlines

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: 9 Imported by: 0

Documentation

Index

Constants

View Source
const PRESERVE float32 = 0.9 //0.0075

PRESERVE: At each scaline we can compromise only 70% of its bytes

Variables

View Source
var ErrDataTooSmall = errors.New("Scanline is too small to hide anything in it")

ErrDataTooSmall Data is too small to hide anything in it

View Source
var SectionsMap = [][]byte{
	[]byte{1, 1, 1, 1, 1, 1, 1, 1},
	[]byte{2, 2, 2, 2},
	[]byte{3, 3, 2},
	[]byte{4, 4},
	[]byte{5, 3},
	[]byte{6, 2},
	[]byte{7, 1},
	[]byte{8},
}

SectionsMap ways of dividing a 8 bit number

Functions

func Div

func Div(number byte, parts int) [][2]byte

Div Divides a 8 bit number $N into sections, each section contaning at most $M bits

Usage:

b = Div(0b00101010, 3) == [[0b001, 3], [0b010, 3], [0b10, 2]]
b[0][0] is the first 3 bits of the number
b[0][1] is the length of b[0][0]

**@param** _number byte_ The byte to be divided

**@param** _parts int_ How many parts should it be divided into

**@return** _[][2]byte_ An array containg all parts of the divided number into $N parts

func ToJson

func ToJson(mymap map[string]interface{}) string

ToJson transforms a map into a string json representation

func Unite

func Unite(parts [][2]byte) byte

Unite is the exact opposite of Div. It the takes the broken byte pieces and reassemble it, into a full byte.

Types

type Scanliens

type Scanliens struct {
	// contains filtered or unexported fields
}

Scanliens Represensts the **parsed** union of all IDAT chunks.

When talking about PNG files _the real_ image data lives inside the IDAT chunk, however this data is compressed and scattered in multiple IDAT chunks. This class is the actual representation of those IDAT chunks.

func FromChunks

func FromChunks(chunks []chunk.Chunk, header map[string]interface{}) (Scanliens, uint32, error)

FromChunks Creates a new Scanlines instance from an array of chunks

func (*Scanliens) Get

func (t *Scanliens) Get(index int) []byte

Get Returns the specified scaline

func (*Scanliens) GetScanlines

func (t *Scanliens) GetScanlines() [][]byte

GetScanlines Returns all scanlines

func (*Scanliens) HideBytes

func (t *Scanliens) HideBytes(data []byte, dataType []byte, bitloss int) error

HideBytes Tries to hide some bytes inside this scanline

func (*Scanliens) RevealBytes

func (t *Scanliens) RevealBytes() (data []byte, dataType string, bitloss int, err error)

RevealBytes Tries to reveal some hidden bytes inside this scanline

func (*Scanliens) ToChunks

func (t *Scanliens) ToChunks(chunkSize uint32) ([]chunk.Chunk, error)

ToChunks Converts the scanlines into an array of IDAT chunks

func (*Scanliens) ToString

func (t *Scanliens) ToString() string

ToString Returns a string representation of this scalines

func (*Scanliens) ToggleFilter

func (t *Scanliens) ToggleFilter(undo bool, lines []int)

type Slice

type Slice struct {
	// contains filtered or unexported fields
}

Slice Represents a real slice

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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