2020-10-19 10:58:10 +00:00

12 lines
3.8 KiB
Go

//
// Copyright 2020 FoxyUtils ehf. All rights reserved.
//
// This is a commercial product and requires a license to operate.
// A trial license can be obtained at https://unidoc.io
//
// DO NOT EDIT: generated by unitwist Go source code obfuscator.
//
// Use of this source code is governed by the UniDoc End User License Agreement
// terms that can be accessed at https://unidoc.io/eula/
package basic ;import _b "github.com/unidoc/unipdf/v3/internal/jbig2/errors";func NewIntSlice (i int )*IntSlice {_ca :=IntSlice (make ([]int ,i ));return &_ca };func (_ac *Stack )Pop ()(_fed interface{},_bf bool ){_fed ,_bf =_ac .peek ();if !_bf {return nil ,_bf ;};_ac .Data =_ac .Data [:_ac .top ()];return _fed ,true ;};func (_ce *Stack )peek ()(interface{},bool ){_ddb :=_ce .top ();if _ddb ==-1{return nil ,false ;};return _ce .Data [_ddb ],true ;};func (_fea *IntSlice )Copy ()*IntSlice {_e :=IntSlice (make ([]int ,len (*_fea )));copy (_e ,*_fea );return &_e ;};func NewNumSlice (i int )*NumSlice {_gc :=NumSlice (make ([]float32 ,i ));return &_gc };func (_bg *NumSlice )Add (v float32 ){*_bg =append (*_bg ,v )};func Min (x ,y int )int {if x < y {return x ;};return y ;};func (_ag IntSlice )Size ()int {return len (_ag )};type Stack struct{Data []interface{};Aux *Stack ;};func (_dg *Stack )top ()int {return len (_dg .Data )-1};type NumSlice []float32 ;type IntsMap map[uint64 ][]int ;func (_ggd NumSlice )GetInt (i int )(int ,error ){const _be ="\u0047\u0065\u0074\u0049\u006e\u0074";if i < 0||i > len (_ggd )-1{return 0,_b .Errorf (_be ,"\u0069n\u0064\u0065\u0078\u003a\u0020\u0027\u0025\u0064\u0027\u0020\u006fu\u0074\u0020\u006f\u0066\u0020\u0072\u0061\u006e\u0067\u0065",i );};_ddg :=_ggd [i ];return int (_ddg +Sign (_ddg )*0.5),nil ;};func Max (x ,y int )int {if x > y {return x ;};return y ;};func (_a IntsMap )Add (key uint64 ,value int ){_a [key ]=append (_a [key ],value )};type IntSlice []int ;func (_aa NumSlice )GetIntSlice ()[]int {_ab :=make ([]int ,len (_aa ));for _ff ,_cd :=range _aa {_ab [_ff ]=int (_cd );};return _ab ;};func (_dd IntSlice )Get (index int )(int ,error ){if index > len (_dd )-1{return 0,_b .Errorf ("\u0049\u006e\u0074S\u006c\u0069\u0063\u0065\u002e\u0047\u0065\u0074","\u0069\u006e\u0064\u0065x:\u0020\u0025\u0064\u0020\u006f\u0075\u0074\u0020\u006f\u0066\u0020\u0072\u0061\u006eg\u0065",index );};return _dd [index ],nil ;};func (_bgf NumSlice )Get (i int )(float32 ,error ){if i < 0||i > len (_bgf )-1{return 0,_b .Errorf ("\u004e\u0075\u006dS\u006c\u0069\u0063\u0065\u002e\u0047\u0065\u0074","\u0069n\u0064\u0065\u0078\u003a\u0020\u0027\u0025\u0064\u0027\u0020\u006fu\u0074\u0020\u006f\u0066\u0020\u0072\u0061\u006e\u0067\u0065",i );};return _bgf [i ],nil ;};func (_ebe *Stack )Push (v interface{}){_ebe .Data =append (_ebe .Data ,v )};func Ceil (numerator ,denominator int )int {if numerator %denominator ==0{return numerator /denominator ;};return (numerator /denominator )+1;};func (_ae *IntSlice )Add (v int )error {if _ae ==nil {return _b .Error ("\u0049\u006e\u0074S\u006c\u0069\u0063\u0065\u002e\u0041\u0064\u0064","\u0073\u006c\u0069\u0063\u0065\u0020\u006e\u006f\u0074\u0020\u0064\u0065f\u0069\u006e\u0065\u0064");};*_ae =append (*_ae ,v );return nil ;};func Abs (v int )int {if v > 0{return v ;};return -v ;};func (_c IntsMap )Get (key uint64 )(int ,bool ){_g ,_gg :=_c [key ];if !_gg {return 0,false ;};if len (_g )==0{return 0,false ;};return _g [0],true ;};func (_aae *Stack )Peek ()(_aga interface{},_eb bool ){return _aae .peek ()};func (_fg *Stack )Len ()int {return len (_fg .Data )};func Sign (v float32 )float32 {if v >=0.0{return 1.0;};return -1.0;};func (_cb *NumSlice )AddInt (v int ){*_cb =append (*_cb ,float32 (v ))};func (_fe IntsMap )Delete (key uint64 ){delete (_fe ,key )};func (_d IntsMap )GetSlice (key uint64 )([]int ,bool ){_ad ,_bb :=_d [key ];if !_bb {return nil ,false ;};return _ad ,true ;};