2020-08-31 21:12:07 +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 _a "github.com/unidoc/unipdf/v3/internal/jbig2/errors";func (_ab IntsMap )Delete (key uint64 ){delete (_ab ,key )};func (_fd *Stack )Peek ()(_ce interface{},_dc bool ){return _fd .peek ()};func Abs (v int )int {if v > 0{return v ;};return -v ;};type IntsMap map[uint64 ][]int ;func NewIntSlice (i int )*IntSlice {_ef :=IntSlice (make ([]int ,i ));return &_ef };func (_ea *IntSlice )Copy ()*IntSlice {_ee :=IntSlice (make ([]int ,len (*_ea )));copy (_ee ,*_ea );return &_ee ;};func (_gf *IntSlice )Add (v int )error {if _gf ==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");};*_gf =append (*_gf ,v );return nil ;};func (_db IntSlice )Get (index int )(int ,error ){if index > len (_db )-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 _db [index ],nil ;};type Stack struct{Data []interface{};Aux *Stack ;};func Sign (v float32 )float32 {if v >=0.0{return 1.0;};return -1.0;};func Max (x ,y int )int {if x > y {return x ;};return y ;};func (_gffg *Stack )top ()int {return len (_gffg .Data )-1};func (_d IntsMap )Get (key uint64 )(int ,bool ){_fg ,_dd :=_d [key ];if !_dd {return 0,false ;};if len (_fg )==0{return 0,false ;};return _fg [0],true ;};func (_g IntsMap )GetSlice (key uint64 )([]int ,bool ){_de ,_e :=_g [key ];if !_e {return nil ,false ;};return _de ,true ;};func (_dde *Stack )Pop ()(_bca interface{},_df bool ){_bca ,_df =_dde .peek ();if !_df {return nil ,_df ;};_dde .Data =_dde .Data [:_dde .top ()];return _bca ,true ;};func (_cg *NumSlice )AddInt (v int ){*_cg =append (*_cg ,float32 (v ))};func (_dg *Stack )peek ()(interface{},bool ){_aeg :=_dg .top ();if _aeg ==-1{return nil ,false ;};return _dg .Data [_aeg ],true ;};func (_f IntsMap )Add (key uint64 ,value int ){_f [key ]=append (_f [key ],value )};func (_ad NumSlice )GetIntSlice ()[]int {_bg :=make ([]int ,len (_ad ));for _fgd ,_da :=range _ad {_bg [_fgd ]=int (_da );};return _bg ;};func (_cc *Stack )Len ()int {return len (_cc .Data )};type NumSlice []float32 ;func Min (x ,y int )int {if x < y {return x ;};return y ;};func (_gff NumSlice )GetInt (i int )(int ,error ){const _fb ="\u0047\u0065\u0074\u0049\u006e\u0074";if i < 0||i > len (_gff )-1{return 0,_a .Errorf (_fb ,"\u0069n\u0064\u0065\u0078\u003a\u0020\u0027\u0025\u0064\u0027\u0020\u006fu\u0074\u0020\u006f\u0066\u0020\u0072\u0061\u006e\u0067\u0065",i );};_ga :=_gff [i ];return int (_ga +Sign (_ga )*0.5),nil ;};func (_bc *NumSlice )Add (v float32 ){*_bc =append (*_bc ,v )};func (_ff IntSlice )Size ()int {return len (_ff )};func Ceil (numerator ,denominator int )int {if numerator %denominator ==0{return numerator /denominator ;};return (numerator /denominator )+1;};func (_gc NumSlice )Get (i int )(float32 ,error ){if i < 0||i > len (_gc )-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 _gc [i ],nil ;};func (_ae *Stack )Push (v interface{}){_ae .Data =append (_ae .Data ,v )};type IntSlice []int ;func NewNumSlice (i int )*NumSlice {_b :=NumSlice (make ([]float32 ,i ));return &_b };