// // 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 sampling ;import (_b "github.com/unidoc/unipdf/v3/internal/bitwise";_d "github.com/unidoc/unipdf/v3/internal/imageutil";_c "io";);func NewReader (img _d .ImageBase )*Reader {return &Reader {_ae :_b .NewReader (img .Data ),_e :img ,_ad :img .ColorComponents ,_fc :img .BytesPerLine *8!=img .ColorComponents *img .BitsPerComponent *img .Width }; };func ResampleUint32 (data []uint32 ,bitsPerInputSample int ,bitsPerOutputSample int )[]uint32 {var _ecf []uint32 ;_ff :=bitsPerOutputSample ;var _fe uint32 ;var _ce uint32 ;_dgc :=0;_gdd :=0;_fac :=0;for _fac < len (data ){if _dgc > 0{_dgcd :=_dgc ;if _ff < _dgcd {_dgcd =_ff ; };_fe =(_fe <>uint (bitsPerInputSample -_dgcd ));_dgc -=_dgcd ;if _dgc > 0{_ce =_ce <>uint (_dgc ));if _ea < bitsPerInputSample {_ce =_dd <=bitsPerOutputSample {_bf :=_dgc ;if _ff < _bf {_bf =_ff ;};_fe =(_fe <>uint (bitsPerInputSample -_bf ));_dgc -=_bf ;if _dgc > 0{_ce =_ce < 0&&_ff < bitsPerOutputSample {_fe <<=uint (_ff );_ecf =append (_ecf ,_fe );};return _ecf ;};func ResampleBytes (data []byte ,bitsPerSample int )[]uint32 {var _dff []uint32 ;_bc :=bitsPerSample ;var _de uint32 ; var _ec byte ;_acc :=0;_dc :=0;_fg :=0;for _fg < len (data ){if _acc > 0{_dg :=_acc ;if _bc < _dg {_dg =_bc ;};_de =(_de <>uint (8-_dg ));_acc -=_dg ;if _acc > 0{_ec =_ec <>uint (_acc ));if _ace < 8{_ec =_fgf <=bitsPerSample {_fa :=_acc ;if _bc < _fa {_fa =_bc ;};_de =(_de <>uint (8-_fa ));_acc -=_fa ;if _acc > 0{_ec =_ec <