22 lines
3.8 KiB
Go
Raw Normal View History

2020-08-27 21:45:09 +00:00
//
// 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/
2023-05-29 17:26:33 +00:00
package basic ;import _f "github.com/unidoc/unipdf/v3/internal/jbig2/errors";func (_cf IntsMap )Add (key uint64 ,value int ){_cf [key ]=append (_cf [key ],value )};func Max (x ,y int )int {if x > y {return x ;};return y ;};func (_cb IntsMap )Get (key uint64 )(int ,bool ){_fc ,_cd :=_cb [key ];
if !_cd {return 0,false ;};if len (_fc )==0{return 0,false ;};return _fc [0],true ;};func Ceil (numerator ,denominator int )int {if numerator %denominator ==0{return numerator /denominator ;};return (numerator /denominator )+1;};type IntSlice []int ;func (_df NumSlice )Get (i int )(float32 ,error ){if i < 0||i > len (_df )-1{return 0,_f .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 _df [i ],nil ;};type IntsMap map[uint64 ][]int ;func Sign (v float32 )float32 {if v >=0.0{return 1.0;};return -1.0;};func NewIntSlice (i int )*IntSlice {_ec :=IntSlice (make ([]int ,i ));return &_ec };func (_ea *IntSlice )Add (v int )error {if _ea ==nil {return _f .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");
};*_ea =append (*_ea ,v );return nil ;};func (_fgf *Stack )peek ()(interface{},bool ){_ead :=_fgf .top ();if _ead ==-1{return nil ,false ;};return _fgf .Data [_ead ],true ;};func (_fe IntSlice )Get (index int )(int ,error ){if index > len (_fe )-1{return 0,_f .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 _fe [index ],nil ;};func (_aa IntsMap )Delete (key uint64 ){delete (_aa ,key )};func (_ecc IntSlice )Size ()int {return len (_ecc )};type Stack struct{Data []interface{};Aux *Stack ;};func Abs (v int )int {if v > 0{return v ;};return -v ;};type NumSlice []float32 ;
func (_fd *Stack )Push (v interface{}){_fd .Data =append (_fd .Data ,v )};func NewNumSlice (i int )*NumSlice {_b :=NumSlice (make ([]float32 ,i ));return &_b };func (_gg *Stack )Peek ()(_be interface{},_eea bool ){return _gg .peek ()};func (_ed *NumSlice )AddInt (v int ){*_ed =append (*_ed ,float32 (v ))};
func (_eaa NumSlice )GetInt (i int )(int ,error ){const _de ="\u0047\u0065\u0074\u0049\u006e\u0074";if i < 0||i > len (_eaa )-1{return 0,_f .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 );
};_cdb :=_eaa [i ];return int (_cdb +Sign (_cdb )*0.5),nil ;};func (_ad *Stack )Pop ()(_eag interface{},_db bool ){_eag ,_db =_ad .peek ();if !_db {return nil ,_db ;};_ad .Data =_ad .Data [:_ad .top ()];return _eag ,true ;};func (_gf *Stack )top ()int {return len (_gf .Data )-1};
func Min (x ,y int )int {if x < y {return x ;};return y ;};func (_fg *IntSlice )Copy ()*IntSlice {_d :=IntSlice (make ([]int ,len (*_fg )));copy (_d ,*_fg );return &_d ;};func (_fec NumSlice )GetIntSlice ()[]int {_edf :=make ([]int ,len (_fec ));for _g ,_ee :=range _fec {_edf [_g ]=int (_ee );
};return _edf ;};func (_cg IntsMap )GetSlice (key uint64 )([]int ,bool ){_e ,_a :=_cg [key ];if !_a {return nil ,false ;};return _e ,true ;};func (_fca *Stack )Len ()int {return len (_fca .Data )};func (_bf *NumSlice )Add (v float32 ){*_bf =append (*_bf ,v )};