From e17a425dfb3382310fb5863f516dacdca9f44956 Mon Sep 17 00:00:00 2001 From: leshe4ka46 Date: Sun, 19 Oct 2025 14:47:59 +0300 Subject: fuck the unipdf licencing --- unipdf/internal/jbig2/basic/basic.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 unipdf/internal/jbig2/basic/basic.go (limited to 'unipdf/internal/jbig2/basic') diff --git a/unipdf/internal/jbig2/basic/basic.go b/unipdf/internal/jbig2/basic/basic.go new file mode 100644 index 0000000..65d849b --- /dev/null +++ b/unipdf/internal/jbig2/basic/basic.go @@ -0,0 +1,23 @@ +// +// 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/v4/internal/jbig2/errors";func (_dg *IntSlice )Copy ()*IntSlice {_ag :=IntSlice (make ([]int ,len (*_dg )));copy (_ag ,*_dg );return &_ag ;};func NewIntSlice (i int )*IntSlice {_ae :=IntSlice (make ([]int ,i )); +return &_ae };func (_e IntsMap )Add (key uint64 ,value int ){_e [key ]=append (_e [key ],value )};func (_f IntsMap )Get (key uint64 )(int ,bool ){_ec ,_gf :=_f [key ];if !_gf {return 0,false ;};if len (_ec )==0{return 0,false ;};return _ec [0],true ;}; +func (_cg *Stack )top ()int {return len (_cg .Data )-1};func (_aa *IntSlice )Add (v int )error {if _aa ==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"); +};*_aa =append (*_aa ,v );return nil ;};func (_ggd *NumSlice )AddInt (v int ){*_ggd =append (*_ggd ,float32 (v ))};type NumSlice []float32 ;type Stack struct{Data []interface{};Aux *Stack ;};func (_fc *Stack )Push (v interface{}){_fc .Data =append (_fc .Data ,v )}; +func NewNumSlice (i int )*NumSlice {_ga :=NumSlice (make ([]float32 ,i ));return &_ga };func (_da *Stack )Len ()int {return len (_da .Data )};func (_db *NumSlice )Add (v float32 ){*_db =append (*_db ,v )};type IntsMap map[uint64 ][]int ;type IntSlice []int ; +func (_d IntsMap )Delete (key uint64 ){delete (_d ,key )};func Ceil (numerator ,denominator int )int {if numerator %denominator ==0{return numerator /denominator ;};return (numerator /denominator )+1;};func (_gg IntSlice )Get (index int )(int ,error ){if index > len (_gg )-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 _gg [index ],nil ;};func (_cfc *Stack )Peek ()(_afe interface{},_de bool ){return _cfc .peek ()};func (_eg *Stack )Pop ()(_ded interface{},_ge bool ){_ded ,_ge =_eg .peek ();if !_ge {return nil ,_ge ;};_eg .Data =_eg .Data [:_eg .top ()];return _ded ,true ; +};func (_c IntsMap )GetSlice (key uint64 )([]int ,bool ){_fb ,_gc :=_c [key ];if !_gc {return nil ,false ;};return _fb ,true ;};func Min (x ,y int )int {if x < y {return x ;};return y ;};func (_af NumSlice )GetInt (i int )(int ,error ){const _ca ="\u0047\u0065\u0074\u0049\u006e\u0074"; +if i < 0||i > len (_af )-1{return 0,_g .Errorf (_ca ,"\u0069n\u0064\u0065\u0078\u003a\u0020\u0027\u0025\u0064\u0027\u0020\u006fu\u0074\u0020\u006f\u0066\u0020\u0072\u0061\u006e\u0067\u0065",i );};_fe :=_af [i ];return int (_fe +Sign (_fe )*0.5),nil ;}; +func Max (x ,y int )int {if x > y {return x ;};return y ;};func Abs (v int )int {if v > 0{return v ;};return -v ;};func (_aef NumSlice )GetIntSlice ()[]int {_cb :=make ([]int ,len (_aef ));for _ed ,_cf :=range _aef {_cb [_ed ]=int (_cf );};return _cb ; +};func (_df *Stack )peek ()(interface{},bool ){_ea :=_df .top ();if _ea ==-1{return nil ,false ;};return _df .Data [_ea ],true ;};func Sign (v float32 )float32 {if v >=0.0{return 1.0;};return -1.0;};func (_gb IntSlice )Size ()int {return len (_gb )};func (_ecg NumSlice )Get (i int )(float32 ,error ){if i < 0||i > len (_ecg )-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 _ecg [i ],nil ;}; \ No newline at end of file -- cgit v1.2.3