Documentation ¶
Overview ¶
Package basic contains common structures, slices and maps used within the jbig2 package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Ceil ¶
Ceil gets the 'ceil' value for the provided 'numerator' and 'denominator'.
func Min ¶
Min gets the minimal value from the provided 'x' and 'y' arguments.
Types ¶
type IntSlice ¶
type IntSlice []int
IntSlice is the integer slice that contains panic safe methods.
func (IntSlice) Get ¶
Get gets the integer at 'index'. Returns error if the index is out of range or given integer doesn't exists.
type IntsMap ¶
IntsMap is a wrapper over the map[uint64][]int. The 'key' collisions are stored under subsequent slice positions.
func (IntsMap) Add ¶
Add adds the 'value' to the ints map at the 'key'.
func (IntsMap) Get ¶
Get gets the first int value at the 'key'.
type NumSlice ¶
type NumSlice []float32
NumSlice is the slice of the numbers that has a panic safe API.
func (*NumSlice) AddInt ¶
AddInt adds the 'v' integer value to the num slice.
func (NumSlice) Get ¶
Get the float32 value at 'i' index. Returns error if the index 'i' is out of range.
func (NumSlice) GetInt ¶
GetInt gets the integer value at the 'i' position. The functions return errors if the index 'i' is out of range. Returns '0' on error.
type Stack ¶
type Stack struct { // Data keeps the stack's values. Data []interface{} // Aux is the auxiliary additional stack use for some helpers. Aux *Stack }
Stack is the LIFO data structure implementation
func (*Stack) Peek ¶
Peek returns the top element of the stack 's'. returns false if the stack is zero length.
func (*Stack) Pop ¶
Pop the top element of the slack and returns it. Returns false if the stack is 'zero' length.