2020-12-06 13:03:03 +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 _g "github.com/unidoc/unipdf/v3/internal/jbig2/errors";func (_da *Stack )Push (v interface{}){_da .Data =append (_da .Data ,v )};func (_ec *IntSlice )Copy ()*IntSlice {_ae :=IntSlice (make ([]int ,len (*_ec )));copy (_ae ,*_ec );return &_ae ;};func NewNumSlice (i int )*NumSlice {_dg :=NumSlice (make ([]float32 ,i ));return &_dg };func Sign (v float32 )float32 {if v >=0.0{return 1.0;};return -1.0;};func Min (x ,y int )int {if x < y {return x ;};return y ;};func (_fa IntsMap )GetSlice (key uint64 )([]int ,bool ){_fd ,_e :=_fa [key ];if !_e {return nil ,false ;};return _fd ,true ;};func (_aeb IntSlice )Size ()int {return len (_aeb )};func Max (x ,y int )int {if x > y {return x ;};return y ;};func Ceil (numerator ,denominator int )int {if numerator %denominator ==0{return numerator /denominator ;};return (numerator /denominator )+1;};func (_ceg *Stack )peek ()(interface{},bool ){_ffg :=_ceg .top ();if _ffg ==-1{return nil ,false ;};return _ceg .Data [_ffg ],true ;};func (_dd NumSlice )Get (i int )(float32 ,error ){if i < 0||i > len (_dd )-1{return 0,_g .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 _dd [i ],nil ;};func (_c IntsMap )Add (key uint64 ,value int ){_c [key ]=append (_c [key ],value )};func Abs (v int )int {if v > 0{return v ;};return -v ;};func (_ca *NumSlice )Add (v float32 ){*_ca =append (*_ca ,v )};func (_a *IntSlice )Add (v int )error {if _a ==nil {return _g .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 (_aab NumSlice )GetIntSlice ()[]int {_dfd :=make ([]int ,len (_aab ));for _ff ,_ab :=range _aab {_dfd [_ff ]=int (_ab );};return _dfd ;};func NewIntSlice (i int )*IntSlice {_ea :=IntSlice (make ([]int ,i ));return &_ea };func (_efc *Stack )Len ()int {return len (_efc .Data )};func (_dfc *Stack )Pop ()(_fc interface{},_efd bool ){_fc ,_efd =_dfc .peek ();if !_efd {return nil ,_efd ;};_dfc .Data =_dfc .Data [:_dfc .top ()];return _fc ,true ;};func (_ddf *Stack )Peek ()(_aec interface{},_af bool ){return _ddf .peek ()};func (_d IntsMap )Get (key uint64 )(int ,bool ){_b ,_ce :=_d [key ];if !_ce {return 0,false ;};if len (_b )==0{return 0,false ;};return _b [0],true ;};func (_efde *Stack )top ()int {return len (_efde .Data )-1};func (_be *NumSlice )AddInt (v int ){*_be =append (*_be ,float32 (v ))};type NumSlice []float32 ;type IntSlice []int ;type Stack struct{Data []interface{};Aux *Stack ;};func (_ef IntSlice )Get (index int )(int ,error ){if index > len (_ef )-1{return 0,_g .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 _ef [index ],nil ;};func (_cc IntsMap )Delete (key uint64 ){delete (_cc ,key )};type IntsMap map[uint64 ][]int ;func (_df NumSlice )GetInt (i int )(int ,error ){const _dfe ="\u0047\u0065\u0074\u0049\u006e\u0074";if i < 0||i > len (_df )-1{return 0,_g .Errorf (_dfe ,"\u0069n\u0064\u0065\u0078\u003a\u0020\u0027\u0025\u0064\u0027\u0020\u006fu\u0074\u0020\u006f\u0066\u0020\u0072\u0061\u006e\u0067\u0065",i );};_aa :=_df [i ];return int (_aa +Sign (_aa )*0.5),nil ;};