2021-03-23 23:12:52 +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 _f "github.com/unidoc/unipdf/v3/internal/jbig2/errors";func Ceil (numerator ,denominator int )int {if numerator %denominator ==0{return numerator /denominator ;};return (numerator /denominator )+1;};func (_g IntsMap )Add (key uint64 ,value int ){_g [key ]=append (_g [key ],value )};
func (_ffc *Stack )Push (v interface{}){_ffc .Data =append (_ffc .Data ,v )};func Abs (v int )int {if v > 0{return v ;};return -v ;};type IntSlice []int ;func (_gd *NumSlice )AddInt (v int ){*_gd =append (*_gd ,float32 (v ))};func (_ga *Stack )Pop ()(_ge interface{},_fd bool ){_ge ,_fd =_ga .peek ();
if !_fd {return nil ,_fd ;};_ga .Data =_ga .Data [:_ga .top ()];return _ge ,true ;};func (_add *Stack )Peek ()(_bb interface{},_eaa bool ){return _add .peek ()};func (_df NumSlice )GetInt (i int )(int ,error ){const _eg ="\u0047\u0065\u0074\u0049\u006e\u0074";
if i < 0||i > len (_df )-1{return 0,_f .Errorf (_eg ,"\u0069n\u0064\u0065\u0078\u003a\u0020\u0027\u0025\u0064\u0027\u0020\u006fu\u0074\u0020\u006f\u0066\u0020\u0072\u0061\u006e\u0067\u0065",i );};_bf :=_df [i ];return int (_bf +Sign (_bf )*0.5),nil ;};
func Min (x ,y int )int {if x < y {return x ;};return y ;};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 (_c IntsMap )Get (key uint64 )(int ,bool ){_cf ,_e :=_c [key ];if !_e {return 0,false ;};if len (_cf )==0{return 0,false ;};return _cf [0],true ;};func Max (x ,y int )int {if x > y {return x ;};return y ;};type Stack struct{Data []interface{};
Aux *Stack ;};func NewNumSlice (i int )*NumSlice {_aa :=NumSlice (make ([]float32 ,i ));return &_aa };type NumSlice []float32 ;func (_bc *IntSlice )Copy ()*IntSlice {_ad :=IntSlice (make ([]int ,len (*_bc )));copy (_ad ,*_bc );return &_ad ;};func (_bd *NumSlice )Add (v float32 ){*_bd =append (*_bd ,v )};
func (_af IntSlice )Size ()int {return len (_af )};func NewIntSlice (i int )*IntSlice {_ag :=IntSlice (make ([]int ,i ));return &_ag };func (_eaf NumSlice )GetIntSlice ()[]int {_dd :=make ([]int ,len (_eaf ));for _gf ,_bfd :=range _eaf {_dd [_gf ]=int (_bfd );
};return _dd ;};func (_ce *Stack )peek ()(interface{},bool ){_afc :=_ce .top ();if _afc ==-1{return nil ,false ;};return _ce .Data [_afc ],true ;};func Sign (v float32 )float32 {if v >=0.0{return 1.0;};return -1.0;};func (_d IntSlice )Get (index int )(int ,error ){if index > len (_d )-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 _d [index ],nil ;};func (_ae NumSlice )Get (i int )(float32 ,error ){if i < 0||i > len (_ae )-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 _ae [i ],nil ;};func (_ef *Stack )Len ()int {return len (_ef .Data )};type IntsMap map[uint64 ][]int ;func (_gc *Stack )top ()int {return len (_gc .Data )-1};func (_cfe IntsMap )Delete (key uint64 ){delete (_cfe ,key )};func (_a IntsMap )GetSlice (key uint64 )([]int ,bool ){_ff ,_eb :=_a [key ];
if !_eb {return nil ,false ;};return _ff ,true ;};