2021-09-23 22:37:42 +00:00

21 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 _e "github.com/unidoc/unipdf/v3/internal/jbig2/errors";func (_ee IntsMap )Get (key uint64 )(int ,bool ){_b ,_eeb :=_ee [key ];if !_eeb {return 0,false ;};if len (_b )==0{return 0,false ;};return _b [0],true ;};func (_cbe *Stack )Peek ()(_ae interface{},_gf bool ){return _cbe .peek ()};
func (_fb *Stack )Push (v interface{}){_fb .Data =append (_fb .Data ,v )};func Min (x ,y int )int {if x < y {return x ;};return y ;};type IntSlice []int ;type Stack struct{Data []interface{};Aux *Stack ;};func Abs (v int )int {if v > 0{return v ;};return -v ;
};func (_dg IntsMap )GetSlice (key uint64 )([]int ,bool ){_g ,_eg :=_dg [key ];if !_eg {return nil ,false ;};return _g ,true ;};func (_gb NumSlice )GetInt (i int )(int ,error ){const _de ="\u0047\u0065\u0074\u0049\u006e\u0074";if i < 0||i > len (_gb )-1{return 0,_e .Errorf (_de ,"\u0069n\u0064\u0065\u0078\u003a\u0020\u0027\u0025\u0064\u0027\u0020\u006fu\u0074\u0020\u006f\u0066\u0020\u0072\u0061\u006e\u0067\u0065",i );
};_cd :=_gb [i ];return int (_cd +Sign (_cd )*0.5),nil ;};func Max (x ,y int )int {if x > y {return x ;};return y ;};func NewIntSlice (i int )*IntSlice {_eec :=IntSlice (make ([]int ,i ));return &_eec };func (_a *IntSlice )Add (v int )error {if _a ==nil {return _e .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");
};*_a =append (*_a ,v );return nil ;};func (_cf *Stack )top ()int {return len (_cf .Data )-1};func Sign (v float32 )float32 {if v >=0.0{return 1.0;};return -1.0;};func (_ec *Stack )Pop ()(_ece interface{},_egc bool ){_ece ,_egc =_ec .peek ();if !_egc {return nil ,_egc ;
};_ec .Data =_ec .Data [:_ec .top ()];return _ece ,true ;};func (_bd IntsMap )Delete (key uint64 ){delete (_bd ,key )};func (_dgf *NumSlice )AddInt (v int ){*_dgf =append (*_dgf ,float32 (v ))};type NumSlice []float32 ;func (_ge *Stack )Len ()int {return len (_ge .Data )};
func NewNumSlice (i int )*NumSlice {_fg :=NumSlice (make ([]float32 ,i ));return &_fg };func Ceil (numerator ,denominator int )int {if numerator %denominator ==0{return numerator /denominator ;};return (numerator /denominator )+1;};func (_cb IntSlice )Get (index int )(int ,error ){if index > len (_cb )-1{return 0,_e .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 _cb [index ],nil ;};func (_da *Stack )peek ()(interface{},bool ){_dgb :=_da .top ();if _dgb ==-1{return nil ,false ;};return _da .Data [_dgb ],true ;};func (_c *IntSlice )Copy ()*IntSlice {_af :=IntSlice (make ([]int ,len (*_c )));copy (_af ,*_c );
return &_af ;};func (_f IntsMap )Add (key uint64 ,value int ){_f [key ]=append (_f [key ],value )};type IntsMap map[uint64 ][]int ;func (_ga IntSlice )Size ()int {return len (_ga )};func (_ff NumSlice )Get (i int )(float32 ,error ){if i < 0||i > len (_ff )-1{return 0,_e .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 _ff [i ],nil ;};func (_fc NumSlice )GetIntSlice ()[]int {_fe :=make ([]int ,len (_fc ));for _fce ,_gbf :=range _fc {_fe [_fce ]=int (_gbf );};return _fe ;};func (_cbb *NumSlice )Add (v float32 ){*_cbb =append (*_cbb ,v )};