2022-07-13 21:28:43 +00:00

23 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 _a "github.com/unidoc/unipdf/v3/internal/jbig2/errors";func NewIntSlice (i int )*IntSlice {_ec :=IntSlice (make ([]int ,i ));return &_ec };func Ceil (numerator ,denominator int )int {if numerator %denominator ==0{return numerator /denominator ;
};return (numerator /denominator )+1;};func (_e IntsMap )Add (key uint64 ,value int ){_e [key ]=append (_e [key ],value )};func (_af *Stack )Push (v interface{}){_af .Data =append (_af .Data ,v )};func (_fc *Stack )Peek ()(_cad interface{},_cac bool ){return _fc .peek ()};
func NewNumSlice (i int )*NumSlice {_ca :=NumSlice (make ([]float32 ,i ));return &_ca };func (_g *IntSlice )Add (v int )error {if _g ==nil {return _a .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");
};*_g =append (*_g ,v );return nil ;};func (_eg IntSlice )Get (index int )(int ,error ){if index > len (_eg )-1{return 0,_a .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 _eg [index ],nil ;};func Abs (v int )int {if v > 0{return v ;};return -v ;};func Max (x ,y int )int {if x > y {return x ;};return y ;};type IntSlice []int ;func (_ef IntsMap )Get (key uint64 )(int ,bool ){_efa ,_df :=_ef [key ];if !_df {return 0,false ;
};if len (_efa )==0{return 0,false ;};return _efa [0],true ;};func Sign (v float32 )float32 {if v >=0.0{return 1.0;};return -1.0;};func (_fae NumSlice )GetInt (i int )(int ,error ){const _ae ="\u0047\u0065\u0074\u0049\u006e\u0074";if i < 0||i > len (_fae )-1{return 0,_a .Errorf (_ae ,"\u0069n\u0064\u0065\u0078\u003a\u0020\u0027\u0025\u0064\u0027\u0020\u006fu\u0074\u0020\u006f\u0066\u0020\u0072\u0061\u006e\u0067\u0065",i );
};_bf :=_fae [i ];return int (_bf +Sign (_bf )*0.5),nil ;};func (_gd *Stack )top ()int {return len (_gd .Data )-1};func (_fcg *Stack )Pop ()(_ggg interface{},_fe bool ){_ggg ,_fe =_fcg .peek ();if !_fe {return nil ,_fe ;};_fcg .Data =_fcg .Data [:_fcg .top ()];
return _ggg ,true ;};func (_ag *NumSlice )AddInt (v int ){*_ag =append (*_ag ,float32 (v ))};func (_fa NumSlice )Get (i int )(float32 ,error ){if i < 0||i > len (_fa )-1{return 0,_a .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 _fa [i ],nil ;};func (_gf *Stack )peek ()(interface{},bool ){_cgc :=_gf .top ();if _cgc ==-1{return nil ,false ;};return _gf .Data [_cgc ],true ;};type NumSlice []float32 ;func (_b IntsMap )GetSlice (key uint64 )([]int ,bool ){_f ,_c :=_b [key ];
if !_c {return nil ,false ;};return _f ,true ;};func (_cg NumSlice )GetIntSlice ()[]int {_ac :=make ([]int ,len (_cg ));for _ce ,_bfb :=range _cg {_ac [_ce ]=int (_bfb );};return _ac ;};func (_cab *Stack )Len ()int {return len (_cab .Data )};func (_ga *IntSlice )Copy ()*IntSlice {_fd :=IntSlice (make ([]int ,len (*_ga )));
copy (_fd ,*_ga );return &_fd ;};func Min (x ,y int )int {if x < y {return x ;};return y ;};func (_gg *NumSlice )Add (v float32 ){*_gg =append (*_gg ,v )};type IntsMap map[uint64 ][]int ;type Stack struct{Data []interface{};Aux *Stack ;};func (_cb IntsMap )Delete (key uint64 ){delete (_cb ,key )};
func (_db IntSlice )Size ()int {return len (_db )};