2021-05-31 17:17:31 +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 _bd "github.com/unidoc/unipdf/v3/internal/jbig2/errors";func (_g IntsMap )GetSlice (key uint64 )([]int ,bool ){_bg ,_cd :=_g [key ];if !_cd {return nil ,false ;};return _bg ,true ;};func (_bgc *IntSlice )Copy ()*IntSlice {_ga :=IntSlice (make ([]int ,len (*_bgc )));
copy (_ga ,*_bgc );return &_ga ;};func (_a IntsMap )Get (key uint64 )(int ,bool ){_f ,_c :=_a [key ];if !_c {return 0,false ;};if len (_f )==0{return 0,false ;};return _f [0],true ;};func Sign (v float32 )float32 {if v >=0.0{return 1.0;};return -1.0;};
func Ceil (numerator ,denominator int )int {if numerator %denominator ==0{return numerator /denominator ;};return (numerator /denominator )+1;};func (_aac *NumSlice )AddInt (v int ){*_aac =append (*_aac ,float32 (v ))};func (_aa *NumSlice )Add (v float32 ){*_aa =append (*_aa ,v )};
func Abs (v int )int {if v > 0{return v ;};return -v ;};func (_db *Stack )Pop ()(_fb interface{},_cdd bool ){_fb ,_cdd =_db .peek ();if !_cdd {return nil ,_cdd ;};_db .Data =_db .Data [:_db .top ()];return _fb ,true ;};type IntsMap map[uint64 ][]int ;func Max (x ,y int )int {if x > y {return x ;
};return y ;};func (_d IntsMap )Add (key uint64 ,value int ){_d [key ]=append (_d [key ],value )};func (_bdb IntSlice )Get (index int )(int ,error ){if index > len (_bdb )-1{return 0,_bd .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 _bdb [index ],nil ;};func (_cf NumSlice )GetIntSlice ()[]int {_ae :=make ([]int ,len (_cf ));for _eg ,_gfe :=range _cf {_ae [_eg ]=int (_gfe );};return _ae ;};func (_fg *IntSlice )Add (v int )error {if _fg ==nil {return _bd .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");
};*_fg =append (*_fg ,v );return nil ;};func NewIntSlice (i int )*IntSlice {_ef :=IntSlice (make ([]int ,i ));return &_ef };func (_bde IntSlice )Size ()int {return len (_bde )};func Min (x ,y int )int {if x < y {return x ;};return y ;};func (_gag *Stack )peek ()(interface{},bool ){_efa :=_gag .top ();
if _efa ==-1{return nil ,false ;};return _gag .Data [_efa ],true ;};type IntSlice []int ;func (_fa *Stack )top ()int {return len (_fa .Data )-1};func (_be *Stack )Len ()int {return len (_be .Data )};func NewNumSlice (i int )*NumSlice {_da :=NumSlice (make ([]float32 ,i ));
return &_da };func (_ea *Stack )Push (v interface{}){_ea .Data =append (_ea .Data ,v )};type NumSlice []float32 ;func (_gd *Stack )Peek ()(_ce interface{},_ba bool ){return _gd .peek ()};func (_ca NumSlice )GetInt (i int )(int ,error ){const _bdc ="\u0047\u0065\u0074\u0049\u006e\u0074";
if i < 0||i > len (_ca )-1{return 0,_bd .Errorf (_bdc ,"\u0069n\u0064\u0065\u0078\u003a\u0020\u0027\u0025\u0064\u0027\u0020\u006fu\u0074\u0020\u006f\u0066\u0020\u0072\u0061\u006e\u0067\u0065",i );};_eb :=_ca [i ];return int (_eb +Sign (_eb )*0.5),nil ;
};func (_gf NumSlice )Get (i int )(float32 ,error ){if i < 0||i > len (_gf )-1{return 0,_bd .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 _gf [i ],nil ;};type Stack struct{Data []interface{};Aux *Stack ;};func (_e IntsMap )Delete (key uint64 ){delete (_e ,key )};