functions.h 506 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819
  1. /**
  2. This file was auto-generated by mupdfwrap.py.
  3. */
  4. #ifndef MUPDF_FUNCTIONS_H
  5. #define MUPDF_FUNCTIONS_H
  6. #include "mupdf/extra.h"
  7. #include "mupdf/fitz.h"
  8. #include "mupdf/pdf.h"
  9. #include <iostream>
  10. #include <string>
  11. #include <vector>
  12. namespace mupdf
  13. {
  14. /*
  15. The keys that are defined for fz_lookup_metadata().
  16. */
  17. FZ_DATA extern const std::vector<std::string> metadata_keys;
  18. /** Low-level wrapper for `::fz_aa_level()`. */
  19. /**
  20. Get the number of bits of antialiasing we are
  21. using (for graphics). Between 0 and 8.
  22. */
  23. FZ_FUNCTION int ll_fz_aa_level();
  24. /** Low-level wrapper for `::fz_abs()`. */
  25. /**
  26. Some standard math functions, done as static inlines for speed.
  27. People with compilers that do not adequately implement inline
  28. may like to reimplement these using macros.
  29. */
  30. FZ_FUNCTION float ll_fz_abs(float f);
  31. /** Low-level wrapper for `::fz_absi()`. */
  32. FZ_FUNCTION int ll_fz_absi(int i);
  33. /** Low-level wrapper for `::fz_add_layout_char()`. */
  34. /**
  35. Add a new char to the line at the end of the layout block.
  36. */
  37. FZ_FUNCTION void ll_fz_add_layout_char(::fz_layout_block *block, float x, float w, const char *p);
  38. /** Low-level wrapper for `::fz_add_layout_line()`. */
  39. /**
  40. Add a new line to the end of the layout block.
  41. */
  42. FZ_FUNCTION void ll_fz_add_layout_line(::fz_layout_block *block, float x, float y, float h, const char *p);
  43. /** Low-level wrapper for `::fz_add_separation()`. */
  44. /**
  45. Add a separation (null terminated name, colorspace)
  46. */
  47. FZ_FUNCTION void ll_fz_add_separation(::fz_separations *sep, const char *name, ::fz_colorspace *cs, int cs_channel);
  48. /** Low-level wrapper for `::fz_add_separation_equivalents()`. */
  49. /**
  50. Add a separation with equivalents (null terminated name,
  51. colorspace)
  52. (old, deprecated)
  53. */
  54. FZ_FUNCTION void ll_fz_add_separation_equivalents(::fz_separations *sep, uint32_t rgba, uint32_t cmyk, const char *name);
  55. /** Low-level wrapper for `::fz_adjust_rect_for_stroke()`. */
  56. /**
  57. Given a rectangle (assumed to be the bounding box for a path),
  58. expand it to allow for the expansion of the bbox that would be
  59. seen by stroking the path with the given stroke state and
  60. transform.
  61. */
  62. FZ_FUNCTION ::fz_rect ll_fz_adjust_rect_for_stroke(::fz_rect rect, const ::fz_stroke_state *stroke, ::fz_matrix ctm);
  63. /** Low-level wrapper for `::fz_advance_glyph()`. */
  64. /**
  65. Return the advance for a given glyph.
  66. font: The font to look for the glyph in.
  67. glyph: The glyph to find the advance for.
  68. wmode: 1 for vertical mode, 0 for horizontal.
  69. Returns the advance for the glyph.
  70. */
  71. FZ_FUNCTION float ll_fz_advance_glyph(::fz_font *font, int glyph, int wmode);
  72. /** Low-level wrapper for `::fz_aes_crypt_cbc()`. */
  73. /**
  74. AES block processing. Encrypts or Decrypts (according to mode,
  75. which must match what was initially set up) length bytes (which
  76. must be a multiple of 16), using (and modifying) the insertion
  77. vector iv, reading from input, and writing to output.
  78. Never throws an exception.
  79. */
  80. FZ_FUNCTION void ll_fz_aes_crypt_cbc(::fz_aes *ctx, int mode, size_t length, unsigned char iv[16], const unsigned char *input, unsigned char *output);
  81. /** Low-level wrapper for `::fz_aes_setkey_dec()`. */
  82. /**
  83. AES decryption initialization. Fills in the supplied context
  84. and prepares for decryption using the given key.
  85. Returns non-zero for error (key size other than 128/192/256).
  86. Never throws an exception.
  87. */
  88. FZ_FUNCTION int ll_fz_aes_setkey_dec(::fz_aes *ctx, const unsigned char *key, int keysize);
  89. /** Low-level wrapper for `::fz_aes_setkey_enc()`. */
  90. /**
  91. AES encryption initialization. Fills in the supplied context
  92. and prepares for encryption using the given key.
  93. Returns non-zero for error (key size other than 128/192/256).
  94. Never throws an exception.
  95. */
  96. FZ_FUNCTION int ll_fz_aes_setkey_enc(::fz_aes *ctx, const unsigned char *key, int keysize);
  97. /** Low-level wrapper for `::fz_alpha_from_gray()`. */
  98. FZ_FUNCTION ::fz_pixmap *ll_fz_alpha_from_gray(::fz_pixmap *gray);
  99. /** Low-level wrapper for `::fz_append_base64()`. */
  100. /**
  101. Write a base64 encoded data block, optionally with periodic newlines.
  102. */
  103. FZ_FUNCTION void ll_fz_append_base64(::fz_buffer *out, const unsigned char *data, size_t size, int newline);
  104. /** Low-level wrapper for `::fz_append_base64_buffer()`. */
  105. /**
  106. Append a base64 encoded fz_buffer, optionally with periodic newlines.
  107. */
  108. FZ_FUNCTION void ll_fz_append_base64_buffer(::fz_buffer *out, ::fz_buffer *data, int newline);
  109. /** Low-level wrapper for `::fz_append_bits()`. */
  110. FZ_FUNCTION void ll_fz_append_bits(::fz_buffer *buf, int value, int count);
  111. /** Low-level wrapper for `::fz_append_bits_pad()`. */
  112. FZ_FUNCTION void ll_fz_append_bits_pad(::fz_buffer *buf);
  113. /** Low-level wrapper for `::fz_append_buffer()`. */
  114. /**
  115. Append the contents of the source buffer onto the end of the
  116. destination buffer, extending automatically as required.
  117. Ownership of buffers does not change.
  118. */
  119. FZ_FUNCTION void ll_fz_append_buffer(::fz_buffer *destination, ::fz_buffer *source);
  120. /** Low-level wrapper for `::fz_append_byte()`. */
  121. FZ_FUNCTION void ll_fz_append_byte(::fz_buffer *buf, int c);
  122. /** Low-level wrapper for `::fz_append_data()`. */
  123. /**
  124. fz_append_*: Append data to a buffer.
  125. The buffer will automatically grow as required.
  126. */
  127. FZ_FUNCTION void ll_fz_append_data(::fz_buffer *buf, const void *data, size_t len);
  128. /** Low-level wrapper for `::fz_append_image_as_data_uri()`. */
  129. FZ_FUNCTION void ll_fz_append_image_as_data_uri(::fz_buffer *out, ::fz_image *image);
  130. /** Low-level wrapper for `::fz_append_int16_be()`. */
  131. FZ_FUNCTION void ll_fz_append_int16_be(::fz_buffer *buf, int x);
  132. /** Low-level wrapper for `::fz_append_int16_le()`. */
  133. FZ_FUNCTION void ll_fz_append_int16_le(::fz_buffer *buf, int x);
  134. /** Low-level wrapper for `::fz_append_int32_be()`. */
  135. FZ_FUNCTION void ll_fz_append_int32_be(::fz_buffer *buf, int x);
  136. /** Low-level wrapper for `::fz_append_int32_le()`. */
  137. FZ_FUNCTION void ll_fz_append_int32_le(::fz_buffer *buf, int x);
  138. /** Low-level wrapper for `::fz_append_json()`. */
  139. FZ_FUNCTION void ll_fz_append_json(::fz_buffer *buf, ::fz_json *value);
  140. /** Low-level wrapper for `::fz_append_pdf_string()`. */
  141. /**
  142. fz_append_pdf_string: Append a string with PDF syntax quotes and
  143. escapes.
  144. The buffer will automatically grow as required.
  145. */
  146. FZ_FUNCTION void ll_fz_append_pdf_string(::fz_buffer *buffer, const char *text);
  147. /** Low-level wrapper for `::fz_append_pixmap_as_data_uri()`. */
  148. FZ_FUNCTION void ll_fz_append_pixmap_as_data_uri(::fz_buffer *out, ::fz_pixmap *pixmap);
  149. /** Low-level wrapper for `::fz_append_rune()`. */
  150. FZ_FUNCTION void ll_fz_append_rune(::fz_buffer *buf, int c);
  151. /** Low-level wrapper for `::fz_append_string()`. */
  152. FZ_FUNCTION void ll_fz_append_string(::fz_buffer *buf, const char *data);
  153. /** Low-level wrapper for `::fz_append_vprintf()`. */
  154. /**
  155. fz_append_vprintf: Format and append data to buffer using
  156. printf-like formatting with varargs (see fz_vsnprintf).
  157. */
  158. FZ_FUNCTION void ll_fz_append_vprintf(::fz_buffer *buffer, const char *fmt, va_list args);
  159. /** Low-level wrapper for `::fz_arc4_encrypt()`. */
  160. /**
  161. RC4 block encrypt operation; encrypt src into dst (both of
  162. length len) updating the RC4 state as we go.
  163. Never throws an exception.
  164. */
  165. FZ_FUNCTION void ll_fz_arc4_encrypt(::fz_arc4 *state, unsigned char *dest, const unsigned char *src, size_t len);
  166. /** Low-level wrapper for `::fz_arc4_final()`. */
  167. /**
  168. RC4 finalization. Zero the context.
  169. Never throws an exception.
  170. */
  171. FZ_FUNCTION void ll_fz_arc4_final(::fz_arc4 *state);
  172. /** Low-level wrapper for `::fz_arc4_init()`. */
  173. /**
  174. RC4 initialization. Begins an RC4 operation, writing a new
  175. context.
  176. Never throws an exception.
  177. */
  178. FZ_FUNCTION void ll_fz_arc4_init(::fz_arc4 *state, const unsigned char *key, size_t len);
  179. /** Low-level wrapper for `::fz_archive_format()`. */
  180. /**
  181. Return a pointer to a string describing the format of the
  182. archive.
  183. The lifetime of the string is unspecified (in current
  184. implementations the string will persist until the archive
  185. is closed, but this is not guaranteed).
  186. */
  187. FZ_FUNCTION const char *ll_fz_archive_format(::fz_archive *arch);
  188. /** Low-level wrapper for `::fz_atof()`. */
  189. /**
  190. Range checking atof
  191. */
  192. FZ_FUNCTION float ll_fz_atof(const char *s);
  193. /** Low-level wrapper for `::fz_atoi()`. */
  194. /**
  195. atoi that copes with NULL
  196. */
  197. FZ_FUNCTION int ll_fz_atoi(const char *s);
  198. /** Low-level wrapper for `::fz_atoi64()`. */
  199. /**
  200. 64bit atoi that copes with NULL
  201. */
  202. FZ_FUNCTION int64_t ll_fz_atoi64(const char *s);
  203. /** Low-level wrapper for `::fz_atoz()`. */
  204. /**
  205. size_t atoi that copes with NULL.
  206. NOTE: limited to 63bits. Negative numbers
  207. are returned as 0.
  208. */
  209. FZ_FUNCTION size_t ll_fz_atoz(const char *s);
  210. /** Low-level wrapper for `::fz_authenticate_password()`. */
  211. /**
  212. Test if the given password can decrypt the document.
  213. password: The password string to be checked. Some document
  214. specifications do not specify any particular text encoding, so
  215. neither do we.
  216. Returns 0 for failure to authenticate, non-zero for success.
  217. For PDF documents, further information can be given by examining
  218. the bits in the return code.
  219. Bit 0 => No password required
  220. Bit 1 => User password authenticated
  221. Bit 2 => Owner password authenticated
  222. */
  223. FZ_FUNCTION int ll_fz_authenticate_password(::fz_document *doc, const char *password);
  224. /** Low-level wrapper for `::fz_autowarp_pixmap()`. */
  225. FZ_FUNCTION ::fz_pixmap *ll_fz_autowarp_pixmap(::fz_pixmap *src, ::fz_quad points);
  226. /** Low-level wrapper for `::fz_available()`. */
  227. /**
  228. Ask how many bytes are available immediately from
  229. a given stream.
  230. stm: The stream to read from.
  231. max: A hint for the underlying stream; the maximum number of
  232. bytes that we are sure we will want to read. If you do not know
  233. this number, give 1.
  234. Returns the number of bytes immediately available between the
  235. read and write pointers. This number is guaranteed only to be 0
  236. if we have hit EOF. The number of bytes returned here need have
  237. no relation to max (could be larger, could be smaller).
  238. */
  239. FZ_FUNCTION size_t ll_fz_available(::fz_stream *stm, size_t max);
  240. /** Low-level wrapper for `::fz_barcode_type_from_string()`. */
  241. /**
  242. Helper function to search the above list (case insensitively)
  243. for an exact match. Returns FZ_BARCODE_NONE if no match found.
  244. */
  245. FZ_FUNCTION ::fz_barcode_type ll_fz_barcode_type_from_string(const char *str);
  246. /** Low-level wrapper for `::fz_base_colorspace()`. */
  247. /**
  248. Get the 'base' colorspace for a colorspace.
  249. For indexed colorspaces, this is the colorspace the index
  250. decodes into. For all other colorspaces, it is the colorspace
  251. itself.
  252. The returned colorspace is 'borrowed' (i.e. no additional
  253. references are taken or dropped).
  254. */
  255. FZ_FUNCTION ::fz_colorspace *ll_fz_base_colorspace(::fz_colorspace *cs);
  256. /** Low-level wrapper for `::fz_basename()`. */
  257. /**
  258. Find the filename component in a path.
  259. */
  260. FZ_FUNCTION const char *ll_fz_basename(const char *path);
  261. /** Low-level wrapper for `::fz_begin_group()`. */
  262. FZ_FUNCTION void ll_fz_begin_group(::fz_device *dev, ::fz_rect area, ::fz_colorspace *cs, int isolated, int knockout, int blendmode, float alpha);
  263. /** Low-level wrapper for `::fz_begin_layer()`. */
  264. FZ_FUNCTION void ll_fz_begin_layer(::fz_device *dev, const char *layer_name);
  265. /** Low-level wrapper for `::fz_begin_mask()`. */
  266. FZ_FUNCTION void ll_fz_begin_mask(::fz_device *dev, ::fz_rect area, int luminosity, ::fz_colorspace *colorspace, const float *bc, ::fz_color_params color_params);
  267. /** Low-level wrapper for `::fz_begin_metatext()`. */
  268. FZ_FUNCTION void ll_fz_begin_metatext(::fz_device *dev, ::fz_metatext meta, const char *text);
  269. /** Low-level wrapper for `::fz_begin_page()`. */
  270. /**
  271. Called to start the process of writing a page to
  272. a document.
  273. mediabox: page size rectangle in points.
  274. Returns a borrowed fz_device to write page contents to. This
  275. should be kept if required, and only dropped if it was kept.
  276. */
  277. FZ_FUNCTION ::fz_device *ll_fz_begin_page(::fz_document_writer *wri, ::fz_rect mediabox);
  278. /** Low-level wrapper for `::fz_begin_structure()`. */
  279. FZ_FUNCTION void ll_fz_begin_structure(::fz_device *dev, ::fz_structure standard, const char *raw, int idx);
  280. /** Low-level wrapper for `::fz_begin_tile()`. */
  281. FZ_FUNCTION void ll_fz_begin_tile(::fz_device *dev, ::fz_rect area, ::fz_rect view, float xstep, float ystep, ::fz_matrix ctm);
  282. /** Low-level wrapper for `::fz_begin_tile_id()`. */
  283. FZ_FUNCTION int ll_fz_begin_tile_id(::fz_device *dev, ::fz_rect area, ::fz_rect view, float xstep, float ystep, ::fz_matrix ctm, int id);
  284. /** Low-level wrapper for `::fz_begin_tile_tid()`. */
  285. FZ_FUNCTION int ll_fz_begin_tile_tid(::fz_device *dev, ::fz_rect area, ::fz_rect view, float xstep, float ystep, ::fz_matrix ctm, int id, int doc_id);
  286. /** Low-level wrapper for `::fz_bidi_fragment_text()`.
  287. This function has out-params. Python/C# wrappers look like:
  288. `ll_fz_bidi_fragment_text(const uint32_t *text, size_t textlen, ::fz_bidi_fragment_fn *callback, void *arg, int flags)` => ::fz_bidi_direction baseDir
  289. */
  290. /**
  291. Partitions the given Unicode sequence into one or more
  292. unidirectional fragments and invokes the given callback
  293. function for each fragment.
  294. For example, if directionality of text is:
  295. 0123456789
  296. rrlllrrrrr,
  297. we'll invoke callback with:
  298. &text[0], length == 2
  299. &text[2], length == 3
  300. &text[5], length == 5
  301. @param[in] text start of Unicode sequence
  302. @param[in] textlen number of Unicodes to analyse
  303. @param[in] baseDir direction of paragraph (specify FZ_BIDI_NEUTRAL to force auto-detection)
  304. @param[in] callback function to be called for each fragment
  305. @param[in] arg data to be passed to the callback function
  306. @param[in] flags flags to control operation (see fz_bidi_flags above)
  307. */
  308. FZ_FUNCTION void ll_fz_bidi_fragment_text(const uint32_t *text, size_t textlen, ::fz_bidi_direction *baseDir, ::fz_bidi_fragment_fn *callback, void *arg, int flags);
  309. /** Low-level wrapper for `::fz_bitmap_details()`.
  310. This function has out-params. Python/C# wrappers look like:
  311. `ll_fz_bitmap_details(::fz_bitmap *bitmap)` => `(int w, int h, int n, int stride)`
  312. */
  313. /**
  314. Retrieve details of a given bitmap.
  315. bitmap: The bitmap to query.
  316. w: Pointer to storage to retrieve width (or NULL).
  317. h: Pointer to storage to retrieve height (or NULL).
  318. n: Pointer to storage to retrieve number of color components (or
  319. NULL).
  320. stride: Pointer to storage to retrieve bitmap stride (or NULL).
  321. */
  322. FZ_FUNCTION void ll_fz_bitmap_details(::fz_bitmap *bitmap, int *w, int *h, int *n, int *stride);
  323. /** Low-level wrapper for `::fz_blendmode_name()`. */
  324. /**
  325. Map from enumeration to blend mode string.
  326. The string is static, with arbitrary lifespan.
  327. */
  328. FZ_FUNCTION const char *ll_fz_blendmode_name(int blendmode);
  329. /** Low-level wrapper for `::fz_bound_display_list()`. */
  330. /**
  331. Return the bounding box of the page recorded in a display list.
  332. */
  333. FZ_FUNCTION ::fz_rect ll_fz_bound_display_list(::fz_display_list *list);
  334. /** Low-level wrapper for `::fz_bound_glyph()`. */
  335. /**
  336. Return a bbox for a given glyph in a font.
  337. font: The font to look for the glyph in.
  338. gid: The glyph to bound.
  339. trm: The matrix to apply to the glyph before bounding.
  340. Returns rectangle by value containing the bounds of the given
  341. glyph.
  342. */
  343. FZ_FUNCTION ::fz_rect ll_fz_bound_glyph(::fz_font *font, int gid, ::fz_matrix trm);
  344. /** Low-level wrapper for `::fz_bound_page()`. */
  345. /**
  346. Determine the size of a page at 72 dpi.
  347. */
  348. FZ_FUNCTION ::fz_rect ll_fz_bound_page(::fz_page *page);
  349. /** Low-level wrapper for `::fz_bound_page_box()`. */
  350. FZ_FUNCTION ::fz_rect ll_fz_bound_page_box(::fz_page *page, ::fz_box_type box);
  351. /** Low-level wrapper for `::fz_bound_path()`. */
  352. /**
  353. Return a bounding rectangle for a path.
  354. path: The path to bound.
  355. stroke: If NULL, the bounding rectangle given is for
  356. the filled path. If non-NULL the bounding rectangle
  357. given is for the path stroked with the given attributes.
  358. ctm: The matrix to apply to the path during stroking.
  359. r: Pointer to a fz_rect which will be used to hold
  360. the result.
  361. Returns r, updated to contain the bounding rectangle.
  362. */
  363. FZ_FUNCTION ::fz_rect ll_fz_bound_path(const ::fz_path *path, const ::fz_stroke_state *stroke, ::fz_matrix ctm);
  364. /** Low-level wrapper for `::fz_bound_shade()`. */
  365. /**
  366. Bound a given shading.
  367. shade: The shade to bound.
  368. ctm: The transform to apply to the shade before bounding.
  369. r: Pointer to storage to put the bounds in.
  370. Returns r, updated to contain the bounds for the shading.
  371. */
  372. FZ_FUNCTION ::fz_rect ll_fz_bound_shade(::fz_shade *shade, ::fz_matrix ctm);
  373. /** Low-level wrapper for `::fz_bound_text()`. */
  374. /**
  375. Find the bounds of a given text object.
  376. text: The text object to find the bounds of.
  377. stroke: Pointer to the stroke attributes (for stroked
  378. text), or NULL (for filled text).
  379. ctm: The matrix in use.
  380. r: pointer to storage for the bounds.
  381. Returns a pointer to r, which is updated to contain the
  382. bounding box for the text object.
  383. */
  384. FZ_FUNCTION ::fz_rect ll_fz_bound_text(const ::fz_text *text, const ::fz_stroke_state *stroke, ::fz_matrix ctm);
  385. /** Low-level wrapper for `::fz_box_type_from_string()`. */
  386. FZ_FUNCTION ::fz_box_type ll_fz_box_type_from_string(const char *name);
  387. /** Low-level wrapper for `::fz_brotli_bound()`. */
  388. /**
  389. Returns the upper bound on the
  390. size of brotli compressed data of length size.
  391. */
  392. FZ_FUNCTION size_t ll_fz_brotli_bound(size_t size);
  393. /** Low-level wrapper for `::fz_buffer_extract()`.
  394. This function has out-params. Python/C# wrappers look like:
  395. `ll_fz_buffer_extract(::fz_buffer *buf)` => `(size_t, unsigned char *data)`
  396. */
  397. /**
  398. Take ownership of buffer contents.
  399. Performs the same task as fz_buffer_storage, but ownership of
  400. the data buffer returns with this call. The buffer is left
  401. empty.
  402. Note: Bad things may happen if this is called on a buffer with
  403. multiple references that is being used from multiple threads.
  404. data: Pointer to place to retrieve data pointer.
  405. Returns length of stream.
  406. */
  407. FZ_FUNCTION size_t ll_fz_buffer_extract(::fz_buffer *buf, unsigned char **data);
  408. /** Low-level wrapper for `::fz_buffer_storage()`.
  409. This function has out-params. Python/C# wrappers look like:
  410. `ll_fz_buffer_storage(::fz_buffer *buf)` => `(size_t, unsigned char *datap)`
  411. */
  412. /**
  413. Retrieve internal memory of buffer.
  414. datap: Output parameter that will be pointed to the data.
  415. Returns the current size of the data in bytes.
  416. */
  417. FZ_FUNCTION size_t ll_fz_buffer_storage(::fz_buffer *buf, unsigned char **datap);
  418. /** Low-level wrapper for `::fz_calculate_font_ascender_descender()`. */
  419. /**
  420. Ensure that a font has its ascender/descender values calculated
  421. from the actual bbox of the glyphs.
  422. Note, that we combine the declared values from the font (or the
  423. default values if those are not present) with the actual bbox to
  424. get the final result. So this can only cause ascender/descender
  425. to move further apart!
  426. */
  427. FZ_FUNCTION void ll_fz_calculate_font_ascender_descender(::fz_font *font);
  428. /** Low-level wrapper for `::fz_calloc()`. */
  429. /**
  430. Allocate array of memory of count entries of size bytes.
  431. Clears the memory to zero.
  432. Throws exception in the event of failure to allocate.
  433. */
  434. FZ_FUNCTION void *ll_fz_calloc(size_t count, size_t size);
  435. /** Low-level wrapper for `::fz_calloc_no_throw()`. */
  436. /**
  437. fz_calloc equivalent that returns NULL rather than throwing
  438. exceptions.
  439. */
  440. FZ_FUNCTION void *ll_fz_calloc_no_throw(size_t count, size_t size);
  441. /** Low-level wrapper for `::fz_caught()`. */
  442. /**
  443. Within an fz_catch() block, retrieve the error code for
  444. the current exception.
  445. This assumes no intervening use of fz_try/fz_catch.
  446. */
  447. FZ_FUNCTION int ll_fz_caught();
  448. /** Low-level wrapper for `::fz_caught_errno()`. */
  449. FZ_FUNCTION int ll_fz_caught_errno();
  450. /** Low-level wrapper for `::fz_caught_message()`. */
  451. /**
  452. Within an fz_catch() block, retrieve the formatted message
  453. string for the current exception.
  454. This assumes no intervening use of fz_try/fz_catch.
  455. */
  456. FZ_FUNCTION const char *ll_fz_caught_message();
  457. /** Low-level wrapper for `::fz_chartorune()`.
  458. This function has out-params. Python/C# wrappers look like:
  459. `ll_fz_chartorune(const char *str)` => `(int, int rune)`
  460. */
  461. /**
  462. UTF8 decode a single rune from a sequence of chars.
  463. rune: Pointer to an int to assign the decoded 'rune' to.
  464. (0xFFFD on error).
  465. str: Pointer to a UTF8 encoded string.
  466. Returns the number of bytes consumed.
  467. */
  468. FZ_FUNCTION int ll_fz_chartorune(int *rune, const char *str);
  469. /** Low-level wrapper for `::fz_chartorunen()`.
  470. This function has out-params. Python/C# wrappers look like:
  471. `ll_fz_chartorunen(const char *str, size_t n)` => `(int, int rune)`
  472. */
  473. /**
  474. UTF8 decode a single rune from a sequence of chars
  475. of given length.
  476. rune: Pointer to an int to assign the decoded 'rune' to.
  477. (0xFFFD on error).
  478. str: Pointer to a UTF8 encoded string.
  479. n: The number of bytes available at str.
  480. Returns the number of bytes consumed.
  481. */
  482. FZ_FUNCTION int ll_fz_chartorunen(int *rune, const char *str, size_t n);
  483. /** Low-level wrapper for `::fz_clamp()`. */
  484. FZ_FUNCTION float ll_fz_clamp(float x, float min, float max);
  485. /** Low-level wrapper for `::fz_clamp64()`. */
  486. FZ_FUNCTION int64_t ll_fz_clamp64(int64_t x, int64_t min, int64_t max);
  487. /** Low-level wrapper for `::fz_clamp_color()`.
  488. This function has out-params. Python/C# wrappers look like:
  489. `ll_fz_clamp_color(::fz_colorspace *cs, const float *in)` => float out
  490. */
  491. /**
  492. Clamp the samples in a color to the correct ranges for a
  493. given colorspace.
  494. */
  495. FZ_FUNCTION void ll_fz_clamp_color(::fz_colorspace *cs, const float *in, float *out);
  496. /** Low-level wrapper for `::fz_clamp_location()`. */
  497. /**
  498. Clamps a location into valid chapter/page range. (First clamps
  499. the chapter into range, then the page into range).
  500. */
  501. FZ_FUNCTION ::fz_location ll_fz_clamp_location(::fz_document *doc, ::fz_location loc);
  502. /** Low-level wrapper for `::fz_clampd()`. */
  503. FZ_FUNCTION double ll_fz_clampd(double x, double min, double max);
  504. /** Low-level wrapper for `::fz_clampi()`. */
  505. FZ_FUNCTION int ll_fz_clampi(int x, int min, int max);
  506. /** Low-level wrapper for `::fz_clampp()`. */
  507. FZ_FUNCTION void *ll_fz_clampp(void *x, void *min, void *max);
  508. /** Low-level wrapper for `::fz_classify_stext_rect()`. */
  509. FZ_FUNCTION void ll_fz_classify_stext_rect(::fz_stext_page *page, ::fz_structure classification, ::fz_rect rect);
  510. /** Low-level wrapper for `::fz_cleanname()`. */
  511. /**
  512. rewrite path to the shortest string that names the same path.
  513. Eliminates multiple and trailing slashes, interprets "." and
  514. "..". Overwrites the string in place.
  515. */
  516. FZ_FUNCTION char *ll_fz_cleanname(char *name);
  517. /** Low-level wrapper for `::fz_cleanname_strdup()`. */
  518. /**
  519. rewrite path to the shortest string that names the same path.
  520. Eliminates multiple and trailing slashes, interprets "." and
  521. "..". Allocates a new string that the caller must free.
  522. */
  523. FZ_FUNCTION char *ll_fz_cleanname_strdup(const char *name);
  524. /** Low-level wrapper for `::fz_clear_bitmap()`. */
  525. /**
  526. Set the entire bitmap to 0.
  527. Never throws exceptions.
  528. */
  529. FZ_FUNCTION void ll_fz_clear_bitmap(::fz_bitmap *bit);
  530. /** Low-level wrapper for `::fz_clear_buffer()`. */
  531. /**
  532. Empties the buffer. Storage is not freed, but is held ready
  533. to be reused as the buffer is refilled.
  534. Never throws exceptions.
  535. */
  536. FZ_FUNCTION void ll_fz_clear_buffer(::fz_buffer *buf);
  537. /** Low-level wrapper for `::fz_clear_pixmap()`. */
  538. /**
  539. Sets all components (including alpha) of
  540. all pixels in a pixmap to 0.
  541. pix: The pixmap to clear.
  542. */
  543. FZ_FUNCTION void ll_fz_clear_pixmap(::fz_pixmap *pix);
  544. /** Low-level wrapper for `::fz_clear_pixmap_rect_with_value()`. */
  545. /**
  546. Clears a subrect of a pixmap with the given value.
  547. pix: The pixmap to clear.
  548. value: Values in the range 0 to 255 are valid. Each component
  549. sample for each pixel in the pixmap will be set to this value,
  550. while alpha will always be set to 255 (non-transparent).
  551. r: the rectangle.
  552. */
  553. FZ_FUNCTION void ll_fz_clear_pixmap_rect_with_value(::fz_pixmap *pix, int value, ::fz_irect r);
  554. /** Low-level wrapper for `::fz_clear_pixmap_with_value()`. */
  555. /**
  556. Clears a pixmap with the given value.
  557. pix: The pixmap to clear.
  558. value: Values in the range 0 to 255 are valid. Each component
  559. sample for each pixel in the pixmap will be set to this value,
  560. while alpha will always be set to 255 (non-transparent).
  561. This function is horrible, and should be removed from the
  562. API and replaced with a less magic one.
  563. */
  564. FZ_FUNCTION void ll_fz_clear_pixmap_with_value(::fz_pixmap *pix, int value);
  565. /** Low-level wrapper for `::fz_clip_image_mask()`. */
  566. FZ_FUNCTION void ll_fz_clip_image_mask(::fz_device *dev, ::fz_image *image, ::fz_matrix ctm, ::fz_rect scissor);
  567. /** Low-level wrapper for `::fz_clip_path()`. */
  568. FZ_FUNCTION void ll_fz_clip_path(::fz_device *dev, const ::fz_path *path, int even_odd, ::fz_matrix ctm, ::fz_rect scissor);
  569. /** Low-level wrapper for `::fz_clip_stroke_path()`. */
  570. FZ_FUNCTION void ll_fz_clip_stroke_path(::fz_device *dev, const ::fz_path *path, const ::fz_stroke_state *stroke, ::fz_matrix ctm, ::fz_rect scissor);
  571. /** Low-level wrapper for `::fz_clip_stroke_text()`. */
  572. FZ_FUNCTION void ll_fz_clip_stroke_text(::fz_device *dev, const ::fz_text *text, const ::fz_stroke_state *stroke, ::fz_matrix ctm, ::fz_rect scissor);
  573. /** Low-level wrapper for `::fz_clip_text()`. */
  574. FZ_FUNCTION void ll_fz_clip_text(::fz_device *dev, const ::fz_text *text, ::fz_matrix ctm, ::fz_rect scissor);
  575. /** Low-level wrapper for `::fz_clone_buffer()`. */
  576. /**
  577. Make a new buffer, containing a copy of the data used in
  578. the original.
  579. */
  580. FZ_FUNCTION ::fz_buffer *ll_fz_clone_buffer(::fz_buffer *buf);
  581. /** Low-level wrapper for `::fz_clone_context()`. */
  582. /**
  583. Make a clone of an existing context.
  584. This function is meant to be used in multi-threaded
  585. applications where each thread requires its own context, yet
  586. parts of the global state, for example caching, are shared.
  587. ctx: Context obtained from fz_new_context to make a copy of.
  588. ctx must have had locks and lock/functions setup when created.
  589. The two contexts will share the memory allocator, resource
  590. store, locks and lock/unlock functions. They will each have
  591. their own exception stacks though.
  592. May return NULL.
  593. */
  594. FZ_FUNCTION ::fz_context *ll_fz_clone_context();
  595. /** Low-level wrapper for `::fz_clone_default_colorspaces()`. */
  596. /**
  597. Returns a reference to a newly cloned default colorspaces
  598. structure.
  599. The new clone may safely be altered without fear of race
  600. conditions as the caller is the only reference holder.
  601. */
  602. FZ_FUNCTION ::fz_default_colorspaces *ll_fz_clone_default_colorspaces(::fz_default_colorspaces *base);
  603. /** Low-level wrapper for `::fz_clone_path()`. */
  604. /**
  605. Clone the data for a path.
  606. This is used in preference to fz_keep_path when a whole
  607. new copy of a path is required, rather than just a shared
  608. pointer. This probably indicates that the path is about to
  609. be modified.
  610. path: path to clone.
  611. Throws exceptions on failure to allocate.
  612. */
  613. FZ_FUNCTION ::fz_path *ll_fz_clone_path(::fz_path *path);
  614. /** Low-level wrapper for `::fz_clone_pixmap()`. */
  615. /**
  616. Clone a pixmap, copying the pixels and associated data to new
  617. storage.
  618. The reference count of 'old' is unchanged.
  619. */
  620. FZ_FUNCTION ::fz_pixmap *ll_fz_clone_pixmap(const ::fz_pixmap *old);
  621. /** Low-level wrapper for `::fz_clone_pixmap_area_with_different_seps()`. */
  622. FZ_FUNCTION ::fz_pixmap *ll_fz_clone_pixmap_area_with_different_seps(::fz_pixmap *src, const ::fz_irect *bbox, ::fz_colorspace *dcs, ::fz_separations *seps, ::fz_color_params color_params, ::fz_default_colorspaces *default_cs);
  623. /** Low-level wrapper for `::fz_clone_separations_for_overprint()`. */
  624. /**
  625. Return a separations object with all the spots in the input
  626. separations object that are set to composite, reset to be
  627. enabled. If there ARE no spots in the object, this returns
  628. NULL. If the object already has all its spots enabled, then
  629. just returns another handle on the same object.
  630. */
  631. FZ_FUNCTION ::fz_separations *ll_fz_clone_separations_for_overprint(::fz_separations *seps);
  632. /** Low-level wrapper for `::fz_clone_stroke_state()`. */
  633. /**
  634. Create an identical stroke_state structure and return a
  635. reference to it.
  636. stroke: The stroke state reference to clone.
  637. Exceptions may be thrown in the event of a failure to
  638. allocate.
  639. */
  640. FZ_FUNCTION ::fz_stroke_state *ll_fz_clone_stroke_state(const ::fz_stroke_state *stroke);
  641. /** Low-level wrapper for `::fz_close_band_writer()`. */
  642. /**
  643. Finishes up the output and closes the band writer. After this
  644. call no more headers or bands may be written.
  645. */
  646. FZ_FUNCTION void ll_fz_close_band_writer(::fz_band_writer *writer);
  647. /** Low-level wrapper for `::fz_close_device()`. */
  648. /**
  649. Signal the end of input, and flush any buffered output.
  650. This is NOT called implicitly on fz_drop_device. This
  651. may throw exceptions.
  652. */
  653. FZ_FUNCTION void ll_fz_close_device(::fz_device *dev);
  654. /** Low-level wrapper for `::fz_close_document_writer()`. */
  655. /**
  656. Called to end the process of writing
  657. pages to a document.
  658. This writes any file level trailers required. After this
  659. completes successfully the file is up to date and complete.
  660. */
  661. FZ_FUNCTION void ll_fz_close_document_writer(::fz_document_writer *wri);
  662. /** Low-level wrapper for `::fz_close_output()`. */
  663. /**
  664. Flush pending output and close an output stream.
  665. */
  666. FZ_FUNCTION void ll_fz_close_output(::fz_output *arg_1);
  667. /** Low-level wrapper for `::fz_close_zip_writer()`. */
  668. /**
  669. Close the zip file for writing.
  670. This flushes any pending data to the file. This can throw
  671. exceptions.
  672. */
  673. FZ_FUNCTION void ll_fz_close_zip_writer(::fz_zip_writer *zip);
  674. /** Low-level wrapper for `::fz_closepath()`. */
  675. /**
  676. Close the current subpath.
  677. path: The path to modify.
  678. Throws exceptions on failure to allocate, attempting to modify
  679. a packed path, and illegal path closes (i.e. closing a non open
  680. path).
  681. */
  682. FZ_FUNCTION void ll_fz_closepath(::fz_path *path);
  683. /** Low-level wrapper for `::fz_colorspace_colorant()`. */
  684. /**
  685. Retrieve a the name for a colorant.
  686. Returns a pointer with the same lifespan as the colorspace.
  687. */
  688. FZ_FUNCTION const char *ll_fz_colorspace_colorant(::fz_colorspace *cs, int n);
  689. /** Low-level wrapper for `::fz_colorspace_device_n_has_cmyk()`. */
  690. /**
  691. True if DeviceN color space has cyan magenta yellow or black as
  692. one of its colorants.
  693. */
  694. FZ_FUNCTION int ll_fz_colorspace_device_n_has_cmyk(::fz_colorspace *cs);
  695. /** Low-level wrapper for `::fz_colorspace_device_n_has_only_cmyk()`. */
  696. /**
  697. True if DeviceN color space has only colorants from the CMYK set.
  698. */
  699. FZ_FUNCTION int ll_fz_colorspace_device_n_has_only_cmyk(::fz_colorspace *cs);
  700. /** Low-level wrapper for `::fz_colorspace_digest()`. */
  701. /**
  702. Get checksum of underlying ICC profile.
  703. */
  704. FZ_FUNCTION void ll_fz_colorspace_digest(::fz_colorspace *cs, unsigned char digest[16]);
  705. /** Low-level wrapper for `::fz_colorspace_is_cmyk()`. */
  706. FZ_FUNCTION int ll_fz_colorspace_is_cmyk(::fz_colorspace *cs);
  707. /** Low-level wrapper for `::fz_colorspace_is_device()`. */
  708. FZ_FUNCTION int ll_fz_colorspace_is_device(::fz_colorspace *cs);
  709. /** Low-level wrapper for `::fz_colorspace_is_device_cmyk()`. */
  710. FZ_FUNCTION int ll_fz_colorspace_is_device_cmyk(::fz_colorspace *cs);
  711. /** Low-level wrapper for `::fz_colorspace_is_device_gray()`. */
  712. FZ_FUNCTION int ll_fz_colorspace_is_device_gray(::fz_colorspace *cs);
  713. /** Low-level wrapper for `::fz_colorspace_is_device_n()`. */
  714. FZ_FUNCTION int ll_fz_colorspace_is_device_n(::fz_colorspace *cs);
  715. /** Low-level wrapper for `::fz_colorspace_is_gray()`. */
  716. /**
  717. Tests for particular types of colorspaces
  718. */
  719. FZ_FUNCTION int ll_fz_colorspace_is_gray(::fz_colorspace *cs);
  720. /** Low-level wrapper for `::fz_colorspace_is_icc()`. */
  721. FZ_FUNCTION int ll_fz_colorspace_is_icc(::fz_colorspace *cs);
  722. /** Low-level wrapper for `::fz_colorspace_is_indexed()`. */
  723. FZ_FUNCTION int ll_fz_colorspace_is_indexed(::fz_colorspace *cs);
  724. /** Low-level wrapper for `::fz_colorspace_is_lab()`. */
  725. FZ_FUNCTION int ll_fz_colorspace_is_lab(::fz_colorspace *cs);
  726. /** Low-level wrapper for `::fz_colorspace_is_lab_icc()`. */
  727. FZ_FUNCTION int ll_fz_colorspace_is_lab_icc(::fz_colorspace *cs);
  728. /** Low-level wrapper for `::fz_colorspace_is_rgb()`. */
  729. FZ_FUNCTION int ll_fz_colorspace_is_rgb(::fz_colorspace *cs);
  730. /** Low-level wrapper for `::fz_colorspace_is_subtractive()`. */
  731. /**
  732. True for CMYK, Separation and DeviceN colorspaces.
  733. */
  734. FZ_FUNCTION int ll_fz_colorspace_is_subtractive(::fz_colorspace *cs);
  735. /** Low-level wrapper for `::fz_colorspace_n()`. */
  736. /**
  737. Query the number of colorants in a colorspace.
  738. */
  739. FZ_FUNCTION int ll_fz_colorspace_n(::fz_colorspace *cs);
  740. /** Low-level wrapper for `::fz_colorspace_name()`. */
  741. /**
  742. Query the name of a colorspace.
  743. The returned string has the same lifespan as the colorspace
  744. does. Caller should not free it.
  745. */
  746. FZ_FUNCTION const char *ll_fz_colorspace_name(::fz_colorspace *cs);
  747. /** Low-level wrapper for `::fz_colorspace_name_colorant()`. */
  748. /**
  749. Assign a name for a given colorant in a colorspace.
  750. Used while initially setting up a colorspace. The string is
  751. copied into local storage, so need not be retained by the
  752. caller.
  753. */
  754. FZ_FUNCTION void ll_fz_colorspace_name_colorant(::fz_colorspace *cs, int n, const char *name);
  755. /** Low-level wrapper for `::fz_colorspace_type()`. */
  756. /**
  757. Query the type of colorspace.
  758. */
  759. FZ_FUNCTION enum fz_colorspace_type ll_fz_colorspace_type(::fz_colorspace *cs);
  760. /** Low-level wrapper for `::fz_compare_separations()`. */
  761. /**
  762. Compare 2 separations structures (or NULLs).
  763. Return 0 if identical, non-zero if not identical.
  764. */
  765. FZ_FUNCTION int ll_fz_compare_separations(const ::fz_separations *sep1, const ::fz_separations *sep2);
  766. /** Low-level wrapper for `::fz_compress_brotli()`.
  767. This function has out-params. Python/C# wrappers look like:
  768. `ll_fz_compress_brotli(unsigned char *dest, const unsigned char *source, size_t source_length, ::fz_brotli_level level)` => size_t compressed_length
  769. */
  770. /**
  771. Compress source_length bytes of data starting
  772. at source, into a buffer of length *destLen, starting at dest.
  773. *compressed_length will be updated on exit to contain the size
  774. actually used.
  775. */
  776. FZ_FUNCTION void ll_fz_compress_brotli(unsigned char *dest, size_t *compressed_length, const unsigned char *source, size_t source_length, ::fz_brotli_level level);
  777. /** Low-level wrapper for `::fz_compress_ccitt_fax_g3()`. */
  778. /**
  779. Compress bitmap data as CCITT Group 3 1D fax image.
  780. Creates a stream assuming the default PDF parameters,
  781. except the number of columns.
  782. */
  783. FZ_FUNCTION ::fz_buffer *ll_fz_compress_ccitt_fax_g3(const unsigned char *data, int columns, int rows, ptrdiff_t stride);
  784. /** Low-level wrapper for `::fz_compress_ccitt_fax_g4()`. */
  785. /**
  786. Compress bitmap data as CCITT Group 4 2D fax image.
  787. Creates a stream assuming the default PDF parameters, except
  788. K=-1 and the number of columns.
  789. */
  790. FZ_FUNCTION ::fz_buffer *ll_fz_compress_ccitt_fax_g4(const unsigned char *data, int columns, int rows, ptrdiff_t stride);
  791. /** Low-level wrapper for `::fz_compressed_buffer_size()`. */
  792. /**
  793. Return the storage size used for a buffer and its data.
  794. Used in implementing store handling.
  795. Never throws exceptions.
  796. */
  797. FZ_FUNCTION size_t ll_fz_compressed_buffer_size(::fz_compressed_buffer *buffer);
  798. /** Low-level wrapper for `::fz_compressed_image_buffer()`. */
  799. /**
  800. Retrieve the underlying compressed data for an image.
  801. Returns a pointer to the underlying data buffer for an image,
  802. or NULL if this image is not based upon a compressed data
  803. buffer.
  804. This is not a reference counted structure, so no reference is
  805. returned. Lifespan is limited to that of the image itself.
  806. */
  807. FZ_FUNCTION ::fz_compressed_buffer *ll_fz_compressed_image_buffer(::fz_image *image);
  808. /** Low-level wrapper for `::fz_compressed_image_type()`. */
  809. /**
  810. Return the type of a compressed image.
  811. Any non-compressed image will have the type returned as UNKNOWN.
  812. */
  813. FZ_FUNCTION int ll_fz_compressed_image_type(::fz_image *image);
  814. /** Low-level wrapper for `::fz_concat()`. */
  815. /**
  816. Multiply two matrices.
  817. The order of the two matrices are important since matrix
  818. multiplication is not commutative.
  819. Returns result.
  820. */
  821. FZ_FUNCTION ::fz_matrix ll_fz_concat(::fz_matrix left, ::fz_matrix right);
  822. /** Low-level wrapper for `::fz_concat_push_drop()`. */
  823. /**
  824. Add a chained stream to the end of the concatenate filter.
  825. Ownership of chain is passed in.
  826. */
  827. FZ_FUNCTION void ll_fz_concat_push_drop(::fz_stream *concat, ::fz_stream *chain);
  828. /** Low-level wrapper for `::fz_contains_rect()`. */
  829. /**
  830. Test rectangle inclusion.
  831. Return true if a entirely contains b.
  832. */
  833. FZ_FUNCTION int ll_fz_contains_rect(::fz_rect a, ::fz_rect b);
  834. /** Low-level wrapper for `::fz_convert_color()`.
  835. This function has out-params. Python/C# wrappers look like:
  836. `ll_fz_convert_color(::fz_colorspace *ss, const float *sv, ::fz_colorspace *ds, ::fz_colorspace *is, ::fz_color_params params)` => float dv
  837. */
  838. /**
  839. Convert color values sv from colorspace ss into colorvalues dv
  840. for colorspace ds, via an optional intervening space is,
  841. respecting the given color_params.
  842. */
  843. FZ_FUNCTION void ll_fz_convert_color(::fz_colorspace *ss, const float *sv, ::fz_colorspace *ds, float *dv, ::fz_colorspace *is, ::fz_color_params params);
  844. /** Low-level wrapper for `::fz_convert_error()`.
  845. This function has out-params. Python/C# wrappers look like:
  846. `ll_fz_convert_error()` => `(const char *, int code)`
  847. */
  848. FZ_FUNCTION const char *ll_fz_convert_error(int *code);
  849. /** Low-level wrapper for `::fz_convert_indexed_pixmap_to_base()`. */
  850. /**
  851. Convert pixmap from indexed to base colorspace.
  852. This creates a new bitmap containing the converted pixmap data.
  853. */
  854. FZ_FUNCTION ::fz_pixmap *ll_fz_convert_indexed_pixmap_to_base(const ::fz_pixmap *src);
  855. /** Low-level wrapper for `::fz_convert_pixmap()`. */
  856. /**
  857. Convert an existing pixmap to a desired
  858. colorspace. Other properties of the pixmap, such as resolution
  859. and position are copied to the converted pixmap.
  860. pix: The pixmap to convert.
  861. default_cs: If NULL pix->colorspace is used. It is possible that
  862. the data may need to be interpreted as one of the color spaces
  863. in default_cs.
  864. cs_des: Desired colorspace, may be NULL to denote alpha-only.
  865. prf: Proofing color space through which we need to convert.
  866. color_params: Parameters that may be used in conversion (e.g.
  867. ri).
  868. keep_alpha: If 0 any alpha component is removed, otherwise
  869. alpha is kept if present in the pixmap.
  870. */
  871. FZ_FUNCTION ::fz_pixmap *ll_fz_convert_pixmap(const ::fz_pixmap *pix, ::fz_colorspace *cs_des, ::fz_colorspace *prf, ::fz_default_colorspaces *default_cs, ::fz_color_params color_params, int keep_alpha);
  872. /** Low-level wrapper for `::fz_convert_separation_colors()`.
  873. This function has out-params. Python/C# wrappers look like:
  874. `ll_fz_convert_separation_colors(::fz_colorspace *src_cs, const float *src_color, ::fz_separations *dst_seps, ::fz_colorspace *dst_cs, ::fz_color_params color_params)` => float dst_color
  875. */
  876. /**
  877. Convert a color given in terms of one colorspace,
  878. to a color in terms of another colorspace/separations.
  879. */
  880. FZ_FUNCTION void ll_fz_convert_separation_colors(::fz_colorspace *src_cs, const float *src_color, ::fz_separations *dst_seps, ::fz_colorspace *dst_cs, float *dst_color, ::fz_color_params color_params);
  881. /** Low-level wrapper for `::fz_convert_separation_pixmap_to_base()`. */
  882. /**
  883. Convert pixmap from DeviceN/Separation to base colorspace.
  884. This creates a new bitmap containing the converted pixmap data.
  885. */
  886. FZ_FUNCTION ::fz_pixmap *ll_fz_convert_separation_pixmap_to_base(const ::fz_pixmap *src);
  887. /** Low-level wrapper for `::fz_copy_option()`. */
  888. /**
  889. Copy an option (val) into a destination buffer (dest), of maxlen
  890. bytes.
  891. Returns the number of bytes (including terminator) that did not
  892. fit. If val is maxlen or greater bytes in size, it will be left
  893. unterminated.
  894. */
  895. FZ_FUNCTION size_t ll_fz_copy_option(const char *val, char *dest, size_t maxlen);
  896. /** Low-level wrapper for `::fz_copy_pixmap_rect()`. */
  897. FZ_FUNCTION void ll_fz_copy_pixmap_rect(::fz_pixmap *dest, ::fz_pixmap *src, ::fz_irect r, const ::fz_default_colorspaces *default_cs);
  898. /** Low-level wrapper for `::fz_copy_rectangle()`. */
  899. /**
  900. Return a newly allocated UTF-8 string with the text for a given
  901. selection rectangle.
  902. crlf: If true, write "\r\n" style line endings (otherwise "\n"
  903. only).
  904. */
  905. FZ_FUNCTION char *ll_fz_copy_rectangle(::fz_stext_page *page, ::fz_rect area, int crlf);
  906. /** Low-level wrapper for `::fz_copy_selection()`. */
  907. /**
  908. Return a newly allocated UTF-8 string with the text for a given
  909. selection.
  910. crlf: If true, write "\r\n" style line endings (otherwise "\n"
  911. only).
  912. */
  913. FZ_FUNCTION char *ll_fz_copy_selection(::fz_stext_page *page, ::fz_point a, ::fz_point b, int crlf);
  914. /** Low-level wrapper for `::fz_count_active_separations()`. */
  915. /**
  916. Return the number of active separations.
  917. */
  918. FZ_FUNCTION int ll_fz_count_active_separations(const ::fz_separations *seps);
  919. /** Low-level wrapper for `::fz_count_archive_entries()`. */
  920. /**
  921. Number of entries in archive.
  922. Will always return a value >= 0.
  923. May throw an exception if this type of archive cannot count the
  924. entries (such as a directory).
  925. */
  926. FZ_FUNCTION int ll_fz_count_archive_entries(::fz_archive *arch);
  927. /** Low-level wrapper for `::fz_count_chapter_pages()`. */
  928. /**
  929. Return the number of pages in a chapter.
  930. May return 0.
  931. */
  932. FZ_FUNCTION int ll_fz_count_chapter_pages(::fz_document *doc, int chapter);
  933. /** Low-level wrapper for `::fz_count_chapters()`. */
  934. /**
  935. Return the number of chapters in the document.
  936. At least 1.
  937. */
  938. FZ_FUNCTION int ll_fz_count_chapters(::fz_document *doc);
  939. /** Low-level wrapper for `::fz_count_pages()`. */
  940. /**
  941. Return the number of pages in document
  942. May return 0 for documents with no pages.
  943. */
  944. FZ_FUNCTION int ll_fz_count_pages(::fz_document *doc);
  945. /** Low-level wrapper for `::fz_count_separations()`. */
  946. FZ_FUNCTION int ll_fz_count_separations(const ::fz_separations *sep);
  947. /** Low-level wrapper for `::fz_create_link()`. */
  948. /**
  949. Create a new link on a page.
  950. */
  951. FZ_FUNCTION ::fz_link *ll_fz_create_link(::fz_page *page, ::fz_rect bbox, const char *uri);
  952. /** Low-level wrapper for `::fz_currentpoint()`. */
  953. /**
  954. Return the current point that a path has
  955. reached or (0,0) if empty.
  956. path: path to return the current point of.
  957. */
  958. FZ_FUNCTION ::fz_point ll_fz_currentpoint(::fz_path *path);
  959. /** Low-level wrapper for `::fz_curveto()`. */
  960. /**
  961. Append a 'curveto' command to an open path. (For a
  962. cubic bezier).
  963. path: The path to modify.
  964. x0, y0: The coordinates of the first control point for the
  965. curve.
  966. x1, y1: The coordinates of the second control point for the
  967. curve.
  968. x2, y2: The end coordinates for the curve.
  969. Throws exceptions on failure to allocate, or attempting to
  970. modify a packed path.
  971. */
  972. FZ_FUNCTION void ll_fz_curveto(::fz_path *path, float x0, float y0, float x1, float y1, float x2, float y2);
  973. /** Low-level wrapper for `::fz_curvetov()`. */
  974. /**
  975. Append a 'curvetov' command to an open path. (For a
  976. cubic bezier with the first control coordinate equal to
  977. the start point).
  978. path: The path to modify.
  979. x1, y1: The coordinates of the second control point for the
  980. curve.
  981. x2, y2: The end coordinates for the curve.
  982. Throws exceptions on failure to allocate, or attempting to
  983. modify a packed path.
  984. */
  985. FZ_FUNCTION void ll_fz_curvetov(::fz_path *path, float x1, float y1, float x2, float y2);
  986. /** Low-level wrapper for `::fz_curvetoy()`. */
  987. /**
  988. Append a 'curvetoy' command to an open path. (For a
  989. cubic bezier with the second control coordinate equal to
  990. the end point).
  991. path: The path to modify.
  992. x0, y0: The coordinates of the first control point for the
  993. curve.
  994. x2, y2: The end coordinates for the curve (and the second
  995. control coordinate).
  996. Throws exceptions on failure to allocate, or attempting to
  997. modify a packed path.
  998. */
  999. FZ_FUNCTION void ll_fz_curvetoy(::fz_path *path, float x0, float y0, float x2, float y2);
  1000. /** Low-level wrapper for `::fz_debug_store()`. */
  1001. /**
  1002. Output debugging information for the current state of the store
  1003. to the given output channel.
  1004. */
  1005. FZ_FUNCTION void ll_fz_debug_store(::fz_output *out);
  1006. /** Low-level wrapper for `::fz_debug_xml()`. */
  1007. /**
  1008. Pretty-print an XML tree to stdout. (Deprecated, use
  1009. fz_output_xml in preference).
  1010. */
  1011. FZ_FUNCTION void ll_fz_debug_xml(::fz_xml *item, int level);
  1012. /** Low-level wrapper for `::fz_decode_barcode_from_display_list()`.
  1013. This function has out-params. Python/C# wrappers look like:
  1014. `ll_fz_decode_barcode_from_display_list(::fz_display_list *list, ::fz_rect subarea, int rotate)` => `(char *, ::fz_barcode_type type)`
  1015. */
  1016. /**
  1017. Decode a barcode from a display list.
  1018. type: NULL, or a pointer to recieve the barcode type decoded.
  1019. list: The display list to render to get the barcode.
  1020. subarea: subarea of the page to decode.
  1021. rotate: 0, 90, 180, or 270.
  1022. returns the decoded value.
  1023. */
  1024. FZ_FUNCTION char *ll_fz_decode_barcode_from_display_list(::fz_barcode_type *type, ::fz_display_list *list, ::fz_rect subarea, int rotate);
  1025. /** Low-level wrapper for `::fz_decode_barcode_from_display_list2()`.
  1026. This function has out-params. Python/C# wrappers look like:
  1027. `ll_fz_decode_barcode_from_display_list2(::fz_display_list *list, ::fz_rect subarea, int rotate)` => `(std::string, ::fz_barcode_type type)`
  1028. */
  1029. /** SWIG-friendly wrapper for fz_decode_barcode_from_display_list(),
  1030. avoiding leak of the returned string. */
  1031. FZ_FUNCTION std::string ll_fz_decode_barcode_from_display_list2(::fz_barcode_type *type, ::fz_display_list *list, ::fz_rect subarea, int rotate);
  1032. /** Low-level wrapper for `::fz_decode_barcode_from_page()`.
  1033. This function has out-params. Python/C# wrappers look like:
  1034. `ll_fz_decode_barcode_from_page(::fz_page *page, ::fz_rect subarea, int rotate)` => `(char *, ::fz_barcode_type type)`
  1035. */
  1036. /**
  1037. Decode a barcode from a page.
  1038. type: NULL, or a pointer to recieve the barcode type decoded.
  1039. page: The page to decode.
  1040. subarea: subarea of the page to decode.
  1041. rotate: 0, 90, 180, or 270.
  1042. returns the decoded value.
  1043. */
  1044. FZ_FUNCTION char *ll_fz_decode_barcode_from_page(::fz_barcode_type *type, ::fz_page *page, ::fz_rect subarea, int rotate);
  1045. /** Low-level wrapper for `::fz_decode_barcode_from_page2()`.
  1046. This function has out-params. Python/C# wrappers look like:
  1047. `ll_fz_decode_barcode_from_page2(::fz_page *page, ::fz_rect subarea, int rotate)` => `(std::string, ::fz_barcode_type type)`
  1048. */
  1049. /** SWIG-friendly wrapper for fz_decode_barcode_from_page(), avoiding
  1050. leak of the returned string. */
  1051. FZ_FUNCTION std::string ll_fz_decode_barcode_from_page2(::fz_barcode_type *type, ::fz_page *page, ::fz_rect subarea, int rotate);
  1052. /** Low-level wrapper for `::fz_decode_barcode_from_pixmap()`.
  1053. This function has out-params. Python/C# wrappers look like:
  1054. `ll_fz_decode_barcode_from_pixmap(::fz_pixmap *pix, int rotate)` => `(char *, ::fz_barcode_type type)`
  1055. */
  1056. /**
  1057. Decode a barcode from a pixmap.
  1058. type: NULL, or a pointer to recieve the barcode type decoded.
  1059. pix: The pixmap to decode.
  1060. rotate: 0, 90, 180, or 270.
  1061. returns the decoded value as an fz_malloced block. Should
  1062. be fz_free'd by the caller.
  1063. */
  1064. FZ_FUNCTION char *ll_fz_decode_barcode_from_pixmap(::fz_barcode_type *type, ::fz_pixmap *pix, int rotate);
  1065. /** Low-level wrapper for `::fz_decode_barcode_from_pixmap2()`.
  1066. This function has out-params. Python/C# wrappers look like:
  1067. `ll_fz_decode_barcode_from_pixmap2(::fz_pixmap *pix, int rotate)` => `(std::string, ::fz_barcode_type type)`
  1068. */
  1069. /** SWIG-friendly wrapper for fz_decode_barcode_from_pixmap(), avoiding
  1070. leak of the returned string. */
  1071. FZ_FUNCTION std::string ll_fz_decode_barcode_from_pixmap2(::fz_barcode_type *type, ::fz_pixmap *pix, int rotate);
  1072. /** Low-level wrapper for `::fz_decode_tile()`. */
  1073. FZ_FUNCTION void ll_fz_decode_tile(::fz_pixmap *pix, const float *decode);
  1074. /** Low-level wrapper for `::fz_decode_uri()`. */
  1075. /**
  1076. * Return a new string representing the unencoded version of the given URI.
  1077. * This decodes all escape sequences except those that would result in a reserved
  1078. * character that are part of the URI syntax (; / ? : @ & = + $ , #).
  1079. */
  1080. FZ_FUNCTION char *ll_fz_decode_uri(const char *s);
  1081. /** Low-level wrapper for `::fz_decode_uri_component()`. */
  1082. /**
  1083. * Return a new string representing the unencoded version of the given URI component.
  1084. * This decodes all escape sequences!
  1085. */
  1086. FZ_FUNCTION char *ll_fz_decode_uri_component(const char *s);
  1087. /** Low-level wrapper for `::fz_decomp_image_from_stream()`.
  1088. This function has out-params. Python/C# wrappers look like:
  1089. `ll_fz_decomp_image_from_stream(::fz_stream *stm, ::fz_compressed_image *image, ::fz_irect *subarea, int indexed, int l2factor)` => `(fz_pixmap *, int l2extra)`
  1090. */
  1091. /**
  1092. Decode a subarea of a compressed image. l2factor is the amount
  1093. of subsampling inbuilt to the stream (i.e. performed by the
  1094. decoder). If non NULL, l2extra is the extra amount of
  1095. subsampling that should be performed by this routine. This will
  1096. be updated on exit to the amount of subsampling that is still
  1097. required to be done.
  1098. Returns a kept reference.
  1099. */
  1100. FZ_FUNCTION ::fz_pixmap *ll_fz_decomp_image_from_stream(::fz_stream *stm, ::fz_compressed_image *image, ::fz_irect *subarea, int indexed, int l2factor, int *l2extra);
  1101. /** Low-level wrapper for `::fz_decouple_type3_font()`. */
  1102. FZ_FUNCTION void ll_fz_decouple_type3_font(::fz_font *font, void *t3doc);
  1103. /** Low-level wrapper for `::fz_default_cmyk()`. */
  1104. FZ_FUNCTION ::fz_colorspace *ll_fz_default_cmyk(const ::fz_default_colorspaces *default_cs);
  1105. /** Low-level wrapper for `::fz_default_error_callback()`. */
  1106. /**
  1107. FIXME: Better not to expose fz_default_error_callback, and
  1108. fz_default_warning callback and to allow 'NULL' to be used
  1109. int fz_set_xxxx_callback to mean "defaults".
  1110. FIXME: Do we need/want functions like
  1111. fz_error_callback(ctx, message) to allow callers to inject
  1112. stuff into the error/warning streams?
  1113. */
  1114. /**
  1115. The default error callback. Declared publicly just so that the
  1116. error callback can be set back to this after it has been
  1117. overridden.
  1118. */
  1119. FZ_FUNCTION void ll_fz_default_error_callback(void *user, const char *message);
  1120. /** Low-level wrapper for `::fz_default_gray()`. */
  1121. /**
  1122. Retrieve default colorspaces (typically page local).
  1123. If default_cs is non NULL, the default is retrieved from there,
  1124. otherwise the global default is retrieved.
  1125. These return borrowed references that should not be dropped,
  1126. unless they are kept first.
  1127. */
  1128. FZ_FUNCTION ::fz_colorspace *ll_fz_default_gray(const ::fz_default_colorspaces *default_cs);
  1129. /** Low-level wrapper for `::fz_default_halftone()`. */
  1130. /**
  1131. Create a 'default' halftone structure
  1132. for the given number of components.
  1133. num_comps: The number of components to use.
  1134. Returns a simple default halftone. The default halftone uses
  1135. the same halftone tile for each plane, which may not be ideal
  1136. for all purposes.
  1137. */
  1138. FZ_FUNCTION ::fz_halftone *ll_fz_default_halftone(int num_comps);
  1139. /** Low-level wrapper for `::fz_default_output_intent()`. */
  1140. FZ_FUNCTION ::fz_colorspace *ll_fz_default_output_intent(const ::fz_default_colorspaces *default_cs);
  1141. /** Low-level wrapper for `::fz_default_rgb()`. */
  1142. FZ_FUNCTION ::fz_colorspace *ll_fz_default_rgb(const ::fz_default_colorspaces *default_cs);
  1143. /** Low-level wrapper for `::fz_default_warning_callback()`. */
  1144. /**
  1145. The default warning callback. Declared publicly just so that
  1146. the warning callback can be set back to this after it has been
  1147. overridden.
  1148. */
  1149. FZ_FUNCTION void ll_fz_default_warning_callback(void *user, const char *message);
  1150. /** Low-level wrapper for `::fz_defer_reap_end()`. */
  1151. /**
  1152. Decrement the defer reap count.
  1153. If the defer reap count returns to 0, and the store
  1154. has reapable objects in, a reap pass will begin.
  1155. Call this at the end of a process during which you
  1156. potentially might drop many reapable objects.
  1157. It is vital that every fz_defer_reap_start is matched
  1158. by a fz_defer_reap_end call.
  1159. */
  1160. FZ_FUNCTION void ll_fz_defer_reap_end();
  1161. /** Low-level wrapper for `::fz_defer_reap_start()`. */
  1162. /**
  1163. Increment the defer reap count.
  1164. No reap operations will take place (except for those
  1165. triggered by an immediate failed malloc) until the
  1166. defer reap count returns to 0.
  1167. Call this at the start of a process during which you
  1168. potentially might drop many reapable objects.
  1169. It is vital that every fz_defer_reap_start is matched
  1170. by a fz_defer_reap_end call.
  1171. */
  1172. FZ_FUNCTION void ll_fz_defer_reap_start();
  1173. /** Low-level wrapper for `::fz_deflate()`.
  1174. This function has out-params. Python/C# wrappers look like:
  1175. `ll_fz_deflate(unsigned char *dest, const unsigned char *source, size_t source_length, ::fz_deflate_level level)` => size_t compressed_length
  1176. */
  1177. /**
  1178. Compress source_length bytes of data starting
  1179. at source, into a buffer of length *compressed_length, starting at
  1180. dest. *compressed_length will be updated on exit to contain the size
  1181. actually used.
  1182. */
  1183. FZ_FUNCTION void ll_fz_deflate(unsigned char *dest, size_t *compressed_length, const unsigned char *source, size_t source_length, ::fz_deflate_level level);
  1184. /** Low-level wrapper for `::fz_deflate_bound()`. */
  1185. /**
  1186. Returns the upper bound on the
  1187. size of flated data of length size.
  1188. */
  1189. FZ_FUNCTION size_t ll_fz_deflate_bound(size_t size);
  1190. /** Low-level wrapper for `::fz_delete_link()`. */
  1191. /**
  1192. Delete an existing link on a page.
  1193. */
  1194. FZ_FUNCTION void ll_fz_delete_link(::fz_page *page, ::fz_link *link);
  1195. /** Low-level wrapper for `::fz_deskew_pixmap()`. */
  1196. FZ_FUNCTION ::fz_pixmap *ll_fz_deskew_pixmap(::fz_pixmap *src, double degrees, int border);
  1197. /** Low-level wrapper for `::fz_detach_xml()`. */
  1198. /**
  1199. Detach a node from the tree, unlinking it from its parent,
  1200. and setting the document root to the node.
  1201. */
  1202. FZ_FUNCTION void ll_fz_detach_xml(::fz_xml *node);
  1203. /** Low-level wrapper for `::fz_detect_document()`. */
  1204. FZ_FUNCTION int ll_fz_detect_document(::fz_quad *points, ::fz_pixmap *src);
  1205. /** Low-level wrapper for `::fz_detect_skew()`. */
  1206. FZ_FUNCTION double ll_fz_detect_skew(::fz_pixmap *pixmap);
  1207. /** Low-level wrapper for `::fz_device_bgr()`. */
  1208. FZ_FUNCTION ::fz_colorspace *ll_fz_device_bgr();
  1209. /** Low-level wrapper for `::fz_device_cmyk()`. */
  1210. FZ_FUNCTION ::fz_colorspace *ll_fz_device_cmyk();
  1211. /** Low-level wrapper for `::fz_device_current_scissor()`. */
  1212. /**
  1213. Find current scissor region as tracked by the device.
  1214. */
  1215. FZ_FUNCTION ::fz_rect ll_fz_device_current_scissor(::fz_device *dev);
  1216. /** Low-level wrapper for `::fz_device_gray()`. */
  1217. /**
  1218. Retrieve global default colorspaces.
  1219. These return borrowed references that should not be dropped,
  1220. unless they are kept first.
  1221. */
  1222. FZ_FUNCTION ::fz_colorspace *ll_fz_device_gray();
  1223. /** Low-level wrapper for `::fz_device_lab()`. */
  1224. FZ_FUNCTION ::fz_colorspace *ll_fz_device_lab();
  1225. /** Low-level wrapper for `::fz_device_rgb()`. */
  1226. FZ_FUNCTION ::fz_colorspace *ll_fz_device_rgb();
  1227. /** Low-level wrapper for `::fz_dirname()`. */
  1228. /**
  1229. extract the directory component from a path.
  1230. */
  1231. FZ_FUNCTION void ll_fz_dirname(char *dir, const char *path, size_t dirsize);
  1232. /** Low-level wrapper for `::fz_disable_device_hints()`. */
  1233. /**
  1234. Disable (clear) hint bits within the hint bitfield for a device.
  1235. */
  1236. FZ_FUNCTION void ll_fz_disable_device_hints(::fz_device *dev, int hints);
  1237. /** Low-level wrapper for `::fz_disable_icc()`. */
  1238. /**
  1239. Disable icc profile based operation.
  1240. */
  1241. FZ_FUNCTION void ll_fz_disable_icc();
  1242. /** Low-level wrapper for `::fz_display_list_is_empty()`. */
  1243. /**
  1244. Check for a display list being empty
  1245. list: The list to check.
  1246. Returns true if empty, false otherwise.
  1247. */
  1248. FZ_FUNCTION int ll_fz_display_list_is_empty(const ::fz_display_list *list);
  1249. /** Low-level wrapper for `::fz_div255()`. */
  1250. /**
  1251. Undo alpha premultiplication.
  1252. */
  1253. FZ_FUNCTION int ll_fz_div255(int c, int a);
  1254. /** Low-level wrapper for `::fz_do_always()`. */
  1255. FZ_FUNCTION int ll_fz_do_always();
  1256. /** Low-level wrapper for `::fz_do_catch()`. */
  1257. FZ_FUNCTION int ll_fz_do_catch();
  1258. /** Low-level wrapper for `::fz_do_try()`. */
  1259. FZ_FUNCTION int ll_fz_do_try();
  1260. /** Low-level wrapper for `::fz_document_handler_open()`. */
  1261. /** Helper for calling `fz_document_handler::open` function pointer via
  1262. Swig from Python/C#. */
  1263. FZ_FUNCTION ::fz_document *ll_fz_document_handler_open(const ::fz_document_handler *handler, ::fz_stream *stream, ::fz_stream *accel, ::fz_archive *dir, void *recognize_state);
  1264. /** Low-level wrapper for `::fz_document_handler_recognize()`. */
  1265. /** Helper for calling a `fz_document_handler::recognize` function
  1266. pointer via Swig from Python/C#. */
  1267. FZ_FUNCTION int ll_fz_document_handler_recognize(const ::fz_document_handler *handler, const char *magic);
  1268. /** Low-level wrapper for `::fz_document_output_intent()`. */
  1269. /**
  1270. Find the output intent colorspace if the document has defined
  1271. one.
  1272. Returns a borrowed reference that should not be dropped, unless
  1273. it is kept first.
  1274. */
  1275. FZ_FUNCTION ::fz_colorspace *ll_fz_document_output_intent(::fz_document *doc);
  1276. /** Low-level wrapper for `::fz_document_supports_accelerator()`. */
  1277. /**
  1278. Query if the document supports the saving of accelerator data.
  1279. */
  1280. FZ_FUNCTION int ll_fz_document_supports_accelerator(::fz_document *doc);
  1281. /** Low-level wrapper for `::fz_dom_add_attribute()`. */
  1282. /**
  1283. Add an attribute to an element.
  1284. Ownership of att and value remain with the caller.
  1285. */
  1286. FZ_FUNCTION void ll_fz_dom_add_attribute(::fz_xml *elt, const char *att, const char *value);
  1287. /** Low-level wrapper for `::fz_dom_append_child()`. */
  1288. /**
  1289. Insert an element as the last child of a parent, unlinking the
  1290. child from its current position if required.
  1291. */
  1292. FZ_FUNCTION void ll_fz_dom_append_child(::fz_xml *parent, ::fz_xml *child);
  1293. /** Low-level wrapper for `::fz_dom_attribute()`. */
  1294. /**
  1295. Retrieve the value of a given attribute from a given element.
  1296. Returns a borrowed pointer to the value or NULL if not found.
  1297. */
  1298. FZ_FUNCTION const char *ll_fz_dom_attribute(::fz_xml *elt, const char *att);
  1299. /** Low-level wrapper for `::fz_dom_body()`. */
  1300. /**
  1301. Return a borrowed reference for the 'body' element of
  1302. the given DOM.
  1303. */
  1304. FZ_FUNCTION ::fz_xml *ll_fz_dom_body(::fz_xml *dom);
  1305. /** Low-level wrapper for `::fz_dom_clone()`. */
  1306. /**
  1307. Clone an element (and its children).
  1308. A borrowed reference to the clone is returned. The clone is not
  1309. yet linked into the DOM.
  1310. */
  1311. FZ_FUNCTION ::fz_xml *ll_fz_dom_clone(::fz_xml *elt);
  1312. /** Low-level wrapper for `::fz_dom_create_element()`. */
  1313. /**
  1314. Create an element of a given tag type for the given DOM.
  1315. The element is not linked into the DOM yet.
  1316. */
  1317. FZ_FUNCTION ::fz_xml *ll_fz_dom_create_element(::fz_xml *dom, const char *tag);
  1318. /** Low-level wrapper for `::fz_dom_create_text_node()`. */
  1319. /**
  1320. Create a text node for the given DOM.
  1321. The element is not linked into the DOM yet.
  1322. */
  1323. FZ_FUNCTION ::fz_xml *ll_fz_dom_create_text_node(::fz_xml *dom, const char *text);
  1324. /** Low-level wrapper for `::fz_dom_document_element()`. */
  1325. /**
  1326. Return a borrowed reference for the document (the top
  1327. level element) of the DOM.
  1328. */
  1329. FZ_FUNCTION ::fz_xml *ll_fz_dom_document_element(::fz_xml *dom);
  1330. /** Low-level wrapper for `::fz_dom_find()`. */
  1331. /**
  1332. Find the first element matching the requirements in a depth first traversal from elt.
  1333. The tagname must match tag, unless tag is NULL, when all tag names are considered to match.
  1334. If att is NULL, then all tags match.
  1335. Otherwise:
  1336. If match is NULL, then only nodes that have an att attribute match.
  1337. If match is non-NULL, then only nodes that have an att attribute that matches match match.
  1338. Returns NULL (if no match found), or a borrowed reference to the first matching element.
  1339. */
  1340. FZ_FUNCTION ::fz_xml *ll_fz_dom_find(::fz_xml *elt, const char *tag, const char *att, const char *match);
  1341. /** Low-level wrapper for `::fz_dom_find_next()`. */
  1342. /**
  1343. Find the next element matching the requirements.
  1344. */
  1345. FZ_FUNCTION ::fz_xml *ll_fz_dom_find_next(::fz_xml *elt, const char *tag, const char *att, const char *match);
  1346. /** Low-level wrapper for `::fz_dom_first_child()`. */
  1347. /**
  1348. Return a borrowed reference to the first child of a node,
  1349. or NULL if there isn't one.
  1350. */
  1351. FZ_FUNCTION ::fz_xml *ll_fz_dom_first_child(::fz_xml *elt);
  1352. /** Low-level wrapper for `::fz_dom_get_attribute()`.
  1353. This function has out-params. Python/C# wrappers look like:
  1354. `ll_fz_dom_get_attribute(::fz_xml *elt, int i)` => `(const char *, const char *att)`
  1355. */
  1356. /**
  1357. Enumerate through the attributes of an element.
  1358. Call with i=0,1,2,3... to enumerate attributes.
  1359. On return *att and the return value will be NULL if there are not
  1360. that many attributes to read. Otherwise, *att will be filled in
  1361. with a borrowed pointer to the attribute name, and the return
  1362. value will be a borrowed pointer to the value.
  1363. */
  1364. FZ_FUNCTION const char *ll_fz_dom_get_attribute(::fz_xml *elt, int i, const char **att);
  1365. /** Low-level wrapper for `::fz_dom_insert_after()`. */
  1366. /**
  1367. Insert an element (new_elt), after another element (node),
  1368. unlinking the new_elt from its current position if required.
  1369. */
  1370. FZ_FUNCTION void ll_fz_dom_insert_after(::fz_xml *node, ::fz_xml *new_elt);
  1371. /** Low-level wrapper for `::fz_dom_insert_before()`. */
  1372. /**
  1373. Insert an element (new_elt), before another element (node),
  1374. unlinking the new_elt from its current position if required.
  1375. */
  1376. FZ_FUNCTION void ll_fz_dom_insert_before(::fz_xml *node, ::fz_xml *new_elt);
  1377. /** Low-level wrapper for `::fz_dom_next()`. */
  1378. /**
  1379. Return a borrowed reference to the next sibling of a node,
  1380. or NULL if there isn't one.
  1381. */
  1382. FZ_FUNCTION ::fz_xml *ll_fz_dom_next(::fz_xml *elt);
  1383. /** Low-level wrapper for `::fz_dom_parent()`. */
  1384. /**
  1385. Return a borrowed reference to the parent of a node,
  1386. or NULL if there isn't one.
  1387. */
  1388. FZ_FUNCTION ::fz_xml *ll_fz_dom_parent(::fz_xml *elt);
  1389. /** Low-level wrapper for `::fz_dom_previous()`. */
  1390. /**
  1391. Return a borrowed reference to the previous sibling of a node,
  1392. or NULL if there isn't one.
  1393. */
  1394. FZ_FUNCTION ::fz_xml *ll_fz_dom_previous(::fz_xml *elt);
  1395. /** Low-level wrapper for `::fz_dom_remove()`. */
  1396. /**
  1397. Remove an element from the DOM. The element can be added back elsewhere
  1398. if required.
  1399. No reference counting changes for the element.
  1400. */
  1401. FZ_FUNCTION void ll_fz_dom_remove(::fz_xml *elt);
  1402. /** Low-level wrapper for `::fz_dom_remove_attribute()`. */
  1403. /**
  1404. Remove an attribute from an element.
  1405. */
  1406. FZ_FUNCTION void ll_fz_dom_remove_attribute(::fz_xml *elt, const char *att);
  1407. /** Low-level wrapper for `::fz_draw_story()`. */
  1408. FZ_FUNCTION void ll_fz_draw_story(::fz_story *story, ::fz_device *dev, ::fz_matrix ctm);
  1409. /** Low-level wrapper for `::fz_drop_archive()`. */
  1410. /**
  1411. Drop a reference to an archive.
  1412. When the last reference is dropped, this closes and releases
  1413. any memory or filehandles associated with the archive.
  1414. */
  1415. FZ_FUNCTION void ll_fz_drop_archive(::fz_archive *arch);
  1416. /** Low-level wrapper for `::fz_drop_band_writer()`. */
  1417. /**
  1418. Drop the reference to the band writer, causing it to be
  1419. destroyed.
  1420. Never throws an exception.
  1421. */
  1422. FZ_FUNCTION void ll_fz_drop_band_writer(::fz_band_writer *writer);
  1423. /** Low-level wrapper for `::fz_drop_bitmap()`. */
  1424. /**
  1425. Drop a reference to the bitmap. When the reference count reaches
  1426. zero, the bitmap will be destroyed.
  1427. Never throws exceptions.
  1428. */
  1429. FZ_FUNCTION void ll_fz_drop_bitmap(::fz_bitmap *bit);
  1430. /** Low-level wrapper for `::fz_drop_buffer()`. */
  1431. /**
  1432. Drop a reference to the buffer. When the reference count reaches
  1433. zero, the buffer is destroyed.
  1434. Never throws exceptions.
  1435. */
  1436. FZ_FUNCTION void ll_fz_drop_buffer(::fz_buffer *buf);
  1437. /** Low-level wrapper for `::fz_drop_colorspace()`. */
  1438. /**
  1439. Drops a reference to the colorspace.
  1440. When the reference count reaches zero, the colorspace is
  1441. destroyed.
  1442. */
  1443. FZ_FUNCTION void ll_fz_drop_colorspace(::fz_colorspace *colorspace);
  1444. /** Low-level wrapper for `::fz_drop_colorspace_imp()`. */
  1445. FZ_FUNCTION void ll_fz_drop_colorspace_imp(::fz_storable *cs_);
  1446. /** Low-level wrapper for `::fz_drop_compressed_buffer()`. */
  1447. /**
  1448. Drop a reference to a compressed buffer. Destroys the buffer
  1449. and frees any storage/other references held by it.
  1450. Never throws exceptions.
  1451. */
  1452. FZ_FUNCTION void ll_fz_drop_compressed_buffer(::fz_compressed_buffer *buf);
  1453. /** Low-level wrapper for `::fz_drop_context()`. */
  1454. /**
  1455. Free a context and its global state.
  1456. The context and all of its global state is freed, and any
  1457. buffered warnings are flushed (see fz_flush_warnings). If NULL
  1458. is passed in nothing will happen.
  1459. Must not be called for a context that is being used in an active
  1460. fz_try(), fz_always() or fz_catch() block.
  1461. */
  1462. FZ_FUNCTION void ll_fz_drop_context();
  1463. /** Low-level wrapper for `::fz_drop_default_colorspaces()`. */
  1464. /**
  1465. Drop a reference to the default colorspaces structure. When the
  1466. reference count reaches 0, the references it holds internally
  1467. to the underlying colorspaces will be dropped, and the structure
  1468. will be destroyed.
  1469. Never throws exceptions.
  1470. */
  1471. FZ_FUNCTION void ll_fz_drop_default_colorspaces(::fz_default_colorspaces *default_cs);
  1472. /** Low-level wrapper for `::fz_drop_device()`. */
  1473. /**
  1474. Reduce the reference count on a device. When the reference count
  1475. reaches zero, the device and its resources will be freed.
  1476. Don't forget to call fz_close_device before dropping the device,
  1477. or you may get incomplete output!
  1478. Never throws exceptions.
  1479. */
  1480. FZ_FUNCTION void ll_fz_drop_device(::fz_device *dev);
  1481. /** Low-level wrapper for `::fz_drop_display_list()`. */
  1482. /**
  1483. Decrement the reference count for a display list. When the
  1484. reference count reaches zero, all the references in the display
  1485. list itself are dropped, and the display list is freed.
  1486. Never throws exceptions.
  1487. */
  1488. FZ_FUNCTION void ll_fz_drop_display_list(::fz_display_list *list);
  1489. /** Low-level wrapper for `::fz_drop_document()`. */
  1490. /**
  1491. Decrement the document reference count. When the reference
  1492. count reaches 0, the document and all it's references are
  1493. freed.
  1494. Never throws exceptions.
  1495. */
  1496. FZ_FUNCTION void ll_fz_drop_document(::fz_document *doc);
  1497. /** Low-level wrapper for `::fz_drop_document_writer()`. */
  1498. /**
  1499. Called to discard a fz_document_writer.
  1500. This may be called at any time during the process to release all
  1501. the resources owned by the writer.
  1502. Calling drop without having previously called close may leave
  1503. the file in an inconsistent state.
  1504. */
  1505. FZ_FUNCTION void ll_fz_drop_document_writer(::fz_document_writer *wri);
  1506. /** Low-level wrapper for `::fz_drop_drawn_tiles_for_document()`. */
  1507. /**
  1508. Filter the store and throw away any stored tiles drawn for a
  1509. given document.
  1510. */
  1511. FZ_FUNCTION void ll_fz_drop_drawn_tiles_for_document(::fz_document *doc);
  1512. /** Low-level wrapper for `::fz_drop_font()`. */
  1513. /**
  1514. Drop a reference to a fz_font, destroying the
  1515. font when the last reference is dropped.
  1516. font: The font to drop a reference to.
  1517. */
  1518. FZ_FUNCTION void ll_fz_drop_font(::fz_font *font);
  1519. /** Low-level wrapper for `::fz_drop_function()`. */
  1520. FZ_FUNCTION void ll_fz_drop_function(::fz_function *func);
  1521. /** Low-level wrapper for `::fz_drop_glyph()`. */
  1522. /**
  1523. Drop a reference and free a glyph.
  1524. Decrement the reference count for the glyph. When no
  1525. references remain the glyph will be freed.
  1526. */
  1527. FZ_FUNCTION void ll_fz_drop_glyph(::fz_glyph *pix);
  1528. /** Low-level wrapper for `::fz_drop_halftone()`. */
  1529. /**
  1530. Drop a reference to the halftone. When the reference count
  1531. reaches zero, the halftone is destroyed.
  1532. Never throws exceptions.
  1533. */
  1534. FZ_FUNCTION void ll_fz_drop_halftone(::fz_halftone *ht);
  1535. /** Low-level wrapper for `::fz_drop_hash_table()`. */
  1536. /**
  1537. Destroy the hash table.
  1538. Values are dropped using the drop function.
  1539. */
  1540. FZ_FUNCTION void ll_fz_drop_hash_table(::fz_hash_table *table);
  1541. /** Low-level wrapper for `::fz_drop_image()`. */
  1542. /**
  1543. Decrement the (normal) reference count for an image. When the
  1544. total (normal + key) reference count reaches zero, the image and
  1545. its resources are freed.
  1546. Never throws exceptions.
  1547. */
  1548. FZ_FUNCTION void ll_fz_drop_image(::fz_image *image);
  1549. /** Low-level wrapper for `::fz_drop_image_base()`. */
  1550. /**
  1551. Internal destructor for the base image class members.
  1552. Exposed to allow derived image classes to be written.
  1553. */
  1554. FZ_FUNCTION void ll_fz_drop_image_base(::fz_image *image);
  1555. /** Low-level wrapper for `::fz_drop_image_imp()`. */
  1556. /**
  1557. Internal destructor exposed for fz_store integration.
  1558. */
  1559. FZ_FUNCTION void ll_fz_drop_image_imp(::fz_storable *image);
  1560. /** Low-level wrapper for `::fz_drop_image_store_key()`. */
  1561. /**
  1562. Decrement the store key reference count for an image. When the
  1563. total (normal + key) reference count reaches zero, the image and
  1564. its resources are freed.
  1565. Never throws exceptions.
  1566. */
  1567. FZ_FUNCTION void ll_fz_drop_image_store_key(::fz_image *image);
  1568. /** Low-level wrapper for `::fz_drop_imp()`.
  1569. This function has out-params. Python/C# wrappers look like:
  1570. `ll_fz_drop_imp(void *p)` => `(int, int refs)`
  1571. */
  1572. FZ_FUNCTION int ll_fz_drop_imp(void *p, int *refs);
  1573. /** Low-level wrapper for `::fz_drop_imp16()`.
  1574. This function has out-params. Python/C# wrappers look like:
  1575. `ll_fz_drop_imp16(void *p)` => `(int, int16_t refs)`
  1576. */
  1577. FZ_FUNCTION int ll_fz_drop_imp16(void *p, int16_t *refs);
  1578. /** Low-level wrapper for `::fz_drop_imp8()`. */
  1579. FZ_FUNCTION int ll_fz_drop_imp8(void *p, int8_t *refs);
  1580. /** Low-level wrapper for `::fz_drop_jbig2_globals()`. */
  1581. /**
  1582. Decrement the reference count for a jbig2 globals record.
  1583. When the reference count hits zero, the record is freed.
  1584. Never throws an exception.
  1585. */
  1586. FZ_FUNCTION void ll_fz_drop_jbig2_globals(::fz_jbig2_globals *globals);
  1587. /** Low-level wrapper for `::fz_drop_jbig2_globals_imp()`. */
  1588. /**
  1589. Special jbig2 globals drop function for use in implementing
  1590. store support.
  1591. */
  1592. FZ_FUNCTION void ll_fz_drop_jbig2_globals_imp(::fz_storable *globals);
  1593. /** Low-level wrapper for `::fz_drop_key_storable()`. */
  1594. /**
  1595. Decrement the (normal) reference count for a storable object.
  1596. When the total reference count hits zero, the drop function for
  1597. that object is called to free the object.
  1598. Never throws exceptions.
  1599. */
  1600. FZ_FUNCTION void ll_fz_drop_key_storable(const ::fz_key_storable *arg_1);
  1601. /** Low-level wrapper for `::fz_drop_key_storable_key()`. */
  1602. /**
  1603. Decrement the (key) reference count for a storable object.
  1604. When the total reference count hits zero, the drop function for
  1605. that object is called to free the object.
  1606. Never throws exceptions.
  1607. */
  1608. FZ_FUNCTION void ll_fz_drop_key_storable_key(const ::fz_key_storable *arg_1);
  1609. /** Low-level wrapper for `::fz_drop_layout()`. */
  1610. /**
  1611. Drop layout block. Free the pool, and linked blocks.
  1612. Never throws exceptions.
  1613. */
  1614. FZ_FUNCTION void ll_fz_drop_layout(::fz_layout_block *block);
  1615. /** Low-level wrapper for `::fz_drop_link()`. */
  1616. /**
  1617. Decrement the reference count for a link. When the reference
  1618. count reaches zero, the link is destroyed.
  1619. When a link is freed, the reference for any linked link (next)
  1620. is dropped too, thus an entire linked list of fz_link's can be
  1621. freed by just dropping the head.
  1622. */
  1623. FZ_FUNCTION void ll_fz_drop_link(::fz_link *link);
  1624. /** Low-level wrapper for `::fz_drop_outline()`. */
  1625. /**
  1626. Decrements the reference count. When the reference point
  1627. reaches zero, the outline is freed.
  1628. When freed, it will drop linked outline entries (next and down)
  1629. too, thus a whole outline structure can be dropped by dropping
  1630. the top entry.
  1631. Never throws exceptions.
  1632. */
  1633. FZ_FUNCTION void ll_fz_drop_outline(::fz_outline *outline);
  1634. /** Low-level wrapper for `::fz_drop_outline_iterator()`. */
  1635. /**
  1636. Drop the current iterator.
  1637. */
  1638. FZ_FUNCTION void ll_fz_drop_outline_iterator(::fz_outline_iterator *iter);
  1639. /** Low-level wrapper for `::fz_drop_output()`. */
  1640. /**
  1641. Free an output stream. Don't forget to close it first!
  1642. */
  1643. FZ_FUNCTION void ll_fz_drop_output(::fz_output *arg_1);
  1644. /** Low-level wrapper for `::fz_drop_page()`. */
  1645. /**
  1646. Decrements the reference count for the page. When the reference
  1647. count hits 0, the page and its references are freed.
  1648. Never throws exceptions.
  1649. */
  1650. FZ_FUNCTION void ll_fz_drop_page(::fz_page *page);
  1651. /** Low-level wrapper for `::fz_drop_path()`. */
  1652. /**
  1653. Decrement the reference count. When the reference count hits
  1654. zero, free the path.
  1655. All paths can be dropped, regardless of their packing type.
  1656. Packed paths do not own the blocks into which they are packed
  1657. so dropping them does not free those blocks.
  1658. Never throws exceptions.
  1659. */
  1660. FZ_FUNCTION void ll_fz_drop_path(const ::fz_path *path);
  1661. /** Low-level wrapper for `::fz_drop_pixmap()`. */
  1662. /**
  1663. Decrement the reference count for the pixmap. When the
  1664. reference count hits 0, the pixmap is freed.
  1665. Never throws exceptions.
  1666. */
  1667. FZ_FUNCTION void ll_fz_drop_pixmap(::fz_pixmap *pix);
  1668. /** Low-level wrapper for `::fz_drop_pool()`. */
  1669. /**
  1670. Drop a pool, freeing and invalidating all storage returned from
  1671. the pool.
  1672. */
  1673. FZ_FUNCTION void ll_fz_drop_pool(::fz_pool *pool);
  1674. /** Low-level wrapper for `::fz_drop_separations()`. */
  1675. /**
  1676. Decrement the reference count for a separations structure.
  1677. When the reference count hits zero, the separations structure
  1678. is freed.
  1679. Never throws exceptions.
  1680. */
  1681. FZ_FUNCTION void ll_fz_drop_separations(::fz_separations *sep);
  1682. /** Low-level wrapper for `::fz_drop_shade()`. */
  1683. /**
  1684. Decrement the reference count for the shade structure. When
  1685. the reference count hits zero, the structure is freed.
  1686. Never throws exceptions.
  1687. */
  1688. FZ_FUNCTION void ll_fz_drop_shade(::fz_shade *shade);
  1689. /** Low-level wrapper for `::fz_drop_shade_color_cache()`. */
  1690. FZ_FUNCTION void ll_fz_drop_shade_color_cache(::fz_shade_color_cache *cache);
  1691. /** Low-level wrapper for `::fz_drop_shade_imp()`. */
  1692. /**
  1693. Internal function to destroy a
  1694. shade. Only exposed for use with the fz_store.
  1695. shade: The reference to destroy.
  1696. */
  1697. FZ_FUNCTION void ll_fz_drop_shade_imp(::fz_storable *shade);
  1698. /** Low-level wrapper for `::fz_drop_stext_page()`. */
  1699. FZ_FUNCTION void ll_fz_drop_stext_page(::fz_stext_page *page);
  1700. /** Low-level wrapper for `::fz_drop_storable()`. */
  1701. /**
  1702. Decrement the reference count for a storable object. When the
  1703. reference count hits zero, the drop function for that object
  1704. is called to free the object.
  1705. Never throws exceptions.
  1706. */
  1707. FZ_FUNCTION void ll_fz_drop_storable(const ::fz_storable *arg_1);
  1708. /** Low-level wrapper for `::fz_drop_store_context()`. */
  1709. /**
  1710. Decrement the reference count for the store context. When the
  1711. reference count hits zero, the store context is freed.
  1712. Never throws exceptions.
  1713. */
  1714. FZ_FUNCTION void ll_fz_drop_store_context();
  1715. /** Low-level wrapper for `::fz_drop_story()`. */
  1716. FZ_FUNCTION void ll_fz_drop_story(::fz_story *story);
  1717. /** Low-level wrapper for `::fz_drop_stream()`. */
  1718. /**
  1719. Decrements the reference count for a stream.
  1720. When the reference count for the stream hits zero, frees the
  1721. storage used for the fz_stream itself, and (usually)
  1722. releases the underlying resources that the stream is based upon
  1723. (depends on the method used to open the stream initially).
  1724. */
  1725. FZ_FUNCTION void ll_fz_drop_stream(::fz_stream *stm);
  1726. /** Low-level wrapper for `::fz_drop_string()`. */
  1727. FZ_FUNCTION void ll_fz_drop_string(::fz_string *str);
  1728. /** Low-level wrapper for `::fz_drop_stroke_state()`. */
  1729. /**
  1730. Drop a reference to a stroke state structure, destroying the
  1731. structure if it is the last reference.
  1732. */
  1733. FZ_FUNCTION void ll_fz_drop_stroke_state(const ::fz_stroke_state *stroke);
  1734. /** Low-level wrapper for `::fz_drop_text()`. */
  1735. /**
  1736. Decrement the reference count for the text object. When the
  1737. reference count hits zero, the text object is freed.
  1738. Never throws exceptions.
  1739. */
  1740. FZ_FUNCTION void ll_fz_drop_text(const ::fz_text *text);
  1741. /** Low-level wrapper for `::fz_drop_tree()`. */
  1742. /**
  1743. Drop the tree.
  1744. The storage used by the tree is freed, and each value has
  1745. dropfunc called on it.
  1746. */
  1747. FZ_FUNCTION void ll_fz_drop_tree(::fz_tree *node, void (*dropfunc)(::fz_context *, void *));
  1748. /** Low-level wrapper for `::fz_drop_xml()`. */
  1749. /**
  1750. Drop a reference to the XML. When the last reference is
  1751. dropped, the node and all its children and siblings will
  1752. be freed.
  1753. */
  1754. FZ_FUNCTION void ll_fz_drop_xml(::fz_xml *xml);
  1755. /** Low-level wrapper for `::fz_drop_zip_writer()`. */
  1756. /**
  1757. Drop the reference to the zipfile.
  1758. In common with other 'drop' methods, this will never throw an
  1759. exception.
  1760. */
  1761. FZ_FUNCTION void ll_fz_drop_zip_writer(::fz_zip_writer *zip);
  1762. /** Low-level wrapper for `::fz_dump_glyph_cache_stats()`. */
  1763. /**
  1764. Dump debug statistics for the glyph cache.
  1765. */
  1766. FZ_FUNCTION void ll_fz_dump_glyph_cache_stats(::fz_output *out);
  1767. /** Low-level wrapper for `::fz_duplicate_glyph_names_from_unicode()`. */
  1768. FZ_FUNCTION const char **ll_fz_duplicate_glyph_names_from_unicode(int unicode);
  1769. /** Low-level wrapper for `::fz_empty_store()`. */
  1770. /**
  1771. Evict every item from the store.
  1772. */
  1773. FZ_FUNCTION void ll_fz_empty_store();
  1774. /** Low-level wrapper for `::fz_enable_device_hints()`. */
  1775. /**
  1776. Enable (set) hint bits within the hint bitfield for a device.
  1777. */
  1778. FZ_FUNCTION void ll_fz_enable_device_hints(::fz_device *dev, int hints);
  1779. /** Low-level wrapper for `::fz_enable_icc()`. */
  1780. /**
  1781. Enable icc profile based operation.
  1782. */
  1783. FZ_FUNCTION void ll_fz_enable_icc();
  1784. /** Low-level wrapper for `::fz_encode_character()`. */
  1785. /**
  1786. Find the glyph id for a given unicode
  1787. character within a font.
  1788. font: The font to look for the unicode character in.
  1789. unicode: The unicode character to encode.
  1790. Returns the glyph id for the given unicode value, or 0 if
  1791. unknown.
  1792. */
  1793. FZ_FUNCTION int ll_fz_encode_character(::fz_font *font, int unicode);
  1794. /** Low-level wrapper for `::fz_encode_character_by_glyph_name()`. */
  1795. /**
  1796. Encode character.
  1797. Either by direct lookup of glyphname within a font, or, failing
  1798. that, by mapping glyphname to unicode and thence to the glyph
  1799. index within the given font.
  1800. Returns zero for type3 fonts.
  1801. */
  1802. FZ_FUNCTION int ll_fz_encode_character_by_glyph_name(::fz_font *font, const char *glyphname);
  1803. /** Low-level wrapper for `::fz_encode_character_sc()`. */
  1804. /**
  1805. Encode character, preferring small-caps variant if available.
  1806. font: The font to look for the unicode character in.
  1807. unicode: The unicode character to encode.
  1808. Returns the glyph id for the given unicode value, or 0 if
  1809. unknown.
  1810. */
  1811. FZ_FUNCTION int ll_fz_encode_character_sc(::fz_font *font, int unicode);
  1812. /** Low-level wrapper for `::fz_encode_character_with_fallback()`.
  1813. This function has out-params. Python/C# wrappers look like:
  1814. `ll_fz_encode_character_with_fallback(::fz_font *font, int unicode, int script, int language, ::fz_font **out_font)` => `(int)`
  1815. */
  1816. /**
  1817. Find the glyph id for
  1818. a given unicode character within a font, falling back to
  1819. an alternative if not found.
  1820. font: The font to look for the unicode character in.
  1821. unicode: The unicode character to encode.
  1822. script: The script in use.
  1823. language: The language in use.
  1824. out_font: The font handle in which the given glyph represents
  1825. the requested unicode character. The caller does not own the
  1826. reference it is passed, so should call fz_keep_font if it is
  1827. not simply to be used immediately.
  1828. Returns the glyph id for the given unicode value in the supplied
  1829. font (and sets *out_font to font) if it is present. Otherwise
  1830. an alternative fallback font (based on script/language) is
  1831. searched for. If the glyph is found therein, *out_font is set
  1832. to this reference, and the glyph reference is returned. If it
  1833. cannot be found anywhere, the function returns 0.
  1834. */
  1835. FZ_FUNCTION int ll_fz_encode_character_with_fallback(::fz_font *font, int unicode, int script, int language, ::fz_font **out_font);
  1836. /** Low-level wrapper for `::fz_encode_uri()`. */
  1837. /**
  1838. * Return a new string representing the provided string encoded as a URI.
  1839. */
  1840. FZ_FUNCTION char *ll_fz_encode_uri(const char *s);
  1841. /** Low-level wrapper for `::fz_encode_uri_component()`. */
  1842. /**
  1843. * Return a new string representing the provided string encoded as an URI component.
  1844. * This also encodes the special reserved characters (; / ? : @ & = + $ , #).
  1845. */
  1846. FZ_FUNCTION char *ll_fz_encode_uri_component(const char *s);
  1847. /** Low-level wrapper for `::fz_encode_uri_pathname()`. */
  1848. /**
  1849. * Return a new string representing the provided string encoded as an URI path name.
  1850. * This also encodes the special reserved characters except /.
  1851. */
  1852. FZ_FUNCTION char *ll_fz_encode_uri_pathname(const char *s);
  1853. /** Low-level wrapper for `::fz_end_group()`. */
  1854. FZ_FUNCTION void ll_fz_end_group(::fz_device *dev);
  1855. /** Low-level wrapper for `::fz_end_layer()`. */
  1856. FZ_FUNCTION void ll_fz_end_layer(::fz_device *dev);
  1857. /** Low-level wrapper for `::fz_end_mask()`. */
  1858. FZ_FUNCTION void ll_fz_end_mask(::fz_device *dev);
  1859. /** Low-level wrapper for `::fz_end_mask_tr()`. */
  1860. FZ_FUNCTION void ll_fz_end_mask_tr(::fz_device *dev, ::fz_function *fn);
  1861. /** Low-level wrapper for `::fz_end_metatext()`. */
  1862. FZ_FUNCTION void ll_fz_end_metatext(::fz_device *dev);
  1863. /** Low-level wrapper for `::fz_end_page()`. */
  1864. /**
  1865. Called to end the process of writing a page to a
  1866. document.
  1867. */
  1868. FZ_FUNCTION void ll_fz_end_page(::fz_document_writer *wri);
  1869. /** Low-level wrapper for `::fz_end_structure()`. */
  1870. FZ_FUNCTION void ll_fz_end_structure(::fz_device *dev);
  1871. /** Low-level wrapper for `::fz_end_throw_on_repair()`. */
  1872. FZ_FUNCTION void ll_fz_end_throw_on_repair();
  1873. /** Low-level wrapper for `::fz_end_tile()`. */
  1874. FZ_FUNCTION void ll_fz_end_tile(::fz_device *dev);
  1875. /** Low-level wrapper for `::fz_enumerate_font_cmap()`. */
  1876. /**
  1877. Enumerate a cmap using a callback.
  1878. */
  1879. FZ_FUNCTION void ll_fz_enumerate_font_cmap(::fz_font *font, ::fz_cmap_callback *cb, void *opaque);
  1880. /** Low-level wrapper for `::fz_enumerate_font_cmap2()`. */
  1881. /** SWIG-friendly wrapper for fz_enumerate_font_cmap(). */
  1882. FZ_FUNCTION std::vector<fz_font_ucs_gid> ll_fz_enumerate_font_cmap2(::fz_font *font);
  1883. /** Low-level wrapper for `::fz_error_callback()`.
  1884. This function has out-params. Python/C# wrappers look like:
  1885. `ll_fz_error_callback()` => `(fz_error_cb *, void *user)`
  1886. */
  1887. /**
  1888. Retrieve the currently set error callback, or NULL if none
  1889. has been set. Optionally, if user is non-NULL, the user pointer
  1890. given when the warning callback was set is also passed back to
  1891. the caller.
  1892. */
  1893. FZ_FUNCTION ::fz_error_cb *ll_fz_error_callback(void **user);
  1894. /** Low-level wrapper for `::fz_eval_function()`.
  1895. This function has out-params. Python/C# wrappers look like:
  1896. `ll_fz_eval_function(::fz_function *func, const float *in, int inlen, int outlen)` => float out
  1897. */
  1898. FZ_FUNCTION void ll_fz_eval_function(::fz_function *func, const float *in, int inlen, float *out, int outlen);
  1899. /** Low-level wrapper for `::fz_expand_irect()`. */
  1900. FZ_FUNCTION ::fz_irect ll_fz_expand_irect(::fz_irect a, int expand);
  1901. /** Low-level wrapper for `::fz_expand_rect()`. */
  1902. /**
  1903. Expand a bbox by a given amount in all directions.
  1904. */
  1905. FZ_FUNCTION ::fz_rect ll_fz_expand_rect(::fz_rect b, float expand);
  1906. /** Low-level wrapper for `::fz_extract_ttf_from_ttc()`. */
  1907. FZ_FUNCTION ::fz_buffer *ll_fz_extract_ttf_from_ttc(::fz_font *font);
  1908. /** Low-level wrapper for `::fz_file_exists()`. */
  1909. /**
  1910. Return true if the named file exists and is readable.
  1911. */
  1912. FZ_FUNCTION int ll_fz_file_exists(const char *path);
  1913. /** Low-level wrapper for `::fz_fill_image()`. */
  1914. FZ_FUNCTION void ll_fz_fill_image(::fz_device *dev, ::fz_image *image, ::fz_matrix ctm, float alpha, ::fz_color_params color_params);
  1915. /** Low-level wrapper for `::fz_fill_image_mask()`. */
  1916. FZ_FUNCTION void ll_fz_fill_image_mask(::fz_device *dev, ::fz_image *image, ::fz_matrix ctm, ::fz_colorspace *colorspace, const float *color, float alpha, ::fz_color_params color_params);
  1917. /** Low-level wrapper for `::fz_fill_path()`. */
  1918. /**
  1919. Device calls; graphics primitives and containers.
  1920. */
  1921. FZ_FUNCTION void ll_fz_fill_path(::fz_device *dev, const ::fz_path *path, int even_odd, ::fz_matrix ctm, ::fz_colorspace *colorspace, const float *color, float alpha, ::fz_color_params color_params);
  1922. /** Low-level wrapper for `::fz_fill_pixmap_from_display_list()`. */
  1923. FZ_FUNCTION ::fz_pixmap *ll_fz_fill_pixmap_from_display_list(::fz_display_list *list, ::fz_matrix ctm, ::fz_pixmap *pix);
  1924. /** Low-level wrapper for `::fz_fill_pixmap_with_color()`.
  1925. This function has out-params. Python/C# wrappers look like:
  1926. `ll_fz_fill_pixmap_with_color(::fz_pixmap *pix, ::fz_colorspace *colorspace, ::fz_color_params color_params)` => float color
  1927. */
  1928. /**
  1929. Fill pixmap with solid color.
  1930. */
  1931. FZ_FUNCTION void ll_fz_fill_pixmap_with_color(::fz_pixmap *pix, ::fz_colorspace *colorspace, float *color, ::fz_color_params color_params);
  1932. /** Low-level wrapper for `::fz_fill_shade()`. */
  1933. FZ_FUNCTION void ll_fz_fill_shade(::fz_device *dev, ::fz_shade *shade, ::fz_matrix ctm, float alpha, ::fz_color_params color_params);
  1934. /** Low-level wrapper for `::fz_fill_text()`. */
  1935. FZ_FUNCTION void ll_fz_fill_text(::fz_device *dev, const ::fz_text *text, ::fz_matrix ctm, ::fz_colorspace *colorspace, const float *color, float alpha, ::fz_color_params color_params);
  1936. /** Low-level wrapper for `::fz_filter_store()`. */
  1937. /**
  1938. Filter every element in the store with a matching type with the
  1939. given function.
  1940. If the function returns 1 for an element, drop the element.
  1941. */
  1942. FZ_FUNCTION void ll_fz_filter_store(::fz_store_filter_fn *fn, void *arg, const ::fz_store_type *type);
  1943. /** Low-level wrapper for `::fz_find_item()`. */
  1944. /**
  1945. Find an item within the store.
  1946. drop: The function used to free the value (to ensure we get a
  1947. value of the correct type).
  1948. key: The key used to index the item.
  1949. type: Functions used to manipulate the key.
  1950. Returns NULL for not found, otherwise returns a pointer to the
  1951. value indexed by key to which a reference has been taken.
  1952. */
  1953. FZ_FUNCTION void *ll_fz_find_item(::fz_store_drop_fn *drop, void *key, const ::fz_store_type *type);
  1954. /** Low-level wrapper for `::fz_find_table_within_bounds()`. */
  1955. /**
  1956. Interpret the bounded contents of a given stext page as
  1957. a table.
  1958. The page contents will be rewritten to contain a Table
  1959. structure with the identified content in it.
  1960. This uses the same logic as for fz_table_hunt, without the
  1961. actual hunting. fz_table_hunt hunts to find possible bounds
  1962. for multiple tables on the page; this routine just finds a
  1963. single table contained within the given rectangle.
  1964. Returns the stext_block list that contains the content of
  1965. the table.
  1966. */
  1967. FZ_FUNCTION ::fz_stext_block *ll_fz_find_table_within_bounds(::fz_stext_page *page, ::fz_rect bounds);
  1968. /** Low-level wrapper for `::fz_flush_output()`. */
  1969. /**
  1970. Flush unwritten data.
  1971. */
  1972. FZ_FUNCTION void ll_fz_flush_output(::fz_output *out);
  1973. /** Low-level wrapper for `::fz_flush_warnings()`. */
  1974. /**
  1975. Flush any repeated warnings.
  1976. Repeated warnings are buffered, counted and eventually printed
  1977. along with the number of repetitions. Call fz_flush_warnings
  1978. to force printing of the latest buffered warning and the
  1979. number of repetitions, for example to make sure that all
  1980. warnings are printed before exiting an application.
  1981. */
  1982. FZ_FUNCTION void ll_fz_flush_warnings();
  1983. /** Low-level wrapper for `::fz_font_ascender()`. */
  1984. /**
  1985. Retrieve font ascender in ems.
  1986. */
  1987. FZ_FUNCTION float ll_fz_font_ascender(::fz_font *font);
  1988. /** Low-level wrapper for `::fz_font_bbox()`. */
  1989. /**
  1990. Retrieve the font bbox.
  1991. font: The font to query.
  1992. Returns the font bbox by value; it is valid only if
  1993. fz_font_flags(font)->invalid_bbox is zero.
  1994. */
  1995. FZ_FUNCTION ::fz_rect ll_fz_font_bbox(::fz_font *font);
  1996. /** Low-level wrapper for `::fz_font_descender()`. */
  1997. /**
  1998. Retrieve font descender in ems.
  1999. */
  2000. FZ_FUNCTION float ll_fz_font_descender(::fz_font *font);
  2001. /** Low-level wrapper for `::fz_font_digest()`. */
  2002. /**
  2003. Retrieve the MD5 digest for the font's data.
  2004. */
  2005. FZ_FUNCTION void ll_fz_font_digest(::fz_font *font, unsigned char digest[16]);
  2006. /** Low-level wrapper for `::fz_font_flags()`. */
  2007. /**
  2008. Retrieve a pointer to the font flags
  2009. for a given font. These can then be updated as required.
  2010. font: The font to query
  2011. Returns a pointer to the flags structure (or NULL, if
  2012. the font is NULL).
  2013. */
  2014. FZ_FUNCTION ::fz_font_flags_t *ll_fz_font_flags(::fz_font *font);
  2015. /** Low-level wrapper for `::fz_font_ft_face()`. */
  2016. /**
  2017. Retrieve the FT_Face handle
  2018. for the font.
  2019. font: The font to query
  2020. Returns the FT_Face handle for the font, or NULL
  2021. if not a freetype handled font. (Cast to void *
  2022. to avoid nasty header exposure).
  2023. */
  2024. FZ_FUNCTION void *ll_fz_font_ft_face(::fz_font *font);
  2025. /** Low-level wrapper for `::fz_font_is_bold()`. */
  2026. /**
  2027. Query whether the font flags say that this font is bold.
  2028. */
  2029. FZ_FUNCTION int ll_fz_font_is_bold(::fz_font *font);
  2030. /** Low-level wrapper for `::fz_font_is_italic()`. */
  2031. /**
  2032. Query whether the font flags say that this font is italic.
  2033. */
  2034. FZ_FUNCTION int ll_fz_font_is_italic(::fz_font *font);
  2035. /** Low-level wrapper for `::fz_font_is_monospaced()`. */
  2036. /**
  2037. Query whether the font flags say that this font is monospaced.
  2038. */
  2039. FZ_FUNCTION int ll_fz_font_is_monospaced(::fz_font *font);
  2040. /** Low-level wrapper for `::fz_font_is_serif()`. */
  2041. /**
  2042. Query whether the font flags say that this font is serif.
  2043. */
  2044. FZ_FUNCTION int ll_fz_font_is_serif(::fz_font *font);
  2045. /** Low-level wrapper for `::fz_font_name()`. */
  2046. /**
  2047. Retrieve a pointer to the name of the font.
  2048. font: The font to query.
  2049. Returns a pointer to an internal copy of the font name.
  2050. Will never be NULL, but may be the empty string.
  2051. */
  2052. FZ_FUNCTION const char *ll_fz_font_name(::fz_font *font);
  2053. /** Low-level wrapper for `::fz_font_shaper_data()`. */
  2054. /**
  2055. Retrieve a pointer to the shaper data
  2056. structure for the given font.
  2057. font: The font to query.
  2058. Returns a pointer to the shaper data structure (or NULL if
  2059. font is NULL).
  2060. */
  2061. FZ_FUNCTION ::fz_shaper_data_t *ll_fz_font_shaper_data(::fz_font *font);
  2062. /** Low-level wrapper for `::fz_font_t3_procs()`. */
  2063. /**
  2064. Retrieve the Type3 procs
  2065. for a font.
  2066. font: The font to query
  2067. Returns the t3_procs pointer. Will be NULL for a
  2068. non type-3 font.
  2069. */
  2070. FZ_FUNCTION ::fz_buffer **ll_fz_font_t3_procs(::fz_font *font);
  2071. /** Low-level wrapper for `::fz_format_double()`. */
  2072. /** Swig-friendly and typesafe way to do fz_snprintf(fmt, value). `fmt`
  2073. must end with one of 'efg' otherwise we throw an exception. */
  2074. FZ_FUNCTION std::string ll_fz_format_double(const char *fmt, double value);
  2075. /** Low-level wrapper for `::fz_format_link_uri()`. */
  2076. /**
  2077. Format an internal link to a page number, location, and possible viewing parameters,
  2078. suitable for use with fz_create_link.
  2079. Returns a newly allocated string that the caller must free.
  2080. */
  2081. FZ_FUNCTION char *ll_fz_format_link_uri(::fz_document *doc, ::fz_link_dest dest);
  2082. /** Low-level wrapper for `::fz_format_output_path()`. */
  2083. /**
  2084. create output file name using a template.
  2085. If the path contains %[0-9]*d, the first such pattern will be
  2086. replaced with the page number. If the template does not contain
  2087. such a pattern, the page number will be inserted before the
  2088. filename extension. If the template does not have a filename
  2089. extension, the page number will be added to the end.
  2090. */
  2091. FZ_FUNCTION void ll_fz_format_output_path(char *path, size_t size, const char *fmt, int page);
  2092. /** Low-level wrapper for `::fz_format_string()`. */
  2093. /**
  2094. Our customised 'printf'-like string formatter.
  2095. Takes %c, %d, %s, %u, %x, %X as usual.
  2096. The only modifiers supported are:
  2097. 1) zero-padding ints (e.g. %02d, %03u, %04x, etc).
  2098. 2) ' to indicate that ' should be inserted into
  2099. integers as thousands separators.
  2100. 3) , to indicate that , should be inserted into
  2101. integers as thousands separators.
  2102. 4) _ to indicate that , should be inserted into
  2103. integers as thousands separators.
  2104. Posix chooses the thousand separator in a locale
  2105. specific way - we do not. We always apply it every
  2106. 3 characters for the positive part of integers, so
  2107. other styles, such as Indian (123,456,78) are not
  2108. supported.
  2109. %g output in "as short as possible hopefully lossless
  2110. non-exponent" form, see fz_ftoa for specifics.
  2111. %f and %e output as usual.
  2112. %C outputs a utf8 encoded int.
  2113. %M outputs a fz_matrix*.
  2114. %R outputs a fz_rect*.
  2115. %P outputs a fz_point*.
  2116. %n outputs a PDF name (with appropriate escaping).
  2117. %q and %( output escaped strings in C/PDF syntax.
  2118. %l{d,u,x,X} indicates that the values are int64_t.
  2119. %z{d,u,x,X} indicates that the value is a size_t.
  2120. %< outputs a quoted (utf8) string (for XML).
  2121. %> outputs a hex string for a zero terminated string of bytes.
  2122. user: An opaque pointer that is passed to the emit function.
  2123. emit: A function pointer called to emit output bytes as the
  2124. string is being formatted.
  2125. */
  2126. FZ_FUNCTION void ll_fz_format_string(void *user, void (*emit)(::fz_context *, void *, int ), const char *fmt, va_list args);
  2127. /** Low-level wrapper for `::fz_free()`. */
  2128. /**
  2129. Free a previously allocated block of memory.
  2130. fz_free(ctx, NULL) does nothing.
  2131. Never throws exceptions.
  2132. */
  2133. FZ_FUNCTION void ll_fz_free(void *p);
  2134. /** Low-level wrapper for `::fz_free_aligned()`. */
  2135. /**
  2136. fz_free equivalent, for blocks allocated via fz_malloc_aligned.
  2137. */
  2138. FZ_FUNCTION void ll_fz_free_aligned(void *p);
  2139. /** Low-level wrapper for `::fz_ft_lock()`. */
  2140. FZ_FUNCTION void ll_fz_ft_lock();
  2141. /** Low-level wrapper for `::fz_ft_lock_held()`. */
  2142. FZ_FUNCTION int ll_fz_ft_lock_held();
  2143. /** Low-level wrapper for `::fz_ft_unlock()`. */
  2144. FZ_FUNCTION void ll_fz_ft_unlock();
  2145. /** Low-level wrapper for `::fz_function_size()`. */
  2146. FZ_FUNCTION size_t ll_fz_function_size(::fz_function *func);
  2147. /** Low-level wrapper for `::fz_gamma_pixmap()`. */
  2148. /**
  2149. Apply gamma correction to a pixmap. All components
  2150. of all pixels are modified (except alpha, which is unchanged).
  2151. gamma: The gamma value to apply; 1.0 for no change.
  2152. */
  2153. FZ_FUNCTION void ll_fz_gamma_pixmap(::fz_pixmap *pix, float gamma);
  2154. /** Low-level wrapper for `::fz_generate_transition()`. */
  2155. /**
  2156. Generate a frame of a transition.
  2157. tpix: Target pixmap
  2158. opix: Old pixmap
  2159. npix: New pixmap
  2160. time: Position within the transition (0 to 256)
  2161. trans: Transition details
  2162. Returns 1 if successfully generated a frame.
  2163. Note: Pixmaps must include alpha.
  2164. */
  2165. FZ_FUNCTION int ll_fz_generate_transition(::fz_pixmap *tpix, ::fz_pixmap *opix, ::fz_pixmap *npix, int time, ::fz_transition *trans);
  2166. /** Low-level wrapper for `::fz_get_glyph_name()`. */
  2167. /**
  2168. Find the name of a glyph
  2169. font: The font to look for the glyph in.
  2170. glyph: The glyph id to look for.
  2171. buf: Pointer to a buffer for the name to be inserted into.
  2172. size: The size of the buffer.
  2173. If a font contains a name table, then the name of the glyph
  2174. will be returned in the supplied buffer. Otherwise a name
  2175. is synthesised. The name will be truncated to fit in
  2176. the buffer.
  2177. */
  2178. FZ_FUNCTION void ll_fz_get_glyph_name(::fz_font *font, int glyph, char *buf, int size);
  2179. /** Low-level wrapper for `::fz_get_glyph_name2()`. */
  2180. /**
  2181. C++ alternative to fz_get_glyph_name() that returns information in a std::string.
  2182. */
  2183. FZ_FUNCTION std::string ll_fz_get_glyph_name2(::fz_font *font, int glyph);
  2184. /** Low-level wrapper for `::fz_get_pixmap_from_image()`.
  2185. This function has out-params. Python/C# wrappers look like:
  2186. `ll_fz_get_pixmap_from_image(::fz_image *image, const ::fz_irect *subarea, ::fz_matrix *ctm)` => `(fz_pixmap *, int w, int h)`
  2187. */
  2188. /**
  2189. Called to get a handle to a pixmap from an image.
  2190. image: The image to retrieve a pixmap from.
  2191. subarea: The subarea of the image that we actually care about
  2192. (or NULL to indicate the whole image).
  2193. ctm: Optional, unless subarea is given. If given, then on
  2194. entry this is the transform that will be applied to the complete
  2195. image. It should be updated on exit to the transform to apply to
  2196. the given subarea of the image. This is used to calculate the
  2197. desired width/height for subsampling.
  2198. w: If non-NULL, a pointer to an int to be updated on exit to the
  2199. width (in pixels) that the scaled output will cover.
  2200. h: If non-NULL, a pointer to an int to be updated on exit to the
  2201. height (in pixels) that the scaled output will cover.
  2202. Returns a non NULL kept pixmap pointer. May throw exceptions.
  2203. */
  2204. FZ_FUNCTION ::fz_pixmap *ll_fz_get_pixmap_from_image(::fz_image *image, const ::fz_irect *subarea, ::fz_matrix *ctm, int *w, int *h);
  2205. /** Low-level wrapper for `::fz_get_unscaled_pixmap_from_image()`. */
  2206. /**
  2207. Calls fz_get_pixmap_from_image() with ctm, subarea, w and h all set to NULL.
  2208. */
  2209. FZ_FUNCTION ::fz_pixmap *ll_fz_get_unscaled_pixmap_from_image(::fz_image *image);
  2210. /** Low-level wrapper for `::fz_getopt()`.
  2211. This function has out-params. Python/C# wrappers look like:
  2212. `ll_fz_getopt(int nargc, const char *ostr)` => `(int, char *nargv)`
  2213. */
  2214. /**
  2215. Identical to fz_getopt_long, but with a NULL longopts field, signifying no long
  2216. options.
  2217. */
  2218. FZ_FUNCTION int ll_fz_getopt(int nargc, char **nargv, const char *ostr);
  2219. /** Low-level wrapper for `::fz_getopt_long()`.
  2220. This function has out-params. Python/C# wrappers look like:
  2221. `ll_fz_getopt_long(int nargc, const char *ostr, const ::fz_getopt_long_options *longopts)` => `(int, char *nargv)`
  2222. */
  2223. /**
  2224. Simple functions/variables for use in tools.
  2225. ostr = option string. Comprises single letter options, followed by : if there
  2226. is an argument to the option.
  2227. longopts: NULL (indicating no long options), or a pointer to an array of
  2228. longoptions, terminated by an entry with option == NULL.
  2229. In the event of matching a single char option, this function will normally
  2230. return the char. The exception to this is when the option requires an
  2231. argument and none is supplied; in this case we return ':'.
  2232. In the event of matching a long option, this function returns 0, with fz_optlong
  2233. set to point to the matching option.
  2234. A long option entry may be followed with : to indicate there is an argument to the
  2235. option. If the need for an argument is specified in this way, and no argument is
  2236. given, an error will be displayed and argument processing will stop. If an argument
  2237. is given, and the long option record contains a non-null flag pointer, then the code
  2238. will decode the argument and fill in that flag pointer. Specifically,
  2239. case-insensitive matches to 'yes', 'no', 'true' and 'false' will cause a value of 0
  2240. or 1 as appropriate to be written; failing this the arg will be interpreted as a
  2241. decimal integer using atoi.
  2242. A long option entry may be followed by an list of options (e.g. myoption=foo|bar|baz)
  2243. and the option will be passed to fz_opt_from_list. The return value of that will be
  2244. placed in fz_optitem. If the return value of that function is -1, then an error will
  2245. be displayed and argument processing will stop.
  2246. In the event of reaching the end of the arg list or '--', this function returns EOF.
  2247. In the event of failing to match anything, an error is printed, and we return '?'.
  2248. If an argument is expected for the option, then fz_optarg will be returned pointing
  2249. at the start of the argument. Examples of supported argument formats: '-r500', '-r 500',
  2250. '--resolution 500', '--resolution=500'.
  2251. */
  2252. FZ_FUNCTION int ll_fz_getopt_long(int nargc, char **nargv, const char *ostr, const ::fz_getopt_long_options *longopts);
  2253. /** Low-level wrapper for `::fz_glyph_bbox()`. */
  2254. /**
  2255. Return the bounding box of the glyph in pixels.
  2256. */
  2257. FZ_FUNCTION ::fz_irect ll_fz_glyph_bbox(::fz_glyph *glyph);
  2258. /** Low-level wrapper for `::fz_glyph_bbox_no_ctx()`. */
  2259. FZ_FUNCTION ::fz_irect ll_fz_glyph_bbox_no_ctx(::fz_glyph *src);
  2260. /** Low-level wrapper for `::fz_glyph_cacheable()`. */
  2261. /**
  2262. Determine if a given glyph in a font
  2263. is cacheable. Certain glyphs in a type 3 font cannot safely
  2264. be cached, as their appearance depends on the enclosing
  2265. graphic state.
  2266. font: The font to look for the glyph in.
  2267. gif: The glyph to query.
  2268. Returns non-zero if cacheable, 0 if not.
  2269. */
  2270. FZ_FUNCTION int ll_fz_glyph_cacheable(::fz_font *font, int gid);
  2271. /** Low-level wrapper for `::fz_glyph_height()`. */
  2272. /**
  2273. Return the height of the glyph in pixels.
  2274. */
  2275. FZ_FUNCTION int ll_fz_glyph_height(::fz_glyph *glyph);
  2276. /** Low-level wrapper for `::fz_glyph_name_from_unicode_sc()`. */
  2277. FZ_FUNCTION const char *ll_fz_glyph_name_from_unicode_sc(int unicode);
  2278. /** Low-level wrapper for `::fz_glyph_width()`. */
  2279. /**
  2280. Return the width of the glyph in pixels.
  2281. */
  2282. FZ_FUNCTION int ll_fz_glyph_width(::fz_glyph *glyph);
  2283. /** Low-level wrapper for `::fz_graphics_aa_level()`. */
  2284. /**
  2285. Get the number of bits of antialiasing we are
  2286. using for graphics. Between 0 and 8.
  2287. */
  2288. FZ_FUNCTION int ll_fz_graphics_aa_level();
  2289. /** Low-level wrapper for `::fz_graphics_min_line_width()`. */
  2290. /**
  2291. Get the minimum line width to be
  2292. used for stroked lines.
  2293. min_line_width: The minimum line width to use (in pixels).
  2294. */
  2295. FZ_FUNCTION float ll_fz_graphics_min_line_width();
  2296. /** Low-level wrapper for `::fz_gridfit_matrix()`. */
  2297. /**
  2298. Grid fit a matrix.
  2299. as_tiled = 0 => adjust the matrix so that the image of the unit
  2300. square completely covers any pixel that was touched by the
  2301. image of the unit square under the original matrix.
  2302. as_tiled = 1 => adjust the matrix so that the corners of the
  2303. image of the unit square align with the closest integer corner
  2304. of the image of the unit square under the original matrix.
  2305. */
  2306. FZ_FUNCTION ::fz_matrix ll_fz_gridfit_matrix(int as_tiled, ::fz_matrix m);
  2307. /** Low-level wrapper for `::fz_grisu()`.
  2308. This function has out-params. Python/C# wrappers look like:
  2309. `ll_fz_grisu(float f, char *s)` => `(int, int exp)`
  2310. */
  2311. FZ_FUNCTION int ll_fz_grisu(float f, char *s, int *exp);
  2312. /** Low-level wrapper for `::fz_grow_buffer()`. */
  2313. /**
  2314. Make some space within a buffer (i.e. ensure that
  2315. capacity > size).
  2316. */
  2317. FZ_FUNCTION void ll_fz_grow_buffer(::fz_buffer *buf);
  2318. /** Low-level wrapper for `::fz_has_archive_entry()`. */
  2319. /**
  2320. Check if entry by given name exists.
  2321. If named entry does not exist 0 will be returned, if it does
  2322. exist 1 is returned.
  2323. name: Entry name to look for, this must be an exact match to
  2324. the entry name in the archive.
  2325. */
  2326. FZ_FUNCTION int ll_fz_has_archive_entry(::fz_archive *arch, const char *name);
  2327. /** Low-level wrapper for `::fz_has_option()`.
  2328. This function has out-params. Python/C# wrappers look like:
  2329. `ll_fz_has_option(const char *opts, const char *key)` => `(int, const char *val)`
  2330. */
  2331. /**
  2332. Look for a given option (key) in the opts string. Return 1 if
  2333. it has it, and update *val to point to the value within opts.
  2334. */
  2335. FZ_FUNCTION int ll_fz_has_option(const char *opts, const char *key, const char **val);
  2336. /** Low-level wrapper for `::fz_has_permission()`. */
  2337. /**
  2338. Check permission flags on document.
  2339. */
  2340. FZ_FUNCTION int ll_fz_has_permission(::fz_document *doc, ::fz_permission p);
  2341. /** Low-level wrapper for `::fz_hash_filter()`. */
  2342. /**
  2343. Iterate over the entries in a hash table, removing all the ones where callback returns true.
  2344. Does NOT free the value of the entry, so the caller is expected to take care of this.
  2345. */
  2346. FZ_FUNCTION void ll_fz_hash_filter(::fz_hash_table *table, void *state, ::fz_hash_table_filter_fn *callback);
  2347. /** Low-level wrapper for `::fz_hash_find()`. */
  2348. /**
  2349. Search for a matching hash within the table, and return the
  2350. associated value.
  2351. */
  2352. FZ_FUNCTION void *ll_fz_hash_find(::fz_hash_table *table, const void *key);
  2353. /** Low-level wrapper for `::fz_hash_for_each()`. */
  2354. /**
  2355. Iterate over the entries in a hash table.
  2356. */
  2357. FZ_FUNCTION void ll_fz_hash_for_each(::fz_hash_table *table, void *state, ::fz_hash_table_for_each_fn *callback);
  2358. /** Low-level wrapper for `::fz_hash_insert()`. */
  2359. /**
  2360. Insert a new key/value pair into the hash table.
  2361. If an existing entry with the same key is found, no change is
  2362. made to the hash table, and a pointer to the existing value is
  2363. returned.
  2364. If no existing entry with the same key is found, ownership of
  2365. val passes in, key is copied, and NULL is returned.
  2366. */
  2367. FZ_FUNCTION void *ll_fz_hash_insert(::fz_hash_table *table, const void *key, void *val);
  2368. /** Low-level wrapper for `::fz_hash_remove()`. */
  2369. /**
  2370. Remove the entry for a given key.
  2371. The value is NOT freed, so the caller is expected to take care
  2372. of this.
  2373. */
  2374. FZ_FUNCTION void ll_fz_hash_remove(::fz_hash_table *table, const void *key);
  2375. /** Low-level wrapper for `::fz_hb_lock()`. */
  2376. /**
  2377. Lock against Harfbuzz being called
  2378. simultaneously in several threads. This reuses
  2379. FZ_LOCK_FREETYPE.
  2380. */
  2381. FZ_FUNCTION void ll_fz_hb_lock();
  2382. /** Low-level wrapper for `::fz_hb_unlock()`. */
  2383. /**
  2384. Unlock after a Harfbuzz call. This reuses
  2385. FZ_LOCK_FREETYPE.
  2386. */
  2387. FZ_FUNCTION void ll_fz_hb_unlock();
  2388. /** Low-level wrapper for `::fz_highlight_selection()`. */
  2389. /**
  2390. Return a list of quads to highlight lines inside the selection
  2391. points.
  2392. */
  2393. FZ_FUNCTION int ll_fz_highlight_selection(::fz_stext_page *page, ::fz_point a, ::fz_point b, ::fz_quad *quads, int max_quads);
  2394. /** Low-level wrapper for `::fz_highlight_selection2()`. */
  2395. /**
  2396. C++ alternative to fz_highlight_selection() that returns quads in a
  2397. std::vector.
  2398. */
  2399. FZ_FUNCTION std::vector<fz_quad> ll_fz_highlight_selection2(::fz_stext_page *page, ::fz_point a, ::fz_point b, int max_quads);
  2400. /** Low-level wrapper for `::fz_ignore_error()`. */
  2401. FZ_FUNCTION void ll_fz_ignore_error();
  2402. /** Low-level wrapper for `::fz_ignore_text()`. */
  2403. FZ_FUNCTION void ll_fz_ignore_text(::fz_device *dev, const ::fz_text *text, ::fz_matrix ctm);
  2404. /** Low-level wrapper for `::fz_image_orientation()`. */
  2405. /**
  2406. Request the natural orientation of an image.
  2407. This is for images (such as JPEG) that can contain internal
  2408. specifications of rotation/flips. This is ignored by all the
  2409. internal decode/rendering routines, but can be used by callers
  2410. (such as the image document handler) to respect such
  2411. specifications.
  2412. The values used by MuPDF are as follows, with the equivalent
  2413. Exif specifications given for information:
  2414. 0: Undefined
  2415. 1: 0 degree ccw rotation. (Exif = 1)
  2416. 2: 90 degree ccw rotation. (Exif = 8)
  2417. 3: 180 degree ccw rotation. (Exif = 3)
  2418. 4: 270 degree ccw rotation. (Exif = 6)
  2419. 5: flip on X. (Exif = 2)
  2420. 6: flip on X, then rotate ccw by 90 degrees. (Exif = 5)
  2421. 7: flip on X, then rotate ccw by 180 degrees. (Exif = 4)
  2422. 8: flip on X, then rotate ccw by 270 degrees. (Exif = 7)
  2423. */
  2424. FZ_FUNCTION uint8_t ll_fz_image_orientation(::fz_image *image);
  2425. /** Low-level wrapper for `::fz_image_orientation_matrix()`. */
  2426. FZ_FUNCTION ::fz_matrix ll_fz_image_orientation_matrix(::fz_image *image);
  2427. /** Low-level wrapper for `::fz_image_resolution()`.
  2428. This function has out-params. Python/C# wrappers look like:
  2429. `ll_fz_image_resolution(::fz_image *image)` => `(int xres, int yres)`
  2430. */
  2431. /**
  2432. Request the natural resolution
  2433. of an image.
  2434. xres, yres: Pointers to ints to be updated with the
  2435. natural resolution of an image (or a sensible default
  2436. if not encoded).
  2437. */
  2438. FZ_FUNCTION void ll_fz_image_resolution(::fz_image *image, int *xres, int *yres);
  2439. /** Low-level wrapper for `::fz_image_size()`. */
  2440. /**
  2441. Return the size of the storage used by an image.
  2442. */
  2443. FZ_FUNCTION size_t ll_fz_image_size(::fz_image *im);
  2444. /** Low-level wrapper for `::fz_image_type_name()`. */
  2445. /**
  2446. Map from FZ_IMAGE_* value to string.
  2447. The returned string is static and therefore must not be freed.
  2448. */
  2449. FZ_FUNCTION const char *ll_fz_image_type_name(int type);
  2450. /** Low-level wrapper for `::fz_include_point_in_rect()`. */
  2451. /**
  2452. Expand a bbox to include a given point.
  2453. To create a rectangle that encompasses a sequence of points, the
  2454. rectangle must first be set to be the empty rectangle at one of
  2455. the points before including the others.
  2456. */
  2457. FZ_FUNCTION ::fz_rect ll_fz_include_point_in_rect(::fz_rect r, ::fz_point p);
  2458. /** Low-level wrapper for `::fz_init_text_decoder()`. */
  2459. FZ_FUNCTION void ll_fz_init_text_decoder(::fz_text_decoder *dec, const char *encoding);
  2460. /** Low-level wrapper for `::fz_install_load_system_font_funcs()`. */
  2461. /**
  2462. Install functions to allow MuPDF to request fonts from the
  2463. system.
  2464. Only one set of hooks can be in use at a time.
  2465. */
  2466. FZ_FUNCTION void ll_fz_install_load_system_font_funcs(::fz_load_system_font_fn *f, ::fz_load_system_cjk_font_fn *f_cjk, ::fz_load_system_fallback_font_fn *f_fallback);
  2467. /** Low-level wrapper for `::fz_install_load_system_font_funcs2()`. */
  2468. /**
  2469. Alternative to fz_install_load_system_font_funcs() that takes args in a
  2470. struct, to allow use from Python/C# via Swig Directors.
  2471. */
  2472. FZ_FUNCTION void ll_fz_install_load_system_font_funcs2(::fz_install_load_system_font_funcs_args *args);
  2473. /** Low-level wrapper for `::fz_int2_heap_debug()`. */
  2474. FZ_FUNCTION void ll_fz_int2_heap_debug(::fz_int2_heap *heap);
  2475. /** Low-level wrapper for `::fz_int2_heap_dump()`. */
  2476. FZ_FUNCTION void ll_fz_int2_heap_dump(::fz_output *out, ::fz_int2_heap *heap);
  2477. /** Low-level wrapper for `::fz_int2_heap_insert()`. */
  2478. FZ_FUNCTION void ll_fz_int2_heap_insert(::fz_int2_heap *heap, ::fz_int2 v);
  2479. /** Low-level wrapper for `::fz_int2_heap_sort()`. */
  2480. FZ_FUNCTION void ll_fz_int2_heap_sort(::fz_int2_heap *heap);
  2481. /** Low-level wrapper for `::fz_int2_heap_uniq()`. */
  2482. FZ_FUNCTION void ll_fz_int2_heap_uniq(::fz_int2_heap *heap);
  2483. /** Low-level wrapper for `::fz_int_heap_debug()`. */
  2484. FZ_FUNCTION void ll_fz_int_heap_debug(::fz_int_heap *heap);
  2485. /** Low-level wrapper for `::fz_int_heap_dump()`. */
  2486. FZ_FUNCTION void ll_fz_int_heap_dump(::fz_output *out, ::fz_int_heap *heap);
  2487. /** Low-level wrapper for `::fz_int_heap_insert()`. */
  2488. FZ_FUNCTION void ll_fz_int_heap_insert(::fz_int_heap *heap, int v);
  2489. /** Low-level wrapper for `::fz_int_heap_sort()`. */
  2490. FZ_FUNCTION void ll_fz_int_heap_sort(::fz_int_heap *heap);
  2491. /** Low-level wrapper for `::fz_int_heap_uniq()`. */
  2492. FZ_FUNCTION void ll_fz_int_heap_uniq(::fz_int_heap *heap);
  2493. /** Low-level wrapper for `::fz_intersect_irect()`. */
  2494. /**
  2495. Compute intersection of two bounding boxes.
  2496. Similar to fz_intersect_rect but operates on two bounding
  2497. boxes instead of two rectangles.
  2498. */
  2499. FZ_FUNCTION ::fz_irect ll_fz_intersect_irect(::fz_irect a, ::fz_irect b);
  2500. /** Low-level wrapper for `::fz_intersect_rect()`. */
  2501. /**
  2502. Compute intersection of two rectangles.
  2503. Given two rectangles, update the first to be the smallest
  2504. axis-aligned rectangle that covers the area covered by both
  2505. given rectangles. If either rectangle is empty then the
  2506. intersection is also empty. If either rectangle is infinite
  2507. then the intersection is simply the non-infinite rectangle.
  2508. Should both rectangles be infinite, then the intersection is
  2509. also infinite.
  2510. */
  2511. FZ_FUNCTION ::fz_rect ll_fz_intersect_rect(::fz_rect a, ::fz_rect b);
  2512. /** Low-level wrapper for `::fz_intptr_heap_debug()`. */
  2513. FZ_FUNCTION void ll_fz_intptr_heap_debug(::fz_intptr_heap *heap);
  2514. /** Low-level wrapper for `::fz_intptr_heap_dump()`. */
  2515. FZ_FUNCTION void ll_fz_intptr_heap_dump(::fz_output *out, ::fz_intptr_heap *heap);
  2516. /** Low-level wrapper for `::fz_intptr_heap_insert()`. */
  2517. FZ_FUNCTION void ll_fz_intptr_heap_insert(::fz_intptr_heap *heap, ::fz_intptr v);
  2518. /** Low-level wrapper for `::fz_intptr_heap_sort()`. */
  2519. FZ_FUNCTION void ll_fz_intptr_heap_sort(::fz_intptr_heap *heap);
  2520. /** Low-level wrapper for `::fz_intptr_heap_uniq()`. */
  2521. FZ_FUNCTION void ll_fz_intptr_heap_uniq(::fz_intptr_heap *heap);
  2522. /** Low-level wrapper for `::fz_invert_bitmap()`. */
  2523. /**
  2524. Invert bitmap.
  2525. Never throws exceptions.
  2526. */
  2527. FZ_FUNCTION void ll_fz_invert_bitmap(::fz_bitmap *bmp);
  2528. /** Low-level wrapper for `::fz_invert_matrix()`. */
  2529. /**
  2530. Create an inverse matrix.
  2531. matrix: Matrix to invert. A degenerate matrix, where the
  2532. determinant is equal to zero, can not be inverted and the
  2533. original matrix is returned instead.
  2534. Returns inverse.
  2535. */
  2536. FZ_FUNCTION ::fz_matrix ll_fz_invert_matrix(::fz_matrix matrix);
  2537. /** Low-level wrapper for `::fz_invert_pixmap()`. */
  2538. /**
  2539. Invert all the pixels in a pixmap. All components (process and
  2540. spots) of all pixels are inverted (except alpha, which is
  2541. unchanged).
  2542. */
  2543. FZ_FUNCTION void ll_fz_invert_pixmap(::fz_pixmap *pix);
  2544. /** Low-level wrapper for `::fz_invert_pixmap_alpha()`. */
  2545. /**
  2546. Invert the alpha of all the pixels in a pixmap.
  2547. */
  2548. FZ_FUNCTION void ll_fz_invert_pixmap_alpha(::fz_pixmap *pix);
  2549. /** Low-level wrapper for `::fz_invert_pixmap_luminance()`. */
  2550. /**
  2551. Transform the pixels in a pixmap so that luminance of each
  2552. pixel is inverted, and the chrominance remains unchanged (as
  2553. much as accuracy allows).
  2554. All components of all pixels are inverted (except alpha, which
  2555. is unchanged). Only supports Grey and RGB bitmaps.
  2556. */
  2557. FZ_FUNCTION void ll_fz_invert_pixmap_luminance(::fz_pixmap *pix);
  2558. /** Low-level wrapper for `::fz_invert_pixmap_raw()`. */
  2559. /**
  2560. Invert all the pixels in a non-premultiplied pixmap in a
  2561. very naive manner.
  2562. */
  2563. FZ_FUNCTION void ll_fz_invert_pixmap_raw(::fz_pixmap *pix);
  2564. /** Low-level wrapper for `::fz_invert_pixmap_rect()`. */
  2565. /**
  2566. Invert all the pixels in a given rectangle of a (premultiplied)
  2567. pixmap. All components of all pixels in the rectangle are
  2568. inverted (except alpha, which is unchanged).
  2569. */
  2570. FZ_FUNCTION void ll_fz_invert_pixmap_rect(::fz_pixmap *image, ::fz_irect rect);
  2571. /** Low-level wrapper for `::fz_irect_from_rect()`. */
  2572. /**
  2573. Convert a rect into the minimal bounding box
  2574. that covers the rectangle.
  2575. Coordinates in a bounding box are integers, so rounding of the
  2576. rects coordinates takes place. The top left corner is rounded
  2577. upwards and left while the bottom right corner is rounded
  2578. downwards and to the right.
  2579. */
  2580. FZ_FUNCTION ::fz_irect ll_fz_irect_from_rect(::fz_rect rect);
  2581. /** Low-level wrapper for `::fz_irect_height()`. */
  2582. /**
  2583. Return the height of an irect. Invalid irects return 0.
  2584. */
  2585. FZ_FUNCTION int ll_fz_irect_height(::fz_irect r);
  2586. /** Low-level wrapper for `::fz_irect_width()`. */
  2587. /**
  2588. Return the width of an irect. Invalid irects return 0.
  2589. */
  2590. FZ_FUNCTION unsigned int ll_fz_irect_width(::fz_irect r);
  2591. /** Low-level wrapper for `::fz_is_cfb_archive()`. */
  2592. /**
  2593. Detect if stream object is a cfb archive.
  2594. Assumes that the stream object is seekable.
  2595. */
  2596. FZ_FUNCTION int ll_fz_is_cfb_archive(::fz_stream *file);
  2597. /** Low-level wrapper for `::fz_is_directory()`. */
  2598. /**
  2599. Determine if a given path is a directory.
  2600. In the case of the path not existing, or having no access
  2601. we will return 0.
  2602. */
  2603. FZ_FUNCTION int ll_fz_is_directory(const char *path);
  2604. /** Low-level wrapper for `::fz_is_document_reflowable()`. */
  2605. /**
  2606. Is the document reflowable.
  2607. Returns 1 to indicate reflowable documents, otherwise 0.
  2608. */
  2609. FZ_FUNCTION int ll_fz_is_document_reflowable(::fz_document *doc);
  2610. /** Low-level wrapper for `::fz_is_empty_irect()`. */
  2611. FZ_FUNCTION int ll_fz_is_empty_irect(::fz_irect r);
  2612. /** Low-level wrapper for `::fz_is_empty_quad()`. */
  2613. /**
  2614. Is a quad empty?
  2615. */
  2616. FZ_FUNCTION int ll_fz_is_empty_quad(::fz_quad q);
  2617. /** Low-level wrapper for `::fz_is_empty_rect()`. */
  2618. /**
  2619. Check if rectangle is empty.
  2620. An empty rectangle is defined as one whose area is zero.
  2621. All invalid rectangles are empty.
  2622. */
  2623. FZ_FUNCTION int ll_fz_is_empty_rect(::fz_rect r);
  2624. /** Low-level wrapper for `::fz_is_eof()`. */
  2625. /**
  2626. Query if the stream has reached EOF (during normal bytewise
  2627. reading).
  2628. See fz_is_eof_bits for the equivalent function for bitwise
  2629. reading.
  2630. */
  2631. FZ_FUNCTION int ll_fz_is_eof(::fz_stream *stm);
  2632. /** Low-level wrapper for `::fz_is_eof_bits()`. */
  2633. /**
  2634. Query if the stream has reached EOF (during bitwise
  2635. reading).
  2636. See fz_is_eof for the equivalent function for bytewise
  2637. reading.
  2638. */
  2639. FZ_FUNCTION int ll_fz_is_eof_bits(::fz_stream *stm);
  2640. /** Low-level wrapper for `::fz_is_external_link()`. */
  2641. /**
  2642. Query whether a link is external to a document (determined by
  2643. uri containing a ':', intended to match with '://' which
  2644. separates the scheme from the scheme specific parts in URIs).
  2645. */
  2646. FZ_FUNCTION int ll_fz_is_external_link(const char *uri);
  2647. /** Low-level wrapper for `::fz_is_identity()`. */
  2648. FZ_FUNCTION int ll_fz_is_identity(::fz_matrix m);
  2649. /** Low-level wrapper for `::fz_is_infinite_irect()`. */
  2650. /**
  2651. Check if an integer rectangle
  2652. is infinite.
  2653. */
  2654. FZ_FUNCTION int ll_fz_is_infinite_irect(::fz_irect r);
  2655. /** Low-level wrapper for `::fz_is_infinite_quad()`. */
  2656. /**
  2657. Is a quad infinite?
  2658. */
  2659. FZ_FUNCTION int ll_fz_is_infinite_quad(::fz_quad q);
  2660. /** Low-level wrapper for `::fz_is_infinite_rect()`. */
  2661. /**
  2662. Check if rectangle is infinite.
  2663. */
  2664. FZ_FUNCTION int ll_fz_is_infinite_rect(::fz_rect r);
  2665. /** Low-level wrapper for `::fz_is_irect_inside_irect()`. */
  2666. /**
  2667. Inclusion test for irects.
  2668. rects are assumed to be both open or both closed.
  2669. No invalid rect can include any other rect.
  2670. No invalid rect can be included by any rect.
  2671. Empty (point) rects can include themselves.
  2672. Empty (line) rects can include many (subline) rects.
  2673. */
  2674. FZ_FUNCTION int ll_fz_is_irect_inside_irect(::fz_irect inner, ::fz_irect outer);
  2675. /** Low-level wrapper for `::fz_is_libarchive_archive()`. */
  2676. /**
  2677. Detect if stream object is an archive supported by libarchive.
  2678. Assumes that the stream object is seekable.
  2679. */
  2680. FZ_FUNCTION int ll_fz_is_libarchive_archive(::fz_stream *file);
  2681. /** Low-level wrapper for `::fz_is_lossy_image()`. */
  2682. FZ_FUNCTION int ll_fz_is_lossy_image(::fz_image *image);
  2683. /** Low-level wrapper for `::fz_is_page_range()`. */
  2684. /**
  2685. Check and parse string into page ranges:
  2686. /,?(-?\d+|N)(-(-?\d+|N))?/
  2687. */
  2688. FZ_FUNCTION int ll_fz_is_page_range(const char *s);
  2689. /** Low-level wrapper for `::fz_is_pixmap_monochrome()`. */
  2690. /**
  2691. Check if the pixmap is a 1-channel image containing samples with
  2692. only values 0 and 255
  2693. */
  2694. FZ_FUNCTION int ll_fz_is_pixmap_monochrome(::fz_pixmap *pixmap);
  2695. /** Low-level wrapper for `::fz_is_point_inside_irect()`. */
  2696. /**
  2697. Inclusion test for irects. (Rect is assumed to be open, i.e.
  2698. top right corner is not included).
  2699. */
  2700. FZ_FUNCTION int ll_fz_is_point_inside_irect(int x, int y, ::fz_irect r);
  2701. /** Low-level wrapper for `::fz_is_point_inside_quad()`. */
  2702. /**
  2703. Inclusion test for quads.
  2704. */
  2705. FZ_FUNCTION int ll_fz_is_point_inside_quad(::fz_point p, ::fz_quad q);
  2706. /** Low-level wrapper for `::fz_is_point_inside_rect()`. */
  2707. /**
  2708. Inclusion test for rects. (Rect is assumed to be open, i.e.
  2709. top right corner is not included).
  2710. */
  2711. FZ_FUNCTION int ll_fz_is_point_inside_rect(::fz_point p, ::fz_rect r);
  2712. /** Low-level wrapper for `::fz_is_pow2()`. */
  2713. FZ_FUNCTION int ll_fz_is_pow2(int a);
  2714. /** Low-level wrapper for `::fz_is_quad_inside_quad()`. */
  2715. /**
  2716. Inclusion test for quad in quad.
  2717. This may break down if quads are not 'well formed'.
  2718. */
  2719. FZ_FUNCTION int ll_fz_is_quad_inside_quad(::fz_quad needle, ::fz_quad haystack);
  2720. /** Low-level wrapper for `::fz_is_quad_intersecting_quad()`. */
  2721. /**
  2722. Intersection test for quads.
  2723. This may break down if quads are not 'well formed'.
  2724. */
  2725. FZ_FUNCTION int ll_fz_is_quad_intersecting_quad(::fz_quad a, ::fz_quad b);
  2726. /** Low-level wrapper for `::fz_is_rect_inside_rect()`. */
  2727. /**
  2728. Inclusion test for rects.
  2729. rects are assumed to be both open or both closed.
  2730. No invalid rect can include any other rect.
  2731. No invalid rect can be included by any rect.
  2732. Empty (point) rects can include themselves.
  2733. Empty (line) rects can include many (subline) rects.
  2734. */
  2735. FZ_FUNCTION int ll_fz_is_rect_inside_rect(::fz_rect inner, ::fz_rect outer);
  2736. /** Low-level wrapper for `::fz_is_rectilinear()`. */
  2737. /**
  2738. Check if a transformation is rectilinear.
  2739. Rectilinear means that no shearing is present and that any
  2740. rotations present are a multiple of 90 degrees. Usually this
  2741. is used to make sure that axis-aligned rectangles before the
  2742. transformation are still axis-aligned rectangles afterwards.
  2743. */
  2744. FZ_FUNCTION int ll_fz_is_rectilinear(::fz_matrix m);
  2745. /** Low-level wrapper for `::fz_is_tar_archive()`. */
  2746. /**
  2747. Detect if stream object is a tar archive.
  2748. Assumes that the stream object is seekable.
  2749. */
  2750. FZ_FUNCTION int ll_fz_is_tar_archive(::fz_stream *file);
  2751. /** Low-level wrapper for `::fz_is_valid_blend_colorspace()`. */
  2752. /**
  2753. Check to see that a colorspace is appropriate to be used as
  2754. a blending space (i.e. only grey, rgb or cmyk).
  2755. */
  2756. FZ_FUNCTION int ll_fz_is_valid_blend_colorspace(::fz_colorspace *cs);
  2757. /** Low-level wrapper for `::fz_is_valid_irect()`. */
  2758. /**
  2759. Check if an integer rectangle is valid.
  2760. */
  2761. FZ_FUNCTION int ll_fz_is_valid_irect(::fz_irect r);
  2762. /** Low-level wrapper for `::fz_is_valid_quad()`. */
  2763. /**
  2764. Is a quad valid?
  2765. */
  2766. FZ_FUNCTION int ll_fz_is_valid_quad(::fz_quad q);
  2767. /** Low-level wrapper for `::fz_is_valid_rect()`. */
  2768. /**
  2769. Check if rectangle is valid.
  2770. */
  2771. FZ_FUNCTION int ll_fz_is_valid_rect(::fz_rect r);
  2772. /** Low-level wrapper for `::fz_is_valid_xml_char()`. */
  2773. FZ_FUNCTION int ll_fz_is_valid_xml_char(int c);
  2774. /** Low-level wrapper for `::fz_is_valid_xml_string()`. */
  2775. FZ_FUNCTION int ll_fz_is_valid_xml_string(const char *s);
  2776. /** Low-level wrapper for `::fz_is_zip_archive()`. */
  2777. /**
  2778. Detect if stream object is a zip archive.
  2779. Assumes that the stream object is seekable.
  2780. */
  2781. FZ_FUNCTION int ll_fz_is_zip_archive(::fz_stream *file);
  2782. /** Low-level wrapper for `::fz_iso8859_1_from_unicode()`. */
  2783. FZ_FUNCTION int ll_fz_iso8859_1_from_unicode(int u);
  2784. /** Low-level wrapper for `::fz_iso8859_7_from_unicode()`. */
  2785. FZ_FUNCTION int ll_fz_iso8859_7_from_unicode(int u);
  2786. /** Low-level wrapper for `::fz_jbig2_globals_data()`. */
  2787. /**
  2788. Return buffer containing jbig2 globals data stream.
  2789. */
  2790. FZ_FUNCTION ::fz_buffer *ll_fz_jbig2_globals_data(::fz_jbig2_globals *globals);
  2791. /** Low-level wrapper for `::fz_json_array_get()`. */
  2792. FZ_FUNCTION ::fz_json *ll_fz_json_array_get(::fz_json *array, int ix);
  2793. /** Low-level wrapper for `::fz_json_array_length()`. */
  2794. FZ_FUNCTION int ll_fz_json_array_length(::fz_json *array);
  2795. /** Low-level wrapper for `::fz_json_array_push()`. */
  2796. FZ_FUNCTION void ll_fz_json_array_push(::fz_pool *pool, ::fz_json *array, ::fz_json *item);
  2797. /** Low-level wrapper for `::fz_json_is_array()`. */
  2798. FZ_FUNCTION int ll_fz_json_is_array(::fz_json *json);
  2799. /** Low-level wrapper for `::fz_json_is_boolean()`. */
  2800. FZ_FUNCTION int ll_fz_json_is_boolean(::fz_json *json);
  2801. /** Low-level wrapper for `::fz_json_is_null()`. */
  2802. FZ_FUNCTION int ll_fz_json_is_null(::fz_json *json);
  2803. /** Low-level wrapper for `::fz_json_is_number()`. */
  2804. FZ_FUNCTION int ll_fz_json_is_number(::fz_json *json);
  2805. /** Low-level wrapper for `::fz_json_is_object()`. */
  2806. FZ_FUNCTION int ll_fz_json_is_object(::fz_json *json);
  2807. /** Low-level wrapper for `::fz_json_is_string()`. */
  2808. FZ_FUNCTION int ll_fz_json_is_string(::fz_json *json);
  2809. /** Low-level wrapper for `::fz_json_new_array()`. */
  2810. FZ_FUNCTION ::fz_json *ll_fz_json_new_array(::fz_pool *pool);
  2811. /** Low-level wrapper for `::fz_json_new_boolean()`. */
  2812. FZ_FUNCTION ::fz_json *ll_fz_json_new_boolean(::fz_pool *pool, int x);
  2813. /** Low-level wrapper for `::fz_json_new_null()`. */
  2814. FZ_FUNCTION ::fz_json *ll_fz_json_new_null(::fz_pool *pool);
  2815. /** Low-level wrapper for `::fz_json_new_number()`. */
  2816. FZ_FUNCTION ::fz_json *ll_fz_json_new_number(::fz_pool *pool, double number);
  2817. /** Low-level wrapper for `::fz_json_new_object()`. */
  2818. FZ_FUNCTION ::fz_json *ll_fz_json_new_object(::fz_pool *pool);
  2819. /** Low-level wrapper for `::fz_json_new_string()`. */
  2820. FZ_FUNCTION ::fz_json *ll_fz_json_new_string(::fz_pool *pool, const char *string);
  2821. /** Low-level wrapper for `::fz_json_object_get()`. */
  2822. FZ_FUNCTION ::fz_json *ll_fz_json_object_get(::fz_json *object, const char *key);
  2823. /** Low-level wrapper for `::fz_json_object_set()`. */
  2824. FZ_FUNCTION void ll_fz_json_object_set(::fz_pool *pool, ::fz_json *object, const char *key, ::fz_json *item);
  2825. /** Low-level wrapper for `::fz_json_to_boolean()`. */
  2826. FZ_FUNCTION int ll_fz_json_to_boolean(::fz_json *json);
  2827. /** Low-level wrapper for `::fz_json_to_number()`. */
  2828. FZ_FUNCTION double ll_fz_json_to_number(::fz_json *json);
  2829. /** Low-level wrapper for `::fz_json_to_string()`. */
  2830. FZ_FUNCTION const char *ll_fz_json_to_string(::fz_json *json);
  2831. /** Low-level wrapper for `::fz_keep_archive()`. */
  2832. /**
  2833. Keep a reference to an archive.
  2834. */
  2835. FZ_FUNCTION ::fz_archive *ll_fz_keep_archive(::fz_archive *arch);
  2836. /** Low-level wrapper for `::fz_keep_bitmap()`. */
  2837. /**
  2838. Take an additional reference to the bitmap. The same pointer
  2839. is returned.
  2840. Never throws exceptions.
  2841. */
  2842. FZ_FUNCTION ::fz_bitmap *ll_fz_keep_bitmap(::fz_bitmap *bit);
  2843. /** Low-level wrapper for `::fz_keep_buffer()`. */
  2844. /**
  2845. Take an additional reference to the buffer. The same pointer
  2846. is returned.
  2847. Never throws exceptions.
  2848. */
  2849. FZ_FUNCTION ::fz_buffer *ll_fz_keep_buffer(::fz_buffer *buf);
  2850. /** Low-level wrapper for `::fz_keep_colorspace()`. */
  2851. /**
  2852. Increment the reference count for the colorspace.
  2853. Returns the same pointer. Never throws an exception.
  2854. */
  2855. FZ_FUNCTION ::fz_colorspace *ll_fz_keep_colorspace(::fz_colorspace *colorspace);
  2856. /** Low-level wrapper for `::fz_keep_compressed_buffer()`. */
  2857. /**
  2858. Take a reference to an fz_compressed_buffer.
  2859. */
  2860. FZ_FUNCTION ::fz_compressed_buffer *ll_fz_keep_compressed_buffer(::fz_compressed_buffer *cbuf);
  2861. /** Low-level wrapper for `::fz_keep_default_colorspaces()`. */
  2862. /**
  2863. Keep an additional reference to the default colorspaces
  2864. structure.
  2865. Never throws exceptions.
  2866. */
  2867. FZ_FUNCTION ::fz_default_colorspaces *ll_fz_keep_default_colorspaces(::fz_default_colorspaces *default_cs);
  2868. /** Low-level wrapper for `::fz_keep_device()`. */
  2869. /**
  2870. Increment the reference count for a device. Returns the same
  2871. pointer.
  2872. Never throws exceptions.
  2873. */
  2874. FZ_FUNCTION ::fz_device *ll_fz_keep_device(::fz_device *dev);
  2875. /** Low-level wrapper for `::fz_keep_display_list()`. */
  2876. /**
  2877. Increment the reference count for a display list. Returns the
  2878. same pointer.
  2879. Never throws exceptions.
  2880. */
  2881. FZ_FUNCTION ::fz_display_list *ll_fz_keep_display_list(::fz_display_list *list);
  2882. /** Low-level wrapper for `::fz_keep_document()`. */
  2883. /**
  2884. Increment the document reference count. The same pointer is
  2885. returned.
  2886. Never throws exceptions.
  2887. */
  2888. FZ_FUNCTION ::fz_document *ll_fz_keep_document(::fz_document *doc);
  2889. /** Low-level wrapper for `::fz_keep_font()`. */
  2890. /**
  2891. Add a reference to an existing fz_font.
  2892. font: The font to add a reference to.
  2893. Returns the same font.
  2894. */
  2895. FZ_FUNCTION ::fz_font *ll_fz_keep_font(::fz_font *font);
  2896. /** Low-level wrapper for `::fz_keep_function()`. */
  2897. FZ_FUNCTION ::fz_function *ll_fz_keep_function(::fz_function *func);
  2898. /** Low-level wrapper for `::fz_keep_glyph()`. */
  2899. /**
  2900. Take a reference to a glyph.
  2901. pix: The glyph to increment the reference for.
  2902. Returns pix.
  2903. */
  2904. FZ_FUNCTION ::fz_glyph *ll_fz_keep_glyph(::fz_glyph *pix);
  2905. /** Low-level wrapper for `::fz_keep_halftone()`. */
  2906. /**
  2907. Take an additional reference to the halftone. The same pointer
  2908. is returned.
  2909. Never throws exceptions.
  2910. */
  2911. FZ_FUNCTION ::fz_halftone *ll_fz_keep_halftone(::fz_halftone *half);
  2912. /** Low-level wrapper for `::fz_keep_image()`. */
  2913. /**
  2914. Increment the (normal) reference count for an image. Returns the
  2915. same pointer.
  2916. Never throws exceptions.
  2917. */
  2918. FZ_FUNCTION ::fz_image *ll_fz_keep_image(::fz_image *image);
  2919. /** Low-level wrapper for `::fz_keep_image_store_key()`. */
  2920. /**
  2921. Increment the store key reference for an image. Returns the same
  2922. pointer. (This is the count of references for an image held by
  2923. keys in the image store).
  2924. Never throws exceptions.
  2925. */
  2926. FZ_FUNCTION ::fz_image *ll_fz_keep_image_store_key(::fz_image *image);
  2927. /** Low-level wrapper for `::fz_keep_imp()`.
  2928. This function has out-params. Python/C# wrappers look like:
  2929. `ll_fz_keep_imp(void *p)` => `(void *, int refs)`
  2930. */
  2931. FZ_FUNCTION void *ll_fz_keep_imp(void *p, int *refs);
  2932. /** Low-level wrapper for `::fz_keep_imp16()`.
  2933. This function has out-params. Python/C# wrappers look like:
  2934. `ll_fz_keep_imp16(void *p)` => `(void *, int16_t refs)`
  2935. */
  2936. FZ_FUNCTION void *ll_fz_keep_imp16(void *p, int16_t *refs);
  2937. /** Low-level wrapper for `::fz_keep_imp8()`. */
  2938. FZ_FUNCTION void *ll_fz_keep_imp8(void *p, int8_t *refs);
  2939. /** Low-level wrapper for `::fz_keep_imp8_locked()`. */
  2940. FZ_FUNCTION void *ll_fz_keep_imp8_locked(void *p, int8_t *refs);
  2941. /** Low-level wrapper for `::fz_keep_imp_locked()`.
  2942. This function has out-params. Python/C# wrappers look like:
  2943. `ll_fz_keep_imp_locked(void *p)` => `(void *, int refs)`
  2944. */
  2945. FZ_FUNCTION void *ll_fz_keep_imp_locked(void *p, int *refs);
  2946. /** Low-level wrapper for `::fz_keep_jbig2_globals()`. */
  2947. /**
  2948. Increment the reference count for a jbig2 globals record.
  2949. Never throws an exception.
  2950. */
  2951. FZ_FUNCTION ::fz_jbig2_globals *ll_fz_keep_jbig2_globals(::fz_jbig2_globals *globals);
  2952. /** Low-level wrapper for `::fz_keep_key_storable()`. */
  2953. /**
  2954. Increment the (normal) reference count for a key storable
  2955. object. Returns the same pointer.
  2956. Never throws exceptions.
  2957. */
  2958. FZ_FUNCTION void *ll_fz_keep_key_storable(const ::fz_key_storable *arg_1);
  2959. /** Low-level wrapper for `::fz_keep_key_storable_key()`. */
  2960. /**
  2961. Increment the (key) reference count for a key storable
  2962. object. Returns the same pointer.
  2963. Never throws exceptions.
  2964. */
  2965. FZ_FUNCTION void *ll_fz_keep_key_storable_key(const ::fz_key_storable *arg_1);
  2966. /** Low-level wrapper for `::fz_keep_link()`. */
  2967. /**
  2968. Increment the reference count for a link. The same pointer is
  2969. returned.
  2970. Never throws exceptions.
  2971. */
  2972. FZ_FUNCTION ::fz_link *ll_fz_keep_link(::fz_link *link);
  2973. /** Low-level wrapper for `::fz_keep_outline()`. */
  2974. /**
  2975. Increment the reference count. Returns the same pointer.
  2976. Never throws exceptions.
  2977. */
  2978. FZ_FUNCTION ::fz_outline *ll_fz_keep_outline(::fz_outline *outline);
  2979. /** Low-level wrapper for `::fz_keep_page()`. */
  2980. /**
  2981. Increment the reference count for the page. Returns the same
  2982. pointer.
  2983. Never throws exceptions.
  2984. */
  2985. FZ_FUNCTION ::fz_page *ll_fz_keep_page(::fz_page *page);
  2986. /** Low-level wrapper for `::fz_keep_path()`. */
  2987. /**
  2988. Increment the reference count. Returns the same pointer.
  2989. All paths can be kept, regardless of their packing type.
  2990. Never throws exceptions.
  2991. */
  2992. FZ_FUNCTION ::fz_path *ll_fz_keep_path(const ::fz_path *path);
  2993. /** Low-level wrapper for `::fz_keep_pixmap()`. */
  2994. /**
  2995. Increment the reference count for the pixmap. The same pointer
  2996. is returned.
  2997. Never throws exceptions.
  2998. */
  2999. FZ_FUNCTION ::fz_pixmap *ll_fz_keep_pixmap(::fz_pixmap *pix);
  3000. /** Low-level wrapper for `::fz_keep_separations()`. */
  3001. /**
  3002. Increment the reference count for a separations structure.
  3003. Returns the same pointer.
  3004. Never throws exceptions.
  3005. */
  3006. FZ_FUNCTION ::fz_separations *ll_fz_keep_separations(::fz_separations *sep);
  3007. /** Low-level wrapper for `::fz_keep_shade()`. */
  3008. /**
  3009. Increment the reference count for the shade structure. The
  3010. same pointer is returned.
  3011. Never throws exceptions.
  3012. */
  3013. FZ_FUNCTION ::fz_shade *ll_fz_keep_shade(::fz_shade *shade);
  3014. /** Low-level wrapper for `::fz_keep_stext_page()`. */
  3015. /**
  3016. Take a new reference to an fz_stext_page.
  3017. */
  3018. FZ_FUNCTION ::fz_stext_page *ll_fz_keep_stext_page(::fz_stext_page *page);
  3019. /** Low-level wrapper for `::fz_keep_storable()`. */
  3020. /**
  3021. Increment the reference count for a storable object.
  3022. Returns the same pointer.
  3023. Never throws exceptions.
  3024. */
  3025. FZ_FUNCTION void *ll_fz_keep_storable(const ::fz_storable *arg_1);
  3026. /** Low-level wrapper for `::fz_keep_store_context()`. */
  3027. /**
  3028. Increment the reference count for the store context. Returns
  3029. the same pointer.
  3030. Never throws exceptions.
  3031. */
  3032. FZ_FUNCTION ::fz_store *ll_fz_keep_store_context();
  3033. /** Low-level wrapper for `::fz_keep_stream()`. */
  3034. /**
  3035. Increments the reference count for a stream. Returns the same
  3036. pointer.
  3037. Never throws exceptions.
  3038. */
  3039. FZ_FUNCTION ::fz_stream *ll_fz_keep_stream(::fz_stream *stm);
  3040. /** Low-level wrapper for `::fz_keep_string()`. */
  3041. FZ_FUNCTION ::fz_string *ll_fz_keep_string(::fz_string *str);
  3042. /** Low-level wrapper for `::fz_keep_stroke_state()`. */
  3043. /**
  3044. Take an additional reference to a stroke state structure.
  3045. No modifications should be carried out on a stroke
  3046. state to which more than one reference is held, as
  3047. this can cause race conditions.
  3048. */
  3049. FZ_FUNCTION ::fz_stroke_state *ll_fz_keep_stroke_state(const ::fz_stroke_state *stroke);
  3050. /** Low-level wrapper for `::fz_keep_text()`. */
  3051. /**
  3052. Increment the reference count for the text object. The same
  3053. pointer is returned.
  3054. Never throws exceptions.
  3055. */
  3056. FZ_FUNCTION ::fz_text *ll_fz_keep_text(const ::fz_text *text);
  3057. /** Low-level wrapper for `::fz_keep_xml()`. */
  3058. /**
  3059. Add a reference to the XML.
  3060. */
  3061. FZ_FUNCTION ::fz_xml *ll_fz_keep_xml(::fz_xml *xml);
  3062. /** Low-level wrapper for `::fz_koi8u_from_unicode()`. */
  3063. FZ_FUNCTION int ll_fz_koi8u_from_unicode(int u);
  3064. /** Low-level wrapper for `::fz_last_page()`. */
  3065. /**
  3066. Function to get the location for the last page in the document.
  3067. Using this can be far more efficient in some cases than calling
  3068. fz_count_pages and using the page number.
  3069. */
  3070. FZ_FUNCTION ::fz_location ll_fz_last_page(::fz_document *doc);
  3071. /** Low-level wrapper for `::fz_layout_document()`. */
  3072. /**
  3073. Layout reflowable document types.
  3074. w, h: Page size in points.
  3075. em: Default font size in points.
  3076. */
  3077. FZ_FUNCTION void ll_fz_layout_document(::fz_document *doc, float w, float h, float em);
  3078. /** Low-level wrapper for `::fz_linecap_from_string()`. */
  3079. FZ_FUNCTION ::fz_linecap ll_fz_linecap_from_string(const char *s);
  3080. /** Low-level wrapper for `::fz_linejoin_from_string()`. */
  3081. FZ_FUNCTION ::fz_linejoin ll_fz_linejoin_from_string(const char *s);
  3082. /** Low-level wrapper for `::fz_lineto()`. */
  3083. /**
  3084. Append a 'lineto' command to an open path.
  3085. path: The path to modify.
  3086. x, y: The coordinate to line to.
  3087. Throws exceptions on failure to allocate, or attempting to
  3088. modify a packed path.
  3089. */
  3090. FZ_FUNCTION void ll_fz_lineto(::fz_path *path, float x, float y);
  3091. /** Low-level wrapper for `::fz_list_archive_entry()`. */
  3092. /**
  3093. Get listed name of entry position idx.
  3094. idx: Must be a value >= 0 < return value from
  3095. fz_count_archive_entries. If not in range NULL will be
  3096. returned.
  3097. May throw an exception if this type of archive cannot list the
  3098. entries (such as a directory).
  3099. */
  3100. FZ_FUNCTION const char *ll_fz_list_archive_entry(::fz_archive *arch, int idx);
  3101. /** Low-level wrapper for `::fz_load_bmp_subimage()`. */
  3102. FZ_FUNCTION ::fz_pixmap *ll_fz_load_bmp_subimage(const unsigned char *buf, size_t len, int subimage);
  3103. /** Low-level wrapper for `::fz_load_bmp_subimage_count()`. */
  3104. FZ_FUNCTION int ll_fz_load_bmp_subimage_count(const unsigned char *buf, size_t len);
  3105. /** Low-level wrapper for `::fz_load_chapter_page()`. */
  3106. /**
  3107. Load a page.
  3108. After fz_load_page is it possible to retrieve the size of the
  3109. page using fz_bound_page, or to render the page using
  3110. fz_run_page_*. Free the page by calling fz_drop_page.
  3111. chapter: chapter number, 0 is the first chapter of the document.
  3112. number: page number, 0 is the first page of the chapter.
  3113. */
  3114. FZ_FUNCTION ::fz_page *ll_fz_load_chapter_page(::fz_document *doc, int chapter, int page);
  3115. /** Low-level wrapper for `::fz_load_fallback_font()`. */
  3116. /**
  3117. Try to load a fallback font for the
  3118. given combination of font attributes. Whether a font is
  3119. present or not will depend on the configuration in which
  3120. MuPDF is built.
  3121. script: The script desired (e.g. UCDN_SCRIPT_KATAKANA).
  3122. language: The language desired (e.g. FZ_LANG_ja).
  3123. serif: 1 if serif desired, 0 otherwise.
  3124. bold: 1 if bold desired, 0 otherwise.
  3125. italic: 1 if italic desired, 0 otherwise.
  3126. Returns a new font handle, or NULL if not available.
  3127. */
  3128. FZ_FUNCTION ::fz_font *ll_fz_load_fallback_font(int script, int language, int serif, int bold, int italic);
  3129. /** Low-level wrapper for `::fz_load_jbig2_globals()`. */
  3130. /**
  3131. Create a jbig2 globals record from a buffer.
  3132. Immutable once created.
  3133. */
  3134. FZ_FUNCTION ::fz_jbig2_globals *ll_fz_load_jbig2_globals(::fz_buffer *buf);
  3135. /** Low-level wrapper for `::fz_load_jbig2_subimage()`. */
  3136. FZ_FUNCTION ::fz_pixmap *ll_fz_load_jbig2_subimage(const unsigned char *buf, size_t len, int subimage);
  3137. /** Low-level wrapper for `::fz_load_jbig2_subimage_count()`. */
  3138. FZ_FUNCTION int ll_fz_load_jbig2_subimage_count(const unsigned char *buf, size_t len);
  3139. /** Low-level wrapper for `::fz_load_jpx()`. */
  3140. /**
  3141. Exposed for PDF.
  3142. */
  3143. FZ_FUNCTION ::fz_pixmap *ll_fz_load_jpx(const unsigned char *data, size_t size, ::fz_colorspace *cs);
  3144. /** Low-level wrapper for `::fz_load_links()`. */
  3145. /**
  3146. Load the list of links for a page.
  3147. Returns a linked list of all the links on the page, each with
  3148. its clickable region and link destination. Each link is
  3149. reference counted so drop and free the list of links by
  3150. calling fz_drop_link on the pointer return from fz_load_links.
  3151. page: Page obtained from fz_load_page.
  3152. */
  3153. FZ_FUNCTION ::fz_link *ll_fz_load_links(::fz_page *page);
  3154. /** Low-level wrapper for `::fz_load_outline()`. */
  3155. /**
  3156. Load the hierarchical document outline.
  3157. Should be freed by fz_drop_outline.
  3158. */
  3159. FZ_FUNCTION ::fz_outline *ll_fz_load_outline(::fz_document *doc);
  3160. /** Low-level wrapper for `::fz_load_outline_from_iterator()`. */
  3161. /**
  3162. Routine to implement the old Structure based API from an iterator.
  3163. */
  3164. FZ_FUNCTION ::fz_outline *ll_fz_load_outline_from_iterator(::fz_outline_iterator *iter);
  3165. /** Low-level wrapper for `::fz_load_page()`. */
  3166. /**
  3167. Load a given page number from a document. This may be much less
  3168. efficient than loading by location (chapter+page) for some
  3169. document types.
  3170. */
  3171. FZ_FUNCTION ::fz_page *ll_fz_load_page(::fz_document *doc, int number);
  3172. /** Low-level wrapper for `::fz_load_pnm_subimage()`. */
  3173. FZ_FUNCTION ::fz_pixmap *ll_fz_load_pnm_subimage(const unsigned char *buf, size_t len, int subimage);
  3174. /** Low-level wrapper for `::fz_load_pnm_subimage_count()`. */
  3175. FZ_FUNCTION int ll_fz_load_pnm_subimage_count(const unsigned char *buf, size_t len);
  3176. /** Low-level wrapper for `::fz_load_system_cjk_font()`. */
  3177. /**
  3178. Attempt to load a given font from
  3179. the system.
  3180. name: The name of the desired font.
  3181. ordering: The ordering to load the font from (e.g. FZ_ADOBE_KOREA)
  3182. serif: 1 if serif desired, 0 otherwise.
  3183. Returns a new font handle, or NULL if no matching font was found
  3184. (or on error).
  3185. */
  3186. FZ_FUNCTION ::fz_font *ll_fz_load_system_cjk_font(const char *name, int ordering, int serif);
  3187. /** Low-level wrapper for `::fz_load_system_font()`. */
  3188. /**
  3189. Attempt to load a given font from the system.
  3190. name: The name of the desired font.
  3191. bold: 1 if bold desired, 0 otherwise.
  3192. italic: 1 if italic desired, 0 otherwise.
  3193. needs_exact_metrics: 1 if an exact metrical match is required,
  3194. 0 otherwise.
  3195. Returns a new font handle, or NULL if no matching font was found
  3196. (or on error).
  3197. */
  3198. FZ_FUNCTION ::fz_font *ll_fz_load_system_font(const char *name, int bold, int italic, int needs_exact_metrics);
  3199. /** Low-level wrapper for `::fz_load_tiff_subimage()`. */
  3200. FZ_FUNCTION ::fz_pixmap *ll_fz_load_tiff_subimage(const unsigned char *buf, size_t len, int subimage);
  3201. /** Low-level wrapper for `::fz_load_tiff_subimage_count()`. */
  3202. /**
  3203. Exposed for CBZ.
  3204. */
  3205. FZ_FUNCTION int ll_fz_load_tiff_subimage_count(const unsigned char *buf, size_t len);
  3206. /** Low-level wrapper for `::fz_load_user_css()`. */
  3207. /**
  3208. Set the user stylesheet by loading the source from a file.
  3209. If the file is missing, do nothing.
  3210. */
  3211. FZ_FUNCTION void ll_fz_load_user_css(const char *filename);
  3212. /** Low-level wrapper for `::fz_location_from_page_number()`. */
  3213. /**
  3214. Converts from page number to chapter+page. This may cause many
  3215. chapters to be laid out in order to calculate the number of
  3216. pages within those chapters.
  3217. */
  3218. FZ_FUNCTION ::fz_location ll_fz_location_from_page_number(::fz_document *doc, int number);
  3219. /** Low-level wrapper for `::fz_lock()`. */
  3220. /**
  3221. Lock one of the user supplied mutexes.
  3222. */
  3223. FZ_FUNCTION void ll_fz_lock(int lock);
  3224. /** Low-level wrapper for `::fz_log_error()`. */
  3225. /**
  3226. Log a (preformatted) string to the registered
  3227. error stream (stderr by default).
  3228. */
  3229. FZ_FUNCTION void ll_fz_log_error(const char *str);
  3230. /** Low-level wrapper for `::fz_lookup_base14_font()`.
  3231. This function has out-params. Python/C# wrappers look like:
  3232. `ll_fz_lookup_base14_font(const char *name)` => `(const unsigned char *, int len)`
  3233. */
  3234. /**
  3235. Search the builtin base14 fonts for a match.
  3236. Whether a given font is present or not will depend on the
  3237. configuration in which MuPDF is built.
  3238. name: The name of the font desired.
  3239. len: Pointer to a place to receive the length of the discovered
  3240. font buffer.
  3241. Returns a pointer to the font file data, or NULL if not present.
  3242. */
  3243. FZ_FUNCTION const unsigned char *ll_fz_lookup_base14_font(const char *name, int *len);
  3244. /** Low-level wrapper for `::fz_lookup_blendmode()`. */
  3245. /**
  3246. Map from (case sensitive) blend mode string to enumeration.
  3247. */
  3248. FZ_FUNCTION int ll_fz_lookup_blendmode(const char *name);
  3249. /** Low-level wrapper for `::fz_lookup_bookmark()`. */
  3250. /**
  3251. Find a bookmark and return its page number.
  3252. */
  3253. FZ_FUNCTION ::fz_location ll_fz_lookup_bookmark(::fz_document *doc, ::fz_bookmark mark);
  3254. /** Low-level wrapper for `::fz_lookup_builtin_font()`.
  3255. This function has out-params. Python/C# wrappers look like:
  3256. `ll_fz_lookup_builtin_font(const char *name, int bold, int italic)` => `(const unsigned char *, int len)`
  3257. */
  3258. /**
  3259. Search the builtin fonts for a match.
  3260. Whether a given font is present or not will depend on the
  3261. configuration in which MuPDF is built.
  3262. name: The name of the font desired.
  3263. bold: 1 if bold desired, 0 otherwise.
  3264. italic: 1 if italic desired, 0 otherwise.
  3265. len: Pointer to a place to receive the length of the discovered
  3266. font buffer.
  3267. Returns a pointer to the font file data, or NULL if not present.
  3268. */
  3269. FZ_FUNCTION const unsigned char *ll_fz_lookup_builtin_font(const char *name, int bold, int italic, int *len);
  3270. /** Low-level wrapper for `::fz_lookup_cjk_font()`.
  3271. This function has out-params. Python/C# wrappers look like:
  3272. `ll_fz_lookup_cjk_font(int ordering)` => `(const unsigned char *, int len, int index)`
  3273. */
  3274. /**
  3275. Search the builtin cjk fonts for a match.
  3276. Whether a font is present or not will depend on the
  3277. configuration in which MuPDF is built.
  3278. ordering: The desired ordering of the font (e.g. FZ_ADOBE_KOREA).
  3279. len: Pointer to a place to receive the length of the discovered
  3280. font buffer.
  3281. Returns a pointer to the font file data, or NULL if not present.
  3282. */
  3283. FZ_FUNCTION const unsigned char *ll_fz_lookup_cjk_font(int ordering, int *len, int *index);
  3284. /** Low-level wrapper for `::fz_lookup_cjk_font_by_language()`.
  3285. This function has out-params. Python/C# wrappers look like:
  3286. `ll_fz_lookup_cjk_font_by_language(const char *lang)` => `(const unsigned char *, int len, int subfont)`
  3287. */
  3288. /**
  3289. Search the builtin cjk fonts for a match for a given language.
  3290. Whether a font is present or not will depend on the
  3291. configuration in which MuPDF is built.
  3292. lang: Pointer to a (case sensitive) language string (e.g.
  3293. "ja", "ko", "zh-Hant" etc).
  3294. len: Pointer to a place to receive the length of the discovered
  3295. font buffer.
  3296. subfont: Pointer to a place to store the subfont index of the
  3297. discovered font.
  3298. Returns a pointer to the font file data, or NULL if not present.
  3299. */
  3300. FZ_FUNCTION const unsigned char *ll_fz_lookup_cjk_font_by_language(const char *lang, int *len, int *subfont);
  3301. /** Low-level wrapper for `::fz_lookup_cjk_ordering_by_language()`. */
  3302. /**
  3303. Return the matching FZ_ADOBE_* ordering
  3304. for the given language tag, such as "zh-Hant", "zh-Hans", "ja", or "ko".
  3305. */
  3306. FZ_FUNCTION int ll_fz_lookup_cjk_ordering_by_language(const char *name);
  3307. /** Low-level wrapper for `::fz_lookup_image_type()`. */
  3308. /**
  3309. Map from (case sensitive) image type string to FZ_IMAGE_*
  3310. type value.
  3311. */
  3312. FZ_FUNCTION int ll_fz_lookup_image_type(const char *type);
  3313. /** Low-level wrapper for `::fz_lookup_metadata()`. */
  3314. /**
  3315. Retrieve document meta data strings.
  3316. doc: The document to query.
  3317. key: Which meta data key to retrieve...
  3318. Basic information:
  3319. 'format' -- Document format and version.
  3320. 'encryption' -- Description of the encryption used.
  3321. From the document information dictionary:
  3322. 'info:Title'
  3323. 'info:Author'
  3324. 'info:Subject'
  3325. 'info:Keywords'
  3326. 'info:Creator'
  3327. 'info:Producer'
  3328. 'info:CreationDate'
  3329. 'info:ModDate'
  3330. buf: The buffer to hold the results (a nul-terminated UTF-8
  3331. string).
  3332. size: Size of 'buf'.
  3333. Returns the number of bytes need to store the string plus terminator
  3334. (will be larger than 'size' if the output was truncated), or -1 if the
  3335. key is not recognized or found.
  3336. */
  3337. FZ_FUNCTION int ll_fz_lookup_metadata(::fz_document *doc, const char *key, char *buf, size_t size);
  3338. /** Low-level wrapper for `::fz_lookup_metadata2()`. */
  3339. /**
  3340. C++ alternative to `fz_lookup_metadata()` that returns a `std::string`
  3341. or calls `fz_throw()` if not found.
  3342. */
  3343. FZ_FUNCTION std::string ll_fz_lookup_metadata2(::fz_document *doc, const char *key);
  3344. /** Low-level wrapper for `::fz_lookup_noto_boxes_font()`.
  3345. This function has out-params. Python/C# wrappers look like:
  3346. `ll_fz_lookup_noto_boxes_font()` => `(const unsigned char *, int len)`
  3347. */
  3348. FZ_FUNCTION const unsigned char *ll_fz_lookup_noto_boxes_font(int *len);
  3349. /** Low-level wrapper for `::fz_lookup_noto_emoji_font()`.
  3350. This function has out-params. Python/C# wrappers look like:
  3351. `ll_fz_lookup_noto_emoji_font()` => `(const unsigned char *, int len)`
  3352. */
  3353. FZ_FUNCTION const unsigned char *ll_fz_lookup_noto_emoji_font(int *len);
  3354. /** Low-level wrapper for `::fz_lookup_noto_font()`.
  3355. This function has out-params. Python/C# wrappers look like:
  3356. `ll_fz_lookup_noto_font(int script, int lang)` => `(const unsigned char *, int len, int subfont)`
  3357. */
  3358. /**
  3359. Search the builtin noto fonts for a match.
  3360. Whether a font is present or not will depend on the
  3361. configuration in which MuPDF is built.
  3362. script: The script desired (e.g. UCDN_SCRIPT_KATAKANA).
  3363. lang: The language desired (e.g. FZ_LANG_ja).
  3364. len: Pointer to a place to receive the length of the discovered
  3365. font buffer.
  3366. Returns a pointer to the font file data, or NULL if not present.
  3367. */
  3368. FZ_FUNCTION const unsigned char *ll_fz_lookup_noto_font(int script, int lang, int *len, int *subfont);
  3369. /** Low-level wrapper for `::fz_lookup_noto_math_font()`.
  3370. This function has out-params. Python/C# wrappers look like:
  3371. `ll_fz_lookup_noto_math_font()` => `(const unsigned char *, int len)`
  3372. */
  3373. /**
  3374. Search the builtin noto fonts specific symbol fonts.
  3375. Whether a font is present or not will depend on the
  3376. configuration in which MuPDF is built.
  3377. */
  3378. FZ_FUNCTION const unsigned char *ll_fz_lookup_noto_math_font(int *len);
  3379. /** Low-level wrapper for `::fz_lookup_noto_music_font()`.
  3380. This function has out-params. Python/C# wrappers look like:
  3381. `ll_fz_lookup_noto_music_font()` => `(const unsigned char *, int len)`
  3382. */
  3383. FZ_FUNCTION const unsigned char *ll_fz_lookup_noto_music_font(int *len);
  3384. /** Low-level wrapper for `::fz_lookup_noto_stem_from_script()`. */
  3385. /**
  3386. Look up the Noto font file name for a given script.
  3387. From the returned font stem, you can look for Noto fonts on the system in the form:
  3388. Noto(Sans|Serif)${STEM}-Regular.(otf|ttf)
  3389. */
  3390. FZ_FUNCTION const char *ll_fz_lookup_noto_stem_from_script(int script, int language);
  3391. /** Low-level wrapper for `::fz_lookup_noto_symbol1_font()`.
  3392. This function has out-params. Python/C# wrappers look like:
  3393. `ll_fz_lookup_noto_symbol1_font()` => `(const unsigned char *, int len)`
  3394. */
  3395. FZ_FUNCTION const unsigned char *ll_fz_lookup_noto_symbol1_font(int *len);
  3396. /** Low-level wrapper for `::fz_lookup_noto_symbol2_font()`.
  3397. This function has out-params. Python/C# wrappers look like:
  3398. `ll_fz_lookup_noto_symbol2_font()` => `(const unsigned char *, int len)`
  3399. */
  3400. FZ_FUNCTION const unsigned char *ll_fz_lookup_noto_symbol2_font(int *len);
  3401. /** Low-level wrapper for `::fz_lookup_rendering_intent()`. */
  3402. /**
  3403. Map from (case sensitive) rendering intent string to enumeration
  3404. value.
  3405. */
  3406. FZ_FUNCTION int ll_fz_lookup_rendering_intent(const char *name);
  3407. /** Low-level wrapper for `::fz_lookup_script_name()`. */
  3408. FZ_FUNCTION const char *ll_fz_lookup_script_name(int script, int language);
  3409. /** Low-level wrapper for `::fz_make_bookmark()`. */
  3410. /**
  3411. Create a bookmark for the given page, which can be used to find
  3412. the same location after the document has been laid out with
  3413. different parameters.
  3414. */
  3415. FZ_FUNCTION ::fz_bookmark ll_fz_make_bookmark(::fz_document *doc, ::fz_location loc);
  3416. /** Low-level wrapper for `::fz_make_irect()`. */
  3417. FZ_FUNCTION ::fz_irect ll_fz_make_irect(int x0, int y0, int x1, int y1);
  3418. /** Low-level wrapper for `::fz_make_link_dest_none()`. */
  3419. FZ_FUNCTION ::fz_link_dest ll_fz_make_link_dest_none();
  3420. /** Low-level wrapper for `::fz_make_link_dest_xyz()`. */
  3421. FZ_FUNCTION ::fz_link_dest ll_fz_make_link_dest_xyz(int chapter, int page, float x, float y, float z);
  3422. /** Low-level wrapper for `::fz_make_location()`. */
  3423. /**
  3424. Simple constructor for fz_locations.
  3425. */
  3426. FZ_FUNCTION ::fz_location ll_fz_make_location(int chapter, int page);
  3427. /** Low-level wrapper for `::fz_make_matrix()`. */
  3428. FZ_FUNCTION ::fz_matrix ll_fz_make_matrix(float a, float b, float c, float d, float e, float f);
  3429. /** Low-level wrapper for `::fz_make_point()`. */
  3430. FZ_FUNCTION ::fz_point ll_fz_make_point(float x, float y);
  3431. /** Low-level wrapper for `::fz_make_quad()`. */
  3432. /**
  3433. Inline convenience construction function.
  3434. */
  3435. FZ_FUNCTION ::fz_quad ll_fz_make_quad(float ul_x, float ul_y, float ur_x, float ur_y, float ll_x, float ll_y, float lr_x, float lr_y);
  3436. /** Low-level wrapper for `::fz_make_rect()`. */
  3437. FZ_FUNCTION ::fz_rect ll_fz_make_rect(float x0, float y0, float x1, float y1);
  3438. /** Low-level wrapper for `::fz_malloc()`. */
  3439. /**
  3440. Allocate uninitialized memory of a given size.
  3441. Does NOT clear the memory!
  3442. May return NULL for size = 0.
  3443. Throws exception in the event of failure to allocate.
  3444. */
  3445. FZ_FUNCTION void *ll_fz_malloc(size_t size);
  3446. /** Low-level wrapper for `::fz_malloc_aligned()`. */
  3447. /**
  3448. fz_malloc equivalent, except that the block is guaranteed aligned.
  3449. Block must be freed later using fz_free_aligned.
  3450. */
  3451. FZ_FUNCTION void *ll_fz_malloc_aligned(size_t size, int align);
  3452. /** Low-level wrapper for `::fz_malloc_no_throw()`. */
  3453. /**
  3454. fz_malloc equivalent that returns NULL rather than throwing
  3455. exceptions.
  3456. */
  3457. FZ_FUNCTION void *ll_fz_malloc_no_throw(size_t size);
  3458. /** Low-level wrapper for `::fz_matrix_expansion()`. */
  3459. /**
  3460. Calculate average scaling factor of matrix.
  3461. */
  3462. FZ_FUNCTION float ll_fz_matrix_expansion(::fz_matrix m);
  3463. /** Low-level wrapper for `::fz_matrix_max_expansion()`. */
  3464. /**
  3465. Find the largest expansion performed by this matrix.
  3466. (i.e. max(abs(m.a),abs(m.b),abs(m.c),abs(m.d))
  3467. */
  3468. FZ_FUNCTION float ll_fz_matrix_max_expansion(::fz_matrix m);
  3469. /** Low-level wrapper for `::fz_max()`. */
  3470. FZ_FUNCTION float ll_fz_max(float a, float b);
  3471. /** Low-level wrapper for `::fz_maxi()`. */
  3472. FZ_FUNCTION int ll_fz_maxi(int a, int b);
  3473. /** Low-level wrapper for `::fz_maxi64()`. */
  3474. FZ_FUNCTION int64_t ll_fz_maxi64(int64_t a, int64_t b);
  3475. /** Low-level wrapper for `::fz_maxz()`. */
  3476. FZ_FUNCTION size_t ll_fz_maxz(size_t a, size_t b);
  3477. /** Low-level wrapper for `::fz_md5_buffer()`. */
  3478. /**
  3479. Create an MD5 digest from buffer contents.
  3480. Never throws exceptions.
  3481. */
  3482. FZ_FUNCTION void ll_fz_md5_buffer(::fz_buffer *buffer, unsigned char digest[16]);
  3483. /** Low-level wrapper for `::fz_md5_final()`. */
  3484. /**
  3485. MD5 finalization. Ends an MD5 message-digest operation, writing
  3486. the message digest and zeroizing the context.
  3487. Never throws an exception.
  3488. */
  3489. FZ_FUNCTION void ll_fz_md5_final(::fz_md5 *state, unsigned char digest[16]);
  3490. /** Low-level wrapper for `::fz_md5_final2()`. */
  3491. /**
  3492. C++ alternative to fz_md5_final() that returns the digest by value.
  3493. */
  3494. FZ_FUNCTION std::vector<unsigned char> ll_fz_md5_final2(::fz_md5 *md5);
  3495. /** Low-level wrapper for `::fz_md5_init()`. */
  3496. /**
  3497. MD5 initialization. Begins an MD5 operation, writing a new
  3498. context.
  3499. Never throws an exception.
  3500. */
  3501. FZ_FUNCTION void ll_fz_md5_init(::fz_md5 *state);
  3502. /** Low-level wrapper for `::fz_md5_pixmap()`. */
  3503. FZ_FUNCTION void ll_fz_md5_pixmap(::fz_pixmap *pixmap, unsigned char digest[16]);
  3504. /** Low-level wrapper for `::fz_md5_pixmap2()`. */
  3505. /**
  3506. C++ alternative to `fz_md5_pixmap()` that returns the digest by value.
  3507. */
  3508. FZ_FUNCTION std::vector<unsigned char> ll_fz_md5_pixmap2(::fz_pixmap *pixmap);
  3509. /** Low-level wrapper for `::fz_md5_update()`. */
  3510. /**
  3511. MD5 block update operation. Continues an MD5 message-digest
  3512. operation, processing another message block, and updating the
  3513. context.
  3514. Never throws an exception.
  3515. */
  3516. FZ_FUNCTION void ll_fz_md5_update(::fz_md5 *state, const unsigned char *input, size_t inlen);
  3517. /** Low-level wrapper for `::fz_md5_update_int64()`. */
  3518. /**
  3519. MD5 block update operation. Continues an MD5 message-digest
  3520. operation, processing an int64, and updating the context.
  3521. Never throws an exception.
  3522. */
  3523. FZ_FUNCTION void ll_fz_md5_update_int64(::fz_md5 *state, int64_t i);
  3524. /** Low-level wrapper for `::fz_measure_string()`. */
  3525. /**
  3526. Measure the advance width of a UTF8 string should it be added to a text object.
  3527. This uses the same layout algorithms as fz_show_string, and can be used
  3528. to calculate text alignment adjustments.
  3529. */
  3530. FZ_FUNCTION ::fz_matrix ll_fz_measure_string(::fz_font *user_font, ::fz_matrix trm, const char *s, int wmode, int bidi_level, ::fz_bidi_direction markup_dir, ::fz_text_language language);
  3531. /** Low-level wrapper for `::fz_memmem()`. */
  3532. /**
  3533. Find the start of the first occurrence of the substring needle in haystack.
  3534. */
  3535. FZ_FUNCTION void *ll_fz_memmem(const void *haystack, size_t haystacklen, const void *needle, size_t needlelen);
  3536. /** Low-level wrapper for `::fz_memrnd()`. */
  3537. /**
  3538. Fill block with len bytes of pseudo-randomness.
  3539. */
  3540. FZ_FUNCTION void ll_fz_memrnd(uint8_t *block, int len);
  3541. /** Low-level wrapper for `::fz_min()`. */
  3542. FZ_FUNCTION float ll_fz_min(float a, float b);
  3543. /** Low-level wrapper for `::fz_mini()`. */
  3544. FZ_FUNCTION int ll_fz_mini(int a, int b);
  3545. /** Low-level wrapper for `::fz_mini64()`. */
  3546. FZ_FUNCTION int64_t ll_fz_mini64(int64_t a, int64_t b);
  3547. /** Low-level wrapper for `::fz_minz()`. */
  3548. FZ_FUNCTION size_t ll_fz_minz(size_t a, size_t b);
  3549. /** Low-level wrapper for `::fz_mkdir()`. */
  3550. FZ_FUNCTION int ll_fz_mkdir(char *path);
  3551. /** Low-level wrapper for `::fz_morph_error()`. */
  3552. /**
  3553. Called within a catch block this modifies the current
  3554. exception's code. If it's of type 'fromcode' it is
  3555. modified to 'tocode'. Typically used for 'downgrading'
  3556. exception severity.
  3557. */
  3558. FZ_FUNCTION void ll_fz_morph_error(int fromcode, int tocode);
  3559. /** Low-level wrapper for `::fz_mount_multi_archive()`. */
  3560. /**
  3561. Add an archive to the set of archives handled by a multi
  3562. archive.
  3563. If path is NULL, then the archive contents will appear at the
  3564. top level, otherwise, the archives contents will appear prefixed
  3565. by path.
  3566. */
  3567. FZ_FUNCTION void ll_fz_mount_multi_archive(::fz_archive *arch_, ::fz_archive *sub, const char *path);
  3568. /** Low-level wrapper for `::fz_moveto()`. */
  3569. /**
  3570. Append a 'moveto' command to a path.
  3571. This 'opens' a path.
  3572. path: The path to modify.
  3573. x, y: The coordinate to move to.
  3574. Throws exceptions on failure to allocate, or attempting to
  3575. modify a packed path.
  3576. */
  3577. FZ_FUNCTION void ll_fz_moveto(::fz_path *path, float x, float y);
  3578. /** Low-level wrapper for `::fz_mul255()`. */
  3579. /**
  3580. Multiply scaled two integers in the 0..255 range
  3581. */
  3582. FZ_FUNCTION int ll_fz_mul255(int a, int b);
  3583. /** Low-level wrapper for `::fz_needs_password()`. */
  3584. /**
  3585. Check if a document is encrypted with a
  3586. non-blank password.
  3587. */
  3588. FZ_FUNCTION int ll_fz_needs_password(::fz_document *doc);
  3589. /** Low-level wrapper for `::fz_new_arc4_output()`. */
  3590. FZ_FUNCTION ::fz_output *ll_fz_new_arc4_output(::fz_output *chain, unsigned char *key, size_t keylen);
  3591. /** Low-level wrapper for `::fz_new_archive_of_size()`. */
  3592. FZ_FUNCTION ::fz_archive *ll_fz_new_archive_of_size(::fz_stream *file, int size);
  3593. /** Low-level wrapper for `::fz_new_ascii85_output()`. */
  3594. FZ_FUNCTION ::fz_output *ll_fz_new_ascii85_output(::fz_output *chain);
  3595. /** Low-level wrapper for `::fz_new_asciihex_output()`. */
  3596. /**
  3597. Compression and other filtering outputs.
  3598. These outputs write encoded data to another output. Create a
  3599. filter output with the destination, write to the filter, then
  3600. close and drop it when you're done. These can also be chained
  3601. together, for example to write ASCII Hex encoded, Deflate
  3602. compressed, and RC4 encrypted data to a buffer output.
  3603. Output streams don't use reference counting, so make sure to
  3604. close all of the filters in the reverse order of creation so
  3605. that data is flushed properly.
  3606. Accordingly, ownership of 'chain' is never passed into the
  3607. following functions, but remains with the caller, whose
  3608. responsibility it is to ensure they exist at least until
  3609. the returned fz_output is dropped.
  3610. */
  3611. FZ_FUNCTION ::fz_output *ll_fz_new_asciihex_output(::fz_output *chain);
  3612. /** Low-level wrapper for `::fz_new_band_writer_of_size()`. */
  3613. FZ_FUNCTION ::fz_band_writer *ll_fz_new_band_writer_of_size(size_t size, ::fz_output *out);
  3614. /** Low-level wrapper for `::fz_new_barcode_image()`. */
  3615. /**
  3616. Create an fz_image from a barcode definition.
  3617. type: The type of barcode to create.
  3618. value: The value of the barcode.
  3619. size: The size of the barcode.
  3620. ec_level: error correction level 0-8.
  3621. quiet: whether to include quiet zones (0 or 1).
  3622. hrt: whether to include human readable text below the barcode (0 or 1).
  3623. returns a created fz_image.
  3624. */
  3625. FZ_FUNCTION ::fz_image *ll_fz_new_barcode_image(::fz_barcode_type type, const char *value, int size, int ec_level, int quiet, int hrt);
  3626. /** Low-level wrapper for `::fz_new_barcode_pixmap()`. */
  3627. /**
  3628. Create an fz_pixmap from a barcode definition.
  3629. type: The type of barcode to create.
  3630. value: The value of the barcode.
  3631. size: The size of the barcode.
  3632. ec_level: error correction level 0-8.
  3633. quiet: whether to include quiet zones (0 or 1).
  3634. hrt: whether to include human readable text below the barcode (0 or 1).
  3635. returns a created fz_pixmap.
  3636. */
  3637. FZ_FUNCTION ::fz_pixmap *ll_fz_new_barcode_pixmap(::fz_barcode_type type, const char *value, int size, int ec_level, int quiet, int hrt);
  3638. /** Low-level wrapper for `::fz_new_base14_font()`. */
  3639. /**
  3640. Create a new font from one of the built-in fonts.
  3641. */
  3642. FZ_FUNCTION ::fz_font *ll_fz_new_base14_font(const char *name);
  3643. /** Low-level wrapper for `::fz_new_bbox_device()`. */
  3644. /**
  3645. Create a device to compute the bounding
  3646. box of all marks on a page.
  3647. The returned bounding box will be the union of all bounding
  3648. boxes of all objects on a page.
  3649. */
  3650. FZ_FUNCTION ::fz_device *ll_fz_new_bbox_device(::fz_rect *rectp);
  3651. /** Low-level wrapper for `::fz_new_bitmap()`. */
  3652. /**
  3653. Create a new bitmap.
  3654. w, h: Width and Height for the bitmap
  3655. n: Number of color components (assumed to be a divisor of 8)
  3656. xres, yres: X and Y resolutions (in pixels per inch).
  3657. Returns pointer to created bitmap structure. The bitmap
  3658. data is uninitialised.
  3659. */
  3660. FZ_FUNCTION ::fz_bitmap *ll_fz_new_bitmap(int w, int h, int n, int xres, int yres);
  3661. /** Low-level wrapper for `::fz_new_bitmap_from_image()`. */
  3662. /**
  3663. Make a bitmap from a pixmap and a halftone.
  3664. img: The image to generate from. Currently must be a single
  3665. color component with no alpha.
  3666. ht: The halftone to use. NULL implies the default halftone.
  3667. Returns the resultant bitmap. Throws exceptions in the case of
  3668. failure to allocate.
  3669. */
  3670. FZ_FUNCTION ::fz_bitmap *ll_fz_new_bitmap_from_image(::fz_image *img, ::fz_halftone *ht);
  3671. /** Low-level wrapper for `::fz_new_bitmap_from_pixmap()`. */
  3672. /**
  3673. Make a bitmap from a pixmap and a halftone.
  3674. pix: The pixmap to generate from. Currently must be a single
  3675. color component with no alpha.
  3676. ht: The halftone to use. NULL implies the default halftone.
  3677. Returns the resultant bitmap. Throws exceptions in the case of
  3678. failure to allocate.
  3679. */
  3680. FZ_FUNCTION ::fz_bitmap *ll_fz_new_bitmap_from_pixmap(::fz_pixmap *pix, ::fz_halftone *ht);
  3681. /** Low-level wrapper for `::fz_new_bitmap_from_pixmap_band()`. */
  3682. /**
  3683. Make a bitmap from a pixmap and a
  3684. halftone, allowing for the position of the pixmap within an
  3685. overall banded rendering.
  3686. pix: The pixmap to generate from. Currently must be a single
  3687. color component with no alpha.
  3688. ht: The halftone to use. NULL implies the default halftone.
  3689. band_start: Vertical offset within the overall banded rendering
  3690. (in pixels)
  3691. Returns the resultant bitmap. Throws exceptions in the case of
  3692. failure to allocate.
  3693. */
  3694. FZ_FUNCTION ::fz_bitmap *ll_fz_new_bitmap_from_pixmap_band(::fz_pixmap *pix, ::fz_halftone *ht, int band_start);
  3695. /** Low-level wrapper for `::fz_new_brotli_data()`.
  3696. This function has out-params. Python/C# wrappers look like:
  3697. `ll_fz_new_brotli_data(const unsigned char *source, size_t source_length, ::fz_brotli_level level)` => `(unsigned char *, size_t compressed_length)`
  3698. */
  3699. /**
  3700. Compress source_length bytes of data starting
  3701. at source, into a new memory block malloced for that purpose.
  3702. *compressed_length is updated on exit to contain the size used.
  3703. Ownership of the block is returned from this function, and the
  3704. caller is therefore responsible for freeing it. The block may be
  3705. considerably larger than is actually required. The caller is
  3706. free to fz_realloc it down if it wants to.
  3707. */
  3708. FZ_FUNCTION unsigned char *ll_fz_new_brotli_data(size_t *compressed_length, const unsigned char *source, size_t source_length, ::fz_brotli_level level);
  3709. /** Low-level wrapper for `::fz_new_brotli_data_from_buffer()`.
  3710. This function has out-params. Python/C# wrappers look like:
  3711. `ll_fz_new_brotli_data_from_buffer(::fz_buffer *buffer, ::fz_brotli_level level)` => `(unsigned char *, size_t compressed_length)`
  3712. */
  3713. /**
  3714. Compress the contents of a fz_buffer into a
  3715. new block malloced for that purpose. *compressed_length is
  3716. updated on exit to contain the size used. Ownership of the block
  3717. is returned from this function, and the caller is therefore
  3718. responsible for freeing it. The block may be considerably larger
  3719. than is actually required. The caller is free to fz_realloc it
  3720. down if it wants to.
  3721. */
  3722. FZ_FUNCTION unsigned char *ll_fz_new_brotli_data_from_buffer(size_t *compressed_length, ::fz_buffer *buffer, ::fz_brotli_level level);
  3723. /** Low-level wrapper for `::fz_new_buffer()`. */
  3724. FZ_FUNCTION ::fz_buffer *ll_fz_new_buffer(size_t capacity);
  3725. /** Low-level wrapper for `::fz_new_buffer_from_base64()`. */
  3726. /**
  3727. Create a new buffer with data decoded from a base64 input string.
  3728. */
  3729. FZ_FUNCTION ::fz_buffer *ll_fz_new_buffer_from_base64(const char *data, size_t size);
  3730. /** Low-level wrapper for `::fz_new_buffer_from_copied_data()`. */
  3731. /**
  3732. Create a new buffer containing a copy of the passed data.
  3733. */
  3734. FZ_FUNCTION ::fz_buffer *ll_fz_new_buffer_from_copied_data(const unsigned char *data, size_t size);
  3735. /** Low-level wrapper for `::fz_new_buffer_from_data()`. */
  3736. /**
  3737. Create a new buffer with existing data.
  3738. data: Pointer to existing data.
  3739. size: Size of existing data.
  3740. Takes ownership of data. Does not make a copy. Calls fz_free on
  3741. the data when the buffer is deallocated. Do not use 'data' after
  3742. passing to this function.
  3743. Returns pointer to new buffer. Throws exception on allocation
  3744. failure.
  3745. */
  3746. FZ_FUNCTION ::fz_buffer *ll_fz_new_buffer_from_data(unsigned char *data, size_t size);
  3747. /** Low-level wrapper for `::fz_new_buffer_from_display_list()`. */
  3748. FZ_FUNCTION ::fz_buffer *ll_fz_new_buffer_from_display_list(::fz_display_list *list, const ::fz_stext_options *options);
  3749. /** Low-level wrapper for `::fz_new_buffer_from_image_as_jpeg()`. */
  3750. FZ_FUNCTION ::fz_buffer *ll_fz_new_buffer_from_image_as_jpeg(::fz_image *image, ::fz_color_params color_params, int quality, int invert_cmyk);
  3751. /** Low-level wrapper for `::fz_new_buffer_from_image_as_jpx()`. */
  3752. FZ_FUNCTION ::fz_buffer *ll_fz_new_buffer_from_image_as_jpx(::fz_image *image, ::fz_color_params color_params, int quality);
  3753. /** Low-level wrapper for `::fz_new_buffer_from_image_as_pam()`. */
  3754. FZ_FUNCTION ::fz_buffer *ll_fz_new_buffer_from_image_as_pam(::fz_image *image, ::fz_color_params color_params);
  3755. /** Low-level wrapper for `::fz_new_buffer_from_image_as_pbm()`. */
  3756. FZ_FUNCTION ::fz_buffer *ll_fz_new_buffer_from_image_as_pbm(::fz_image *image, ::fz_color_params color_params);
  3757. /** Low-level wrapper for `::fz_new_buffer_from_image_as_pkm()`. */
  3758. FZ_FUNCTION ::fz_buffer *ll_fz_new_buffer_from_image_as_pkm(::fz_image *image, ::fz_color_params color_params);
  3759. /** Low-level wrapper for `::fz_new_buffer_from_image_as_png()`. */
  3760. /**
  3761. Re-encode a given image as a PNG into a buffer.
  3762. Ownership of the buffer is returned.
  3763. */
  3764. FZ_FUNCTION ::fz_buffer *ll_fz_new_buffer_from_image_as_png(::fz_image *image, ::fz_color_params color_params);
  3765. /** Low-level wrapper for `::fz_new_buffer_from_image_as_pnm()`. */
  3766. FZ_FUNCTION ::fz_buffer *ll_fz_new_buffer_from_image_as_pnm(::fz_image *image, ::fz_color_params color_params);
  3767. /** Low-level wrapper for `::fz_new_buffer_from_image_as_psd()`. */
  3768. FZ_FUNCTION ::fz_buffer *ll_fz_new_buffer_from_image_as_psd(::fz_image *image, ::fz_color_params color_params);
  3769. /** Low-level wrapper for `::fz_new_buffer_from_page()`. */
  3770. FZ_FUNCTION ::fz_buffer *ll_fz_new_buffer_from_page(::fz_page *page, const ::fz_stext_options *options);
  3771. /** Low-level wrapper for `::fz_new_buffer_from_page_number()`. */
  3772. FZ_FUNCTION ::fz_buffer *ll_fz_new_buffer_from_page_number(::fz_document *doc, int number, const ::fz_stext_options *options);
  3773. /** Low-level wrapper for `::fz_new_buffer_from_page_with_format()`. */
  3774. /**
  3775. Returns an fz_buffer containing a page after conversion to specified format.
  3776. page: The page to convert.
  3777. format, options: Passed to fz_new_document_writer_with_output() internally.
  3778. transform, cookie: Passed to fz_run_page() internally.
  3779. */
  3780. FZ_FUNCTION ::fz_buffer *ll_fz_new_buffer_from_page_with_format(::fz_page *page, const char *format, const char *options, ::fz_matrix transform, ::fz_cookie *cookie);
  3781. /** Low-level wrapper for `::fz_new_buffer_from_pixmap_as_jpeg()`. */
  3782. FZ_FUNCTION ::fz_buffer *ll_fz_new_buffer_from_pixmap_as_jpeg(::fz_pixmap *pixmap, ::fz_color_params color_params, int quality, int invert_cmyk);
  3783. /** Low-level wrapper for `::fz_new_buffer_from_pixmap_as_jpx()`. */
  3784. FZ_FUNCTION ::fz_buffer *ll_fz_new_buffer_from_pixmap_as_jpx(::fz_pixmap *pix, ::fz_color_params color_params, int quality);
  3785. /** Low-level wrapper for `::fz_new_buffer_from_pixmap_as_pam()`. */
  3786. FZ_FUNCTION ::fz_buffer *ll_fz_new_buffer_from_pixmap_as_pam(::fz_pixmap *pixmap, ::fz_color_params color_params);
  3787. /** Low-level wrapper for `::fz_new_buffer_from_pixmap_as_pbm()`. */
  3788. FZ_FUNCTION ::fz_buffer *ll_fz_new_buffer_from_pixmap_as_pbm(::fz_pixmap *pixmap, ::fz_color_params color_params);
  3789. /** Low-level wrapper for `::fz_new_buffer_from_pixmap_as_pkm()`. */
  3790. FZ_FUNCTION ::fz_buffer *ll_fz_new_buffer_from_pixmap_as_pkm(::fz_pixmap *pixmap, ::fz_color_params color_params);
  3791. /** Low-level wrapper for `::fz_new_buffer_from_pixmap_as_png()`. */
  3792. /**
  3793. Re-encode a given pixmap as a PNG into a buffer.
  3794. Ownership of the buffer is returned.
  3795. */
  3796. FZ_FUNCTION ::fz_buffer *ll_fz_new_buffer_from_pixmap_as_png(::fz_pixmap *pixmap, ::fz_color_params color_params);
  3797. /** Low-level wrapper for `::fz_new_buffer_from_pixmap_as_pnm()`. */
  3798. FZ_FUNCTION ::fz_buffer *ll_fz_new_buffer_from_pixmap_as_pnm(::fz_pixmap *pixmap, ::fz_color_params color_params);
  3799. /** Low-level wrapper for `::fz_new_buffer_from_pixmap_as_psd()`. */
  3800. FZ_FUNCTION ::fz_buffer *ll_fz_new_buffer_from_pixmap_as_psd(::fz_pixmap *pix, ::fz_color_params color_params);
  3801. /** Low-level wrapper for `::fz_new_buffer_from_shared_data()`. */
  3802. /**
  3803. Like fz_new_buffer, but does not take ownership.
  3804. */
  3805. FZ_FUNCTION ::fz_buffer *ll_fz_new_buffer_from_shared_data(const unsigned char *data, size_t size);
  3806. /** Low-level wrapper for `::fz_new_buffer_from_stext_page()`. */
  3807. /**
  3808. Convert structured text into plain text.
  3809. */
  3810. FZ_FUNCTION ::fz_buffer *ll_fz_new_buffer_from_stext_page(::fz_stext_page *text);
  3811. /** Low-level wrapper for `::fz_new_builtin_font()`. */
  3812. FZ_FUNCTION ::fz_font *ll_fz_new_builtin_font(const char *name, int is_bold, int is_italic);
  3813. /** Low-level wrapper for `::fz_new_cal_gray_colorspace()`. */
  3814. /**
  3815. Create a calibrated gray colorspace.
  3816. The returned reference should be dropped when it is finished
  3817. with.
  3818. Colorspaces are immutable once created.
  3819. */
  3820. FZ_FUNCTION ::fz_colorspace *ll_fz_new_cal_gray_colorspace(float wp[3], float bp[3], float gamma);
  3821. /** Low-level wrapper for `::fz_new_cal_rgb_colorspace()`. */
  3822. /**
  3823. Create a calibrated rgb colorspace.
  3824. The returned reference should be dropped when it is finished
  3825. with.
  3826. Colorspaces are immutable once created.
  3827. */
  3828. FZ_FUNCTION ::fz_colorspace *ll_fz_new_cal_rgb_colorspace(float wp[3], float bp[3], float gamma[3], float matrix[9]);
  3829. /** Low-level wrapper for `::fz_new_cbz_writer()`. */
  3830. FZ_FUNCTION ::fz_document_writer *ll_fz_new_cbz_writer(const char *path, const char *options);
  3831. /** Low-level wrapper for `::fz_new_cbz_writer_with_output()`. */
  3832. FZ_FUNCTION ::fz_document_writer *ll_fz_new_cbz_writer_with_output(::fz_output *out, const char *options);
  3833. /** Low-level wrapper for `::fz_new_cjk_font()`. */
  3834. FZ_FUNCTION ::fz_font *ll_fz_new_cjk_font(int ordering);
  3835. /** Low-level wrapper for `::fz_new_color_pcl_band_writer()`. */
  3836. /**
  3837. Create a new band writer, outputting color pcl.
  3838. */
  3839. FZ_FUNCTION ::fz_band_writer *ll_fz_new_color_pcl_band_writer(::fz_output *out, const ::fz_pcl_options *options);
  3840. /** Low-level wrapper for `::fz_new_colorspace()`. */
  3841. /**
  3842. Creates a new colorspace instance and returns a reference.
  3843. No internal checking is done that the colorspace type (e.g.
  3844. CMYK) matches with the flags (e.g. FZ_COLORSPACE_HAS_CMYK) or
  3845. colorant count (n) or name.
  3846. The reference should be dropped when it is finished with.
  3847. Colorspaces are immutable once created (with the exception of
  3848. setting up colorant names for separation spaces).
  3849. */
  3850. FZ_FUNCTION ::fz_colorspace *ll_fz_new_colorspace(enum fz_colorspace_type type, int flags, int n, const char *name);
  3851. /** Low-level wrapper for `::fz_new_compressed_buffer()`. */
  3852. /**
  3853. Create a new, UNKNOWN format, compressed_buffer.
  3854. */
  3855. FZ_FUNCTION ::fz_compressed_buffer *ll_fz_new_compressed_buffer();
  3856. /** Low-level wrapper for `::fz_new_context_imp()`. */
  3857. FZ_FUNCTION ::fz_context *ll_fz_new_context_imp(const ::fz_alloc_context *alloc, const ::fz_locks_context *locks, size_t max_store, const char *version);
  3858. /** Low-level wrapper for `::fz_new_csv_writer()`. */
  3859. FZ_FUNCTION ::fz_document_writer *ll_fz_new_csv_writer(const char *path, const char *options);
  3860. /** Low-level wrapper for `::fz_new_csv_writer_with_output()`. */
  3861. FZ_FUNCTION ::fz_document_writer *ll_fz_new_csv_writer_with_output(::fz_output *out, const char *options);
  3862. /** Low-level wrapper for `::fz_new_default_colorspaces()`. */
  3863. /**
  3864. Create a new default colorspace structure with values inherited
  3865. from the context, and return a reference to it.
  3866. These can be overridden using fz_set_default_xxxx.
  3867. These should not be overridden while more than one caller has
  3868. the reference for fear of race conditions.
  3869. The caller should drop this reference once finished with it.
  3870. */
  3871. FZ_FUNCTION ::fz_default_colorspaces *ll_fz_new_default_colorspaces();
  3872. /** Low-level wrapper for `::fz_new_deflate_output()`. */
  3873. FZ_FUNCTION ::fz_output *ll_fz_new_deflate_output(::fz_output *chain, int effort, int raw);
  3874. /** Low-level wrapper for `::fz_new_deflated_data()`.
  3875. This function has out-params. Python/C# wrappers look like:
  3876. `ll_fz_new_deflated_data(const unsigned char *source, size_t source_length, ::fz_deflate_level level)` => `(unsigned char *, size_t compressed_length)`
  3877. */
  3878. /**
  3879. Compress source_length bytes of data starting
  3880. at source, into a new memory block malloced for that purpose.
  3881. *compressed_length is updated on exit to contain the size used.
  3882. Ownership of the block is returned from this function, and the
  3883. caller is therefore responsible for freeing it. The block may be
  3884. considerably larger than is actually required. The caller is
  3885. free to fz_realloc it down if it wants to.
  3886. */
  3887. FZ_FUNCTION unsigned char *ll_fz_new_deflated_data(size_t *compressed_length, const unsigned char *source, size_t source_length, ::fz_deflate_level level);
  3888. /** Low-level wrapper for `::fz_new_deflated_data_from_buffer()`.
  3889. This function has out-params. Python/C# wrappers look like:
  3890. `ll_fz_new_deflated_data_from_buffer(::fz_buffer *buffer, ::fz_deflate_level level)` => `(unsigned char *, size_t compressed_length)`
  3891. */
  3892. /**
  3893. Compress the contents of a fz_buffer into a
  3894. new block malloced for that purpose. *compressed_length is
  3895. updated on exit to contain the size used. Ownership of the block
  3896. is returned from this function, and the caller is therefore
  3897. responsible for freeing it. The block may be considerably larger
  3898. than is actually required. The caller is free to fz_realloc it
  3899. down if it wants to.
  3900. */
  3901. FZ_FUNCTION unsigned char *ll_fz_new_deflated_data_from_buffer(size_t *compressed_length, ::fz_buffer *buffer, ::fz_deflate_level level);
  3902. /** Low-level wrapper for `::fz_new_device_of_size()`. */
  3903. /**
  3904. Devices are created by calls to device implementations, for
  3905. instance: foo_new_device(). These will be implemented by calling
  3906. fz_new_derived_device(ctx, foo_device) where foo_device is a
  3907. structure "derived from" fz_device, for instance
  3908. typedef struct { fz_device base; ...extras...} foo_device;
  3909. */
  3910. FZ_FUNCTION ::fz_device *ll_fz_new_device_of_size(int size);
  3911. /** Low-level wrapper for `::fz_new_display_list()`. */
  3912. /**
  3913. Create an empty display list.
  3914. A display list contains drawing commands (text, images, etc.).
  3915. Use fz_new_list_device for populating the list.
  3916. mediabox: Bounds of the page (in points) represented by the
  3917. display list.
  3918. */
  3919. FZ_FUNCTION ::fz_display_list *ll_fz_new_display_list(::fz_rect mediabox);
  3920. /** Low-level wrapper for `::fz_new_display_list_from_page()`. */
  3921. /**
  3922. Create a display list.
  3923. Ownership of the display list is returned to the caller.
  3924. */
  3925. FZ_FUNCTION ::fz_display_list *ll_fz_new_display_list_from_page(::fz_page *page);
  3926. /** Low-level wrapper for `::fz_new_display_list_from_page_contents()`. */
  3927. /**
  3928. Create a display list from page contents (no annotations).
  3929. Ownership of the display list is returned to the caller.
  3930. */
  3931. FZ_FUNCTION ::fz_display_list *ll_fz_new_display_list_from_page_contents(::fz_page *page);
  3932. /** Low-level wrapper for `::fz_new_display_list_from_page_number()`. */
  3933. FZ_FUNCTION ::fz_display_list *ll_fz_new_display_list_from_page_number(::fz_document *doc, int number);
  3934. /** Low-level wrapper for `::fz_new_display_list_from_svg()`.
  3935. This function has out-params. Python/C# wrappers look like:
  3936. `ll_fz_new_display_list_from_svg(::fz_buffer *buf, const char *base_uri, ::fz_archive *dir)` => `(fz_display_list *, float w, float h)`
  3937. */
  3938. /**
  3939. Parse an SVG document into a display-list.
  3940. */
  3941. FZ_FUNCTION ::fz_display_list *ll_fz_new_display_list_from_svg(::fz_buffer *buf, const char *base_uri, ::fz_archive *dir, float *w, float *h);
  3942. /** Low-level wrapper for `::fz_new_display_list_from_svg_xml()`.
  3943. This function has out-params. Python/C# wrappers look like:
  3944. `ll_fz_new_display_list_from_svg_xml(::fz_xml_doc *xmldoc, ::fz_xml *xml, const char *base_uri, ::fz_archive *dir)` => `(fz_display_list *, float w, float h)`
  3945. */
  3946. /**
  3947. Parse an SVG document into a display-list.
  3948. */
  3949. FZ_FUNCTION ::fz_display_list *ll_fz_new_display_list_from_svg_xml(::fz_xml_doc *xmldoc, ::fz_xml *xml, const char *base_uri, ::fz_archive *dir, float *w, float *h);
  3950. /** Low-level wrapper for `::fz_new_document_of_size()`. */
  3951. /**
  3952. New documents are typically created by calls like
  3953. foo_new_document(fz_context *ctx, ...). These work by
  3954. deriving a new document type from fz_document, for instance:
  3955. typedef struct { fz_document base; ...extras... } foo_document;
  3956. These are allocated by calling
  3957. fz_new_derived_document(ctx, foo_document)
  3958. */
  3959. FZ_FUNCTION void *ll_fz_new_document_of_size(int size);
  3960. /** Low-level wrapper for `::fz_new_document_writer()`. */
  3961. /**
  3962. Create a new fz_document_writer, for a
  3963. file of the given type.
  3964. path: The document name to write (or NULL for default)
  3965. format: Which format to write (currently cbz, html, pdf, pam,
  3966. pbm, pgm, pkm, png, ppm, pnm, svg, text, xhtml, docx, odt)
  3967. options: NULL, or pointer to comma separated string to control
  3968. file generation.
  3969. */
  3970. FZ_FUNCTION ::fz_document_writer *ll_fz_new_document_writer(const char *path, const char *format, const char *options);
  3971. /** Low-level wrapper for `::fz_new_document_writer_of_size()`. */
  3972. /**
  3973. Internal function to allocate a
  3974. block for a derived document_writer structure, with the base
  3975. structure's function pointers populated correctly, and the extra
  3976. space zero initialised.
  3977. */
  3978. FZ_FUNCTION ::fz_document_writer *ll_fz_new_document_writer_of_size(size_t size, ::fz_document_writer_begin_page_fn *begin_page, ::fz_document_writer_end_page_fn *end_page, ::fz_document_writer_close_writer_fn *close, ::fz_document_writer_drop_writer_fn *drop);
  3979. /** Low-level wrapper for `::fz_new_document_writer_with_buffer()`. */
  3980. FZ_FUNCTION ::fz_document_writer *ll_fz_new_document_writer_with_buffer(::fz_buffer *buf, const char *format, const char *options);
  3981. /** Low-level wrapper for `::fz_new_document_writer_with_output()`. */
  3982. /**
  3983. Like fz_new_document_writer but takes a fz_output for writing
  3984. the result. Only works for multi-page formats.
  3985. */
  3986. FZ_FUNCTION ::fz_document_writer *ll_fz_new_document_writer_with_output(::fz_output *out, const char *format, const char *options);
  3987. /** Low-level wrapper for `::fz_new_docx_writer()`. */
  3988. FZ_FUNCTION ::fz_document_writer *ll_fz_new_docx_writer(const char *path, const char *options);
  3989. /** Low-level wrapper for `::fz_new_docx_writer_with_output()`. */
  3990. FZ_FUNCTION ::fz_document_writer *ll_fz_new_docx_writer_with_output(::fz_output *out, const char *options);
  3991. /** Low-level wrapper for `::fz_new_dom()`. */
  3992. /**
  3993. Make new xml dom root element.
  3994. */
  3995. FZ_FUNCTION ::fz_xml *ll_fz_new_dom(const char *tag);
  3996. /** Low-level wrapper for `::fz_new_dom_node()`. */
  3997. /**
  3998. Create a new dom node.
  3999. This will NOT be linked in yet.
  4000. */
  4001. FZ_FUNCTION ::fz_xml *ll_fz_new_dom_node(::fz_xml *dom, const char *tag);
  4002. /** Low-level wrapper for `::fz_new_dom_text_node()`. */
  4003. /**
  4004. Create a new dom text node.
  4005. This will NOT be linked in yet.
  4006. */
  4007. FZ_FUNCTION ::fz_xml *ll_fz_new_dom_text_node(::fz_xml *dom, const char *text);
  4008. /** Low-level wrapper for `::fz_new_draw_device()`. */
  4009. /**
  4010. Create a device to draw on a pixmap.
  4011. dest: Target pixmap for the draw device. See fz_new_pixmap*
  4012. for how to obtain a pixmap. The pixmap is not cleared by the
  4013. draw device, see fz_clear_pixmap* for how to clear it prior to
  4014. calling fz_new_draw_device. Free the device by calling
  4015. fz_drop_device.
  4016. transform: Transform from user space in points to device space
  4017. in pixels.
  4018. */
  4019. FZ_FUNCTION ::fz_device *ll_fz_new_draw_device(::fz_matrix transform, ::fz_pixmap *dest);
  4020. /** Low-level wrapper for `::fz_new_draw_device_type3()`. */
  4021. FZ_FUNCTION ::fz_device *ll_fz_new_draw_device_type3(::fz_matrix transform, ::fz_pixmap *dest);
  4022. /** Low-level wrapper for `::fz_new_draw_device_with_bbox()`. */
  4023. /**
  4024. Create a device to draw on a pixmap.
  4025. dest: Target pixmap for the draw device. See fz_new_pixmap*
  4026. for how to obtain a pixmap. The pixmap is not cleared by the
  4027. draw device, see fz_clear_pixmap* for how to clear it prior to
  4028. calling fz_new_draw_device. Free the device by calling
  4029. fz_drop_device.
  4030. transform: Transform from user space in points to device space
  4031. in pixels.
  4032. clip: Bounding box to restrict any marking operations of the
  4033. draw device.
  4034. */
  4035. FZ_FUNCTION ::fz_device *ll_fz_new_draw_device_with_bbox(::fz_matrix transform, ::fz_pixmap *dest, const ::fz_irect *clip);
  4036. /** Low-level wrapper for `::fz_new_draw_device_with_bbox_proof()`. */
  4037. /**
  4038. Create a device to draw on a pixmap.
  4039. dest: Target pixmap for the draw device. See fz_new_pixmap*
  4040. for how to obtain a pixmap. The pixmap is not cleared by the
  4041. draw device, see fz_clear_pixmap* for how to clear it prior to
  4042. calling fz_new_draw_device. Free the device by calling
  4043. fz_drop_device.
  4044. transform: Transform from user space in points to device space
  4045. in pixels.
  4046. clip: Bounding box to restrict any marking operations of the
  4047. draw device.
  4048. proof_cs: Color space to render to prior to mapping to color
  4049. space defined by pixmap.
  4050. */
  4051. FZ_FUNCTION ::fz_device *ll_fz_new_draw_device_with_bbox_proof(::fz_matrix transform, ::fz_pixmap *dest, const ::fz_irect *clip, ::fz_colorspace *cs);
  4052. /** Low-level wrapper for `::fz_new_draw_device_with_options()`.
  4053. This function has out-params. Python/C# wrappers look like:
  4054. `ll_fz_new_draw_device_with_options(const ::fz_draw_options *options, ::fz_rect mediabox, ::fz_pixmap **pixmap)` => `(fz_device *)`
  4055. */
  4056. /**
  4057. Create a new pixmap and draw device, using the specified options.
  4058. options: Options to configure the draw device, and choose the
  4059. resolution and colorspace.
  4060. mediabox: The bounds of the page in points.
  4061. pixmap: An out parameter containing the newly created pixmap.
  4062. */
  4063. FZ_FUNCTION ::fz_device *ll_fz_new_draw_device_with_options(const ::fz_draw_options *options, ::fz_rect mediabox, ::fz_pixmap **pixmap);
  4064. /** Low-level wrapper for `::fz_new_draw_device_with_proof()`. */
  4065. /**
  4066. Create a device to draw on a pixmap.
  4067. dest: Target pixmap for the draw device. See fz_new_pixmap*
  4068. for how to obtain a pixmap. The pixmap is not cleared by the
  4069. draw device, see fz_clear_pixmap* for how to clear it prior to
  4070. calling fz_new_draw_device. Free the device by calling
  4071. fz_drop_device.
  4072. transform: Transform from user space in points to device space
  4073. in pixels.
  4074. proof_cs: Intermediate color space to map though when mapping to
  4075. color space defined by pixmap.
  4076. */
  4077. FZ_FUNCTION ::fz_device *ll_fz_new_draw_device_with_proof(::fz_matrix transform, ::fz_pixmap *dest, ::fz_colorspace *proof_cs);
  4078. /** Low-level wrapper for `::fz_new_font_from_buffer()`. */
  4079. /**
  4080. Create a new font from a font file in a fz_buffer.
  4081. Fonts created in this way, will be eligible for embedding by default.
  4082. name: Name of font (leave NULL to use name from font).
  4083. buffer: Buffer to load from.
  4084. index: Which font from the file to load (0 for default).
  4085. use_glyph_box: 1 if we should use the glyph bbox, 0 otherwise.
  4086. Returns new font handle, or throws exception on error.
  4087. */
  4088. FZ_FUNCTION ::fz_font *ll_fz_new_font_from_buffer(const char *name, ::fz_buffer *buffer, int index, int use_glyph_bbox);
  4089. /** Low-level wrapper for `::fz_new_font_from_file()`. */
  4090. /**
  4091. Create a new font from a font file.
  4092. Fonts created in this way, will be eligible for embedding by default.
  4093. name: Name of font (leave NULL to use name from font).
  4094. path: File path to load from.
  4095. index: Which font from the file to load (0 for default).
  4096. use_glyph_box: 1 if we should use the glyph bbox, 0 otherwise.
  4097. Returns new font handle, or throws exception on error.
  4098. */
  4099. FZ_FUNCTION ::fz_font *ll_fz_new_font_from_file(const char *name, const char *path, int index, int use_glyph_bbox);
  4100. /** Low-level wrapper for `::fz_new_font_from_memory()`. */
  4101. /**
  4102. Create a new font from a font file in memory.
  4103. Fonts created in this way, will be eligible for embedding by default.
  4104. name: Name of font (leave NULL to use name from font).
  4105. data: Pointer to the font file data.
  4106. len: Length of the font file data.
  4107. index: Which font from the file to load (0 for default).
  4108. use_glyph_box: 1 if we should use the glyph bbox, 0 otherwise.
  4109. Returns new font handle, or throws exception on error.
  4110. */
  4111. FZ_FUNCTION ::fz_font *ll_fz_new_font_from_memory(const char *name, const unsigned char *data, int len, int index, int use_glyph_bbox);
  4112. /** Low-level wrapper for `::fz_new_function_of_size()`. */
  4113. FZ_FUNCTION ::fz_function *ll_fz_new_function_of_size(int size, size_t size2, int m, int n, ::fz_function_eval_fn *eval, ::fz_store_drop_fn *drop);
  4114. /** Low-level wrapper for `::fz_new_hash_table()`. */
  4115. /**
  4116. Create a new hash table.
  4117. initialsize: The initial size of the hashtable. The hashtable
  4118. may grow (double in size) if it starts to get crowded (80%
  4119. full).
  4120. keylen: byte length for each key.
  4121. lock: -1 for no lock, otherwise the FZ_LOCK to use to protect
  4122. this table.
  4123. drop_val: Function to use to destroy values on table drop.
  4124. */
  4125. FZ_FUNCTION ::fz_hash_table *ll_fz_new_hash_table(int initialsize, int keylen, int lock, ::fz_hash_table_drop_fn *drop_val);
  4126. /** Low-level wrapper for `::fz_new_icc_colorspace()`. */
  4127. /**
  4128. Create a colorspace from an ICC profile supplied in buf.
  4129. Limited checking is done to ensure that the colorspace type is
  4130. appropriate for the supplied ICC profile.
  4131. An additional reference is taken to buf, which will be dropped
  4132. on destruction. Ownership is NOT passed in.
  4133. The returned reference should be dropped when it is finished
  4134. with.
  4135. Colorspaces are immutable once created.
  4136. */
  4137. FZ_FUNCTION ::fz_colorspace *ll_fz_new_icc_colorspace(enum fz_colorspace_type type, int flags, const char *name, ::fz_buffer *buf);
  4138. /** Low-level wrapper for `::fz_new_image_from_buffer()`. */
  4139. /**
  4140. Create a new image from a
  4141. buffer of data, inferring its type from the format
  4142. of the data.
  4143. */
  4144. FZ_FUNCTION ::fz_image *ll_fz_new_image_from_buffer(::fz_buffer *buffer);
  4145. /** Low-level wrapper for `::fz_new_image_from_compressed_buffer()`. */
  4146. /**
  4147. Create an image based on
  4148. the data in the supplied compressed buffer.
  4149. w,h: Width and height of the created image.
  4150. bpc: Bits per component.
  4151. colorspace: The colorspace (determines the number of components,
  4152. and any color conversions required while decoding).
  4153. xres, yres: The X and Y resolutions respectively.
  4154. interpolate: 1 if interpolation should be used when decoding
  4155. this image, 0 otherwise.
  4156. imagemask: 1 if this is an imagemask (i.e. transparency bitmap
  4157. mask), 0 otherwise.
  4158. decode: NULL, or a pointer to to a decode array. The default
  4159. decode array is [0 1] (repeated n times, for n color components).
  4160. colorkey: NULL, or a pointer to a colorkey array. The default
  4161. colorkey array is [0 255] (repeated n times, for n color
  4162. components).
  4163. buffer: Buffer of compressed data and compression parameters.
  4164. Ownership of this reference is passed in.
  4165. mask: NULL, or another image to use as a mask for this one.
  4166. A new reference is taken to this image. Supplying a masked
  4167. image as a mask to another image is illegal!
  4168. */
  4169. FZ_FUNCTION ::fz_image *ll_fz_new_image_from_compressed_buffer(int w, int h, int bpc, ::fz_colorspace *colorspace, int xres, int yres, int interpolate, int imagemask, const float *decode, const int *colorkey, ::fz_compressed_buffer *buffer, ::fz_image *mask);
  4170. /** Low-level wrapper for `::fz_new_image_from_compressed_buffer2()`. */
  4171. /** Swig-friendly wrapper for fz_new_image_from_compressed_buffer(),
  4172. uses specified `decode` and `colorkey` if they are not null (in which
  4173. case we assert that they have size `2*fz_colorspace_n(colorspace)`). */
  4174. FZ_FUNCTION ::fz_image *ll_fz_new_image_from_compressed_buffer2(int w, int h, int bpc, ::fz_colorspace *colorspace, int xres, int yres, int interpolate, int imagemask, const std::vector<float> &decode, const std::vector<int> &colorkey, ::fz_compressed_buffer *buffer, ::fz_image *mask);
  4175. /** Low-level wrapper for `::fz_new_image_from_display_list()`. */
  4176. /**
  4177. Create a new image from a display list.
  4178. w, h: The conceptual width/height of the image.
  4179. transform: The matrix that needs to be applied to the given
  4180. list to make it render to the unit square.
  4181. list: The display list.
  4182. */
  4183. FZ_FUNCTION ::fz_image *ll_fz_new_image_from_display_list(float w, float h, ::fz_display_list *list);
  4184. /** Low-level wrapper for `::fz_new_image_from_file()`. */
  4185. /**
  4186. Create a new image from the contents
  4187. of a file, inferring its type from the format of the
  4188. data.
  4189. */
  4190. FZ_FUNCTION ::fz_image *ll_fz_new_image_from_file(const char *path);
  4191. /** Low-level wrapper for `::fz_new_image_from_pixmap()`. */
  4192. /**
  4193. Create an image from the given
  4194. pixmap.
  4195. pixmap: The pixmap to base the image upon. A new reference
  4196. to this is taken.
  4197. mask: NULL, or another image to use as a mask for this one.
  4198. A new reference is taken to this image. Supplying a masked
  4199. image as a mask to another image is illegal!
  4200. */
  4201. FZ_FUNCTION ::fz_image *ll_fz_new_image_from_pixmap(::fz_pixmap *pixmap, ::fz_image *mask);
  4202. /** Low-level wrapper for `::fz_new_image_from_svg()`. */
  4203. /**
  4204. Create a scalable image from an SVG document.
  4205. */
  4206. FZ_FUNCTION ::fz_image *ll_fz_new_image_from_svg(::fz_buffer *buf, const char *base_uri, ::fz_archive *dir);
  4207. /** Low-level wrapper for `::fz_new_image_from_svg_xml()`. */
  4208. /**
  4209. Create a scalable image from an SVG document.
  4210. */
  4211. FZ_FUNCTION ::fz_image *ll_fz_new_image_from_svg_xml(::fz_xml_doc *xmldoc, ::fz_xml *xml, const char *base_uri, ::fz_archive *dir);
  4212. /** Low-level wrapper for `::fz_new_image_of_size()`. */
  4213. /**
  4214. Internal function to make a new fz_image structure
  4215. for a derived class.
  4216. w,h: Width and height of the created image.
  4217. bpc: Bits per component.
  4218. colorspace: The colorspace (determines the number of components,
  4219. and any color conversions required while decoding).
  4220. xres, yres: The X and Y resolutions respectively.
  4221. interpolate: 1 if interpolation should be used when decoding
  4222. this image, 0 otherwise.
  4223. imagemask: 1 if this is an imagemask (i.e. transparent), 0
  4224. otherwise.
  4225. decode: NULL, or a pointer to to a decode array. The default
  4226. decode array is [0 1] (repeated n times, for n color components).
  4227. colorkey: NULL, or a pointer to a colorkey array. The default
  4228. colorkey array is [0 255] (repeated n times, for n color
  4229. components).
  4230. mask: NULL, or another image to use as a mask for this one.
  4231. A new reference is taken to this image. Supplying a masked
  4232. image as a mask to another image is illegal!
  4233. size: The size of the required allocated structure (the size of
  4234. the derived structure).
  4235. get: The function to be called to obtain a decoded pixmap.
  4236. get_size: The function to be called to return the storage size
  4237. used by this image.
  4238. drop: The function to be called to dispose of this image once
  4239. the last reference is dropped.
  4240. Returns a pointer to an allocated structure of the required size,
  4241. with the first sizeof(fz_image) bytes initialised as appropriate
  4242. given the supplied parameters, and the other bytes set to zero.
  4243. */
  4244. FZ_FUNCTION ::fz_image *ll_fz_new_image_of_size(int w, int h, int bpc, ::fz_colorspace *colorspace, int xres, int yres, int interpolate, int imagemask, const float *decode, const int *colorkey, ::fz_image *mask, size_t size, ::fz_image_get_pixmap_fn *get_pixmap, ::fz_image_get_size_fn *get_size, ::fz_drop_image_fn *drop);
  4245. /** Low-level wrapper for `::fz_new_indexed_colorspace()`. */
  4246. /**
  4247. Create an indexed colorspace.
  4248. The supplied lookup table is high palette entries long. Each
  4249. entry is n bytes long, where n is given by the number of
  4250. colorants in the base colorspace, one byte per colorant.
  4251. Ownership of lookup is passed it; it will be freed on
  4252. destruction, so must be heap allocated.
  4253. The colorspace will keep an additional reference to the base
  4254. colorspace that will be dropped on destruction.
  4255. The returned reference should be dropped when it is finished
  4256. with.
  4257. Colorspaces are immutable once created.
  4258. */
  4259. FZ_FUNCTION ::fz_colorspace *ll_fz_new_indexed_colorspace(::fz_colorspace *base, int high, unsigned char *lookup);
  4260. /** Low-level wrapper for `::fz_new_jpeg_pixmap_writer()`. */
  4261. FZ_FUNCTION ::fz_document_writer *ll_fz_new_jpeg_pixmap_writer(const char *path, const char *options);
  4262. /** Low-level wrapper for `::fz_new_layout()`. */
  4263. /**
  4264. Create a new layout block, with new allocation pool, zero
  4265. matrices, and initialise linked pointers.
  4266. */
  4267. FZ_FUNCTION ::fz_layout_block *ll_fz_new_layout();
  4268. /** Low-level wrapper for `::fz_new_link_of_size()`. */
  4269. /**
  4270. Create a new link record.
  4271. next is set to NULL with the expectation that the caller will
  4272. handle the linked list setup. Internal function.
  4273. Different document types will be implemented by deriving from
  4274. fz_link. This macro allocates such derived structures, and
  4275. initialises the base sections.
  4276. */
  4277. FZ_FUNCTION ::fz_link *ll_fz_new_link_of_size(int size, ::fz_rect rect, const char *uri);
  4278. /** Low-level wrapper for `::fz_new_list_device()`. */
  4279. /**
  4280. Create a rendering device for a display list.
  4281. When the device is rendering a page it will populate the
  4282. display list with drawing commands (text, images, etc.). The
  4283. display list can later be reused to render a page many times
  4284. without having to re-interpret the page from the document file
  4285. for each rendering. Once the device is no longer needed, free
  4286. it with fz_drop_device.
  4287. list: A display list that the list device takes a reference to.
  4288. */
  4289. FZ_FUNCTION ::fz_device *ll_fz_new_list_device(::fz_display_list *list);
  4290. /** Low-level wrapper for `::fz_new_log_for_module()`. */
  4291. /**
  4292. Internal function to actually do the opening of the logfile.
  4293. Caller should close/drop the output when finished with it.
  4294. */
  4295. FZ_FUNCTION ::fz_output *ll_fz_new_log_for_module(const char *module);
  4296. /** Low-level wrapper for `::fz_new_mono_pcl_band_writer()`. */
  4297. /**
  4298. Create a new band writer, outputting monochrome pcl.
  4299. */
  4300. FZ_FUNCTION ::fz_band_writer *ll_fz_new_mono_pcl_band_writer(::fz_output *out, const ::fz_pcl_options *options);
  4301. /** Low-level wrapper for `::fz_new_mono_pwg_band_writer()`. */
  4302. /**
  4303. Create a new monochrome pwg band writer.
  4304. */
  4305. FZ_FUNCTION ::fz_band_writer *ll_fz_new_mono_pwg_band_writer(::fz_output *out, const ::fz_pwg_options *pwg);
  4306. /** Low-level wrapper for `::fz_new_multi_archive()`. */
  4307. /**
  4308. Create a new multi archive (initially empty).
  4309. */
  4310. FZ_FUNCTION ::fz_archive *ll_fz_new_multi_archive();
  4311. /** Low-level wrapper for `::fz_new_ocr_device()`. */
  4312. /**
  4313. Create a device to OCR the text on the page.
  4314. Renders the page internally to a bitmap that is then OCRd. Text
  4315. is then forwarded onto the target device.
  4316. target: The target device to receive the OCRd text.
  4317. ctm: The transform to apply to the mediabox to get the size for
  4318. the rendered page image. Also used to calculate the resolution
  4319. for the page image. In general, this will be the same as the CTM
  4320. that you pass to fz_run_page (or fz_run_display_list) to feed
  4321. this device.
  4322. mediabox: The mediabox (in points). Combined with the CTM to get
  4323. the bounds of the pixmap used internally for the rendered page
  4324. image.
  4325. with_list: If with_list is false, then all non-text operations
  4326. are forwarded instantly to the target device. This results in
  4327. the target device seeing all NON-text operations, followed by
  4328. all the text operations (derived from OCR).
  4329. If with_list is true, then all the marking operations are
  4330. collated into a display list which is then replayed to the
  4331. target device at the end.
  4332. language: NULL (for "eng"), or a pointer to a string to describe
  4333. the languages/scripts that should be used for OCR (e.g.
  4334. "eng,ara").
  4335. datadir: NULL (for ""), or a pointer to a path string otherwise
  4336. provided to Tesseract in the TESSDATA_PREFIX environment variable.
  4337. progress: NULL, or function to be called periodically to indicate
  4338. progress. Return 0 to continue, or 1 to cancel. progress_arg is
  4339. returned as the void *. The int is a value between 0 and 100 to
  4340. indicate progress.
  4341. progress_arg: A void * value to be parrotted back to the progress
  4342. function.
  4343. */
  4344. FZ_FUNCTION ::fz_device *ll_fz_new_ocr_device(::fz_device *target, ::fz_matrix ctm, ::fz_rect mediabox, int with_list, const char *language, const char *datadir, int (*progress)(::fz_context *, void *, int ), void *progress_arg);
  4345. /** Low-level wrapper for `::fz_new_odt_writer()`. */
  4346. FZ_FUNCTION ::fz_document_writer *ll_fz_new_odt_writer(const char *path, const char *options);
  4347. /** Low-level wrapper for `::fz_new_odt_writer_with_output()`. */
  4348. FZ_FUNCTION ::fz_document_writer *ll_fz_new_odt_writer_with_output(::fz_output *out, const char *options);
  4349. /** Low-level wrapper for `::fz_new_outline()`. */
  4350. /**
  4351. Create a new outline entry with zeroed fields for the caller
  4352. to fill in.
  4353. */
  4354. FZ_FUNCTION ::fz_outline *ll_fz_new_outline();
  4355. /** Low-level wrapper for `::fz_new_outline_iterator()`. */
  4356. /**
  4357. Get an iterator for the document outline.
  4358. Should be freed by fz_drop_outline_iterator.
  4359. */
  4360. FZ_FUNCTION ::fz_outline_iterator *ll_fz_new_outline_iterator(::fz_document *doc);
  4361. /** Low-level wrapper for `::fz_new_outline_iterator_of_size()`. */
  4362. FZ_FUNCTION ::fz_outline_iterator *ll_fz_new_outline_iterator_of_size(size_t size, ::fz_document *doc);
  4363. /** Low-level wrapper for `::fz_new_output()`. */
  4364. /**
  4365. Create a new output object with the given
  4366. internal state and function pointers.
  4367. state: Internal state (opaque to everything but implementation).
  4368. write: Function to output a given buffer.
  4369. close: Cleanup function to destroy state when output closed.
  4370. May permissibly be null.
  4371. */
  4372. FZ_FUNCTION ::fz_output *ll_fz_new_output(int bufsiz, void *state, ::fz_output_write_fn *write, ::fz_output_close_fn *close, ::fz_output_drop_fn *drop);
  4373. /** Low-level wrapper for `::fz_new_output_with_buffer()`. */
  4374. /**
  4375. Open an output stream that appends
  4376. to a buffer.
  4377. buf: The buffer to append to.
  4378. */
  4379. FZ_FUNCTION ::fz_output *ll_fz_new_output_with_buffer(::fz_buffer *buf);
  4380. /** Low-level wrapper for `::fz_new_output_with_file_ptr()`. */
  4381. /**
  4382. Open an output stream that writes to a
  4383. given FILE *.
  4384. file: The file pointers to write to. NULL is interpreted as effectively
  4385. meaning /dev/null or similar.
  4386. */
  4387. FZ_FUNCTION ::fz_output *ll_fz_new_output_with_file_ptr(FILE *file);
  4388. /** Low-level wrapper for `::fz_new_output_with_path()`. */
  4389. /**
  4390. Open an output stream that writes to a
  4391. given path.
  4392. filename: The filename to write to (specified in UTF-8).
  4393. append: non-zero if we should append to the file, rather than
  4394. overwriting it.
  4395. */
  4396. FZ_FUNCTION ::fz_output *ll_fz_new_output_with_path(const char *filename, int append);
  4397. /** Low-level wrapper for `::fz_new_page_of_size()`. */
  4398. /**
  4399. Different document types will be implemented by deriving from
  4400. fz_page. This macro allocates such derived structures, and
  4401. initialises the base sections.
  4402. */
  4403. FZ_FUNCTION ::fz_page *ll_fz_new_page_of_size(int size, ::fz_document *doc);
  4404. /** Low-level wrapper for `::fz_new_pam_band_writer()`. */
  4405. /**
  4406. Create a band writer targeting pnm (greyscale, rgb or cmyk,
  4407. with or without alpha).
  4408. */
  4409. FZ_FUNCTION ::fz_band_writer *ll_fz_new_pam_band_writer(::fz_output *out);
  4410. /** Low-level wrapper for `::fz_new_pam_pixmap_writer()`. */
  4411. FZ_FUNCTION ::fz_document_writer *ll_fz_new_pam_pixmap_writer(const char *path, const char *options);
  4412. /** Low-level wrapper for `::fz_new_path()`. */
  4413. /**
  4414. Create a new (empty) path structure.
  4415. */
  4416. FZ_FUNCTION ::fz_path *ll_fz_new_path();
  4417. /** Low-level wrapper for `::fz_new_pbm_band_writer()`. */
  4418. /**
  4419. Create a new band writer, targeting pbm.
  4420. */
  4421. FZ_FUNCTION ::fz_band_writer *ll_fz_new_pbm_band_writer(::fz_output *out);
  4422. /** Low-level wrapper for `::fz_new_pbm_pixmap_writer()`. */
  4423. FZ_FUNCTION ::fz_document_writer *ll_fz_new_pbm_pixmap_writer(const char *path, const char *options);
  4424. /** Low-level wrapper for `::fz_new_pcl_writer()`. */
  4425. FZ_FUNCTION ::fz_document_writer *ll_fz_new_pcl_writer(const char *path, const char *options);
  4426. /** Low-level wrapper for `::fz_new_pcl_writer_with_output()`. */
  4427. FZ_FUNCTION ::fz_document_writer *ll_fz_new_pcl_writer_with_output(::fz_output *out, const char *options);
  4428. /** Low-level wrapper for `::fz_new_pclm_band_writer()`. */
  4429. /**
  4430. Create a new band writer, outputting pclm
  4431. */
  4432. FZ_FUNCTION ::fz_band_writer *ll_fz_new_pclm_band_writer(::fz_output *out, const ::fz_pclm_options *options);
  4433. /** Low-level wrapper for `::fz_new_pclm_writer()`. */
  4434. FZ_FUNCTION ::fz_document_writer *ll_fz_new_pclm_writer(const char *path, const char *options);
  4435. /** Low-level wrapper for `::fz_new_pclm_writer_with_output()`. */
  4436. FZ_FUNCTION ::fz_document_writer *ll_fz_new_pclm_writer_with_output(::fz_output *out, const char *options);
  4437. /** Low-level wrapper for `::fz_new_pdf_document_from_fz_document()`. */
  4438. FZ_FUNCTION ::pdf_document *ll_fz_new_pdf_document_from_fz_document(::fz_document *ptr);
  4439. /** Low-level wrapper for `::fz_new_pdf_writer()`. */
  4440. /**
  4441. Document writers for various possible output formats.
  4442. All of the "_with_output" variants pass the ownership of out in
  4443. immediately upon calling. The writers are responsible for
  4444. dropping the fz_output when they are finished with it (even
  4445. if they throw an exception during creation).
  4446. */
  4447. FZ_FUNCTION ::fz_document_writer *ll_fz_new_pdf_writer(const char *path, const char *options);
  4448. /** Low-level wrapper for `::fz_new_pdf_writer_with_output()`. */
  4449. FZ_FUNCTION ::fz_document_writer *ll_fz_new_pdf_writer_with_output(::fz_output *out, const char *options);
  4450. /** Low-level wrapper for `::fz_new_pdfocr_band_writer()`. */
  4451. /**
  4452. Create a new band writer, outputting pdfocr.
  4453. Ownership of output stays with the caller, the band writer
  4454. borrows the reference. The caller must keep the output around
  4455. for the duration of the band writer, and then close/drop as
  4456. appropriate.
  4457. */
  4458. FZ_FUNCTION ::fz_band_writer *ll_fz_new_pdfocr_band_writer(::fz_output *out, const ::fz_pdfocr_options *options);
  4459. /** Low-level wrapper for `::fz_new_pdfocr_writer()`. */
  4460. FZ_FUNCTION ::fz_document_writer *ll_fz_new_pdfocr_writer(const char *path, const char *options);
  4461. /** Low-level wrapper for `::fz_new_pdfocr_writer_with_output()`. */
  4462. FZ_FUNCTION ::fz_document_writer *ll_fz_new_pdfocr_writer_with_output(::fz_output *out, const char *options);
  4463. /** Low-level wrapper for `::fz_new_pgm_pixmap_writer()`. */
  4464. FZ_FUNCTION ::fz_document_writer *ll_fz_new_pgm_pixmap_writer(const char *path, const char *options);
  4465. /** Low-level wrapper for `::fz_new_pixmap()`. */
  4466. /**
  4467. Create a new pixmap, with its origin at (0,0)
  4468. cs: The colorspace to use for the pixmap, or NULL for an alpha
  4469. plane/mask.
  4470. w: The width of the pixmap (in pixels)
  4471. h: The height of the pixmap (in pixels)
  4472. seps: Details of separations.
  4473. alpha: 0 for no alpha, 1 for alpha.
  4474. Returns a pointer to the new pixmap. Throws exception on failure
  4475. to allocate.
  4476. */
  4477. FZ_FUNCTION ::fz_pixmap *ll_fz_new_pixmap(::fz_colorspace *cs, int w, int h, ::fz_separations *seps, int alpha);
  4478. /** Low-level wrapper for `::fz_new_pixmap_from_alpha_channel()`. */
  4479. FZ_FUNCTION ::fz_pixmap *ll_fz_new_pixmap_from_alpha_channel(::fz_pixmap *src);
  4480. /** Low-level wrapper for `::fz_new_pixmap_from_color_and_mask()`. */
  4481. FZ_FUNCTION ::fz_pixmap *ll_fz_new_pixmap_from_color_and_mask(::fz_pixmap *color, ::fz_pixmap *mask);
  4482. /** Low-level wrapper for `::fz_new_pixmap_from_display_list()`. */
  4483. /**
  4484. Render the page to a pixmap using the transform and colorspace.
  4485. Ownership of the pixmap is returned to the caller.
  4486. */
  4487. FZ_FUNCTION ::fz_pixmap *ll_fz_new_pixmap_from_display_list(::fz_display_list *list, ::fz_matrix ctm, ::fz_colorspace *cs, int alpha);
  4488. /** Low-level wrapper for `::fz_new_pixmap_from_display_list_with_separations()`. */
  4489. /**
  4490. Render the page contents with control over spot colors.
  4491. Ownership of the pixmap is returned to the caller.
  4492. */
  4493. FZ_FUNCTION ::fz_pixmap *ll_fz_new_pixmap_from_display_list_with_separations(::fz_display_list *list, ::fz_matrix ctm, ::fz_colorspace *cs, ::fz_separations *seps, int alpha);
  4494. /** Low-level wrapper for `::fz_new_pixmap_from_page()`. */
  4495. FZ_FUNCTION ::fz_pixmap *ll_fz_new_pixmap_from_page(::fz_page *page, ::fz_matrix ctm, ::fz_colorspace *cs, int alpha);
  4496. /** Low-level wrapper for `::fz_new_pixmap_from_page_contents()`. */
  4497. /**
  4498. Render the page contents without annotations.
  4499. Ownership of the pixmap is returned to the caller.
  4500. */
  4501. FZ_FUNCTION ::fz_pixmap *ll_fz_new_pixmap_from_page_contents(::fz_page *page, ::fz_matrix ctm, ::fz_colorspace *cs, int alpha);
  4502. /** Low-level wrapper for `::fz_new_pixmap_from_page_contents_with_separations()`. */
  4503. FZ_FUNCTION ::fz_pixmap *ll_fz_new_pixmap_from_page_contents_with_separations(::fz_page *page, ::fz_matrix ctm, ::fz_colorspace *cs, ::fz_separations *seps, int alpha);
  4504. /** Low-level wrapper for `::fz_new_pixmap_from_page_number()`. */
  4505. FZ_FUNCTION ::fz_pixmap *ll_fz_new_pixmap_from_page_number(::fz_document *doc, int number, ::fz_matrix ctm, ::fz_colorspace *cs, int alpha);
  4506. /** Low-level wrapper for `::fz_new_pixmap_from_page_number_with_separations()`. */
  4507. FZ_FUNCTION ::fz_pixmap *ll_fz_new_pixmap_from_page_number_with_separations(::fz_document *doc, int number, ::fz_matrix ctm, ::fz_colorspace *cs, ::fz_separations *seps, int alpha);
  4508. /** Low-level wrapper for `::fz_new_pixmap_from_page_with_separations()`. */
  4509. FZ_FUNCTION ::fz_pixmap *ll_fz_new_pixmap_from_page_with_separations(::fz_page *page, ::fz_matrix ctm, ::fz_colorspace *cs, ::fz_separations *seps, int alpha);
  4510. /** Low-level wrapper for `::fz_new_pixmap_from_pixmap()`. */
  4511. /**
  4512. Create a new pixmap that represents a subarea of the specified
  4513. pixmap. A reference is taken to this pixmap that will be dropped
  4514. on destruction.
  4515. The supplied rectangle must be wholly contained within the
  4516. original pixmap.
  4517. Returns a pointer to the new pixmap. Throws exception on failure
  4518. to allocate.
  4519. */
  4520. FZ_FUNCTION ::fz_pixmap *ll_fz_new_pixmap_from_pixmap(::fz_pixmap *pixmap, const ::fz_irect *rect);
  4521. /** Low-level wrapper for `::fz_new_pixmap_with_bbox()`. */
  4522. /**
  4523. Create a pixmap of a given size, location and pixel format.
  4524. The bounding box specifies the size of the created pixmap and
  4525. where it will be located. The colorspace determines the number
  4526. of components per pixel. Alpha is always present. Pixmaps are
  4527. reference counted, so drop references using fz_drop_pixmap.
  4528. colorspace: Colorspace format used for the created pixmap. The
  4529. pixmap will keep a reference to the colorspace.
  4530. bbox: Bounding box specifying location/size of created pixmap.
  4531. seps: Details of separations.
  4532. alpha: 0 for no alpha, 1 for alpha.
  4533. Returns a pointer to the new pixmap. Throws exception on failure
  4534. to allocate.
  4535. */
  4536. FZ_FUNCTION ::fz_pixmap *ll_fz_new_pixmap_with_bbox(::fz_colorspace *colorspace, ::fz_irect bbox, ::fz_separations *seps, int alpha);
  4537. /** Low-level wrapper for `::fz_new_pixmap_with_bbox_and_data()`. */
  4538. /**
  4539. Create a pixmap of a given size, location and pixel format,
  4540. using the supplied data block.
  4541. The bounding box specifies the size of the created pixmap and
  4542. where it will be located. The colorspace determines the number
  4543. of components per pixel. Alpha is always present. Pixmaps are
  4544. reference counted, so drop references using fz_drop_pixmap.
  4545. colorspace: Colorspace format used for the created pixmap. The
  4546. pixmap will keep a reference to the colorspace.
  4547. rect: Bounding box specifying location/size of created pixmap.
  4548. seps: Details of separations.
  4549. alpha: Number of alpha planes (0 or 1).
  4550. samples: The data block to keep the samples in.
  4551. Returns a pointer to the new pixmap. Throws exception on failure
  4552. to allocate.
  4553. */
  4554. FZ_FUNCTION ::fz_pixmap *ll_fz_new_pixmap_with_bbox_and_data(::fz_colorspace *colorspace, ::fz_irect rect, ::fz_separations *seps, int alpha, unsigned char *samples);
  4555. /** Low-level wrapper for `::fz_new_pixmap_with_data()`. */
  4556. /**
  4557. Create a new pixmap, with its origin at
  4558. (0,0) using the supplied data block.
  4559. cs: The colorspace to use for the pixmap, or NULL for an alpha
  4560. plane/mask.
  4561. w: The width of the pixmap (in pixels)
  4562. h: The height of the pixmap (in pixels)
  4563. seps: Details of separations.
  4564. alpha: 0 for no alpha, 1 for alpha.
  4565. stride: The byte offset from the pixel data in a row to the
  4566. pixel data in the next row.
  4567. samples: The data block to keep the samples in.
  4568. Returns a pointer to the new pixmap. Throws exception on failure to
  4569. allocate.
  4570. */
  4571. FZ_FUNCTION ::fz_pixmap *ll_fz_new_pixmap_with_data(::fz_colorspace *colorspace, int w, int h, ::fz_separations *seps, int alpha, int stride, unsigned char *samples);
  4572. /** Low-level wrapper for `::fz_new_pixmap_writer()`. */
  4573. FZ_FUNCTION ::fz_document_writer *ll_fz_new_pixmap_writer(const char *path, const char *options, const char *default_path, int n, void (*save)(::fz_context *, ::fz_pixmap *, const char *));
  4574. /** Low-level wrapper for `::fz_new_pkm_band_writer()`. */
  4575. /**
  4576. Create a new pkm band writer for CMYK pixmaps.
  4577. */
  4578. FZ_FUNCTION ::fz_band_writer *ll_fz_new_pkm_band_writer(::fz_output *out);
  4579. /** Low-level wrapper for `::fz_new_pkm_pixmap_writer()`. */
  4580. FZ_FUNCTION ::fz_document_writer *ll_fz_new_pkm_pixmap_writer(const char *path, const char *options);
  4581. /** Low-level wrapper for `::fz_new_png_band_writer()`. */
  4582. /**
  4583. Create a new png band writer (greyscale or RGB, with or without
  4584. alpha).
  4585. */
  4586. FZ_FUNCTION ::fz_band_writer *ll_fz_new_png_band_writer(::fz_output *out);
  4587. /** Low-level wrapper for `::fz_new_png_pixmap_writer()`. */
  4588. FZ_FUNCTION ::fz_document_writer *ll_fz_new_png_pixmap_writer(const char *path, const char *options);
  4589. /** Low-level wrapper for `::fz_new_pnm_band_writer()`. */
  4590. /**
  4591. Create a band writer targeting pnm (greyscale or rgb, no
  4592. alpha).
  4593. */
  4594. FZ_FUNCTION ::fz_band_writer *ll_fz_new_pnm_band_writer(::fz_output *out);
  4595. /** Low-level wrapper for `::fz_new_pnm_pixmap_writer()`. */
  4596. FZ_FUNCTION ::fz_document_writer *ll_fz_new_pnm_pixmap_writer(const char *path, const char *options);
  4597. /** Low-level wrapper for `::fz_new_pool()`. */
  4598. /**
  4599. Create a new pool to allocate from.
  4600. */
  4601. FZ_FUNCTION ::fz_pool *ll_fz_new_pool();
  4602. /** Low-level wrapper for `::fz_new_pool_array_imp()`. */
  4603. FZ_FUNCTION ::fz_pool_array *ll_fz_new_pool_array_imp(::fz_pool *pool, size_t size, size_t initial);
  4604. /** Low-level wrapper for `::fz_new_ppm_pixmap_writer()`. */
  4605. FZ_FUNCTION ::fz_document_writer *ll_fz_new_ppm_pixmap_writer(const char *path, const char *options);
  4606. /** Low-level wrapper for `::fz_new_ps_band_writer()`. */
  4607. /**
  4608. Create a postscript band writer for gray, rgb, or cmyk, no
  4609. alpha.
  4610. */
  4611. FZ_FUNCTION ::fz_band_writer *ll_fz_new_ps_band_writer(::fz_output *out);
  4612. /** Low-level wrapper for `::fz_new_ps_writer()`. */
  4613. FZ_FUNCTION ::fz_document_writer *ll_fz_new_ps_writer(const char *path, const char *options);
  4614. /** Low-level wrapper for `::fz_new_ps_writer_with_output()`. */
  4615. FZ_FUNCTION ::fz_document_writer *ll_fz_new_ps_writer_with_output(::fz_output *out, const char *options);
  4616. /** Low-level wrapper for `::fz_new_psd_band_writer()`. */
  4617. /**
  4618. Open a PSD band writer.
  4619. */
  4620. FZ_FUNCTION ::fz_band_writer *ll_fz_new_psd_band_writer(::fz_output *out);
  4621. /** Low-level wrapper for `::fz_new_pwg_band_writer()`. */
  4622. /**
  4623. Create a new color pwg band writer.
  4624. */
  4625. FZ_FUNCTION ::fz_band_writer *ll_fz_new_pwg_band_writer(::fz_output *out, const ::fz_pwg_options *pwg);
  4626. /** Low-level wrapper for `::fz_new_pwg_writer()`. */
  4627. FZ_FUNCTION ::fz_document_writer *ll_fz_new_pwg_writer(const char *path, const char *options);
  4628. /** Low-level wrapper for `::fz_new_pwg_writer_with_output()`. */
  4629. FZ_FUNCTION ::fz_document_writer *ll_fz_new_pwg_writer_with_output(::fz_output *out, const char *options);
  4630. /** Low-level wrapper for `::fz_new_rle_output()`. */
  4631. FZ_FUNCTION ::fz_output *ll_fz_new_rle_output(::fz_output *chain);
  4632. /** Low-level wrapper for `::fz_new_separations()`. */
  4633. /**
  4634. Create a new separations structure (initially empty)
  4635. */
  4636. FZ_FUNCTION ::fz_separations *ll_fz_new_separations(int controllable);
  4637. /** Low-level wrapper for `::fz_new_stext_device()`. */
  4638. /**
  4639. Create a device to extract the text on a page.
  4640. Gather the text on a page into blocks and lines.
  4641. The reading order is taken from the order the text is drawn in
  4642. the source file, so may not be accurate.
  4643. page: The text page to which content should be added. This will
  4644. usually be a newly created (empty) text page, but it can be one
  4645. containing data already (for example when merging multiple
  4646. pages, or watermarking).
  4647. options: Options to configure the stext device.
  4648. */
  4649. FZ_FUNCTION ::fz_device *ll_fz_new_stext_device(::fz_stext_page *page, const ::fz_stext_options *options);
  4650. /** Low-level wrapper for `::fz_new_stext_device_for_page()`. */
  4651. /**
  4652. Create a device to extract the text on a page into an existing
  4653. fz_stext_page structure.
  4654. Gather the text on a page into blocks and lines.
  4655. The reading order is taken from the order the text is drawn in
  4656. the source file, so may not be accurate.
  4657. stext_page: The text page to which content should be added. This will
  4658. usually be a newly created (empty) text page, but it can be one
  4659. containing data already (for example when merging multiple
  4660. pages, or watermarking).
  4661. options: Options to configure the stext device.
  4662. The next 2 parameters are copied into the fz_stext_page structure's
  4663. ids section, so only have to be valid if you expect to interrogate
  4664. that section later.
  4665. chapter_num: The chapter number that this page came from.
  4666. page_num: The page number that this page came from.
  4667. The final parameter is copied into the fz_stext_page structure's
  4668. ids section. The mediabox for the enture fz_stext_page is unioned
  4669. with this, so pass fz_empty_bbox if you don't care about getting
  4670. a valid value back from the ids section, but you don't want to
  4671. upset the value in the page->mediabox field.
  4672. mediabox: The mediabox for this page.
  4673. */
  4674. FZ_FUNCTION ::fz_device *ll_fz_new_stext_device_for_page(::fz_stext_page *stext_page, const ::fz_stext_options *opts, int chapter_num, int page_num, ::fz_rect mediabox);
  4675. /** Low-level wrapper for `::fz_new_stext_page()`. */
  4676. /**
  4677. Create an empty text page.
  4678. The text page is filled out by the text device to contain the
  4679. blocks and lines of text on the page.
  4680. mediabox: optional mediabox information.
  4681. */
  4682. FZ_FUNCTION ::fz_stext_page *ll_fz_new_stext_page(::fz_rect mediabox);
  4683. /** Low-level wrapper for `::fz_new_stext_page_from_chapter_page_number()`. */
  4684. FZ_FUNCTION ::fz_stext_page *ll_fz_new_stext_page_from_chapter_page_number(::fz_document *doc, int chapter, int number, const ::fz_stext_options *options);
  4685. /** Low-level wrapper for `::fz_new_stext_page_from_display_list()`. */
  4686. FZ_FUNCTION ::fz_stext_page *ll_fz_new_stext_page_from_display_list(::fz_display_list *list, const ::fz_stext_options *options);
  4687. /** Low-level wrapper for `::fz_new_stext_page_from_page()`. */
  4688. /**
  4689. Extract text from page.
  4690. Ownership of the fz_stext_page is returned to the caller.
  4691. */
  4692. FZ_FUNCTION ::fz_stext_page *ll_fz_new_stext_page_from_page(::fz_page *page, const ::fz_stext_options *options);
  4693. /** Low-level wrapper for `::fz_new_stext_page_from_page_number()`. */
  4694. FZ_FUNCTION ::fz_stext_page *ll_fz_new_stext_page_from_page_number(::fz_document *doc, int number, const ::fz_stext_options *options);
  4695. /** Low-level wrapper for `::fz_new_stext_struct()`. */
  4696. FZ_FUNCTION ::fz_stext_block *ll_fz_new_stext_struct(::fz_stext_page *page, ::fz_structure standard, const char *raw, int index);
  4697. /** Low-level wrapper for `::fz_new_store_context()`. */
  4698. /**
  4699. Create a new store inside the context
  4700. max: The maximum size (in bytes) that the store is allowed to
  4701. grow to. FZ_STORE_UNLIMITED means no limit.
  4702. */
  4703. FZ_FUNCTION void ll_fz_new_store_context(size_t max);
  4704. /** Low-level wrapper for `::fz_new_story()`. */
  4705. FZ_FUNCTION ::fz_story *ll_fz_new_story(::fz_buffer *buf, const char *user_css, float em, ::fz_archive *dir);
  4706. /** Low-level wrapper for `::fz_new_stream()`. */
  4707. /**
  4708. Create a new stream object with the given
  4709. internal state and function pointers.
  4710. state: Internal state (opaque to everything but implementation).
  4711. next: Should provide the next set of bytes (up to max) of stream
  4712. data. Return the number of bytes read, or EOF when there is no
  4713. more data.
  4714. drop: Should clean up and free the internal state. May not
  4715. throw exceptions.
  4716. */
  4717. FZ_FUNCTION ::fz_stream *ll_fz_new_stream(void *state, ::fz_stream_next_fn *next, ::fz_stream_drop_fn *drop);
  4718. /** Low-level wrapper for `::fz_new_string()`. */
  4719. FZ_FUNCTION ::fz_string *ll_fz_new_string(const char *str);
  4720. /** Low-level wrapper for `::fz_new_stroke_state()`. */
  4721. /**
  4722. Create a new (empty) stroke state structure (with no dash
  4723. data) and return a reference to it.
  4724. Throws exception on failure to allocate.
  4725. */
  4726. FZ_FUNCTION ::fz_stroke_state *ll_fz_new_stroke_state();
  4727. /** Low-level wrapper for `::fz_new_stroke_state_with_dash_len()`. */
  4728. /**
  4729. Create a new (empty) stroke state structure, with room for
  4730. dash data of the given length, and return a reference to it.
  4731. len: The number of dash elements to allow room for.
  4732. Throws exception on failure to allocate.
  4733. */
  4734. FZ_FUNCTION ::fz_stroke_state *ll_fz_new_stroke_state_with_dash_len(int len);
  4735. /** Low-level wrapper for `::fz_new_svg_device()`. */
  4736. /**
  4737. Create a device that outputs (single page) SVG files to
  4738. the given output stream.
  4739. Equivalent to fz_new_svg_device_with_id passing id = NULL.
  4740. */
  4741. FZ_FUNCTION ::fz_device *ll_fz_new_svg_device(::fz_output *out, float page_width, float page_height, int text_format, int reuse_images);
  4742. /** Low-level wrapper for `::fz_new_svg_device_with_id()`.
  4743. This function has out-params. Python/C# wrappers look like:
  4744. `ll_fz_new_svg_device_with_id(::fz_output *out, float page_width, float page_height, int text_format, int reuse_images)` => `(fz_device *, int id)`
  4745. */
  4746. /**
  4747. Create a device that outputs (single page) SVG files to
  4748. the given output stream.
  4749. output: The output stream to send the constructed SVG page to.
  4750. page_width, page_height: The page dimensions to use (in points).
  4751. text_format: How to emit text. One of the following values:
  4752. FZ_SVG_TEXT_AS_TEXT: As <text> elements with possible
  4753. layout errors and mismatching fonts.
  4754. FZ_SVG_TEXT_AS_PATH: As <path> elements with exact
  4755. visual appearance.
  4756. reuse_images: Share image resources using <symbol> definitions.
  4757. id: ID parameter to keep generated IDs unique across SVG files.
  4758. */
  4759. FZ_FUNCTION ::fz_device *ll_fz_new_svg_device_with_id(::fz_output *out, float page_width, float page_height, int text_format, int reuse_images, int *id);
  4760. /** Low-level wrapper for `::fz_new_svg_writer()`. */
  4761. FZ_FUNCTION ::fz_document_writer *ll_fz_new_svg_writer(const char *path, const char *options);
  4762. /** Low-level wrapper for `::fz_new_svg_writer_with_output()`. */
  4763. FZ_FUNCTION ::fz_document_writer *ll_fz_new_svg_writer_with_output(::fz_output *out, const char *options);
  4764. /** Low-level wrapper for `::fz_new_test_device()`.
  4765. This function has out-params. Python/C# wrappers look like:
  4766. `ll_fz_new_test_device(float threshold, int options, ::fz_device *passthrough)` => `(fz_device *, int is_color)`
  4767. */
  4768. /**
  4769. Create a device to test for features.
  4770. Currently only tests for the presence of non-grayscale colors.
  4771. is_color: Possible values returned:
  4772. 0: Definitely greyscale
  4773. 1: Probably color (all colors were grey, but there
  4774. were images or shadings in a non grey colorspace).
  4775. 2: Definitely color
  4776. threshold: The difference from grayscale that will be tolerated.
  4777. Typical values to use are either 0 (be exact) and 0.02 (allow an
  4778. imperceptible amount of slop).
  4779. options: A set of bitfield options, from the FZ_TEST_OPT set.
  4780. passthrough: A device to pass all calls through to, or NULL.
  4781. If set, then the test device can both test and pass through to
  4782. an underlying device (like, say, the display list device). This
  4783. means that a display list can be created and at the end we'll
  4784. know if it's colored or not.
  4785. In the absence of a passthrough device, the device will throw
  4786. an exception to stop page interpretation when color is found.
  4787. */
  4788. FZ_FUNCTION ::fz_device *ll_fz_new_test_device(int *is_color, float threshold, int options, ::fz_device *passthrough);
  4789. /** Low-level wrapper for `::fz_new_text()`. */
  4790. /**
  4791. Create a new empty fz_text object.
  4792. Throws exception on failure to allocate.
  4793. */
  4794. FZ_FUNCTION ::fz_text *ll_fz_new_text();
  4795. /** Low-level wrapper for `::fz_new_text_writer()`. */
  4796. FZ_FUNCTION ::fz_document_writer *ll_fz_new_text_writer(const char *format, const char *path, const char *options);
  4797. /** Low-level wrapper for `::fz_new_text_writer_with_output()`. */
  4798. FZ_FUNCTION ::fz_document_writer *ll_fz_new_text_writer_with_output(const char *format, ::fz_output *out, const char *options);
  4799. /** Low-level wrapper for `::fz_new_trace_device()`. */
  4800. /**
  4801. Create a device to print a debug trace of all device calls.
  4802. */
  4803. FZ_FUNCTION ::fz_device *ll_fz_new_trace_device(::fz_output *out);
  4804. /** Low-level wrapper for `::fz_new_tree_archive()`. */
  4805. /**
  4806. Create an archive that holds named buffers.
  4807. tree can either be a preformed tree with fz_buffers as values,
  4808. or it can be NULL for an empty tree.
  4809. */
  4810. FZ_FUNCTION ::fz_archive *ll_fz_new_tree_archive(::fz_tree *tree);
  4811. /** Low-level wrapper for `::fz_new_type3_font()`. */
  4812. /**
  4813. Create a new (empty) type3 font.
  4814. name: Name of font (or NULL).
  4815. matrix: Font matrix.
  4816. Returns a new font handle, or throws exception on
  4817. allocation failure.
  4818. */
  4819. FZ_FUNCTION ::fz_font *ll_fz_new_type3_font(const char *name, ::fz_matrix matrix);
  4820. /** Low-level wrapper for `::fz_new_xhtml_document_from_document()`. */
  4821. /**
  4822. Use text extraction to convert the input document into XHTML,
  4823. then open the result as a new document that can be reflowed.
  4824. */
  4825. FZ_FUNCTION ::fz_document *ll_fz_new_xhtml_document_from_document(::fz_document *old_doc, const ::fz_stext_options *opts);
  4826. /** Low-level wrapper for `::fz_new_xmltext_device()`. */
  4827. /**
  4828. Create a device to output raw information.
  4829. */
  4830. FZ_FUNCTION ::fz_device *ll_fz_new_xmltext_device(::fz_output *out);
  4831. /** Low-level wrapper for `::fz_new_zip_writer()`. */
  4832. /**
  4833. Create a new zip writer that writes to a given file.
  4834. Open an archive using a seekable stream object rather than
  4835. opening a file or directory on disk.
  4836. */
  4837. FZ_FUNCTION ::fz_zip_writer *ll_fz_new_zip_writer(const char *filename);
  4838. /** Low-level wrapper for `::fz_new_zip_writer_with_output()`. */
  4839. /**
  4840. Create a new zip writer that writes to a given output stream.
  4841. Ownership of out passes in immediately upon calling this function.
  4842. The caller should never drop the fz_output, even if this function throws
  4843. an exception.
  4844. */
  4845. FZ_FUNCTION ::fz_zip_writer *ll_fz_new_zip_writer_with_output(::fz_output *out);
  4846. /** Low-level wrapper for `::fz_next_page()`. */
  4847. /**
  4848. Function to get the location of the next page (allowing for the
  4849. end of chapters etc). If at the end of the document, returns the
  4850. current location.
  4851. */
  4852. FZ_FUNCTION ::fz_location ll_fz_next_page(::fz_document *doc, ::fz_location loc);
  4853. /** Low-level wrapper for `::fz_normalize_vector()`. */
  4854. /**
  4855. Normalize a vector to length one.
  4856. */
  4857. FZ_FUNCTION ::fz_point ll_fz_normalize_vector(::fz_point p);
  4858. /** Low-level wrapper for `::fz_open_a85d()`. */
  4859. /**
  4860. a85d filter performs ASCII 85 Decoding of data read
  4861. from the chained filter.
  4862. */
  4863. FZ_FUNCTION ::fz_stream *ll_fz_open_a85d(::fz_stream *chain);
  4864. /** Low-level wrapper for `::fz_open_accelerated_document()`. */
  4865. /**
  4866. Open a document file and read its basic structure so pages and
  4867. objects can be located. MuPDF will try to repair broken
  4868. documents (without actually changing the file contents).
  4869. The returned fz_document is used when calling most other
  4870. document related functions.
  4871. filename: a path to a file as it would be given to open(2).
  4872. */
  4873. FZ_FUNCTION ::fz_document *ll_fz_open_accelerated_document(const char *filename, const char *accel);
  4874. /** Low-level wrapper for `::fz_open_accelerated_document_with_stream()`. */
  4875. /**
  4876. Open a document using the specified stream object rather than
  4877. opening a file on disk.
  4878. magic: a string used to detect document type; either a file name
  4879. or mime-type.
  4880. stream: a stream of the document contents.
  4881. accel: NULL, or a stream of the 'accelerator' contents for this document.
  4882. NOTE: The caller retains ownership of 'stream' and 'accel' - the document will
  4883. take its own references if required.
  4884. */
  4885. FZ_FUNCTION ::fz_document *ll_fz_open_accelerated_document_with_stream(const char *magic, ::fz_stream *stream, ::fz_stream *accel);
  4886. /** Low-level wrapper for `::fz_open_accelerated_document_with_stream_and_dir()`. */
  4887. /**
  4888. Open a document using the specified stream object rather than
  4889. opening a file on disk.
  4890. magic: a string used to detect document type; either a file name
  4891. or mime-type.
  4892. stream: a stream of the document contents.
  4893. accel: NULL, or a stream of the 'accelerator' contents for this document.
  4894. dir: NULL, or the 'directory context' for the stream contents.
  4895. NOTE: The caller retains ownership of 'stream', 'accel' and 'dir' - the document will
  4896. take its own references if required.
  4897. */
  4898. FZ_FUNCTION ::fz_document *ll_fz_open_accelerated_document_with_stream_and_dir(const char *magic, ::fz_stream *stream, ::fz_stream *accel, ::fz_archive *dir);
  4899. /** Low-level wrapper for `::fz_open_aesd()`. */
  4900. /**
  4901. aesd filter performs AES decoding of data read from the chained
  4902. filter using the supplied key.
  4903. */
  4904. FZ_FUNCTION ::fz_stream *ll_fz_open_aesd(::fz_stream *chain, unsigned char *key, unsigned int keylen);
  4905. /** Low-level wrapper for `::fz_open_ahxd()`. */
  4906. /**
  4907. ahxd filter performs ASCII Hex decoding of data read
  4908. from the chained filter.
  4909. */
  4910. FZ_FUNCTION ::fz_stream *ll_fz_open_ahxd(::fz_stream *chain);
  4911. /** Low-level wrapper for `::fz_open_arc4()`. */
  4912. /**
  4913. arc4 filter performs RC4 decoding of data read from the chained
  4914. filter using the supplied key.
  4915. */
  4916. FZ_FUNCTION ::fz_stream *ll_fz_open_arc4(::fz_stream *chain, unsigned char *key, unsigned int keylen);
  4917. /** Low-level wrapper for `::fz_open_archive()`. */
  4918. /**
  4919. Open a zip or tar archive
  4920. Open a file and identify its archive type based on the archive
  4921. signature contained inside.
  4922. filename: a path to a file as it would be given to open(2).
  4923. */
  4924. FZ_FUNCTION ::fz_archive *ll_fz_open_archive(const char *filename);
  4925. /** Low-level wrapper for `::fz_open_archive_entry()`. */
  4926. /**
  4927. Opens an archive entry as a stream.
  4928. name: Entry name to look for, this must be an exact match to
  4929. the entry name in the archive.
  4930. Throws an exception if a matching entry cannot be found.
  4931. */
  4932. FZ_FUNCTION ::fz_stream *ll_fz_open_archive_entry(::fz_archive *arch, const char *name);
  4933. /** Low-level wrapper for `::fz_open_archive_with_stream()`. */
  4934. /**
  4935. Open zip or tar archive stream.
  4936. Open an archive using a seekable stream object rather than
  4937. opening a file or directory on disk.
  4938. */
  4939. FZ_FUNCTION ::fz_archive *ll_fz_open_archive_with_stream(::fz_stream *file);
  4940. /** Low-level wrapper for `::fz_open_brotlid()`. */
  4941. /**
  4942. brotlid filter performs Brotli decoding of data read
  4943. from the chained filter.
  4944. */
  4945. FZ_FUNCTION ::fz_stream *ll_fz_open_brotlid(::fz_stream *chain);
  4946. /** Low-level wrapper for `::fz_open_buffer()`. */
  4947. /**
  4948. Open a buffer as a stream.
  4949. buf: The buffer to open. Ownership of the buffer is NOT passed
  4950. in (this function takes its own reference).
  4951. Returns pointer to newly created stream. May throw exceptions on
  4952. failure to allocate.
  4953. */
  4954. FZ_FUNCTION ::fz_stream *ll_fz_open_buffer(::fz_buffer *buf);
  4955. /** Low-level wrapper for `::fz_open_cfb_archive()`. */
  4956. /**
  4957. Open a cfb file as an archive.
  4958. An exception is thrown if the file is not recognised as a cfb.
  4959. filename: a path to an archive file as it would be given to
  4960. open(2).
  4961. */
  4962. FZ_FUNCTION ::fz_archive *ll_fz_open_cfb_archive(const char *filename);
  4963. /** Low-level wrapper for `::fz_open_cfb_archive_with_stream()`. */
  4964. /**
  4965. Open a cfb file as an archive.
  4966. Open an archive using a seekable stream object rather than
  4967. opening a file or directory on disk.
  4968. An exception is thrown if the file is not recognised as a chm.
  4969. */
  4970. FZ_FUNCTION ::fz_archive *ll_fz_open_cfb_archive_with_stream(::fz_stream *file);
  4971. /** Low-level wrapper for `::fz_open_compressed_buffer()`. */
  4972. /**
  4973. Open a stream to read the decompressed version of a buffer.
  4974. */
  4975. FZ_FUNCTION ::fz_stream *ll_fz_open_compressed_buffer(::fz_compressed_buffer *arg_1);
  4976. /** Low-level wrapper for `::fz_open_concat()`. */
  4977. /**
  4978. Concat filter concatenates several streams into one.
  4979. */
  4980. FZ_FUNCTION ::fz_stream *ll_fz_open_concat(int max, int pad);
  4981. /** Low-level wrapper for `::fz_open_dctd()`. */
  4982. /**
  4983. dctd filter performs DCT (JPEG) decoding of data read
  4984. from the chained filter.
  4985. color_transform implements the PDF color_transform option
  4986. use -1 for default behavior
  4987. use 0 to disable YUV-RGB / YCCK-CMYK transforms
  4988. use 1 to enable YUV-RGB / YCCK-CMYK transforms
  4989. invert_cmyk implements the necessary inversion for Photoshop CMYK images
  4990. use 0 if embedded in PDF
  4991. use 1 if not embedded in PDF
  4992. For subsampling on decode, set l2factor to the log2 of the
  4993. reduction required (therefore 0 = full size decode).
  4994. jpegtables is an optional stream from which the JPEG tables
  4995. can be read. Use NULL if not required.
  4996. */
  4997. FZ_FUNCTION ::fz_stream *ll_fz_open_dctd(::fz_stream *chain, int color_transform, int invert_cmyk, int l2factor, ::fz_stream *jpegtables);
  4998. /** Low-level wrapper for `::fz_open_directory()`. */
  4999. /**
  5000. Open a directory as if it was an archive.
  5001. A special case where a directory is opened as if it was an
  5002. archive.
  5003. Note that for directories it is not possible to retrieve the
  5004. number of entries or list the entries. It is however possible
  5005. to check if the archive has a particular entry.
  5006. path: a path to a directory as it would be given to opendir(3).
  5007. */
  5008. FZ_FUNCTION ::fz_archive *ll_fz_open_directory(const char *path);
  5009. /** Low-level wrapper for `::fz_open_document()`. */
  5010. /**
  5011. Open a document file and read its basic structure so pages and
  5012. objects can be located. MuPDF will try to repair broken
  5013. documents (without actually changing the file contents).
  5014. The returned fz_document is used when calling most other
  5015. document related functions.
  5016. filename: a path to a file as it would be given to open(2).
  5017. */
  5018. FZ_FUNCTION ::fz_document *ll_fz_open_document(const char *filename);
  5019. /** Low-level wrapper for `::fz_open_document_with_buffer()`. */
  5020. /**
  5021. Open a document using a buffer rather than opening a file on disk.
  5022. */
  5023. FZ_FUNCTION ::fz_document *ll_fz_open_document_with_buffer(const char *magic, ::fz_buffer *buffer);
  5024. /** Low-level wrapper for `::fz_open_document_with_stream()`. */
  5025. /**
  5026. Open a document using the specified stream object rather than
  5027. opening a file on disk.
  5028. magic: a string used to detect document type; either a file name
  5029. or mime-type.
  5030. stream: a stream representing the contents of the document file.
  5031. NOTE: The caller retains ownership of 'stream' - the document will take its
  5032. own reference if required.
  5033. */
  5034. FZ_FUNCTION ::fz_document *ll_fz_open_document_with_stream(const char *magic, ::fz_stream *stream);
  5035. /** Low-level wrapper for `::fz_open_document_with_stream_and_dir()`. */
  5036. /**
  5037. Open a document using the specified stream object rather than
  5038. opening a file on disk.
  5039. magic: a string used to detect document type; either a file name
  5040. or mime-type.
  5041. stream: a stream representing the contents of the document file.
  5042. dir: a 'directory context' for those filetypes that need it.
  5043. NOTE: The caller retains ownership of 'stream' and 'dir' - the document will
  5044. take its own references if required.
  5045. */
  5046. FZ_FUNCTION ::fz_document *ll_fz_open_document_with_stream_and_dir(const char *magic, ::fz_stream *stream, ::fz_archive *dir);
  5047. /** Low-level wrapper for `::fz_open_endstream_filter()`. */
  5048. /**
  5049. The endstream filter reads a PDF substream, and starts to look
  5050. for an 'endstream' token after the specified length.
  5051. */
  5052. FZ_FUNCTION ::fz_stream *ll_fz_open_endstream_filter(::fz_stream *chain, uint64_t len, int64_t offset);
  5053. /** Low-level wrapper for `::fz_open_faxd()`. */
  5054. /**
  5055. faxd filter performs FAX decoding of data read from
  5056. the chained filter.
  5057. k: see fax specification (fax default is 0).
  5058. end_of_line: whether we expect end of line markers (fax default
  5059. is 0).
  5060. encoded_byte_align: whether we align to bytes after each line
  5061. (fax default is 0).
  5062. columns: how many columns in the image (fax default is 1728).
  5063. rows: 0 for unspecified or the number of rows of data to expect.
  5064. end_of_block: whether we expect end of block markers (fax
  5065. default is 1).
  5066. black_is_1: determines the polarity of the image (fax default is
  5067. 0).
  5068. */
  5069. FZ_FUNCTION ::fz_stream *ll_fz_open_faxd(::fz_stream *chain, int k, int end_of_line, int encoded_byte_align, int columns, int rows, int end_of_block, int black_is_1);
  5070. /** Low-level wrapper for `::fz_open_file()`. */
  5071. /**
  5072. Open the named file and wrap it in a stream.
  5073. filename: Path to a file. On non-Windows machines the filename
  5074. should be exactly as it would be passed to fopen(2). On Windows
  5075. machines, the path should be UTF-8 encoded so that non-ASCII
  5076. characters can be represented. Other platforms do the encoding
  5077. as standard anyway (and in most cases, particularly for MacOS
  5078. and Linux, the encoding they use is UTF-8 anyway).
  5079. */
  5080. FZ_FUNCTION ::fz_stream *ll_fz_open_file(const char *filename);
  5081. /** Low-level wrapper for `::fz_open_file_autodelete()`. */
  5082. /**
  5083. Do the same as fz_open_file, but delete the file upon close.
  5084. */
  5085. FZ_FUNCTION ::fz_stream *ll_fz_open_file_autodelete(const char *filename);
  5086. /** Low-level wrapper for `::fz_open_file_ptr_no_close()`. */
  5087. /**
  5088. Create a stream from a FILE * that will not be closed
  5089. when the stream is dropped.
  5090. */
  5091. FZ_FUNCTION ::fz_stream *ll_fz_open_file_ptr_no_close(FILE *file);
  5092. /** Low-level wrapper for `::fz_open_flated()`. */
  5093. /**
  5094. flated filter performs LZ77 decoding (inflating) of data read
  5095. from the chained filter.
  5096. window_bits: How large a decompression window to use. Typically
  5097. 15. A negative number, -n, means to use n bits, but to expect
  5098. raw data with no header.
  5099. */
  5100. FZ_FUNCTION ::fz_stream *ll_fz_open_flated(::fz_stream *chain, int window_bits);
  5101. /** Low-level wrapper for `::fz_open_image_decomp_stream()`.
  5102. This function has out-params. Python/C# wrappers look like:
  5103. `ll_fz_open_image_decomp_stream(::fz_stream *arg_0, ::fz_compression_params *arg_1)` => `(fz_stream *, int l2factor)`
  5104. */
  5105. /**
  5106. Open a stream to read the decompressed version of another stream
  5107. with optional log2 subsampling.
  5108. */
  5109. FZ_FUNCTION ::fz_stream *ll_fz_open_image_decomp_stream(::fz_stream *arg_1, ::fz_compression_params *arg_2, int *l2factor);
  5110. /** Low-level wrapper for `::fz_open_image_decomp_stream_from_buffer()`.
  5111. This function has out-params. Python/C# wrappers look like:
  5112. `ll_fz_open_image_decomp_stream_from_buffer(::fz_compressed_buffer *arg_0)` => `(fz_stream *, int l2factor)`
  5113. */
  5114. /**
  5115. Open a stream to read the decompressed version of a buffer,
  5116. with optional log2 subsampling.
  5117. l2factor = NULL for no subsampling, or a pointer to an integer
  5118. containing the maximum log2 subsample factor acceptable (0 =
  5119. none, 1 = halve dimensions, 2 = quarter dimensions etc). If
  5120. non-NULL, then *l2factor will be updated on exit with the actual
  5121. log2 subsample factor achieved.
  5122. */
  5123. FZ_FUNCTION ::fz_stream *ll_fz_open_image_decomp_stream_from_buffer(::fz_compressed_buffer *arg_1, int *l2factor);
  5124. /** Low-level wrapper for `::fz_open_jbig2d()`. */
  5125. /**
  5126. Open a filter that performs jbig2 decompression on the chained
  5127. stream, using the optional globals record.
  5128. */
  5129. FZ_FUNCTION ::fz_stream *ll_fz_open_jbig2d(::fz_stream *chain, ::fz_jbig2_globals *globals, int embedded);
  5130. /** Low-level wrapper for `::fz_open_leecher()`. */
  5131. /**
  5132. Attach a filter to a stream that will store any
  5133. characters read from the stream into the supplied buffer.
  5134. chain: The underlying stream to leech from.
  5135. buf: The buffer into which the read data should be appended.
  5136. The buffer will be resized as required.
  5137. Returns pointer to newly created stream. May throw exceptions on
  5138. failure to allocate.
  5139. */
  5140. FZ_FUNCTION ::fz_stream *ll_fz_open_leecher(::fz_stream *chain, ::fz_buffer *buf);
  5141. /** Low-level wrapper for `::fz_open_libarchive_archive()`. */
  5142. /**
  5143. Open an archive using libarchive.
  5144. An exception is thrown if the file is not supported by libarchive.
  5145. filename: a path to an archive file as it would be given to
  5146. open(2).
  5147. */
  5148. FZ_FUNCTION ::fz_archive *ll_fz_open_libarchive_archive(const char *filename);
  5149. /** Low-level wrapper for `::fz_open_libarchive_archive_with_stream()`. */
  5150. /**
  5151. Open an archive using libarchive.
  5152. Open an archive using a seekable stream object rather than
  5153. opening a file or directory on disk.
  5154. An exception is thrown if the stream is not supported by libarchive.
  5155. */
  5156. FZ_FUNCTION ::fz_archive *ll_fz_open_libarchive_archive_with_stream(::fz_stream *file);
  5157. /** Low-level wrapper for `::fz_open_libarchived()`. */
  5158. /**
  5159. libarchived filter performs generic compressed decoding of data
  5160. in any format understood by libarchive from the chained filter.
  5161. This will throw an exception if libarchive is not built in, or
  5162. if the compression format is not recognised.
  5163. */
  5164. FZ_FUNCTION ::fz_stream *ll_fz_open_libarchived(::fz_stream *chain);
  5165. /** Low-level wrapper for `::fz_open_lzwd()`. */
  5166. /**
  5167. lzwd filter performs LZW decoding of data read from the chained
  5168. filter.
  5169. early_change: (Default 1) specifies whether to change codes 1
  5170. bit early.
  5171. min_bits: (Default 9) specifies the minimum number of bits to
  5172. use.
  5173. reverse_bits: (Default 0) allows for compatibility with gif and
  5174. old style tiffs (1).
  5175. old_tiff: (Default 0) allows for different handling of the clear
  5176. code, as found in old style tiffs.
  5177. */
  5178. FZ_FUNCTION ::fz_stream *ll_fz_open_lzwd(::fz_stream *chain, int early_change, int min_bits, int reverse_bits, int old_tiff);
  5179. /** Low-level wrapper for `::fz_open_memory()`. */
  5180. /**
  5181. Open a block of memory as a stream.
  5182. data: Pointer to start of data block. Ownership of the data
  5183. block is NOT passed in.
  5184. len: Number of bytes in data block.
  5185. Returns pointer to newly created stream. May throw exceptions on
  5186. failure to allocate.
  5187. */
  5188. FZ_FUNCTION ::fz_stream *ll_fz_open_memory(const unsigned char *data, size_t len);
  5189. /** Low-level wrapper for `::fz_open_null_filter()`. */
  5190. /**
  5191. The null filter reads a specified amount of data from the
  5192. substream.
  5193. */
  5194. FZ_FUNCTION ::fz_stream *ll_fz_open_null_filter(::fz_stream *chain, uint64_t len, int64_t offset);
  5195. /** Low-level wrapper for `::fz_open_predict()`. */
  5196. /**
  5197. predict filter performs pixel prediction on data read from
  5198. the chained filter.
  5199. predictor: 1 = copy, 2 = tiff, other = inline PNG predictor
  5200. columns: width of image in pixels
  5201. colors: number of components.
  5202. bpc: bits per component (typically 8)
  5203. */
  5204. FZ_FUNCTION ::fz_stream *ll_fz_open_predict(::fz_stream *chain, int predictor, int columns, int colors, int bpc);
  5205. /** Low-level wrapper for `::fz_open_range_filter()`. */
  5206. /**
  5207. The range filter copies data from specified ranges of the
  5208. chained stream.
  5209. */
  5210. FZ_FUNCTION ::fz_stream *ll_fz_open_range_filter(::fz_stream *chain, ::fz_range *ranges, int nranges);
  5211. /** Low-level wrapper for `::fz_open_reflowed_document()`. */
  5212. FZ_FUNCTION ::fz_document *ll_fz_open_reflowed_document(::fz_document *underdoc, const ::fz_stext_options *opts);
  5213. /** Low-level wrapper for `::fz_open_rld()`. */
  5214. /**
  5215. rld filter performs Run Length Decoding of data read
  5216. from the chained filter.
  5217. */
  5218. FZ_FUNCTION ::fz_stream *ll_fz_open_rld(::fz_stream *chain);
  5219. /** Low-level wrapper for `::fz_open_sgilog16()`. */
  5220. /**
  5221. SGI Log 16bit (greyscale) decode from the chained filter.
  5222. Decodes lines of w pixels to 8bpp greyscale.
  5223. */
  5224. FZ_FUNCTION ::fz_stream *ll_fz_open_sgilog16(::fz_stream *chain, int w);
  5225. /** Low-level wrapper for `::fz_open_sgilog24()`. */
  5226. /**
  5227. SGI Log 24bit (LUV) decode from the chained filter.
  5228. Decodes lines of w pixels to 8bpc rgb.
  5229. */
  5230. FZ_FUNCTION ::fz_stream *ll_fz_open_sgilog24(::fz_stream *chain, int w);
  5231. /** Low-level wrapper for `::fz_open_sgilog32()`. */
  5232. /**
  5233. SGI Log 32bit (LUV) decode from the chained filter.
  5234. Decodes lines of w pixels to 8bpc rgb.
  5235. */
  5236. FZ_FUNCTION ::fz_stream *ll_fz_open_sgilog32(::fz_stream *chain, int w);
  5237. /** Low-level wrapper for `::fz_open_tar_archive()`. */
  5238. /**
  5239. Open a tar archive file.
  5240. An exception is thrown if the file is not a tar archive as
  5241. indicated by the presence of a tar signature.
  5242. filename: a path to a tar archive file as it would be given to
  5243. open(2).
  5244. */
  5245. FZ_FUNCTION ::fz_archive *ll_fz_open_tar_archive(const char *filename);
  5246. /** Low-level wrapper for `::fz_open_tar_archive_with_stream()`. */
  5247. /**
  5248. Open a tar archive stream.
  5249. Open an archive using a seekable stream object rather than
  5250. opening a file or directory on disk.
  5251. An exception is thrown if the stream is not a tar archive as
  5252. indicated by the presence of a tar signature.
  5253. */
  5254. FZ_FUNCTION ::fz_archive *ll_fz_open_tar_archive_with_stream(::fz_stream *file);
  5255. /** Low-level wrapper for `::fz_open_thunder()`. */
  5256. /**
  5257. 4bit greyscale Thunderscan decoding from the chained filter.
  5258. Decodes lines of w pixels to 8bpp greyscale.
  5259. */
  5260. FZ_FUNCTION ::fz_stream *ll_fz_open_thunder(::fz_stream *chain, int w);
  5261. /** Low-level wrapper for `::fz_open_zip_archive()`. */
  5262. /**
  5263. Open a zip archive file.
  5264. An exception is thrown if the file is not a zip archive as
  5265. indicated by the presence of a zip signature.
  5266. filename: a path to a zip archive file as it would be given to
  5267. open(2).
  5268. */
  5269. FZ_FUNCTION ::fz_archive *ll_fz_open_zip_archive(const char *path);
  5270. /** Low-level wrapper for `::fz_open_zip_archive_with_stream()`. */
  5271. /**
  5272. Open a zip archive stream.
  5273. Open an archive using a seekable stream object rather than
  5274. opening a file or directory on disk.
  5275. An exception is thrown if the stream is not a zip archive as
  5276. indicated by the presence of a zip signature.
  5277. */
  5278. FZ_FUNCTION ::fz_archive *ll_fz_open_zip_archive_with_stream(::fz_stream *file);
  5279. /** Low-level wrapper for `::fz_opt_from_list()`. */
  5280. /**
  5281. Return the index of a (case-insensitive) option within an optlist.
  5282. For instance for optlist = "Foo|Bar|Baz", and opt = "bar",
  5283. this would return 1.
  5284. If the optlist ends with "|*" then that is a catch all case and
  5285. matches all options allowing the caller to process it itself.
  5286. fz_optarg will be set to point to the option, and the return
  5287. value will be the index of the '*' option within that list.
  5288. If an optlist entry ends with ':' (e.g. "Foo:") then that option
  5289. may have suboptions appended to it (for example "JPG:80") and
  5290. fz_optarg will be set to point at "80". Otherwise fz_optarg will
  5291. be set to NULL.
  5292. In the event of no-match found, prints an error and returns -1.
  5293. */
  5294. FZ_FUNCTION int ll_fz_opt_from_list(char *opt, const char *optlist);
  5295. /** Low-level wrapper for `::fz_option_eq()`. */
  5296. /**
  5297. Check to see if an option, a, from a string matches a reference
  5298. option, b.
  5299. (i.e. a could be 'foo' or 'foo,bar...' etc, but b can only be
  5300. 'foo'.)
  5301. */
  5302. FZ_FUNCTION int ll_fz_option_eq(const char *a, const char *b);
  5303. /** Low-level wrapper for `::fz_optpath()`. */
  5304. /**
  5305. Convert "-" to "/dev/stdout" for use with command lines.
  5306. Also converts "nul" and "con" on Windows.
  5307. */
  5308. FZ_FUNCTION char *ll_fz_optpath(char *opt);
  5309. /** Low-level wrapper for `::fz_outline_glyph()`. */
  5310. /**
  5311. Look a glyph up from a font, and return the outline of the
  5312. glyph using the given transform.
  5313. The caller owns the returned path, and so is responsible for
  5314. ensuring that it eventually gets dropped.
  5315. */
  5316. FZ_FUNCTION ::fz_path *ll_fz_outline_glyph(::fz_font *font, int gid, ::fz_matrix ctm);
  5317. /** Low-level wrapper for `::fz_outline_iterator_delete()`. */
  5318. /**
  5319. Delete the current item.
  5320. This implicitly moves us to the 'next' item, and the return code is as for fz_outline_iterator_next.
  5321. */
  5322. FZ_FUNCTION int ll_fz_outline_iterator_delete(::fz_outline_iterator *iter);
  5323. /** Low-level wrapper for `::fz_outline_iterator_down()`. */
  5324. FZ_FUNCTION int ll_fz_outline_iterator_down(::fz_outline_iterator *iter);
  5325. /** Low-level wrapper for `::fz_outline_iterator_from_outline()`. */
  5326. FZ_FUNCTION ::fz_outline_iterator *ll_fz_outline_iterator_from_outline(::fz_outline *outline);
  5327. /** Low-level wrapper for `::fz_outline_iterator_insert()`. */
  5328. /**
  5329. Call to insert a new item BEFORE the current point.
  5330. Ownership of pointers are retained by the caller. The item data will be copied.
  5331. After an insert, we do not change where we are pointing.
  5332. The return code is the same as for next, it indicates the current iterator position.
  5333. Note that for PDF documents at least, the is_open field is ignored. All childless
  5334. nodes are considered closed by PDF, hence (given every newly inserted node is
  5335. childless by definition) all new nodes are inserted with is_open == false.
  5336. */
  5337. FZ_FUNCTION int ll_fz_outline_iterator_insert(::fz_outline_iterator *iter, ::fz_outline_item *item);
  5338. /** Low-level wrapper for `::fz_outline_iterator_item()`. */
  5339. /**
  5340. Call to get the current outline item.
  5341. Can return NULL. The item is only valid until the next call.
  5342. */
  5343. FZ_FUNCTION ::fz_outline_item *ll_fz_outline_iterator_item(::fz_outline_iterator *iter);
  5344. /** Low-level wrapper for `::fz_outline_iterator_next()`. */
  5345. /**
  5346. Calls to move the iterator position.
  5347. A negative return value means we could not move as requested. Otherwise:
  5348. 0 = the final position has a valid item.
  5349. 1 = not a valid item, but we can insert an item here.
  5350. */
  5351. FZ_FUNCTION int ll_fz_outline_iterator_next(::fz_outline_iterator *iter);
  5352. /** Low-level wrapper for `::fz_outline_iterator_prev()`. */
  5353. FZ_FUNCTION int ll_fz_outline_iterator_prev(::fz_outline_iterator *iter);
  5354. /** Low-level wrapper for `::fz_outline_iterator_up()`. */
  5355. FZ_FUNCTION int ll_fz_outline_iterator_up(::fz_outline_iterator *iter);
  5356. /** Low-level wrapper for `::fz_outline_iterator_update()`. */
  5357. /**
  5358. Update the current item properties according to the given item.
  5359. */
  5360. FZ_FUNCTION void ll_fz_outline_iterator_update(::fz_outline_iterator *iter, ::fz_outline_item *item);
  5361. /** Low-level wrapper for `::fz_output_accelerator()`. */
  5362. /**
  5363. Output accelerator data for the document to a given output
  5364. stream.
  5365. */
  5366. FZ_FUNCTION void ll_fz_output_accelerator(::fz_document *doc, ::fz_output *accel);
  5367. /** Low-level wrapper for `::fz_output_supports_stream()`. */
  5368. /**
  5369. Query whether a given fz_output supports fz_stream_from_output.
  5370. */
  5371. FZ_FUNCTION int ll_fz_output_supports_stream(::fz_output *out);
  5372. /** Low-level wrapper for `::fz_output_xml()`. */
  5373. /**
  5374. Pretty-print an XML tree to given output.
  5375. */
  5376. FZ_FUNCTION void ll_fz_output_xml(::fz_output *out, ::fz_xml *item, int level);
  5377. /** Low-level wrapper for `::fz_overlaps_rect()`. */
  5378. /**
  5379. Test rectangle overlap.
  5380. Returns true if the area of the overlap is
  5381. non zero.
  5382. */
  5383. FZ_FUNCTION int ll_fz_overlaps_rect(::fz_rect a, ::fz_rect b);
  5384. /** Low-level wrapper for `::fz_pack_path()`. */
  5385. /**
  5386. Pack a path into the given block.
  5387. To minimise the size of paths, this function allows them to be
  5388. packed into a buffer with other information. Paths can be used
  5389. interchangeably regardless of how they are packed.
  5390. pack: Pointer to a block of data to pack the path into. Should
  5391. be aligned by the caller to the same alignment as required for
  5392. a fz_path pointer.
  5393. path: The path to pack.
  5394. Returns the number of bytes within the block used. Callers can
  5395. access the packed path data by casting the value of pack on
  5396. entry to be a fz_path *.
  5397. Throws exceptions on failure to allocate.
  5398. Implementation details: Paths can be 'unpacked', 'flat', or
  5399. 'open'. Standard paths, as created are 'unpacked'. Paths
  5400. will be packed as 'flat', unless they are too large
  5401. (where large indicates that they exceed some private
  5402. implementation defined limits, currently including having
  5403. more than 256 coordinates or commands).
  5404. Large paths are 'open' packed as a header into the given block,
  5405. plus pointers to other data blocks.
  5406. Users should not have to care about whether paths are 'open'
  5407. or 'flat' packed. Simply pack a path (if required), and then
  5408. forget about the details.
  5409. */
  5410. FZ_FUNCTION size_t ll_fz_pack_path(uint8_t *pack, const ::fz_path *path);
  5411. /** Low-level wrapper for `::fz_packed_path_size()`. */
  5412. /**
  5413. Return the number of bytes required to pack a path.
  5414. */
  5415. FZ_FUNCTION int ll_fz_packed_path_size(const ::fz_path *path);
  5416. /** Low-level wrapper for `::fz_page_label()`. */
  5417. /**
  5418. Get page label for a given page.
  5419. */
  5420. FZ_FUNCTION const char *ll_fz_page_label(::fz_page *page, char *buf, int size);
  5421. /** Low-level wrapper for `::fz_page_number_from_location()`. */
  5422. /**
  5423. Converts from chapter+page to page number. This may cause many
  5424. chapters to be laid out in order to calculate the number of
  5425. pages within those chapters.
  5426. */
  5427. FZ_FUNCTION int ll_fz_page_number_from_location(::fz_document *doc, ::fz_location loc);
  5428. /** Low-level wrapper for `::fz_page_presentation()`.
  5429. This function has out-params. Python/C# wrappers look like:
  5430. `ll_fz_page_presentation(::fz_page *page, ::fz_transition *transition)` => `(fz_transition *, float duration)`
  5431. */
  5432. /**
  5433. Get the presentation details for a given page.
  5434. transition: A pointer to a transition struct to fill out.
  5435. duration: A pointer to a place to set the page duration in
  5436. seconds. Will be set to 0 if no transition is specified for the
  5437. page.
  5438. Returns: a pointer to the transition structure, or NULL if there
  5439. is no transition specified for the page.
  5440. */
  5441. FZ_FUNCTION ::fz_transition *ll_fz_page_presentation(::fz_page *page, ::fz_transition *transition, float *duration);
  5442. /** Low-level wrapper for `::fz_page_separations()`. */
  5443. /**
  5444. Get the separations details for a page.
  5445. This will be NULL, unless the format specifically supports
  5446. separations (such as PDF files). May be NULL even
  5447. so, if there are no separations on a page.
  5448. Returns a reference that must be dropped.
  5449. */
  5450. FZ_FUNCTION ::fz_separations *ll_fz_page_separations(::fz_page *page);
  5451. /** Low-level wrapper for `::fz_page_uses_overprint()`. */
  5452. /**
  5453. Query if a given page requires overprint.
  5454. */
  5455. FZ_FUNCTION int ll_fz_page_uses_overprint(::fz_page *page);
  5456. /** Low-level wrapper for `::fz_paint_shade()`.
  5457. This function has out-params. Python/C# wrappers look like:
  5458. `ll_fz_paint_shade(::fz_shade *shade, ::fz_colorspace *override_cs, ::fz_matrix ctm, ::fz_pixmap *dest, ::fz_color_params color_params, ::fz_irect bbox, const ::fz_overprint *eop, ::fz_shade_color_cache **cache)` =>
  5459. */
  5460. /**
  5461. Render a shade to a given pixmap.
  5462. shade: The shade to paint.
  5463. override_cs: NULL, or colorspace to override the shades
  5464. inbuilt colorspace.
  5465. ctm: The transform to apply.
  5466. dest: The pixmap to render into.
  5467. color_params: The color rendering settings
  5468. bbox: Pointer to a bounding box to limit the rendering
  5469. of the shade.
  5470. eop: NULL, or pointer to overprint bitmap.
  5471. cache: *cache is used to cache color information. If *cache is NULL it
  5472. is set to point to a new fz_shade_color_cache. If cache is NULL it is
  5473. ignored.
  5474. */
  5475. FZ_FUNCTION void ll_fz_paint_shade(::fz_shade *shade, ::fz_colorspace *override_cs, ::fz_matrix ctm, ::fz_pixmap *dest, ::fz_color_params color_params, ::fz_irect bbox, const ::fz_overprint *eop, ::fz_shade_color_cache **cache);
  5476. /** Low-level wrapper for `::fz_paragraph_break()`. */
  5477. /**
  5478. Attempt to break paragraphs at plausible places.
  5479. */
  5480. FZ_FUNCTION void ll_fz_paragraph_break(::fz_stext_page *page);
  5481. /** Low-level wrapper for `::fz_parse_draw_options()`. */
  5482. /**
  5483. Parse draw device options from a comma separated key-value string.
  5484. */
  5485. FZ_FUNCTION ::fz_draw_options *ll_fz_parse_draw_options(::fz_draw_options *options, const char *string);
  5486. /** Low-level wrapper for `::fz_parse_json()`. */
  5487. FZ_FUNCTION ::fz_json *ll_fz_parse_json(::fz_pool *pool, const char *s);
  5488. /** Low-level wrapper for `::fz_parse_page_range()`.
  5489. This function has out-params. Python/C# wrappers look like:
  5490. `ll_fz_parse_page_range(const char *s, int n)` => `(const char *, int a, int b)`
  5491. */
  5492. FZ_FUNCTION const char *ll_fz_parse_page_range(const char *s, int *a, int *b, int n);
  5493. /** Low-level wrapper for `::fz_parse_pcl_options()`. */
  5494. /**
  5495. Parse PCL options.
  5496. Currently defined options and values are as follows:
  5497. preset=X Either "generic" or one of the presets as for fz_pcl_preset.
  5498. spacing=0 No vertical spacing capability
  5499. spacing=1 PCL 3 spacing (<ESC>*p+<n>Y)
  5500. spacing=2 PCL 4 spacing (<ESC>*b<n>Y)
  5501. spacing=3 PCL 5 spacing (<ESC>*b<n>Y and clear seed row)
  5502. mode2 Disable/Enable mode 2 graphics compression
  5503. mode3 Disable/Enable mode 3 graphics compression
  5504. eog_reset End of graphics (<ESC>*rB) resets all parameters
  5505. has_duplex Duplex supported (<ESC>&l<duplex>S)
  5506. has_papersize Papersize setting supported (<ESC>&l<sizecode>A)
  5507. has_copies Number of copies supported (<ESC>&l<copies>X)
  5508. is_ljet4pjl Disable/Enable HP 4PJL model-specific output
  5509. is_oce9050 Disable/Enable Oce 9050 model-specific output
  5510. */
  5511. FZ_FUNCTION ::fz_pcl_options *ll_fz_parse_pcl_options(::fz_pcl_options *opts, const char *args);
  5512. /** Low-level wrapper for `::fz_parse_pclm_options()`. */
  5513. /**
  5514. Parse PCLm options.
  5515. Currently defined options and values are as follows:
  5516. compression=none: No compression
  5517. compression=flate: Flate compression
  5518. strip-height=n: Strip height (default 16)
  5519. */
  5520. FZ_FUNCTION ::fz_pclm_options *ll_fz_parse_pclm_options(::fz_pclm_options *opts, const char *args);
  5521. /** Low-level wrapper for `::fz_parse_pdfocr_options()`. */
  5522. /**
  5523. Parse PDFOCR options.
  5524. Currently defined options and values are as follows:
  5525. compression=none: No compression
  5526. compression=flate: Flate compression
  5527. strip-height=n: Strip height (default 16)
  5528. ocr-language=<lang>: OCR Language (default eng)
  5529. ocr-datadir=<datadir>: OCR data path (default rely on TESSDATA_PREFIX)
  5530. */
  5531. FZ_FUNCTION ::fz_pdfocr_options *ll_fz_parse_pdfocr_options(::fz_pdfocr_options *opts, const char *args);
  5532. /** Low-level wrapper for `::fz_parse_stext_options()`. */
  5533. /**
  5534. Parse stext device options from a comma separated key-value
  5535. string.
  5536. */
  5537. FZ_FUNCTION ::fz_stext_options *ll_fz_parse_stext_options(::fz_stext_options *opts, const char *string);
  5538. /** Low-level wrapper for `::fz_parse_xml()`. */
  5539. /**
  5540. Parse the contents of buffer into a tree of xml nodes.
  5541. preserve_white: whether to keep or delete all-whitespace nodes.
  5542. */
  5543. FZ_FUNCTION ::fz_xml *ll_fz_parse_xml(::fz_buffer *buf, int preserve_white);
  5544. /** Low-level wrapper for `::fz_parse_xml_archive_entry()`. */
  5545. /**
  5546. Parse the contents of an archive entry into a tree of xml nodes.
  5547. preserve_white: whether to keep or delete all-whitespace nodes.
  5548. */
  5549. FZ_FUNCTION ::fz_xml *ll_fz_parse_xml_archive_entry(::fz_archive *dir, const char *filename, int preserve_white);
  5550. /** Low-level wrapper for `::fz_parse_xml_from_html5()`. */
  5551. /**
  5552. Parse the contents of a buffer into a tree of XML nodes,
  5553. using the HTML5 parsing algorithm.
  5554. */
  5555. FZ_FUNCTION ::fz_xml *ll_fz_parse_xml_from_html5(::fz_buffer *buf);
  5556. /** Low-level wrapper for `::fz_parse_xml_stream()`. */
  5557. /**
  5558. Parse the contents of buffer into a tree of xml nodes.
  5559. preserve_white: whether to keep or delete all-whitespace nodes.
  5560. */
  5561. FZ_FUNCTION ::fz_xml *ll_fz_parse_xml_stream(::fz_stream *stream, int preserve_white);
  5562. /** Low-level wrapper for `::fz_path_is_rect()`. */
  5563. /**
  5564. Check whether a given path, under the given transform
  5565. is an axis-aligned rectangle.
  5566. We accept zero width or height rectangles, so
  5567. "move 100, 100; line 200, 100" would count as
  5568. a rectangle too.
  5569. */
  5570. FZ_FUNCTION int ll_fz_path_is_rect(const ::fz_path *path, ::fz_matrix ctm);
  5571. /** Low-level wrapper for `::fz_path_is_rect_with_bounds()`. */
  5572. /**
  5573. Check whether a given path, under the given transform
  5574. is an axis-aligned rectangle.
  5575. We accept zero width or height rectangles, so
  5576. "move 100, 100; line 200, 100" would count as
  5577. a rectangle too.
  5578. bounds = NULL, or place to return the rectangle
  5579. bounds if the path is a rectangle.
  5580. */
  5581. FZ_FUNCTION int ll_fz_path_is_rect_with_bounds(const ::fz_path *path, ::fz_matrix ctm, ::fz_rect *bounds);
  5582. /** Low-level wrapper for `::fz_pcl_preset()`. */
  5583. /**
  5584. Initialize PCL option struct for a given preset.
  5585. Currently defined presets include:
  5586. generic Generic PCL printer
  5587. ljet4 HP DeskJet
  5588. dj500 HP DeskJet 500
  5589. fs600 Kyocera FS-600
  5590. lj HP LaserJet, HP LaserJet Plus
  5591. lj2 HP LaserJet IIp, HP LaserJet IId
  5592. lj3 HP LaserJet III
  5593. lj3d HP LaserJet IIId
  5594. lj4 HP LaserJet 4
  5595. lj4pl HP LaserJet 4 PL
  5596. lj4d HP LaserJet 4d
  5597. lp2563b HP 2563B line printer
  5598. oce9050 Oce 9050 Line printer
  5599. */
  5600. FZ_FUNCTION void ll_fz_pcl_preset(::fz_pcl_options *opts, const char *preset);
  5601. /** Low-level wrapper for `::fz_pdfocr_band_writer_set_progress()`. */
  5602. /**
  5603. Set the progress callback for a pdfocr bandwriter.
  5604. */
  5605. FZ_FUNCTION void ll_fz_pdfocr_band_writer_set_progress(::fz_band_writer *writer, ::fz_pdfocr_progress_fn *progress_fn, void *progress_arg);
  5606. /** Low-level wrapper for `::fz_pdfocr_writer_set_progress()`. */
  5607. FZ_FUNCTION void ll_fz_pdfocr_writer_set_progress(::fz_document_writer *writer, ::fz_pdfocr_progress_fn *progress, void *arg_3);
  5608. /** Low-level wrapper for `::fz_peek_byte()`. */
  5609. /**
  5610. Peek at the next byte in a stream.
  5611. stm: The stream to peek at.
  5612. Returns -1 for EOF, or the next byte that will be read.
  5613. */
  5614. FZ_FUNCTION int ll_fz_peek_byte(::fz_stream *stm);
  5615. /** Low-level wrapper for `::fz_pixmap_alpha()`. */
  5616. /**
  5617. Return the number of alpha planes in a pixmap.
  5618. Returns the number of alphas. Does not throw exceptions.
  5619. */
  5620. FZ_FUNCTION int ll_fz_pixmap_alpha(const ::fz_pixmap *pix);
  5621. /** Low-level wrapper for `::fz_pixmap_bbox()`. */
  5622. /**
  5623. Return the bounding box for a pixmap.
  5624. */
  5625. FZ_FUNCTION ::fz_irect ll_fz_pixmap_bbox(const ::fz_pixmap *pix);
  5626. /** Low-level wrapper for `::fz_pixmap_colorants()`. */
  5627. /**
  5628. Return the number of colorants in a pixmap.
  5629. Returns the number of colorants (components, less any spots and
  5630. alpha).
  5631. */
  5632. FZ_FUNCTION int ll_fz_pixmap_colorants(const ::fz_pixmap *pix);
  5633. /** Low-level wrapper for `::fz_pixmap_colorspace()`. */
  5634. /**
  5635. Return the colorspace of a pixmap
  5636. Returns colorspace.
  5637. */
  5638. FZ_FUNCTION ::fz_colorspace *ll_fz_pixmap_colorspace(const ::fz_pixmap *pix);
  5639. /** Low-level wrapper for `::fz_pixmap_components()`. */
  5640. /**
  5641. Return the number of components in a pixmap.
  5642. Returns the number of components (including spots and alpha).
  5643. */
  5644. FZ_FUNCTION int ll_fz_pixmap_components(const ::fz_pixmap *pix);
  5645. /** Low-level wrapper for `::fz_pixmap_height()`. */
  5646. /**
  5647. Return the height of the pixmap in pixels.
  5648. */
  5649. FZ_FUNCTION int ll_fz_pixmap_height(const ::fz_pixmap *pix);
  5650. /** Low-level wrapper for `::fz_pixmap_image_tile()`. */
  5651. /**
  5652. Retrieve the underlying fz_pixmap for an image.
  5653. Returns a pointer to the underlying fz_pixmap for an image,
  5654. or NULL if this image is not based upon an fz_pixmap.
  5655. No reference is returned. Lifespan is limited to that of
  5656. the image itself. If required, use fz_keep_pixmap to take
  5657. a reference to keep it longer.
  5658. */
  5659. FZ_FUNCTION ::fz_pixmap *ll_fz_pixmap_image_tile(::fz_pixmap_image *cimg);
  5660. /** Low-level wrapper for `::fz_pixmap_samples()`. */
  5661. /**
  5662. Returns a pointer to the pixel data of a pixmap.
  5663. Returns the pointer.
  5664. */
  5665. FZ_FUNCTION unsigned char *ll_fz_pixmap_samples(const ::fz_pixmap *pix);
  5666. /** Low-level wrapper for `::fz_pixmap_samples_int()`. */
  5667. /** */
  5668. FZ_FUNCTION long long ll_fz_pixmap_samples_int(::fz_pixmap *pixmap);
  5669. /** Low-level wrapper for `::fz_pixmap_size()`. */
  5670. /**
  5671. Return sizeof fz_pixmap plus size of data, in bytes.
  5672. */
  5673. FZ_FUNCTION size_t ll_fz_pixmap_size(::fz_pixmap *pix);
  5674. /** Low-level wrapper for `::fz_pixmap_spots()`. */
  5675. /**
  5676. Return the number of spots in a pixmap.
  5677. Returns the number of spots (components, less colorants and
  5678. alpha). Does not throw exceptions.
  5679. */
  5680. FZ_FUNCTION int ll_fz_pixmap_spots(const ::fz_pixmap *pix);
  5681. /** Low-level wrapper for `::fz_pixmap_stride()`. */
  5682. /**
  5683. Return the number of bytes in a row in the pixmap.
  5684. */
  5685. FZ_FUNCTION int ll_fz_pixmap_stride(const ::fz_pixmap *pix);
  5686. /** Low-level wrapper for `::fz_pixmap_width()`. */
  5687. /**
  5688. Return the width of the pixmap in pixels.
  5689. */
  5690. FZ_FUNCTION int ll_fz_pixmap_width(const ::fz_pixmap *pix);
  5691. /** Low-level wrapper for `::fz_pixmap_x()`. */
  5692. /**
  5693. Return the x value of the pixmap in pixels.
  5694. */
  5695. FZ_FUNCTION int ll_fz_pixmap_x(const ::fz_pixmap *pix);
  5696. /** Low-level wrapper for `::fz_pixmap_y()`. */
  5697. /**
  5698. Return the y value of the pixmap in pixels.
  5699. */
  5700. FZ_FUNCTION int ll_fz_pixmap_y(const ::fz_pixmap *pix);
  5701. /** Low-level wrapper for `::fz_place_story()`. */
  5702. FZ_FUNCTION int ll_fz_place_story(::fz_story *story, ::fz_rect where, ::fz_rect *filled);
  5703. /** Low-level wrapper for `::fz_place_story_flags()`. */
  5704. FZ_FUNCTION int ll_fz_place_story_flags(::fz_story *story, ::fz_rect where, ::fz_rect *filled, int flags);
  5705. /** Low-level wrapper for `::fz_pool_alloc()`. */
  5706. /**
  5707. Allocate a block of size bytes from the pool.
  5708. */
  5709. FZ_FUNCTION void *ll_fz_pool_alloc(::fz_pool *pool, size_t size);
  5710. /** Low-level wrapper for `::fz_pool_array_append()`.
  5711. This function has out-params. Python/C# wrappers look like:
  5712. `ll_fz_pool_array_append(::fz_pool_array *arr)` => `(void *, size_t idx)`
  5713. */
  5714. /**
  5715. Append an element to the end of the array.
  5716. Returns a pointer to the new element (initially all 0's), and
  5717. (optionally) the index of that element.
  5718. */
  5719. FZ_FUNCTION void *ll_fz_pool_array_append(::fz_pool_array *arr, size_t *idx);
  5720. /** Low-level wrapper for `::fz_pool_array_len()`. */
  5721. /**
  5722. Get the length of the array.
  5723. */
  5724. FZ_FUNCTION size_t ll_fz_pool_array_len(::fz_pool_array *arr);
  5725. /** Low-level wrapper for `::fz_pool_array_lookup()`. */
  5726. /**
  5727. Lookup an element in the array.
  5728. */
  5729. FZ_FUNCTION void *ll_fz_pool_array_lookup(::fz_pool_array *arr, size_t idx);
  5730. /** Low-level wrapper for `::fz_pool_size()`. */
  5731. /**
  5732. The current size of the pool.
  5733. The number of bytes of storage currently allocated to the pool.
  5734. This is the total of the storage used for the blocks making
  5735. up the pool, rather then total of the allocated blocks so far,
  5736. so it will increase in 'lumps'.
  5737. from the pool, then the pool size may still be X
  5738. */
  5739. FZ_FUNCTION size_t ll_fz_pool_size(::fz_pool *pool);
  5740. /** Low-level wrapper for `::fz_pool_strdup()`. */
  5741. /**
  5742. strdup equivalent allocating from the pool.
  5743. */
  5744. FZ_FUNCTION char *ll_fz_pool_strdup(::fz_pool *pool, const char *s);
  5745. /** Low-level wrapper for `::fz_pop_clip()`. */
  5746. FZ_FUNCTION void ll_fz_pop_clip(::fz_device *dev);
  5747. /** Low-level wrapper for `::fz_post_scale()`. */
  5748. /**
  5749. Scale a matrix by postmultiplication.
  5750. m: Pointer to the matrix to scale
  5751. sx, sy: Scaling factors along the X- and Y-axes. A scaling
  5752. factor of 1.0 will not cause any scaling along the relevant
  5753. axis.
  5754. Returns m (updated).
  5755. */
  5756. FZ_FUNCTION ::fz_matrix ll_fz_post_scale(::fz_matrix m, float sx, float sy);
  5757. /** Low-level wrapper for `::fz_pre_rotate()`. */
  5758. /**
  5759. Rotate a transformation by premultiplying.
  5760. The premultiplied matrix is of the form
  5761. [ cos(deg) sin(deg) -sin(deg) cos(deg) 0 0 ].
  5762. m: Pointer to matrix to premultiply.
  5763. degrees: Degrees of counter clockwise rotation. Values less
  5764. than zero and greater than 360 are handled as expected.
  5765. Returns m (updated).
  5766. */
  5767. FZ_FUNCTION ::fz_matrix ll_fz_pre_rotate(::fz_matrix m, float degrees);
  5768. /** Low-level wrapper for `::fz_pre_scale()`. */
  5769. /**
  5770. Scale a matrix by premultiplication.
  5771. m: Pointer to the matrix to scale
  5772. sx, sy: Scaling factors along the X- and Y-axes. A scaling
  5773. factor of 1.0 will not cause any scaling along the relevant
  5774. axis.
  5775. Returns m (updated).
  5776. */
  5777. FZ_FUNCTION ::fz_matrix ll_fz_pre_scale(::fz_matrix m, float sx, float sy);
  5778. /** Low-level wrapper for `::fz_pre_shear()`. */
  5779. /**
  5780. Premultiply a matrix with a shearing matrix.
  5781. The shearing matrix is of the form [ 1 sy sx 1 0 0 ].
  5782. m: pointer to matrix to premultiply
  5783. sx, sy: Shearing factors. A shearing factor of 0.0 will not
  5784. cause any shearing along the relevant axis.
  5785. Returns m (updated).
  5786. */
  5787. FZ_FUNCTION ::fz_matrix ll_fz_pre_shear(::fz_matrix m, float sx, float sy);
  5788. /** Low-level wrapper for `::fz_pre_translate()`. */
  5789. /**
  5790. Translate a matrix by premultiplication.
  5791. m: The matrix to translate
  5792. tx, ty: Translation distances along the X- and Y-axes. A
  5793. translation of 0 will not cause any translation along the
  5794. relevant axis.
  5795. Returns m.
  5796. */
  5797. FZ_FUNCTION ::fz_matrix ll_fz_pre_translate(::fz_matrix m, float tx, float ty);
  5798. /** Low-level wrapper for `::fz_prepare_t3_glyph()`. */
  5799. /**
  5800. Force a type3 font to cache the displaylist for a given glyph
  5801. id.
  5802. This caching can involve reading the underlying file, so must
  5803. happen ahead of time, so we aren't suddenly forced to read the
  5804. file while playing a displaylist back.
  5805. */
  5806. FZ_FUNCTION void ll_fz_prepare_t3_glyph(::fz_font *font, int gid);
  5807. /** Low-level wrapper for `::fz_previous_page()`. */
  5808. /**
  5809. Function to get the location of the previous page (allowing for
  5810. the end of chapters etc). If already at the start of the
  5811. document, returns the current page.
  5812. */
  5813. FZ_FUNCTION ::fz_location ll_fz_previous_page(::fz_document *doc, ::fz_location loc);
  5814. /** Low-level wrapper for `::fz_print_stext_header_as_html()`. */
  5815. FZ_FUNCTION void ll_fz_print_stext_header_as_html(::fz_output *out);
  5816. /** Low-level wrapper for `::fz_print_stext_header_as_xhtml()`. */
  5817. FZ_FUNCTION void ll_fz_print_stext_header_as_xhtml(::fz_output *out);
  5818. /** Low-level wrapper for `::fz_print_stext_page_as_html()`. */
  5819. /**
  5820. Output structured text to a file in HTML (visual) format.
  5821. */
  5822. FZ_FUNCTION void ll_fz_print_stext_page_as_html(::fz_output *out, ::fz_stext_page *page, int id);
  5823. /** Low-level wrapper for `::fz_print_stext_page_as_json()`. */
  5824. /**
  5825. Output structured text to a file in JSON format.
  5826. */
  5827. FZ_FUNCTION void ll_fz_print_stext_page_as_json(::fz_output *out, ::fz_stext_page *page, float scale);
  5828. /** Low-level wrapper for `::fz_print_stext_page_as_text()`. */
  5829. /**
  5830. Output structured text to a file in plain-text UTF-8 format.
  5831. */
  5832. FZ_FUNCTION void ll_fz_print_stext_page_as_text(::fz_output *out, ::fz_stext_page *page);
  5833. /** Low-level wrapper for `::fz_print_stext_page_as_xhtml()`. */
  5834. /**
  5835. Output structured text to a file in XHTML (semantic) format.
  5836. */
  5837. FZ_FUNCTION void ll_fz_print_stext_page_as_xhtml(::fz_output *out, ::fz_stext_page *page, int id);
  5838. /** Low-level wrapper for `::fz_print_stext_page_as_xml()`. */
  5839. /**
  5840. Output structured text to a file in XML format.
  5841. */
  5842. FZ_FUNCTION void ll_fz_print_stext_page_as_xml(::fz_output *out, ::fz_stext_page *page, int id);
  5843. /** Low-level wrapper for `::fz_print_stext_trailer_as_html()`. */
  5844. FZ_FUNCTION void ll_fz_print_stext_trailer_as_html(::fz_output *out);
  5845. /** Low-level wrapper for `::fz_print_stext_trailer_as_xhtml()`. */
  5846. FZ_FUNCTION void ll_fz_print_stext_trailer_as_xhtml(::fz_output *out);
  5847. /** Low-level wrapper for `::fz_process_opened_pages()`. */
  5848. /**
  5849. Iterates over all opened pages of the document, calling the
  5850. provided callback for each page for processing. If the callback
  5851. returns non-NULL then the iteration stops and that value is returned
  5852. to the called of fz_process_opened_pages().
  5853. The state pointer provided to fz_process_opened_pages() is
  5854. passed on to the callback but is owned by the caller.
  5855. Returns the first non-NULL value returned by the callback,
  5856. or NULL if the callback returned NULL for all opened pages.
  5857. */
  5858. FZ_FUNCTION void *ll_fz_process_opened_pages(::fz_document *doc, ::fz_process_opened_page_fn *process_openend_page, void *state);
  5859. /** Low-level wrapper for `::fz_process_shade()`. */
  5860. /**
  5861. Process a shade, using supplied callback functions. This
  5862. decomposes the shading to a mesh (even ones that are not
  5863. natively meshes, such as linear or radial shadings), and
  5864. processes triangles from those meshes.
  5865. shade: The shade to process.
  5866. ctm: The transform to use
  5867. prepare: Callback function to 'prepare' each vertex.
  5868. This function is passed an array of floats, and populates
  5869. a fz_vertex structure.
  5870. process: This function is passed 3 pointers to vertex
  5871. structures, and actually performs the processing (typically
  5872. filling the area between the vertices).
  5873. process_arg: An opaque argument passed through from caller
  5874. to callback functions.
  5875. */
  5876. FZ_FUNCTION void ll_fz_process_shade(::fz_shade *shade, ::fz_matrix ctm, ::fz_rect scissor, ::fz_shade_prepare_fn *prepare, ::fz_shade_process_fn *process, void *process_arg);
  5877. /** Low-level wrapper for `::fz_ptr_heap_insert()`. */
  5878. FZ_FUNCTION void ll_fz_ptr_heap_insert(::fz_ptr_heap *heap, void *v, int (*HEAP_CMP)(void **, void **));
  5879. /** Low-level wrapper for `::fz_ptr_heap_sort()`. */
  5880. FZ_FUNCTION void ll_fz_ptr_heap_sort(::fz_ptr_heap *heap, int (*HEAP_CMP)(void **, void **));
  5881. /** Low-level wrapper for `::fz_ptr_heap_uniq()`. */
  5882. FZ_FUNCTION void ll_fz_ptr_heap_uniq(::fz_ptr_heap *heap, int (*HEAP_CMP)(void **, void **));
  5883. /** Low-level wrapper for `::fz_purge_glyph_cache()`. */
  5884. /**
  5885. Purge all the glyphs from the cache.
  5886. */
  5887. FZ_FUNCTION void ll_fz_purge_glyph_cache();
  5888. /** Low-level wrapper for `::fz_quad_from_rect()`. */
  5889. /**
  5890. Convert a rect to a quad (losslessly).
  5891. */
  5892. FZ_FUNCTION ::fz_quad ll_fz_quad_from_rect(::fz_rect r);
  5893. /** Low-level wrapper for `::fz_quadto()`. */
  5894. /**
  5895. Append a 'quadto' command to an open path. (For a
  5896. quadratic bezier).
  5897. path: The path to modify.
  5898. x0, y0: The control coordinates for the quadratic curve.
  5899. x1, y1: The end coordinates for the quadratic curve.
  5900. Throws exceptions on failure to allocate, or attempting to
  5901. modify a packed path.
  5902. */
  5903. FZ_FUNCTION void ll_fz_quadto(::fz_path *path, float x0, float y0, float x1, float y1);
  5904. /** Low-level wrapper for `::fz_range_limit_xml_char()`. */
  5905. FZ_FUNCTION int ll_fz_range_limit_xml_char(int c);
  5906. /** Low-level wrapper for `::fz_read()`. */
  5907. /**
  5908. Read from a stream into a given data block.
  5909. stm: The stream to read from.
  5910. data: The data block to read into.
  5911. len: The length of the data block (in bytes).
  5912. Returns the number of bytes read. May throw exceptions.
  5913. */
  5914. FZ_FUNCTION size_t ll_fz_read(::fz_stream *stm, unsigned char *data, size_t len);
  5915. /** Low-level wrapper for `::fz_read_all()`. */
  5916. /**
  5917. Read all of a stream into a buffer.
  5918. stm: The stream to read from
  5919. initial: Suggested initial size for the buffer.
  5920. Returns a buffer created from reading from the stream. May throw
  5921. exceptions on failure to allocate.
  5922. */
  5923. FZ_FUNCTION ::fz_buffer *ll_fz_read_all(::fz_stream *stm, size_t initial);
  5924. /** Low-level wrapper for `::fz_read_archive_entry()`. */
  5925. /**
  5926. Reads all bytes in an archive entry
  5927. into a buffer.
  5928. name: Entry name to look for, this must be an exact match to
  5929. the entry name in the archive.
  5930. Throws an exception if a matching entry cannot be found.
  5931. */
  5932. FZ_FUNCTION ::fz_buffer *ll_fz_read_archive_entry(::fz_archive *arch, const char *name);
  5933. /** Low-level wrapper for `::fz_read_best()`.
  5934. This function has out-params. Python/C# wrappers look like:
  5935. `ll_fz_read_best(::fz_stream *stm, size_t initial, size_t worst_case)` => `(fz_buffer *, int truncated)`
  5936. */
  5937. /**
  5938. Attempt to read a stream into a buffer. If truncated
  5939. is NULL behaves as fz_read_all, sets a truncated flag in case of
  5940. error.
  5941. stm: The stream to read from.
  5942. initial: Suggested initial size for the buffer.
  5943. truncated: Flag to store success/failure indication in.
  5944. worst_case: 0 for unknown, otherwise an upper bound for the
  5945. size of the stream.
  5946. Returns a buffer created from reading from the stream.
  5947. */
  5948. FZ_FUNCTION ::fz_buffer *ll_fz_read_best(::fz_stream *stm, size_t initial, int *truncated, size_t worst_case);
  5949. /** Low-level wrapper for `::fz_read_bits()`. */
  5950. /**
  5951. Read the next n bits from a stream (assumed to
  5952. be packed most significant bit first).
  5953. stm: The stream to read from.
  5954. n: The number of bits to read, between 1 and 8*sizeof(int)
  5955. inclusive.
  5956. Returns -1 for EOF, or the required number of bits.
  5957. */
  5958. FZ_FUNCTION unsigned int ll_fz_read_bits(::fz_stream *stm, int n);
  5959. /** Low-level wrapper for `::fz_read_byte()`. */
  5960. /**
  5961. Read the next byte from a stream.
  5962. stm: The stream t read from.
  5963. Returns -1 for end of stream, or the next byte. May
  5964. throw exceptions.
  5965. */
  5966. FZ_FUNCTION int ll_fz_read_byte(::fz_stream *stm);
  5967. /** Low-level wrapper for `::fz_read_file()`. */
  5968. /**
  5969. Read all the contents of a file into a buffer.
  5970. */
  5971. FZ_FUNCTION ::fz_buffer *ll_fz_read_file(const char *filename);
  5972. /** Low-level wrapper for `::fz_read_float()`. */
  5973. FZ_FUNCTION float ll_fz_read_float(::fz_stream *stm);
  5974. /** Low-level wrapper for `::fz_read_float_le()`. */
  5975. FZ_FUNCTION float ll_fz_read_float_le(::fz_stream *stm);
  5976. /** Low-level wrapper for `::fz_read_int16()`. */
  5977. FZ_FUNCTION int16_t ll_fz_read_int16(::fz_stream *stm);
  5978. /** Low-level wrapper for `::fz_read_int16_le()`. */
  5979. FZ_FUNCTION int16_t ll_fz_read_int16_le(::fz_stream *stm);
  5980. /** Low-level wrapper for `::fz_read_int32()`. */
  5981. FZ_FUNCTION int32_t ll_fz_read_int32(::fz_stream *stm);
  5982. /** Low-level wrapper for `::fz_read_int32_le()`. */
  5983. FZ_FUNCTION int32_t ll_fz_read_int32_le(::fz_stream *stm);
  5984. /** Low-level wrapper for `::fz_read_int64()`. */
  5985. FZ_FUNCTION int64_t ll_fz_read_int64(::fz_stream *stm);
  5986. /** Low-level wrapper for `::fz_read_int64_le()`. */
  5987. FZ_FUNCTION int64_t ll_fz_read_int64_le(::fz_stream *stm);
  5988. /** Low-level wrapper for `::fz_read_line()`. */
  5989. /**
  5990. Read a line from stream into the buffer until either a
  5991. terminating newline or EOF, which it replaces with a null byte
  5992. ('\0').
  5993. Returns buf on success, and NULL when end of file occurs while
  5994. no characters have been read.
  5995. */
  5996. FZ_FUNCTION char *ll_fz_read_line(::fz_stream *stm, char *buf, size_t max);
  5997. /** Low-level wrapper for `::fz_read_rbits()`. */
  5998. /**
  5999. Read the next n bits from a stream (assumed to
  6000. be packed least significant bit first).
  6001. stm: The stream to read from.
  6002. n: The number of bits to read, between 1 and 8*sizeof(int)
  6003. inclusive.
  6004. Returns (unsigned int)-1 for EOF, or the required number of bits.
  6005. */
  6006. FZ_FUNCTION unsigned int ll_fz_read_rbits(::fz_stream *stm, int n);
  6007. /** Low-level wrapper for `::fz_read_rune()`. */
  6008. /**
  6009. Read a utf-8 rune from a stream.
  6010. In the event of encountering badly formatted utf-8 codes
  6011. (such as a leading code with an unexpected number of following
  6012. codes) no error/exception is given, but undefined values may be
  6013. returned.
  6014. */
  6015. FZ_FUNCTION int ll_fz_read_rune(::fz_stream *in);
  6016. /** Low-level wrapper for `::fz_read_string()`. */
  6017. /**
  6018. Read a null terminated string from the stream into
  6019. a buffer of a given length. The buffer will be null terminated.
  6020. Throws on failure (including the failure to fit the entire
  6021. string including the terminator into the buffer).
  6022. */
  6023. FZ_FUNCTION void ll_fz_read_string(::fz_stream *stm, char *buffer, int len);
  6024. /** Low-level wrapper for `::fz_read_uint16()`. */
  6025. /**
  6026. fz_read_[u]int(16|24|32|64)(_le)?
  6027. Read a 16/32/64 bit signed/unsigned integer from stream,
  6028. in big or little-endian byte orders.
  6029. Throws an exception if EOF is encountered.
  6030. */
  6031. FZ_FUNCTION uint16_t ll_fz_read_uint16(::fz_stream *stm);
  6032. /** Low-level wrapper for `::fz_read_uint16_le()`. */
  6033. FZ_FUNCTION uint16_t ll_fz_read_uint16_le(::fz_stream *stm);
  6034. /** Low-level wrapper for `::fz_read_uint24()`. */
  6035. FZ_FUNCTION uint32_t ll_fz_read_uint24(::fz_stream *stm);
  6036. /** Low-level wrapper for `::fz_read_uint24_le()`. */
  6037. FZ_FUNCTION uint32_t ll_fz_read_uint24_le(::fz_stream *stm);
  6038. /** Low-level wrapper for `::fz_read_uint32()`. */
  6039. FZ_FUNCTION uint32_t ll_fz_read_uint32(::fz_stream *stm);
  6040. /** Low-level wrapper for `::fz_read_uint32_le()`. */
  6041. FZ_FUNCTION uint32_t ll_fz_read_uint32_le(::fz_stream *stm);
  6042. /** Low-level wrapper for `::fz_read_uint64()`. */
  6043. FZ_FUNCTION uint64_t ll_fz_read_uint64(::fz_stream *stm);
  6044. /** Low-level wrapper for `::fz_read_uint64_le()`. */
  6045. FZ_FUNCTION uint64_t ll_fz_read_uint64_le(::fz_stream *stm);
  6046. /** Low-level wrapper for `::fz_read_utf16_be()`. */
  6047. FZ_FUNCTION int ll_fz_read_utf16_be(::fz_stream *stm);
  6048. /** Low-level wrapper for `::fz_read_utf16_le()`. */
  6049. /**
  6050. Read a utf-16 rune from a stream. (little endian and
  6051. big endian respectively).
  6052. In the event of encountering badly formatted utf-16 codes
  6053. (mismatched surrogates) no error/exception is given, but
  6054. undefined values may be returned.
  6055. */
  6056. FZ_FUNCTION int ll_fz_read_utf16_le(::fz_stream *stm);
  6057. /** Low-level wrapper for `::fz_realloc()`. */
  6058. /**
  6059. Reallocates a block of memory to given size. Existing contents
  6060. up to min(old_size,new_size) are maintained. The rest of the
  6061. block is uninitialised.
  6062. fz_realloc(ctx, NULL, size) behaves like fz_malloc(ctx, size).
  6063. fz_realloc(ctx, p, 0); behaves like fz_free(ctx, p).
  6064. Throws exception in the event of failure to allocate.
  6065. */
  6066. FZ_FUNCTION void *ll_fz_realloc(void *p, size_t size);
  6067. /** Low-level wrapper for `::fz_realloc_no_throw()`. */
  6068. /**
  6069. fz_realloc equivalent that returns NULL rather than throwing
  6070. exceptions.
  6071. */
  6072. FZ_FUNCTION void *ll_fz_realloc_no_throw(void *p, size_t size);
  6073. /** Low-level wrapper for `::fz_realpath()`. */
  6074. /**
  6075. Resolve a path to an absolute file name.
  6076. The resolved path buffer must be of at least PATH_MAX size.
  6077. */
  6078. FZ_FUNCTION char *ll_fz_realpath(const char *path, char *resolved_path);
  6079. /** Low-level wrapper for `::fz_recognize_document()`. */
  6080. /**
  6081. Given a magic find a document handler that can handle a
  6082. document of this type.
  6083. magic: Can be a filename extension (including initial period) or
  6084. a mimetype.
  6085. */
  6086. FZ_FUNCTION const ::fz_document_handler *ll_fz_recognize_document(const char *magic);
  6087. /** Low-level wrapper for `::fz_recognize_document_content()`. */
  6088. /**
  6089. Given a filename find a document handler that can handle a
  6090. document of this type.
  6091. filename: The filename of the document. This will be opened and sampled
  6092. to check data.
  6093. */
  6094. FZ_FUNCTION const ::fz_document_handler *ll_fz_recognize_document_content(const char *filename);
  6095. /** Low-level wrapper for `::fz_recognize_document_stream_and_dir_content()`. */
  6096. /**
  6097. Given a magic find a document handler that can handle a
  6098. document of this type.
  6099. stream: the file stream to sample. May be NULL if the document is
  6100. a directory.
  6101. dir: an fz_archive representing the directory from which the
  6102. stream was opened (or NULL).
  6103. magic: Can be a filename extension (including initial period) or
  6104. a mimetype.
  6105. */
  6106. FZ_FUNCTION const ::fz_document_handler *ll_fz_recognize_document_stream_and_dir_content(::fz_stream *stream, ::fz_archive *dir, const char *magic);
  6107. /** Low-level wrapper for `::fz_recognize_document_stream_content()`. */
  6108. /**
  6109. Given a magic find a document handler that can handle a
  6110. document of this type.
  6111. stream: the file stream to sample. May be NULL if the document is
  6112. a directory.
  6113. magic: Can be a filename extension (including initial period) or
  6114. a mimetype.
  6115. */
  6116. FZ_FUNCTION const ::fz_document_handler *ll_fz_recognize_document_stream_content(::fz_stream *stream, const char *magic);
  6117. /** Low-level wrapper for `::fz_recognize_image_format()`. */
  6118. /**
  6119. Recognise image format strings in the first 8 bytes from image
  6120. data.
  6121. */
  6122. FZ_FUNCTION int ll_fz_recognize_image_format(unsigned char p[8]);
  6123. /** Low-level wrapper for `::fz_rect_from_irect()`. */
  6124. /**
  6125. Convert a bbox into a rect.
  6126. For our purposes, a rect can represent all the values we meet in
  6127. a bbox, so nothing can go wrong.
  6128. rect: A place to store the generated rectangle.
  6129. bbox: The bbox to convert.
  6130. Returns rect (updated).
  6131. */
  6132. FZ_FUNCTION ::fz_rect ll_fz_rect_from_irect(::fz_irect bbox);
  6133. /** Low-level wrapper for `::fz_rect_from_quad()`. */
  6134. /**
  6135. Convert a quad to the smallest rect that covers it.
  6136. */
  6137. FZ_FUNCTION ::fz_rect ll_fz_rect_from_quad(::fz_quad q);
  6138. /** Low-level wrapper for `::fz_rectto()`. */
  6139. /**
  6140. Append a 'rectto' command to an open path.
  6141. The rectangle is equivalent to:
  6142. moveto x0 y0
  6143. lineto x1 y0
  6144. lineto x1 y1
  6145. lineto x0 y1
  6146. closepath
  6147. path: The path to modify.
  6148. x0, y0: First corner of the rectangle.
  6149. x1, y1: Second corner of the rectangle.
  6150. Throws exceptions on failure to allocate, or attempting to
  6151. modify a packed path.
  6152. */
  6153. FZ_FUNCTION void ll_fz_rectto(::fz_path *path, float x0, float y0, float x1, float y1);
  6154. /** Low-level wrapper for `::fz_register_activity_logger()`. */
  6155. FZ_FUNCTION void ll_fz_register_activity_logger(::fz_activity_fn *activity, void *opaque);
  6156. /** Low-level wrapper for `::fz_register_archive_handler()`. */
  6157. FZ_FUNCTION void ll_fz_register_archive_handler(const ::fz_archive_handler *handler);
  6158. /** Low-level wrapper for `::fz_register_document_handler()`. */
  6159. /**
  6160. Register a handler for a document type.
  6161. handler: The handler to register. This must live on for the duration of the
  6162. use of this handler. It will be passed back to the handler for calls so
  6163. the caller can use it to retrieve state.
  6164. */
  6165. FZ_FUNCTION void ll_fz_register_document_handler(const ::fz_document_handler *handler);
  6166. /** Low-level wrapper for `::fz_register_document_handlers()`. */
  6167. /**
  6168. Register handlers for all the standard document types supported in
  6169. this build.
  6170. */
  6171. FZ_FUNCTION void ll_fz_register_document_handlers();
  6172. /** Low-level wrapper for `::fz_remove_item()`. */
  6173. /**
  6174. Remove an item from the store.
  6175. If an item indexed by the given key exists in the store, remove
  6176. it.
  6177. drop: The function used to free the value (to ensure we get a
  6178. value of the correct type).
  6179. key: The key used to find the item to remove.
  6180. type: Functions used to manipulate the key.
  6181. */
  6182. FZ_FUNCTION void ll_fz_remove_item(::fz_store_drop_fn *drop, void *key, const ::fz_store_type *type);
  6183. /** Low-level wrapper for `::fz_render_flags()`. */
  6184. FZ_FUNCTION void ll_fz_render_flags(::fz_device *dev, int set, int clear);
  6185. /** Low-level wrapper for `::fz_render_glyph_pixmap()`. */
  6186. /**
  6187. Create a pixmap containing a rendered glyph.
  6188. Lookup gid from font, clip it with scissor, and rendering it
  6189. with aa bits of antialiasing into a new pixmap.
  6190. The caller takes ownership of the pixmap and so must free it.
  6191. Note: This function is no longer used for normal rendering
  6192. operations, and is kept around just because we use it in the
  6193. app. It should be considered "at risk" of removal from the API.
  6194. */
  6195. FZ_FUNCTION ::fz_pixmap *ll_fz_render_glyph_pixmap(::fz_font *font, int gid, ::fz_matrix *ctm, const ::fz_irect *scissor, int aa);
  6196. /** Low-level wrapper for `::fz_render_t3_glyph_direct()`. */
  6197. /**
  6198. Nasty PDF interpreter specific hernia, required to allow the
  6199. interpreter to replay glyphs from a type3 font directly into
  6200. the target device.
  6201. This is only used in exceptional circumstances (such as type3
  6202. glyphs that inherit current graphics state, or nested type3
  6203. glyphs).
  6204. */
  6205. FZ_FUNCTION void ll_fz_render_t3_glyph_direct(::fz_device *dev, ::fz_font *font, int gid, ::fz_matrix trm, void *gstate, ::fz_default_colorspaces *def_cs, void *fill_gstate, void *stroke_gstate);
  6206. /** Low-level wrapper for `::fz_rendering_intent_name()`. */
  6207. /**
  6208. Map from enumerated rendering intent to string.
  6209. The returned string is static and therefore must not be freed.
  6210. */
  6211. FZ_FUNCTION const char *ll_fz_rendering_intent_name(int ri);
  6212. /** Low-level wrapper for `::fz_report_error()`. */
  6213. FZ_FUNCTION void ll_fz_report_error();
  6214. /** Low-level wrapper for `::fz_reset_output()`. */
  6215. /**
  6216. Reset a closed output stream. Returns state to
  6217. (broadly) that which it was in when opened. Not
  6218. all outputs can be reset, so this may throw an
  6219. exception.
  6220. */
  6221. FZ_FUNCTION void ll_fz_reset_output(::fz_output *arg_1);
  6222. /** Low-level wrapper for `::fz_reset_story()`. */
  6223. FZ_FUNCTION void ll_fz_reset_story(::fz_story *story);
  6224. /** Low-level wrapper for `::fz_resize_buffer()`. */
  6225. /**
  6226. Ensure that a buffer has a given capacity,
  6227. truncating data if required.
  6228. capacity: The desired capacity for the buffer. If the current
  6229. size of the buffer contents is smaller than capacity, it is
  6230. truncated.
  6231. */
  6232. FZ_FUNCTION void ll_fz_resize_buffer(::fz_buffer *buf, size_t capacity);
  6233. /** Low-level wrapper for `::fz_resolve_link()`.
  6234. This function has out-params. Python/C# wrappers look like:
  6235. `ll_fz_resolve_link(::fz_document *doc, const char *uri)` => `(fz_location, float xp, float yp)`
  6236. */
  6237. /**
  6238. Resolve an internal link to a page number.
  6239. xp, yp: Pointer to store coordinate of destination on the page.
  6240. Returns (-1,-1) if the URI cannot be resolved.
  6241. */
  6242. FZ_FUNCTION ::fz_location ll_fz_resolve_link(::fz_document *doc, const char *uri, float *xp, float *yp);
  6243. /** Low-level wrapper for `::fz_resolve_link_dest()`. */
  6244. /**
  6245. Resolve an internal link to a page number, location, and possible viewing parameters.
  6246. Returns location (-1,-1) if the URI cannot be resolved.
  6247. */
  6248. FZ_FUNCTION ::fz_link_dest ll_fz_resolve_link_dest(::fz_document *doc, const char *uri);
  6249. /** Low-level wrapper for `::fz_rethrow()`. */
  6250. FZ_FUNCTION void ll_fz_rethrow();
  6251. /** Low-level wrapper for `::fz_rethrow_if()`. */
  6252. /**
  6253. Within an fz_catch() block, rethrow the current exception
  6254. if the errcode of the current exception matches.
  6255. This assumes no intervening use of fz_try/fz_catch.
  6256. */
  6257. FZ_FUNCTION void ll_fz_rethrow_if(int errcode);
  6258. /** Low-level wrapper for `::fz_rethrow_unless()`. */
  6259. FZ_FUNCTION void ll_fz_rethrow_unless(int errcode);
  6260. /** Low-level wrapper for `::fz_rotate()`. */
  6261. /**
  6262. Create a rotation matrix.
  6263. The returned matrix is of the form
  6264. [ cos(deg) sin(deg) -sin(deg) cos(deg) 0 0 ].
  6265. m: Pointer to place to store matrix
  6266. degrees: Degrees of counter clockwise rotation. Values less
  6267. than zero and greater than 360 are handled as expected.
  6268. Returns m.
  6269. */
  6270. FZ_FUNCTION ::fz_matrix ll_fz_rotate(float degrees);
  6271. /** Low-level wrapper for `::fz_round_rect()`. */
  6272. /**
  6273. Round rectangle coordinates.
  6274. Coordinates in a bounding box are integers, so rounding of the
  6275. rects coordinates takes place. The top left corner is rounded
  6276. upwards and left while the bottom right corner is rounded
  6277. downwards and to the right.
  6278. This differs from fz_irect_from_rect, in that fz_irect_from_rect
  6279. slavishly follows the numbers (i.e any slight over/under
  6280. calculations can cause whole extra pixels to be added).
  6281. fz_round_rect allows for a small amount of rounding error when
  6282. calculating the bbox.
  6283. */
  6284. FZ_FUNCTION ::fz_irect ll_fz_round_rect(::fz_rect rect);
  6285. /** Low-level wrapper for `::fz_run_display_list()`. */
  6286. /**
  6287. (Re)-run a display list through a device.
  6288. list: A display list, created by fz_new_display_list and
  6289. populated with objects from a page by running fz_run_page on a
  6290. device obtained from fz_new_list_device.
  6291. ctm: Transform to apply to display list contents. May include
  6292. for example scaling and rotation, see fz_scale, fz_rotate and
  6293. fz_concat. Set to fz_identity if no transformation is desired.
  6294. scissor: Only the part of the contents of the display list
  6295. visible within this area will be considered when the list is
  6296. run through the device. This does not imply for tile objects
  6297. contained in the display list.
  6298. cookie: Communication mechanism between caller and library
  6299. running the page. Intended for multi-threaded applications,
  6300. while single-threaded applications set cookie to NULL. The
  6301. caller may abort an ongoing page run. Cookie also communicates
  6302. progress information back to the caller. The fields inside
  6303. cookie are continually updated while the page is being run.
  6304. */
  6305. FZ_FUNCTION void ll_fz_run_display_list(::fz_display_list *list, ::fz_device *dev, ::fz_matrix ctm, ::fz_rect scissor, ::fz_cookie *cookie);
  6306. /** Low-level wrapper for `::fz_run_document_structure()`. */
  6307. /**
  6308. Run the document structure through a device.
  6309. doc: Document in question.
  6310. dev: Device obtained from fz_new_*_device.
  6311. cookie: Communication mechanism between caller and library.
  6312. Intended for multi-threaded applications, while
  6313. single-threaded applications set cookie to NULL. The
  6314. caller may abort an ongoing rendering of a page. Cookie also
  6315. communicates progress information back to the caller. The
  6316. fields inside cookie are continually updated while the page is
  6317. rendering.
  6318. */
  6319. FZ_FUNCTION void ll_fz_run_document_structure(::fz_document *doc, ::fz_device *dev, ::fz_cookie *cookie);
  6320. /** Low-level wrapper for `::fz_run_page()`. */
  6321. /**
  6322. Run a page through a device.
  6323. page: Page obtained from fz_load_page.
  6324. dev: Device obtained from fz_new_*_device.
  6325. transform: Transform to apply to page. May include for example
  6326. scaling and rotation, see fz_scale, fz_rotate and fz_concat.
  6327. Set to fz_identity if no transformation is desired.
  6328. cookie: Communication mechanism between caller and library
  6329. rendering the page. Intended for multi-threaded applications,
  6330. while single-threaded applications set cookie to NULL. The
  6331. caller may abort an ongoing rendering of a page. Cookie also
  6332. communicates progress information back to the caller. The
  6333. fields inside cookie are continually updated while the page is
  6334. rendering.
  6335. */
  6336. FZ_FUNCTION void ll_fz_run_page(::fz_page *page, ::fz_device *dev, ::fz_matrix transform, ::fz_cookie *cookie);
  6337. /** Low-level wrapper for `::fz_run_page_annots()`. */
  6338. /**
  6339. Run the annotations on a page through a device.
  6340. */
  6341. FZ_FUNCTION void ll_fz_run_page_annots(::fz_page *page, ::fz_device *dev, ::fz_matrix transform, ::fz_cookie *cookie);
  6342. /** Low-level wrapper for `::fz_run_page_contents()`. */
  6343. /**
  6344. Run a page through a device. Just the main
  6345. page content, without the annotations, if any.
  6346. page: Page obtained from fz_load_page.
  6347. dev: Device obtained from fz_new_*_device.
  6348. transform: Transform to apply to page. May include for example
  6349. scaling and rotation, see fz_scale, fz_rotate and fz_concat.
  6350. Set to fz_identity if no transformation is desired.
  6351. cookie: Communication mechanism between caller and library
  6352. rendering the page. Intended for multi-threaded applications,
  6353. while single-threaded applications set cookie to NULL. The
  6354. caller may abort an ongoing rendering of a page. Cookie also
  6355. communicates progress information back to the caller. The
  6356. fields inside cookie are continually updated while the page is
  6357. rendering.
  6358. */
  6359. FZ_FUNCTION void ll_fz_run_page_contents(::fz_page *page, ::fz_device *dev, ::fz_matrix transform, ::fz_cookie *cookie);
  6360. /** Low-level wrapper for `::fz_run_page_widgets()`. */
  6361. /**
  6362. Run the widgets on a page through a device.
  6363. */
  6364. FZ_FUNCTION void ll_fz_run_page_widgets(::fz_page *page, ::fz_device *dev, ::fz_matrix transform, ::fz_cookie *cookie);
  6365. /** Low-level wrapper for `::fz_run_t3_glyph()`. */
  6366. /**
  6367. Run a glyph from a Type3 font to
  6368. a given device.
  6369. font: The font to find the glyph in.
  6370. gid: The glyph to run.
  6371. trm: The transform to apply.
  6372. dev: The device to render onto.
  6373. */
  6374. FZ_FUNCTION void ll_fz_run_t3_glyph(::fz_font *font, int gid, ::fz_matrix trm, struct ::fz_device *dev);
  6375. /** Low-level wrapper for `::fz_runeidx()`. */
  6376. /**
  6377. Compute the index of a rune in a string.
  6378. str: Pointer to beginning of a string.
  6379. p: Pointer to a char in str.
  6380. Returns the index of the rune pointed to by p in str.
  6381. */
  6382. FZ_FUNCTION int ll_fz_runeidx(const char *str, const char *p);
  6383. /** Low-level wrapper for `::fz_runelen()`. */
  6384. /**
  6385. Count how many chars are required to represent a rune.
  6386. rune: The rune to encode.
  6387. Returns the number of bytes required to represent this run in
  6388. UTF8.
  6389. */
  6390. FZ_FUNCTION int ll_fz_runelen(int rune);
  6391. /** Low-level wrapper for `::fz_runeptr()`. */
  6392. /**
  6393. Obtain a pointer to the char representing the rune
  6394. at a given index.
  6395. str: Pointer to beginning of a string.
  6396. idx: Index of a rune to return a char pointer to.
  6397. Returns a pointer to the char where the desired rune starts,
  6398. or NULL if the string ends before the index is reached.
  6399. */
  6400. FZ_FUNCTION const char *ll_fz_runeptr(const char *str, int idx);
  6401. /** Low-level wrapper for `::fz_runetochar()`. */
  6402. /**
  6403. UTF8 encode a rune to a sequence of chars.
  6404. str: Pointer to a place to put the UTF8 encoded character.
  6405. rune: Pointer to a 'rune'.
  6406. Returns the number of bytes the rune took to output.
  6407. */
  6408. FZ_FUNCTION int ll_fz_runetochar(char *str, int rune);
  6409. /** Low-level wrapper for `::fz_samples_get()`. */
  6410. /**
  6411. Provides simple (but slow) access to pixmap data from Python and C#.
  6412. */
  6413. FZ_FUNCTION int ll_fz_samples_get(::fz_pixmap *pixmap, int offset);
  6414. /** Low-level wrapper for `::fz_samples_set()`. */
  6415. /**
  6416. Provides simple (but slow) write access to pixmap data from Python and
  6417. C#.
  6418. */
  6419. FZ_FUNCTION void ll_fz_samples_set(::fz_pixmap *pixmap, int offset, int value);
  6420. /** Low-level wrapper for `::fz_save_accelerator()`. */
  6421. /**
  6422. Save accelerator data for the document to a given file.
  6423. */
  6424. FZ_FUNCTION void ll_fz_save_accelerator(::fz_document *doc, const char *accel);
  6425. /** Low-level wrapper for `::fz_save_bitmap_as_pbm()`. */
  6426. /**
  6427. Save a bitmap as a pbm.
  6428. */
  6429. FZ_FUNCTION void ll_fz_save_bitmap_as_pbm(::fz_bitmap *bitmap, const char *filename);
  6430. /** Low-level wrapper for `::fz_save_bitmap_as_pcl()`. */
  6431. /**
  6432. Save a bitmap as mono PCL.
  6433. */
  6434. FZ_FUNCTION void ll_fz_save_bitmap_as_pcl(::fz_bitmap *bitmap, char *filename, int append, const ::fz_pcl_options *pcl);
  6435. /** Low-level wrapper for `::fz_save_bitmap_as_pkm()`. */
  6436. /**
  6437. Save a CMYK bitmap as a pkm.
  6438. */
  6439. FZ_FUNCTION void ll_fz_save_bitmap_as_pkm(::fz_bitmap *bitmap, const char *filename);
  6440. /** Low-level wrapper for `::fz_save_bitmap_as_pwg()`. */
  6441. /**
  6442. Save a bitmap as a PWG.
  6443. */
  6444. FZ_FUNCTION void ll_fz_save_bitmap_as_pwg(::fz_bitmap *bitmap, char *filename, int append, const ::fz_pwg_options *pwg);
  6445. /** Low-level wrapper for `::fz_save_buffer()`. */
  6446. /**
  6447. Save the contents of a buffer to a file.
  6448. */
  6449. FZ_FUNCTION void ll_fz_save_buffer(::fz_buffer *buf, const char *filename);
  6450. /** Low-level wrapper for `::fz_save_pixmap_as_jpeg()`. */
  6451. /**
  6452. Save a pixmap as a JPEG.
  6453. */
  6454. FZ_FUNCTION void ll_fz_save_pixmap_as_jpeg(::fz_pixmap *pixmap, const char *filename, int quality);
  6455. /** Low-level wrapper for `::fz_save_pixmap_as_jpx()`. */
  6456. /**
  6457. Save pixmap data as JP2K with no subsampling.
  6458. quality = 100 = lossless
  6459. otherwise for a factor of x compression use 100-x. (so 80 is 1:20 compression)
  6460. */
  6461. FZ_FUNCTION void ll_fz_save_pixmap_as_jpx(::fz_pixmap *pixmap, const char *filename, int q);
  6462. /** Low-level wrapper for `::fz_save_pixmap_as_pam()`. */
  6463. /**
  6464. Save a pixmap as a pnm (greyscale, rgb or cmyk, with or without
  6465. alpha).
  6466. */
  6467. FZ_FUNCTION void ll_fz_save_pixmap_as_pam(::fz_pixmap *pixmap, const char *filename);
  6468. /** Low-level wrapper for `::fz_save_pixmap_as_pbm()`. */
  6469. /**
  6470. Save a pixmap as a pbm. (Performing halftoning).
  6471. */
  6472. FZ_FUNCTION void ll_fz_save_pixmap_as_pbm(::fz_pixmap *pixmap, const char *filename);
  6473. /** Low-level wrapper for `::fz_save_pixmap_as_pcl()`. */
  6474. /**
  6475. Save an (RGB) pixmap as color PCL.
  6476. */
  6477. FZ_FUNCTION void ll_fz_save_pixmap_as_pcl(::fz_pixmap *pixmap, char *filename, int append, const ::fz_pcl_options *pcl);
  6478. /** Low-level wrapper for `::fz_save_pixmap_as_pclm()`. */
  6479. /**
  6480. Save a (Greyscale or RGB) pixmap as pclm.
  6481. */
  6482. FZ_FUNCTION void ll_fz_save_pixmap_as_pclm(::fz_pixmap *pixmap, const char *filename, int append, const ::fz_pclm_options *options);
  6483. /** Low-level wrapper for `::fz_save_pixmap_as_pdfocr()`. */
  6484. /**
  6485. Save a (Greyscale or RGB) pixmap as pdfocr.
  6486. */
  6487. FZ_FUNCTION void ll_fz_save_pixmap_as_pdfocr(::fz_pixmap *pixmap, char *filename, int append, const ::fz_pdfocr_options *options);
  6488. /** Low-level wrapper for `::fz_save_pixmap_as_pkm()`. */
  6489. /**
  6490. Save a CMYK pixmap as a pkm. (Performing halftoning).
  6491. */
  6492. FZ_FUNCTION void ll_fz_save_pixmap_as_pkm(::fz_pixmap *pixmap, const char *filename);
  6493. /** Low-level wrapper for `::fz_save_pixmap_as_png()`. */
  6494. /**
  6495. Save a (Greyscale or RGB) pixmap as a png.
  6496. */
  6497. FZ_FUNCTION void ll_fz_save_pixmap_as_png(::fz_pixmap *pixmap, const char *filename);
  6498. /** Low-level wrapper for `::fz_save_pixmap_as_pnm()`. */
  6499. /**
  6500. Save a pixmap as a pnm (greyscale or rgb, no alpha).
  6501. */
  6502. FZ_FUNCTION void ll_fz_save_pixmap_as_pnm(::fz_pixmap *pixmap, const char *filename);
  6503. /** Low-level wrapper for `::fz_save_pixmap_as_ps()`. */
  6504. /**
  6505. Save a (gray, rgb, or cmyk, no alpha) pixmap out as postscript.
  6506. */
  6507. FZ_FUNCTION void ll_fz_save_pixmap_as_ps(::fz_pixmap *pixmap, char *filename, int append);
  6508. /** Low-level wrapper for `::fz_save_pixmap_as_psd()`. */
  6509. /**
  6510. Save a pixmap as a PSD file.
  6511. */
  6512. FZ_FUNCTION void ll_fz_save_pixmap_as_psd(::fz_pixmap *pixmap, const char *filename);
  6513. /** Low-level wrapper for `::fz_save_pixmap_as_pwg()`. */
  6514. /**
  6515. Save a pixmap as a PWG.
  6516. */
  6517. FZ_FUNCTION void ll_fz_save_pixmap_as_pwg(::fz_pixmap *pixmap, char *filename, int append, const ::fz_pwg_options *pwg);
  6518. /** Low-level wrapper for `::fz_save_xml()`. */
  6519. /**
  6520. As for fz_write_xml, but direct to a file.
  6521. */
  6522. FZ_FUNCTION void ll_fz_save_xml(::fz_xml *root, const char *path, int indented);
  6523. /** Low-level wrapper for `::fz_scale()`. */
  6524. /**
  6525. Create a scaling matrix.
  6526. The returned matrix is of the form [ sx 0 0 sy 0 0 ].
  6527. m: Pointer to the matrix to populate
  6528. sx, sy: Scaling factors along the X- and Y-axes. A scaling
  6529. factor of 1.0 will not cause any scaling along the relevant
  6530. axis.
  6531. Returns m.
  6532. */
  6533. FZ_FUNCTION ::fz_matrix ll_fz_scale(float sx, float sy);
  6534. /** Low-level wrapper for `::fz_scale_pixmap()`. */
  6535. FZ_FUNCTION ::fz_pixmap *ll_fz_scale_pixmap(::fz_pixmap *src, float x, float y, float w, float h, const ::fz_irect *clip);
  6536. /** Low-level wrapper for `::fz_search_chapter_page_number()`.
  6537. This function has out-params. Python/C# wrappers look like:
  6538. `ll_fz_search_chapter_page_number(::fz_document *doc, int chapter, int page, const char *needle, ::fz_quad *hit_bbox, int hit_max)` => `(int, int hit_mark)`
  6539. */
  6540. FZ_FUNCTION int ll_fz_search_chapter_page_number(::fz_document *doc, int chapter, int page, const char *needle, int *hit_mark, ::fz_quad *hit_bbox, int hit_max);
  6541. /** Low-level wrapper for `::fz_search_chapter_page_number_cb()`. */
  6542. FZ_FUNCTION int ll_fz_search_chapter_page_number_cb(::fz_document *doc, int chapter, int page, const char *needle, ::fz_search_callback_fn *cb, void *opaque);
  6543. /** Low-level wrapper for `::fz_search_display_list()`.
  6544. This function has out-params. Python/C# wrappers look like:
  6545. `ll_fz_search_display_list(::fz_display_list *list, const char *needle, ::fz_quad *hit_bbox, int hit_max)` => `(int, int hit_mark)`
  6546. */
  6547. FZ_FUNCTION int ll_fz_search_display_list(::fz_display_list *list, const char *needle, int *hit_mark, ::fz_quad *hit_bbox, int hit_max);
  6548. /** Low-level wrapper for `::fz_search_display_list_cb()`. */
  6549. FZ_FUNCTION int ll_fz_search_display_list_cb(::fz_display_list *list, const char *needle, ::fz_search_callback_fn *cb, void *opaque);
  6550. /** Low-level wrapper for `::fz_search_page()`.
  6551. This function has out-params. Python/C# wrappers look like:
  6552. `ll_fz_search_page(::fz_page *page, const char *needle, ::fz_quad *hit_bbox, int hit_max)` => `(int, int hit_mark)`
  6553. */
  6554. /**
  6555. Search for the 'needle' text on the page.
  6556. Record the hits in the hit_bbox array and return the number of
  6557. hits. Will stop looking once it has filled hit_max rectangles.
  6558. */
  6559. FZ_FUNCTION int ll_fz_search_page(::fz_page *page, const char *needle, int *hit_mark, ::fz_quad *hit_bbox, int hit_max);
  6560. /** Low-level wrapper for `::fz_search_page2()`. */
  6561. /**
  6562. C++ alternative to fz_search_page() that returns information in a std::vector.
  6563. */
  6564. FZ_FUNCTION std::vector<fz_search_page2_hit> ll_fz_search_page2(::fz_document *doc, int number, const char *needle, int hit_max);
  6565. /** Low-level wrapper for `::fz_search_page_cb()`. */
  6566. /**
  6567. Search for the 'needle' text on the page.
  6568. */
  6569. FZ_FUNCTION int ll_fz_search_page_cb(::fz_page *page, const char *needle, ::fz_search_callback_fn *cb, void *opaque);
  6570. /** Low-level wrapper for `::fz_search_page_number()`.
  6571. This function has out-params. Python/C# wrappers look like:
  6572. `ll_fz_search_page_number(::fz_document *doc, int number, const char *needle, ::fz_quad *hit_bbox, int hit_max)` => `(int, int hit_mark)`
  6573. */
  6574. FZ_FUNCTION int ll_fz_search_page_number(::fz_document *doc, int number, const char *needle, int *hit_mark, ::fz_quad *hit_bbox, int hit_max);
  6575. /** Low-level wrapper for `::fz_search_page_number_cb()`. */
  6576. FZ_FUNCTION int ll_fz_search_page_number_cb(::fz_document *doc, int number, const char *needle, ::fz_search_callback_fn *cb, void *opaque);
  6577. /** Low-level wrapper for `::fz_search_stext_page()`.
  6578. This function has out-params. Python/C# wrappers look like:
  6579. `ll_fz_search_stext_page(::fz_stext_page *text, const char *needle, ::fz_quad *hit_bbox, int hit_max)` => `(int, int hit_mark)`
  6580. */
  6581. /**
  6582. Search for occurrence of 'needle' in text page.
  6583. Return the number of quads and store hit quads in the passed in
  6584. array.
  6585. NOTE: This is an experimental interface and subject to change
  6586. without notice.
  6587. */
  6588. FZ_FUNCTION int ll_fz_search_stext_page(::fz_stext_page *text, const char *needle, int *hit_mark, ::fz_quad *hit_bbox, int hit_max);
  6589. /** Low-level wrapper for `::fz_search_stext_page_cb()`. */
  6590. /**
  6591. Search for occurrence of 'needle' in text page.
  6592. Call callback once for each hit. This callback will receive
  6593. (potentially) multiple quads for each hit.
  6594. Returns the number of hits - note that this is potentially
  6595. different from (i.e. is not greater than) the number of quads
  6596. as returned by the non callback API.
  6597. NOTE: This is an experimental interface and subject to change
  6598. without notice.
  6599. */
  6600. FZ_FUNCTION int ll_fz_search_stext_page_cb(::fz_stext_page *text, const char *needle, ::fz_search_callback_fn *cb, void *opaque);
  6601. /** Low-level wrapper for `::fz_seek()`. */
  6602. /**
  6603. Seek within a stream.
  6604. stm: The stream to seek within.
  6605. offset: The offset to seek to.
  6606. whence: From where the offset is measured (see fseek).
  6607. SEEK_SET - start of stream.
  6608. SEEK_CUR - current position.
  6609. SEEK_END - end of stream.
  6610. */
  6611. FZ_FUNCTION void ll_fz_seek(::fz_stream *stm, int64_t offset, int whence);
  6612. /** Low-level wrapper for `::fz_seek_output()`. */
  6613. /**
  6614. Seek to the specified file position.
  6615. See fseek for arguments.
  6616. Throw an error on unseekable outputs.
  6617. */
  6618. FZ_FUNCTION void ll_fz_seek_output(::fz_output *out, int64_t off, int whence);
  6619. /** Low-level wrapper for `::fz_segment_stext_page()`. */
  6620. /**
  6621. Perform segmentation analysis on an (unstructured) page to look for
  6622. recursive subdivisions.
  6623. Essentially this code attempts to split the page horizontally and/or
  6624. vertically repeatedly into smaller and smaller "segments" (divisions).
  6625. This minimises the reordering of the content, but some reordering
  6626. may be unavoidable.
  6627. Returns 0 if no changes were made to the document.
  6628. This is experimental code, and may change (or be removed) in future
  6629. versions!
  6630. */
  6631. FZ_FUNCTION int ll_fz_segment_stext_page(::fz_stext_page *page);
  6632. /** Low-level wrapper for `::fz_segment_stext_rect()`. */
  6633. /**
  6634. Perform segmentation analysis on a rectangle of a given
  6635. stext page.
  6636. Like fz_segment_stext_page, this attempts to split the given page
  6637. region horizontally and/or vertically repeatedly into smaller and
  6638. smaller "segments".
  6639. This works for pages with structure too, but splitting with
  6640. rectangles that cut across structure blocks may not behave as
  6641. expected.
  6642. This minimises the reordering of the content (as viewed from the
  6643. perspective of a depth first traversal), but some reordering may
  6644. be unavoidable.
  6645. This function accepts smaller gaps for segmentation than the full
  6646. page segmentation does.
  6647. Returns 0 if no changes were made to the document.
  6648. This is experimental code, and may change (or be removed) in future
  6649. versions!
  6650. */
  6651. FZ_FUNCTION int ll_fz_segment_stext_rect(::fz_stext_page *page, ::fz_rect rect);
  6652. /** Low-level wrapper for `::fz_separation_current_behavior()`. */
  6653. /**
  6654. Test for the current behavior of a separation.
  6655. */
  6656. FZ_FUNCTION ::fz_separation_behavior ll_fz_separation_current_behavior(const ::fz_separations *sep, int separation);
  6657. /** Low-level wrapper for `::fz_separation_equivalent()`.
  6658. This function has out-params. Python/C# wrappers look like:
  6659. `ll_fz_separation_equivalent(const ::fz_separations *seps, int idx, ::fz_colorspace *dst_cs, ::fz_colorspace *prf, ::fz_color_params color_params)` => float dst_color
  6660. */
  6661. /**
  6662. Get the equivalent separation color in a given colorspace.
  6663. */
  6664. FZ_FUNCTION void ll_fz_separation_equivalent(const ::fz_separations *seps, int idx, ::fz_colorspace *dst_cs, float *dst_color, ::fz_colorspace *prf, ::fz_color_params color_params);
  6665. /** Low-level wrapper for `::fz_separation_name()`. */
  6666. FZ_FUNCTION const char *ll_fz_separation_name(const ::fz_separations *sep, int separation);
  6667. /** Low-level wrapper for `::fz_set_aa_level()`. */
  6668. /**
  6669. Set the number of bits of antialiasing we should
  6670. use (for both text and graphics).
  6671. bits: The number of bits of antialiasing to use (values are
  6672. clamped to within the 0 to 8 range).
  6673. */
  6674. FZ_FUNCTION void ll_fz_set_aa_level(int bits);
  6675. /** Low-level wrapper for `::fz_set_compressed_image_buffer()`. */
  6676. FZ_FUNCTION void ll_fz_set_compressed_image_buffer(::fz_compressed_image *cimg, ::fz_compressed_buffer *buf);
  6677. /** Low-level wrapper for `::fz_set_default_cmyk()`. */
  6678. FZ_FUNCTION void ll_fz_set_default_cmyk(::fz_default_colorspaces *default_cs, ::fz_colorspace *cs);
  6679. /** Low-level wrapper for `::fz_set_default_colorspaces()`. */
  6680. FZ_FUNCTION void ll_fz_set_default_colorspaces(::fz_device *dev, ::fz_default_colorspaces *default_cs);
  6681. /** Low-level wrapper for `::fz_set_default_gray()`. */
  6682. /**
  6683. Set new defaults within the default colorspace structure.
  6684. New references are taken to the new default, and references to
  6685. the old defaults dropped.
  6686. Never throws exceptions.
  6687. */
  6688. FZ_FUNCTION void ll_fz_set_default_gray(::fz_default_colorspaces *default_cs, ::fz_colorspace *cs);
  6689. /** Low-level wrapper for `::fz_set_default_output_intent()`. */
  6690. FZ_FUNCTION void ll_fz_set_default_output_intent(::fz_default_colorspaces *default_cs, ::fz_colorspace *cs);
  6691. /** Low-level wrapper for `::fz_set_default_rgb()`. */
  6692. FZ_FUNCTION void ll_fz_set_default_rgb(::fz_default_colorspaces *default_cs, ::fz_colorspace *cs);
  6693. /** Low-level wrapper for `::fz_set_error_callback()`. */
  6694. /**
  6695. Set the error callback. This will be called as part of the
  6696. exception handling.
  6697. The callback must not throw exceptions!
  6698. */
  6699. FZ_FUNCTION void ll_fz_set_error_callback(::fz_error_cb *error_cb, void *user);
  6700. /** Low-level wrapper for `::fz_set_font_bbox()`. */
  6701. /**
  6702. Set the font bbox.
  6703. font: The font to set the bbox for.
  6704. xmin, ymin, xmax, ymax: The bounding box.
  6705. */
  6706. FZ_FUNCTION void ll_fz_set_font_bbox(::fz_font *font, float xmin, float ymin, float xmax, float ymax);
  6707. /** Low-level wrapper for `::fz_set_font_embedding()`. */
  6708. /**
  6709. Control whether a given font should be embedded or not when writing.
  6710. */
  6711. FZ_FUNCTION void ll_fz_set_font_embedding(::fz_font *font, int embed);
  6712. /** Low-level wrapper for `::fz_set_graphics_aa_level()`. */
  6713. /**
  6714. Set the number of bits of antialiasing we
  6715. should use for graphics.
  6716. bits: The number of bits of antialiasing to use (values are
  6717. clamped to within the 0 to 8 range).
  6718. */
  6719. FZ_FUNCTION void ll_fz_set_graphics_aa_level(int bits);
  6720. /** Low-level wrapper for `::fz_set_graphics_min_line_width()`. */
  6721. /**
  6722. Set the minimum line width to be
  6723. used for stroked lines.
  6724. min_line_width: The minimum line width to use (in pixels).
  6725. */
  6726. FZ_FUNCTION void ll_fz_set_graphics_min_line_width(float min_line_width);
  6727. /** Low-level wrapper for `::fz_set_link_rect()`. */
  6728. FZ_FUNCTION void ll_fz_set_link_rect(::fz_link *link, ::fz_rect rect);
  6729. /** Low-level wrapper for `::fz_set_link_uri()`. */
  6730. FZ_FUNCTION void ll_fz_set_link_uri(::fz_link *link, const char *uri);
  6731. /** Low-level wrapper for `::fz_set_metadata()`. */
  6732. FZ_FUNCTION void ll_fz_set_metadata(::fz_document *doc, const char *key, const char *value);
  6733. /** Low-level wrapper for `::fz_set_pixmap_image_tile()`. */
  6734. FZ_FUNCTION void ll_fz_set_pixmap_image_tile(::fz_pixmap_image *cimg, ::fz_pixmap *pix);
  6735. /** Low-level wrapper for `::fz_set_pixmap_resolution()`. */
  6736. /**
  6737. Set the pixels per inch resolution of the pixmap.
  6738. */
  6739. FZ_FUNCTION void ll_fz_set_pixmap_resolution(::fz_pixmap *pix, int xres, int yres);
  6740. /** Low-level wrapper for `::fz_set_separation_behavior()`. */
  6741. /**
  6742. Control the rendering of a given separation.
  6743. */
  6744. FZ_FUNCTION void ll_fz_set_separation_behavior(::fz_separations *sep, int separation, ::fz_separation_behavior behavior);
  6745. /** Low-level wrapper for `::fz_set_stddbg()`. */
  6746. /**
  6747. Set the output stream to be used for fz_stddbg. Set to NULL to
  6748. reset to default (stderr).
  6749. */
  6750. FZ_FUNCTION void ll_fz_set_stddbg(::fz_output *out);
  6751. /** Low-level wrapper for `::fz_set_text_aa_level()`. */
  6752. /**
  6753. Set the number of bits of antialiasing we
  6754. should use for text.
  6755. bits: The number of bits of antialiasing to use (values are
  6756. clamped to within the 0 to 8 range).
  6757. */
  6758. FZ_FUNCTION void ll_fz_set_text_aa_level(int bits);
  6759. /** Low-level wrapper for `::fz_set_use_document_css()`. */
  6760. /**
  6761. Toggle whether to respect document styles in HTML and EPUB.
  6762. */
  6763. FZ_FUNCTION void ll_fz_set_use_document_css(int use);
  6764. /** Low-level wrapper for `::fz_set_user_context()`. */
  6765. /**
  6766. Set the user field in the context.
  6767. NULL initially, this field can be set to any opaque value
  6768. required by the user. It is copied on clones.
  6769. */
  6770. FZ_FUNCTION void ll_fz_set_user_context(void *user);
  6771. /** Low-level wrapper for `::fz_set_user_css()`. */
  6772. /**
  6773. Set the user stylesheet source text for use with HTML and EPUB.
  6774. */
  6775. FZ_FUNCTION void ll_fz_set_user_css(const char *text);
  6776. /** Low-level wrapper for `::fz_set_warning_callback()`. */
  6777. /**
  6778. Set the warning callback. This will be called as part of the
  6779. exception handling.
  6780. The callback must not throw exceptions!
  6781. */
  6782. FZ_FUNCTION void ll_fz_set_warning_callback(::fz_warning_cb *warning_cb, void *user);
  6783. /** Low-level wrapper for `::fz_sha256_final()`. */
  6784. /**
  6785. MD5 finalization. Ends an MD5 message-digest operation, writing
  6786. the message digest and zeroizing the context.
  6787. Never throws an exception.
  6788. */
  6789. FZ_FUNCTION void ll_fz_sha256_final(::fz_sha256 *state, unsigned char digest[32]);
  6790. /** Low-level wrapper for `::fz_sha256_init()`. */
  6791. /**
  6792. SHA256 initialization. Begins an SHA256 operation, initialising
  6793. the supplied context.
  6794. Never throws an exception.
  6795. */
  6796. FZ_FUNCTION void ll_fz_sha256_init(::fz_sha256 *state);
  6797. /** Low-level wrapper for `::fz_sha256_update()`. */
  6798. /**
  6799. SHA256 block update operation. Continues an SHA256 message-
  6800. digest operation, processing another message block, and updating
  6801. the context.
  6802. Never throws an exception.
  6803. */
  6804. FZ_FUNCTION void ll_fz_sha256_update(::fz_sha256 *state, const unsigned char *input, size_t inlen);
  6805. /** Low-level wrapper for `::fz_sha384_final()`. */
  6806. /**
  6807. SHA384 finalization. Ends an SHA384 message-digest operation,
  6808. writing the message digest and zeroizing the context.
  6809. Never throws an exception.
  6810. */
  6811. FZ_FUNCTION void ll_fz_sha384_final(::fz_sha384 *state, unsigned char digest[64]);
  6812. /** Low-level wrapper for `::fz_sha384_init()`. */
  6813. /**
  6814. SHA384 initialization. Begins an SHA384 operation, initialising
  6815. the supplied context.
  6816. Never throws an exception.
  6817. */
  6818. FZ_FUNCTION void ll_fz_sha384_init(::fz_sha384 *state);
  6819. /** Low-level wrapper for `::fz_sha384_update()`. */
  6820. /**
  6821. SHA384 block update operation. Continues an SHA384 message-
  6822. digest operation, processing another message block, and updating
  6823. the context.
  6824. Never throws an exception.
  6825. */
  6826. FZ_FUNCTION void ll_fz_sha384_update(::fz_sha384 *state, const unsigned char *input, size_t inlen);
  6827. /** Low-level wrapper for `::fz_sha512_final()`. */
  6828. /**
  6829. SHA512 finalization. Ends an SHA512 message-digest operation,
  6830. writing the message digest and zeroizing the context.
  6831. Never throws an exception.
  6832. */
  6833. FZ_FUNCTION void ll_fz_sha512_final(::fz_sha512 *state, unsigned char digest[64]);
  6834. /** Low-level wrapper for `::fz_sha512_init()`. */
  6835. /**
  6836. SHA512 initialization. Begins an SHA512 operation, initialising
  6837. the supplied context.
  6838. Never throws an exception.
  6839. */
  6840. FZ_FUNCTION void ll_fz_sha512_init(::fz_sha512 *state);
  6841. /** Low-level wrapper for `::fz_sha512_update()`. */
  6842. /**
  6843. SHA512 block update operation. Continues an SHA512 message-
  6844. digest operation, processing another message block, and updating
  6845. the context.
  6846. Never throws an exception.
  6847. */
  6848. FZ_FUNCTION void ll_fz_sha512_update(::fz_sha512 *state, const unsigned char *input, size_t inlen);
  6849. /** Low-level wrapper for `::fz_shear()`. */
  6850. /**
  6851. Create a shearing matrix.
  6852. The returned matrix is of the form [ 1 sy sx 1 0 0 ].
  6853. m: pointer to place to store returned matrix
  6854. sx, sy: Shearing factors. A shearing factor of 0.0 will not
  6855. cause any shearing along the relevant axis.
  6856. Returns m.
  6857. */
  6858. FZ_FUNCTION ::fz_matrix ll_fz_shear(float sx, float sy);
  6859. /** Low-level wrapper for `::fz_show_glyph()`. */
  6860. /**
  6861. Add a glyph/unicode value to a text object.
  6862. text: Text object to add to.
  6863. font: The font the glyph should be added in.
  6864. trm: The transform to use for the glyph.
  6865. glyph: The glyph id to add.
  6866. unicode: The unicode character for the glyph.
  6867. cid: The CJK CID value or raw character code.
  6868. wmode: 1 for vertical mode, 0 for horizontal.
  6869. bidi_level: The bidirectional level for this glyph.
  6870. markup_dir: The direction of the text as specified in the
  6871. markup.
  6872. language: The language in use (if known, 0 otherwise)
  6873. (e.g. FZ_LANG_zh_Hans).
  6874. Throws exception on failure to allocate.
  6875. */
  6876. FZ_FUNCTION void ll_fz_show_glyph(::fz_text *text, ::fz_font *font, ::fz_matrix trm, int glyph, int unicode, int wmode, int bidi_level, ::fz_bidi_direction markup_dir, ::fz_text_language language);
  6877. /** Low-level wrapper for `::fz_show_glyph_aux()`. */
  6878. FZ_FUNCTION void ll_fz_show_glyph_aux(::fz_text *text, ::fz_font *font, ::fz_matrix trm, float adv, int glyph, int unicode, int cid, int wmode, int bidi_level, ::fz_bidi_direction markup_dir, ::fz_text_language lang);
  6879. /** Low-level wrapper for `::fz_show_string()`. */
  6880. /**
  6881. Add a UTF8 string to a text object.
  6882. text: Text object to add to.
  6883. font: The font the string should be added in.
  6884. trm: The transform to use.
  6885. s: The utf-8 string to add.
  6886. wmode: 1 for vertical mode, 0 for horizontal.
  6887. bidi_level: The bidirectional level for this glyph.
  6888. markup_dir: The direction of the text as specified in the markup.
  6889. language: The language in use (if known, 0 otherwise)
  6890. (e.g. FZ_LANG_zh_Hans).
  6891. Returns the transform updated with the advance width of the
  6892. string.
  6893. */
  6894. FZ_FUNCTION ::fz_matrix ll_fz_show_string(::fz_text *text, ::fz_font *font, ::fz_matrix trm, const char *s, int wmode, int bidi_level, ::fz_bidi_direction markup_dir, ::fz_text_language language);
  6895. /** Low-level wrapper for `::fz_shrink_store()`. */
  6896. /**
  6897. Evict items from the store until the total size of
  6898. the objects in the store is reduced to a given percentage of its
  6899. current size.
  6900. percent: %age of current size to reduce the store to.
  6901. Returns non zero if we managed to free enough memory, zero
  6902. otherwise.
  6903. */
  6904. FZ_FUNCTION int ll_fz_shrink_store(unsigned int percent);
  6905. /** Low-level wrapper for `::fz_skip()`. */
  6906. /**
  6907. Read from a stream discarding data.
  6908. stm: The stream to read from.
  6909. len: The number of bytes to read.
  6910. Returns the number of bytes read. May throw exceptions.
  6911. */
  6912. FZ_FUNCTION size_t ll_fz_skip(::fz_stream *stm, size_t len);
  6913. /** Low-level wrapper for `::fz_skip_space()`. */
  6914. /**
  6915. Skip over whitespace (bytes <= 32) in a stream.
  6916. */
  6917. FZ_FUNCTION void ll_fz_skip_space(::fz_stream *stm);
  6918. /** Low-level wrapper for `::fz_skip_string()`. */
  6919. /**
  6920. Skip over a given string in a stream. Return 0 if successfully
  6921. skipped, non-zero otherwise. As many characters will be skipped
  6922. over as matched in the string.
  6923. */
  6924. FZ_FUNCTION int ll_fz_skip_string(::fz_stream *stm, const char *str);
  6925. /** Low-level wrapper for `::fz_slice_buffer()`. */
  6926. /**
  6927. Create a new buffer with a (subset of) the data from the buffer.
  6928. start: if >= 0, offset from start of buffer, if < 0 offset from end of buffer.
  6929. end: if >= 0, offset from start of buffer, if < 0 offset from end of buffer.
  6930. */
  6931. FZ_FUNCTION ::fz_buffer *ll_fz_slice_buffer(::fz_buffer *buf, int64_t start, int64_t end);
  6932. /** Low-level wrapper for `::fz_snap_selection()`. */
  6933. FZ_FUNCTION ::fz_quad ll_fz_snap_selection(::fz_stext_page *page, ::fz_point *ap, ::fz_point *bp, int mode);
  6934. /** Low-level wrapper for `::fz_start_throw_on_repair()`. */
  6935. FZ_FUNCTION void ll_fz_start_throw_on_repair();
  6936. /** Low-level wrapper for `::fz_stat_ctime()`. */
  6937. FZ_FUNCTION int64_t ll_fz_stat_ctime(const char *path);
  6938. /** Low-level wrapper for `::fz_stat_mtime()`. */
  6939. FZ_FUNCTION int64_t ll_fz_stat_mtime(const char *path);
  6940. /** Low-level wrapper for `::fz_stddbg()`. */
  6941. /**
  6942. Retrieve an fz_output for the default debugging stream. On
  6943. Windows this will be OutputDebugString for non-console apps.
  6944. Otherwise, it is always fz_stderr.
  6945. Optionally may be fz_dropped when finished with.
  6946. */
  6947. FZ_FUNCTION ::fz_output *ll_fz_stddbg();
  6948. /** Low-level wrapper for `::fz_stderr()`. */
  6949. /**
  6950. Retrieve an fz_output that directs to stdout.
  6951. Optionally may be fz_dropped when finished with.
  6952. */
  6953. FZ_FUNCTION ::fz_output *ll_fz_stderr();
  6954. /** Low-level wrapper for `::fz_stdout()`. */
  6955. /**
  6956. Retrieve an fz_output that directs to stdout.
  6957. Optionally may be fz_dropped when finished with.
  6958. */
  6959. FZ_FUNCTION ::fz_output *ll_fz_stdout();
  6960. /** Low-level wrapper for `::fz_stext_page_block_iterator_begin()`. */
  6961. FZ_FUNCTION ::fz_stext_page_block_iterator ll_fz_stext_page_block_iterator_begin(::fz_stext_page *page);
  6962. /** Low-level wrapper for `::fz_stext_page_block_iterator_down()`. */
  6963. FZ_FUNCTION ::fz_stext_page_block_iterator ll_fz_stext_page_block_iterator_down(::fz_stext_page_block_iterator pos);
  6964. /** Low-level wrapper for `::fz_stext_page_block_iterator_eod()`. */
  6965. FZ_FUNCTION int ll_fz_stext_page_block_iterator_eod(::fz_stext_page_block_iterator pos);
  6966. /** Low-level wrapper for `::fz_stext_page_block_iterator_eod_dfs()`. */
  6967. FZ_FUNCTION int ll_fz_stext_page_block_iterator_eod_dfs(::fz_stext_page_block_iterator pos);
  6968. /** Low-level wrapper for `::fz_stext_page_block_iterator_next()`. */
  6969. FZ_FUNCTION ::fz_stext_page_block_iterator ll_fz_stext_page_block_iterator_next(::fz_stext_page_block_iterator pos);
  6970. /** Low-level wrapper for `::fz_stext_page_block_iterator_next_dfs()`. */
  6971. FZ_FUNCTION ::fz_stext_page_block_iterator ll_fz_stext_page_block_iterator_next_dfs(::fz_stext_page_block_iterator pos);
  6972. /** Low-level wrapper for `::fz_stext_page_block_iterator_up()`. */
  6973. FZ_FUNCTION ::fz_stext_page_block_iterator ll_fz_stext_page_block_iterator_up(::fz_stext_page_block_iterator pos);
  6974. /** Low-level wrapper for `::fz_stext_page_details_for_block()`. */
  6975. /**
  6976. Helper function to retrieve the details for a given id from a block.
  6977. */
  6978. FZ_FUNCTION ::fz_stext_page_details *ll_fz_stext_page_details_for_block(::fz_stext_page *page, ::fz_stext_block *block);
  6979. /** Low-level wrapper for `::fz_stext_remove_page_fill()`. */
  6980. FZ_FUNCTION int ll_fz_stext_remove_page_fill(::fz_stext_page *page);
  6981. /** Low-level wrapper for `::fz_store_item()`. */
  6982. /**
  6983. Add an item to the store.
  6984. Add an item into the store, returning NULL for success. If an
  6985. item with the same key is found in the store, then our item will
  6986. not be inserted, and the function will return a pointer to that
  6987. value instead. This function takes its own reference to val, as
  6988. required (i.e. the caller maintains ownership of its own
  6989. reference).
  6990. key: The key used to index the item.
  6991. val: The value to store.
  6992. itemsize: The size in bytes of the value (as counted towards the
  6993. store size).
  6994. type: Functions used to manipulate the key.
  6995. */
  6996. FZ_FUNCTION void *ll_fz_store_item(void *key, void *val, size_t itemsize, const ::fz_store_type *type);
  6997. /** Low-level wrapper for `::fz_store_scavenge()`.
  6998. This function has out-params. Python/C# wrappers look like:
  6999. `ll_fz_store_scavenge(size_t size)` => `(int, int phase)`
  7000. */
  7001. /**
  7002. Internal function used as part of the scavenging
  7003. allocator; when we fail to allocate memory, before returning a
  7004. failure to the caller, we try to scavenge space within the store
  7005. by evicting at least 'size' bytes. The allocator then retries.
  7006. size: The number of bytes we are trying to have free.
  7007. phase: What phase of the scavenge we are in. Updated on exit.
  7008. Returns non zero if we managed to free any memory.
  7009. */
  7010. FZ_FUNCTION int ll_fz_store_scavenge(size_t size, int *phase);
  7011. /** Low-level wrapper for `::fz_store_scavenge_external()`.
  7012. This function has out-params. Python/C# wrappers look like:
  7013. `ll_fz_store_scavenge_external(size_t size)` => `(int, int phase)`
  7014. */
  7015. /**
  7016. External function for callers to use
  7017. to scavenge while trying allocations.
  7018. size: The number of bytes we are trying to have free.
  7019. phase: What phase of the scavenge we are in. Updated on exit.
  7020. Returns non zero if we managed to free any memory.
  7021. */
  7022. FZ_FUNCTION int ll_fz_store_scavenge_external(size_t size, int *phase);
  7023. /** Low-level wrapper for `::fz_story_document()`. */
  7024. FZ_FUNCTION ::fz_xml *ll_fz_story_document(::fz_story *story);
  7025. /** Low-level wrapper for `::fz_story_positions()`. */
  7026. FZ_FUNCTION void ll_fz_story_positions(::fz_story *story, ::fz_story_position_callback *cb, void *arg);
  7027. /** Low-level wrapper for `::fz_story_warnings()`. */
  7028. FZ_FUNCTION const char *ll_fz_story_warnings(::fz_story *story);
  7029. /** Low-level wrapper for `::fz_strcasecmp()`. */
  7030. /**
  7031. Case insensitive (UTF8) string comparison.
  7032. */
  7033. FZ_FUNCTION int ll_fz_strcasecmp(const char *a, const char *b);
  7034. /** Low-level wrapper for `::fz_strdup()`. */
  7035. /**
  7036. Portable strdup implementation, using fz allocators.
  7037. */
  7038. FZ_FUNCTION char *ll_fz_strdup(const char *s);
  7039. /** Low-level wrapper for `::fz_stream_filename()`. */
  7040. /**
  7041. Return the filename (UTF-8 encoded) from which a stream was opened.
  7042. Returns NULL if the filename is not available (or the stream was
  7043. opened from a source other than a file).
  7044. */
  7045. FZ_FUNCTION const char *ll_fz_stream_filename(::fz_stream *stm);
  7046. /** Low-level wrapper for `::fz_stream_from_output()`. */
  7047. /**
  7048. Obtain the fz_output in the form of a fz_stream.
  7049. This allows data to be read back from some forms of fz_output
  7050. object. When finished reading, the fz_stream should be released
  7051. by calling fz_drop_stream. Until the fz_stream is dropped, no
  7052. further operations should be performed on the fz_output object.
  7053. */
  7054. FZ_FUNCTION ::fz_stream *ll_fz_stream_from_output(::fz_output *arg_1);
  7055. /** Low-level wrapper for `::fz_string_from_barcode_type()`. */
  7056. /**
  7057. Return barcode string matching one of the above barcode types.
  7058. All lowercase, e.g. "none", "aztec" etc.
  7059. */
  7060. FZ_FUNCTION const char *ll_fz_string_from_barcode_type(::fz_barcode_type type);
  7061. /** Low-level wrapper for `::fz_string_from_box_type()`. */
  7062. FZ_FUNCTION const char *ll_fz_string_from_box_type(::fz_box_type box);
  7063. /** Low-level wrapper for `::fz_string_from_buffer()`. */
  7064. /**
  7065. Ensure that a buffer's data ends in a
  7066. 0 byte, and return a pointer to it.
  7067. */
  7068. FZ_FUNCTION const char *ll_fz_string_from_buffer(::fz_buffer *buf);
  7069. /** Low-level wrapper for `::fz_string_from_linecap()`. */
  7070. FZ_FUNCTION const char *ll_fz_string_from_linecap(::fz_linecap cap);
  7071. /** Low-level wrapper for `::fz_string_from_linejoin()`. */
  7072. FZ_FUNCTION const char *ll_fz_string_from_linejoin(::fz_linejoin join);
  7073. /** Low-level wrapper for `::fz_string_from_text_language()`. */
  7074. /**
  7075. Recover ISO 639 (639-{1,2,3,5}) language specification
  7076. strings losslessly from a 15 bit fz_text_language code.
  7077. No validation is carried out. See note above.
  7078. */
  7079. FZ_FUNCTION char *ll_fz_string_from_text_language(char str[8], ::fz_text_language lang);
  7080. /** Low-level wrapper for `::fz_string_from_text_language2()`. */
  7081. /**
  7082. C++ alternative to fz_string_from_text_language() that returns information in a std::string.
  7083. */
  7084. FZ_FUNCTION std::string ll_fz_string_from_text_language2(::fz_text_language lang);
  7085. /** Low-level wrapper for `::fz_strlcat()`. */
  7086. /**
  7087. Concatenate 2 strings, with a maximum length.
  7088. dst: pointer to first string in a buffer of n bytes.
  7089. src: pointer to string to concatenate.
  7090. n: Size (in bytes) of buffer that dst is in.
  7091. Returns the real length that a concatenated dst + src would have
  7092. been (not including terminator).
  7093. */
  7094. FZ_FUNCTION size_t ll_fz_strlcat(char *dst, const char *src, size_t n);
  7095. /** Low-level wrapper for `::fz_strlcpy()`. */
  7096. /**
  7097. Copy at most n-1 chars of a string into a destination
  7098. buffer with null termination, returning the real length of the
  7099. initial string (excluding terminator).
  7100. dst: Destination buffer, at least n bytes long.
  7101. src: C string (non-NULL).
  7102. n: Size of dst buffer in bytes.
  7103. Returns the length (excluding terminator) of src.
  7104. */
  7105. FZ_FUNCTION size_t ll_fz_strlcpy(char *dst, const char *src, size_t n);
  7106. /** Low-level wrapper for `::fz_strncasecmp()`. */
  7107. /**
  7108. Case insensitive (UTF8) string comparison.
  7109. n = maximum number of bytes to read from either a or b.
  7110. */
  7111. FZ_FUNCTION int ll_fz_strncasecmp(const char *a, const char *b, size_t n);
  7112. /** Low-level wrapper for `::fz_strnlen()`. */
  7113. /**
  7114. Return strlen(s), if that is less than maxlen, or maxlen if
  7115. there is no null byte ('\0') among the first maxlen bytes.
  7116. */
  7117. FZ_FUNCTION size_t ll_fz_strnlen(const char *s, size_t maxlen);
  7118. /** Low-level wrapper for `::fz_stroke_path()`. */
  7119. FZ_FUNCTION void ll_fz_stroke_path(::fz_device *dev, const ::fz_path *path, const ::fz_stroke_state *stroke, ::fz_matrix ctm, ::fz_colorspace *colorspace, const float *color, float alpha, ::fz_color_params color_params);
  7120. /** Low-level wrapper for `::fz_stroke_state_eq()`. */
  7121. FZ_FUNCTION int ll_fz_stroke_state_eq(const ::fz_stroke_state *a, const ::fz_stroke_state *b);
  7122. /** Low-level wrapper for `::fz_stroke_text()`. */
  7123. FZ_FUNCTION void ll_fz_stroke_text(::fz_device *dev, const ::fz_text *text, const ::fz_stroke_state *stroke, ::fz_matrix ctm, ::fz_colorspace *colorspace, const float *color, float alpha, ::fz_color_params color_params);
  7124. /** Low-level wrapper for `::fz_strsep()`.
  7125. This function has out-params. Python/C# wrappers look like:
  7126. `ll_fz_strsep(const char *delim)` => `(char *, char *stringp)`
  7127. */
  7128. /**
  7129. Given a pointer to a C string (or a pointer to NULL) break
  7130. it at the first occurrence of a delimiter char (from a given
  7131. set).
  7132. stringp: Pointer to a C string pointer (or NULL). Updated on
  7133. exit to point to the first char of the string after the
  7134. delimiter that was found. The string pointed to by stringp will
  7135. be corrupted by this call (as the found delimiter will be
  7136. overwritten by 0).
  7137. delim: A C string of acceptable delimiter characters.
  7138. Returns a pointer to a C string containing the chars of stringp
  7139. up to the first delimiter char (or the end of the string), or
  7140. NULL.
  7141. */
  7142. FZ_FUNCTION char *ll_fz_strsep(char **stringp, const char *delim);
  7143. /** Low-level wrapper for `::fz_strstr()`. */
  7144. /**
  7145. Safe strstr function.
  7146. haystack: Where to look (may be NULL).
  7147. needled: What to look for.
  7148. Returns NULL if unmatched, or pointer to start of match.
  7149. */
  7150. FZ_FUNCTION const char *ll_fz_strstr(const char *haystack, const char *needle);
  7151. /** Low-level wrapper for `::fz_strstrcase()`. */
  7152. /**
  7153. Safe case-insensitive strstr function. (Accepts UTF-8).
  7154. haystack: Where to look (may be NULL).
  7155. needled: What to look for.
  7156. Returns NULL if unmatched, or pointer to start of match.
  7157. */
  7158. FZ_FUNCTION const char *ll_fz_strstrcase(const char *haystack, const char *needle);
  7159. /** Low-level wrapper for `::fz_strtof()`.
  7160. This function has out-params. Python/C# wrappers look like:
  7161. `ll_fz_strtof(const char *s)` => `(float, char *es)`
  7162. */
  7163. /**
  7164. Locale-independent decimal to binary conversion. On overflow
  7165. return (-)INFINITY and set errno to ERANGE. On underflow return
  7166. 0 and set errno to ERANGE. Special inputs (case insensitive):
  7167. "NAN", "INF" or "INFINITY".
  7168. */
  7169. FZ_FUNCTION float ll_fz_strtof(const char *s, char **es);
  7170. /** Low-level wrapper for `::fz_structure_from_string()`. */
  7171. FZ_FUNCTION ::fz_structure ll_fz_structure_from_string(const char *str);
  7172. /** Low-level wrapper for `::fz_structure_to_string()`. */
  7173. FZ_FUNCTION const char *ll_fz_structure_to_string(::fz_structure type);
  7174. /** Low-level wrapper for `::fz_strverscmp()`. */
  7175. /**
  7176. portable strverscmp(3) function
  7177. */
  7178. FZ_FUNCTION int ll_fz_strverscmp(const char *s1, const char *s2);
  7179. /** Low-level wrapper for `::fz_subpixel_adjust()`. */
  7180. /**
  7181. Perform subpixel quantisation and adjustment on a glyph matrix.
  7182. ctm: On entry, the desired 'ideal' transformation for a glyph.
  7183. On exit, adjusted to a (very similar) transformation quantised
  7184. for subpixel caching.
  7185. subpix_ctm: Initialised by the routine to the transform that
  7186. should be used to render the glyph.
  7187. qe, qf: which subpixel position we quantised to.
  7188. Returns: the size of the glyph.
  7189. Note: This is currently only exposed for use in our app. It
  7190. should be considered "at risk" of removal from the API.
  7191. */
  7192. FZ_FUNCTION float ll_fz_subpixel_adjust(::fz_matrix *ctm, ::fz_matrix *subpix_ctm, unsigned char *qe, unsigned char *qf);
  7193. /** Low-level wrapper for `::fz_subsample_pixmap()`. */
  7194. FZ_FUNCTION void ll_fz_subsample_pixmap(::fz_pixmap *tile, int factor);
  7195. /** Low-level wrapper for `::fz_subset_cff_for_gids()`.
  7196. This function has out-params. Python/C# wrappers look like:
  7197. `ll_fz_subset_cff_for_gids(::fz_buffer *orig, int num_gids, int symbolic, int cidfont)` => `(fz_buffer *, int gids)`
  7198. */
  7199. FZ_FUNCTION ::fz_buffer *ll_fz_subset_cff_for_gids(::fz_buffer *orig, int *gids, int num_gids, int symbolic, int cidfont);
  7200. /** Low-level wrapper for `::fz_subset_ttf_for_gids()`.
  7201. This function has out-params. Python/C# wrappers look like:
  7202. `ll_fz_subset_ttf_for_gids(::fz_buffer *orig, int num_gids, int symbolic, int cidfont)` => `(fz_buffer *, int gids)`
  7203. */
  7204. FZ_FUNCTION ::fz_buffer *ll_fz_subset_ttf_for_gids(::fz_buffer *orig, int *gids, int num_gids, int symbolic, int cidfont);
  7205. /** Low-level wrapper for `::fz_sync_bits()`. */
  7206. /**
  7207. Called after reading bits to tell the stream
  7208. that we are about to return to reading bytewise. Resyncs
  7209. the stream to whole byte boundaries.
  7210. */
  7211. FZ_FUNCTION void ll_fz_sync_bits(::fz_stream *stm);
  7212. /** Low-level wrapper for `::fz_table_hunt()`. */
  7213. /**
  7214. Hunt for possible tables on a page, and update the stext with
  7215. information.
  7216. */
  7217. FZ_FUNCTION void ll_fz_table_hunt(::fz_stext_page *page);
  7218. /** Low-level wrapper for `::fz_table_hunt_within_bounds()`. */
  7219. /**
  7220. Hunt for possible tables within a specific rect on a page, and
  7221. update the stext with information.
  7222. */
  7223. FZ_FUNCTION void ll_fz_table_hunt_within_bounds(::fz_stext_page *page, ::fz_rect bounds);
  7224. /** Low-level wrapper for `::fz_tell()`. */
  7225. /**
  7226. return the current reading position within a stream
  7227. */
  7228. FZ_FUNCTION int64_t ll_fz_tell(::fz_stream *stm);
  7229. /** Low-level wrapper for `::fz_tell_output()`. */
  7230. /**
  7231. Return the current file position.
  7232. Throw an error on untellable outputs.
  7233. */
  7234. FZ_FUNCTION int64_t ll_fz_tell_output(::fz_output *out);
  7235. /** Low-level wrapper for `::fz_terminate_buffer()`. */
  7236. /**
  7237. Zero-terminate buffer in order to use as a C string.
  7238. This byte is invisible and does not affect the length of the
  7239. buffer as returned by fz_buffer_storage. The zero byte is
  7240. written *after* the data, and subsequent writes will overwrite
  7241. the terminating byte.
  7242. Subsequent changes to the size of the buffer (such as by
  7243. fz_buffer_trim, fz_buffer_grow, fz_resize_buffer, etc) may
  7244. invalidate this.
  7245. */
  7246. FZ_FUNCTION void ll_fz_terminate_buffer(::fz_buffer *buf);
  7247. /** Low-level wrapper for `::fz_text_aa_level()`. */
  7248. /**
  7249. Get the number of bits of antialiasing we are
  7250. using for text. Between 0 and 8.
  7251. */
  7252. FZ_FUNCTION int ll_fz_text_aa_level();
  7253. /** Low-level wrapper for `::fz_text_language_from_string()`. */
  7254. /**
  7255. Convert ISO 639 (639-{1,2,3,5}) language specification
  7256. strings losslessly to a 15 bit fz_text_language code.
  7257. No validation is carried out. Obviously invalid (out
  7258. of spec) codes will be mapped to FZ_LANG_UNSET, but
  7259. well-formed (but undefined) codes will be blithely
  7260. accepted.
  7261. */
  7262. FZ_FUNCTION ::fz_text_language ll_fz_text_language_from_string(const char *str);
  7263. /** Low-level wrapper for `::fz_tint_pixmap()`. */
  7264. /**
  7265. Tint all the pixels in an RGB, BGR, or Gray pixmap.
  7266. black: Map black to this hexadecimal RGB color.
  7267. white: Map white to this hexadecimal RGB color.
  7268. */
  7269. FZ_FUNCTION void ll_fz_tint_pixmap(::fz_pixmap *pix, int black, int white);
  7270. /** Low-level wrapper for `::fz_tolower()`. */
  7271. /**
  7272. Unicode aware tolower and toupper functions.
  7273. */
  7274. FZ_FUNCTION int ll_fz_tolower(int c);
  7275. /** Low-level wrapper for `::fz_toupper()`. */
  7276. FZ_FUNCTION int ll_fz_toupper(int c);
  7277. /** Low-level wrapper for `::fz_transform_page()`. */
  7278. /**
  7279. Create transform matrix to draw page
  7280. at a given resolution and rotation. Adjusts the scaling
  7281. factors so that the page covers whole number of
  7282. pixels and adjust the page origin to be at 0,0.
  7283. */
  7284. FZ_FUNCTION ::fz_matrix ll_fz_transform_page(::fz_rect mediabox, float resolution, float rotate);
  7285. /** Low-level wrapper for `::fz_transform_path()`. */
  7286. /**
  7287. Transform a path by a given
  7288. matrix.
  7289. path: The path to modify (must not be a packed path).
  7290. transform: The transform to apply.
  7291. Throws exceptions if the path is packed, or on failure
  7292. to allocate.
  7293. */
  7294. FZ_FUNCTION void ll_fz_transform_path(::fz_path *path, ::fz_matrix transform);
  7295. /** Low-level wrapper for `::fz_transform_point()`. */
  7296. /**
  7297. Apply a transformation to a point.
  7298. transform: Transformation matrix to apply. See fz_concat,
  7299. fz_scale, fz_rotate and fz_translate for how to create a
  7300. matrix.
  7301. point: Pointer to point to update.
  7302. Returns transform (unchanged).
  7303. */
  7304. FZ_FUNCTION ::fz_point ll_fz_transform_point(::fz_point point, ::fz_matrix m);
  7305. /** Low-level wrapper for `::fz_transform_point_xy()`. */
  7306. FZ_FUNCTION ::fz_point ll_fz_transform_point_xy(float x, float y, ::fz_matrix m);
  7307. /** Low-level wrapper for `::fz_transform_quad()`. */
  7308. /**
  7309. Transform a quad by a matrix.
  7310. */
  7311. FZ_FUNCTION ::fz_quad ll_fz_transform_quad(::fz_quad q, ::fz_matrix m);
  7312. /** Low-level wrapper for `::fz_transform_rect()`. */
  7313. /**
  7314. Apply a transform to a rectangle.
  7315. After the four corner points of the axis-aligned rectangle
  7316. have been transformed it may not longer be axis-aligned. So a
  7317. new axis-aligned rectangle is created covering at least the
  7318. area of the transformed rectangle.
  7319. transform: Transformation matrix to apply. See fz_concat,
  7320. fz_scale and fz_rotate for how to create a matrix.
  7321. rect: Rectangle to be transformed. The two special cases
  7322. fz_empty_rect and fz_infinite_rect, may be used but are
  7323. returned unchanged as expected.
  7324. */
  7325. FZ_FUNCTION ::fz_rect ll_fz_transform_rect(::fz_rect rect, ::fz_matrix m);
  7326. /** Low-level wrapper for `::fz_transform_vector()`. */
  7327. /**
  7328. Apply a transformation to a vector.
  7329. transform: Transformation matrix to apply. See fz_concat,
  7330. fz_scale and fz_rotate for how to create a matrix. Any
  7331. translation will be ignored.
  7332. vector: Pointer to vector to update.
  7333. */
  7334. FZ_FUNCTION ::fz_point ll_fz_transform_vector(::fz_point vector, ::fz_matrix m);
  7335. /** Low-level wrapper for `::fz_translate()`. */
  7336. /**
  7337. Create a translation matrix.
  7338. The returned matrix is of the form [ 1 0 0 1 tx ty ].
  7339. m: A place to store the created matrix.
  7340. tx, ty: Translation distances along the X- and Y-axes. A
  7341. translation of 0 will not cause any translation along the
  7342. relevant axis.
  7343. Returns m.
  7344. */
  7345. FZ_FUNCTION ::fz_matrix ll_fz_translate(float tx, float ty);
  7346. /** Low-level wrapper for `::fz_translate_irect()`. */
  7347. FZ_FUNCTION ::fz_irect ll_fz_translate_irect(::fz_irect a, int xoff, int yoff);
  7348. /** Low-level wrapper for `::fz_translate_rect()`. */
  7349. /**
  7350. Translate bounding box.
  7351. Translate a bbox by a given x and y offset. Allows for overflow.
  7352. */
  7353. FZ_FUNCTION ::fz_rect ll_fz_translate_rect(::fz_rect a, float xoff, float yoff);
  7354. /** Low-level wrapper for `::fz_tree_archive_add_buffer()`. */
  7355. /**
  7356. Add a named buffer to an existing tree archive.
  7357. The tree will take a new reference to the buffer. Ownership
  7358. is not transferred.
  7359. */
  7360. FZ_FUNCTION void ll_fz_tree_archive_add_buffer(::fz_archive *arch_, const char *name, ::fz_buffer *buf);
  7361. /** Low-level wrapper for `::fz_tree_archive_add_data()`. */
  7362. /**
  7363. Add a named block of data to an existing tree archive.
  7364. The data will be copied into a buffer, and so the caller
  7365. may free it as soon as this returns.
  7366. */
  7367. FZ_FUNCTION void ll_fz_tree_archive_add_data(::fz_archive *arch_, const char *name, const void *data, size_t size);
  7368. /** Low-level wrapper for `::fz_tree_insert()`. */
  7369. /**
  7370. Insert a new key/value pair and rebalance the tree.
  7371. Return the new root of the tree after inserting and rebalancing.
  7372. May be called with a NULL root to create a new tree.
  7373. No data is copied into the tree structure; key and value are
  7374. merely kept as pointers.
  7375. */
  7376. FZ_FUNCTION ::fz_tree *ll_fz_tree_insert(::fz_tree *root, const char *key, void *value);
  7377. /** Low-level wrapper for `::fz_tree_lookup()`. */
  7378. /**
  7379. Look for the value of a node in the tree with the given key.
  7380. Simple pointer equivalence is used for key.
  7381. Returns NULL for no match.
  7382. */
  7383. FZ_FUNCTION void *ll_fz_tree_lookup(::fz_tree *node, const char *key);
  7384. /** Low-level wrapper for `::fz_trim_buffer()`. */
  7385. /**
  7386. Trim wasted capacity from a buffer by resizing internal memory.
  7387. */
  7388. FZ_FUNCTION void ll_fz_trim_buffer(::fz_buffer *buf);
  7389. /** Low-level wrapper for `::fz_trim_path()`. */
  7390. /**
  7391. Minimise the internal storage used by a path.
  7392. As paths are constructed, the internal buffers
  7393. grow. To avoid repeated reallocations they
  7394. grow with some spare space. Once a path has
  7395. been fully constructed, this call allows the
  7396. excess space to be trimmed.
  7397. */
  7398. FZ_FUNCTION void ll_fz_trim_path(::fz_path *path);
  7399. /** Low-level wrapper for `::fz_truncate_output()`. */
  7400. /**
  7401. Truncate the output at the current position.
  7402. This allows output streams which have seeked back from the end
  7403. of their storage to be truncated at the current point.
  7404. */
  7405. FZ_FUNCTION void ll_fz_truncate_output(::fz_output *arg_1);
  7406. /** Low-level wrapper for `::fz_try_invert_matrix()`. */
  7407. /**
  7408. Attempt to create an inverse matrix.
  7409. inv: Place to store inverse matrix.
  7410. src: Matrix to invert. A degenerate matrix, where the
  7411. determinant is equal to zero, can not be inverted.
  7412. Returns 1 if matrix is degenerate (singular), or 0 otherwise.
  7413. */
  7414. FZ_FUNCTION int ll_fz_try_invert_matrix(::fz_matrix *inv, ::fz_matrix src);
  7415. /** Low-level wrapper for `::fz_try_open_archive_entry()`. */
  7416. /**
  7417. Opens an archive entry as a stream.
  7418. Returns NULL if a matching entry cannot be found, otherwise
  7419. behaves exactly as fz_open_archive_entry.
  7420. */
  7421. FZ_FUNCTION ::fz_stream *ll_fz_try_open_archive_entry(::fz_archive *arch, const char *name);
  7422. /** Low-level wrapper for `::fz_try_open_archive_with_stream()`. */
  7423. /**
  7424. Open zip or tar archive stream.
  7425. Does the same as fz_open_archive_with_stream, but will not throw
  7426. an error in the event of failing to recognise the format. Will
  7427. still throw errors in other cases though!
  7428. */
  7429. FZ_FUNCTION ::fz_archive *ll_fz_try_open_archive_with_stream(::fz_stream *file);
  7430. /** Low-level wrapper for `::fz_try_open_file()`. */
  7431. /**
  7432. Open the named file and wrap it in a stream.
  7433. Does the same as fz_open_file, but in the event the file
  7434. does not open, it will return NULL rather than throw an
  7435. exception.
  7436. */
  7437. FZ_FUNCTION ::fz_stream *ll_fz_try_open_file(const char *name);
  7438. /** Low-level wrapper for `::fz_try_parse_xml_archive_entry()`. */
  7439. /**
  7440. Try and parse the contents of an archive entry into a tree of xml nodes.
  7441. preserve_white: whether to keep or delete all-whitespace nodes.
  7442. Will return NULL if the archive entry can't be found. Otherwise behaves
  7443. the same as fz_parse_xml_archive_entry. May throw exceptions.
  7444. */
  7445. FZ_FUNCTION ::fz_xml *ll_fz_try_parse_xml_archive_entry(::fz_archive *dir, const char *filename, int preserve_white);
  7446. /** Low-level wrapper for `::fz_try_read_archive_entry()`. */
  7447. /**
  7448. Reads all bytes in an archive entry
  7449. into a buffer.
  7450. name: Entry name to look for, this must be an exact match to
  7451. the entry name in the archive.
  7452. Returns NULL if a matching entry cannot be found. Otherwise behaves
  7453. the same as fz_read_archive_entry. Exceptions may be thrown.
  7454. */
  7455. FZ_FUNCTION ::fz_buffer *ll_fz_try_read_archive_entry(::fz_archive *arch, const char *name);
  7456. /** Low-level wrapper for `::fz_try_read_file()`. */
  7457. /**
  7458. Read all the contents of a file into a buffer.
  7459. Returns NULL if the file does not exist, otherwise
  7460. behaves exactly as fz_read_file.
  7461. */
  7462. FZ_FUNCTION ::fz_buffer *ll_fz_try_read_file(const char *filename);
  7463. /** Low-level wrapper for `::fz_tune_image_decode()`. */
  7464. /**
  7465. Set the tuning function to use for
  7466. image decode.
  7467. image_decode: Function to use.
  7468. arg: Opaque argument to be passed to tuning function.
  7469. */
  7470. FZ_FUNCTION void ll_fz_tune_image_decode(::fz_tune_image_decode_fn *image_decode, void *arg);
  7471. /** Low-level wrapper for `::fz_tune_image_scale()`. */
  7472. /**
  7473. Set the tuning function to use for
  7474. image scaling.
  7475. image_scale: Function to use.
  7476. arg: Opaque argument to be passed to tuning function.
  7477. */
  7478. FZ_FUNCTION void ll_fz_tune_image_scale(::fz_tune_image_scale_fn *image_scale, void *arg);
  7479. /** Low-level wrapper for `::fz_unicode_from_glyph_name()`. */
  7480. FZ_FUNCTION int ll_fz_unicode_from_glyph_name(const char *name);
  7481. /** Low-level wrapper for `::fz_unicode_from_glyph_name_strict()`. */
  7482. FZ_FUNCTION int ll_fz_unicode_from_glyph_name_strict(const char *name);
  7483. /** Low-level wrapper for `::fz_union_rect()`. */
  7484. /**
  7485. Compute union of two rectangles.
  7486. Given two rectangles, update the first to be the smallest
  7487. axis-aligned rectangle that encompasses both given rectangles.
  7488. If either rectangle is infinite then the union is also infinite.
  7489. If either rectangle is empty then the union is simply the
  7490. non-empty rectangle. Should both rectangles be empty, then the
  7491. union is also empty.
  7492. */
  7493. FZ_FUNCTION ::fz_rect ll_fz_union_rect(::fz_rect a, ::fz_rect b);
  7494. /** Low-level wrapper for `::fz_unlock()`. */
  7495. /**
  7496. Unlock one of the user supplied mutexes.
  7497. */
  7498. FZ_FUNCTION void ll_fz_unlock(int lock);
  7499. /** Low-level wrapper for `::fz_unpack_stream()`. */
  7500. FZ_FUNCTION ::fz_stream *ll_fz_unpack_stream(::fz_stream *src, int depth, int w, int h, int n, int indexed, int pad, int skip);
  7501. /** Low-level wrapper for `::fz_unread_byte()`. */
  7502. /**
  7503. Unread the single last byte successfully
  7504. read from a stream. Do not call this without having
  7505. successfully read a byte.
  7506. stm: The stream to operate upon.
  7507. */
  7508. FZ_FUNCTION void ll_fz_unread_byte(::fz_stream *stm);
  7509. /** Low-level wrapper for `::fz_unshare_stroke_state()`. */
  7510. /**
  7511. Given a reference to a (possibly) shared stroke_state structure,
  7512. return a reference to an equivalent stroke_state structure
  7513. that is guaranteed to be unshared (i.e. one that can
  7514. safely be modified).
  7515. shared: The reference to a (possibly) shared structure
  7516. to unshare. Ownership of this reference is passed in
  7517. to this function, even in the case of exceptions being
  7518. thrown.
  7519. Exceptions may be thrown in the event of failure to
  7520. allocate if required.
  7521. */
  7522. FZ_FUNCTION ::fz_stroke_state *ll_fz_unshare_stroke_state(::fz_stroke_state *shared);
  7523. /** Low-level wrapper for `::fz_unshare_stroke_state_with_dash_len()`. */
  7524. /**
  7525. Given a reference to a (possibly) shared stroke_state structure,
  7526. return a reference to a stroke_state structure (with room for a
  7527. given amount of dash data) that is guaranteed to be unshared
  7528. (i.e. one that can safely be modified).
  7529. shared: The reference to a (possibly) shared structure
  7530. to unshare. Ownership of this reference is passed in
  7531. to this function, even in the case of exceptions being
  7532. thrown.
  7533. Exceptions may be thrown in the event of failure to
  7534. allocate if required.
  7535. */
  7536. FZ_FUNCTION ::fz_stroke_state *ll_fz_unshare_stroke_state_with_dash_len(::fz_stroke_state *shared, int len);
  7537. /** Low-level wrapper for `::fz_urldecode()`. */
  7538. /**
  7539. Like fz_decode_uri_component but in-place.
  7540. */
  7541. FZ_FUNCTION char *ll_fz_urldecode(char *url);
  7542. /** Low-level wrapper for `::fz_use_document_css()`. */
  7543. /**
  7544. Return whether to respect document styles in HTML and EPUB.
  7545. */
  7546. FZ_FUNCTION int ll_fz_use_document_css();
  7547. /** Low-level wrapper for `::fz_user_context()`. */
  7548. /**
  7549. Read the user field from the context.
  7550. */
  7551. FZ_FUNCTION void *ll_fz_user_context();
  7552. /** Low-level wrapper for `::fz_user_css()`. */
  7553. /**
  7554. Get the user stylesheet source text.
  7555. */
  7556. FZ_FUNCTION const char *ll_fz_user_css();
  7557. /** Low-level wrapper for `::fz_utflen()`. */
  7558. /**
  7559. Count how many runes the UTF-8 encoded string
  7560. consists of.
  7561. s: The UTF-8 encoded, NUL-terminated text string.
  7562. Returns the number of runes in the string.
  7563. */
  7564. FZ_FUNCTION int ll_fz_utflen(const char *s);
  7565. /** Low-level wrapper for `::fz_var_imp()`. */
  7566. FZ_FUNCTION void ll_fz_var_imp(void *arg_0);
  7567. /** Low-level wrapper for `::fz_vlog_error_printf()`. */
  7568. FZ_FUNCTION void ll_fz_vlog_error_printf(const char *fmt, va_list ap);
  7569. /** Low-level wrapper for `::fz_vsnprintf()`. */
  7570. /**
  7571. A vsnprintf work-alike, using our custom formatter.
  7572. */
  7573. FZ_FUNCTION size_t ll_fz_vsnprintf(char *buffer, size_t space, const char *fmt, va_list args);
  7574. /** Low-level wrapper for `::fz_vthrow()`. */
  7575. /**
  7576. Throw an exception.
  7577. This assumes an enclosing fz_try() block within the callstack.
  7578. */
  7579. FZ_FUNCTION void ll_fz_vthrow(int errcode, const char *arg_2, va_list ap);
  7580. /** Low-level wrapper for `::fz_vwarn()`. */
  7581. /**
  7582. Log a warning.
  7583. This goes to the registered warning stream (stderr by
  7584. default).
  7585. */
  7586. FZ_FUNCTION void ll_fz_vwarn(const char *fmt, va_list ap);
  7587. /** Low-level wrapper for `::fz_walk_path()`. */
  7588. /**
  7589. Walk the segments of a path, calling the
  7590. appropriate callback function from a given set for each
  7591. segment of the path.
  7592. path: The path to walk.
  7593. walker: The set of callback functions to use. The first
  7594. 4 callback pointers in the set must be non-NULL. The
  7595. subsequent ones can either be supplied, or can be left
  7596. as NULL, in which case the top 4 functions will be
  7597. called as appropriate to simulate them.
  7598. arg: An opaque argument passed in to each callback.
  7599. Exceptions will only be thrown if the underlying callback
  7600. functions throw them.
  7601. */
  7602. FZ_FUNCTION void ll_fz_walk_path(const ::fz_path *path, const ::fz_path_walker *walker, void *arg);
  7603. /** Low-level wrapper for `::fz_warn()`. */
  7604. FZ_FUNCTION void ll_fz_warn(const char *fmt, ...);
  7605. /** Low-level wrapper for `::fz_warning_callback()`.
  7606. This function has out-params. Python/C# wrappers look like:
  7607. `ll_fz_warning_callback()` => `(fz_warning_cb *, void *user)`
  7608. */
  7609. /**
  7610. Retrieve the currently set warning callback, or NULL if none
  7611. has been set. Optionally, if user is non-NULL, the user pointer
  7612. given when the warning callback was set is also passed back to
  7613. the caller.
  7614. */
  7615. FZ_FUNCTION ::fz_warning_cb *ll_fz_warning_callback(void **user);
  7616. /** Low-level wrapper for `::fz_warp_pixmap()`. */
  7617. FZ_FUNCTION ::fz_pixmap *ll_fz_warp_pixmap(::fz_pixmap *src, ::fz_quad points, int width, int height);
  7618. /** Low-level wrapper for `::fz_windows_1250_from_unicode()`. */
  7619. FZ_FUNCTION int ll_fz_windows_1250_from_unicode(int u);
  7620. /** Low-level wrapper for `::fz_windows_1251_from_unicode()`. */
  7621. FZ_FUNCTION int ll_fz_windows_1251_from_unicode(int u);
  7622. /** Low-level wrapper for `::fz_windows_1252_from_unicode()`. */
  7623. FZ_FUNCTION int ll_fz_windows_1252_from_unicode(int u);
  7624. /** Low-level wrapper for `::fz_write_band()`. */
  7625. /**
  7626. Cause a band writer to write the next band
  7627. of data for an image.
  7628. stride: The byte offset from the first byte of the data
  7629. for a pixel to the first byte of the data for the same pixel
  7630. on the row below.
  7631. band_height: The number of lines in this band.
  7632. samples: Pointer to first byte of the data.
  7633. */
  7634. FZ_FUNCTION void ll_fz_write_band(::fz_band_writer *writer, int stride, int band_height, const unsigned char *samples);
  7635. /** Low-level wrapper for `::fz_write_base64()`. */
  7636. /**
  7637. Write a base64 encoded data block, optionally with periodic
  7638. newlines.
  7639. */
  7640. FZ_FUNCTION void ll_fz_write_base64(::fz_output *out, const unsigned char *data, size_t size, int newline);
  7641. /** Low-level wrapper for `::fz_write_base64_buffer()`. */
  7642. /**
  7643. Write a base64 encoded fz_buffer, optionally with periodic
  7644. newlines.
  7645. */
  7646. FZ_FUNCTION void ll_fz_write_base64_buffer(::fz_output *out, ::fz_buffer *data, int newline);
  7647. /** Low-level wrapper for `::fz_write_bitmap_as_pbm()`. */
  7648. /**
  7649. Write a bitmap as a pbm.
  7650. */
  7651. FZ_FUNCTION void ll_fz_write_bitmap_as_pbm(::fz_output *out, ::fz_bitmap *bitmap);
  7652. /** Low-level wrapper for `::fz_write_bitmap_as_pcl()`. */
  7653. /**
  7654. Write a bitmap as mono PCL.
  7655. */
  7656. FZ_FUNCTION void ll_fz_write_bitmap_as_pcl(::fz_output *out, const ::fz_bitmap *bitmap, const ::fz_pcl_options *pcl);
  7657. /** Low-level wrapper for `::fz_write_bitmap_as_pkm()`. */
  7658. /**
  7659. Write a CMYK bitmap as a pkm.
  7660. */
  7661. FZ_FUNCTION void ll_fz_write_bitmap_as_pkm(::fz_output *out, ::fz_bitmap *bitmap);
  7662. /** Low-level wrapper for `::fz_write_bitmap_as_pwg()`. */
  7663. /**
  7664. Write a bitmap as a PWG.
  7665. */
  7666. FZ_FUNCTION void ll_fz_write_bitmap_as_pwg(::fz_output *out, const ::fz_bitmap *bitmap, const ::fz_pwg_options *pwg);
  7667. /** Low-level wrapper for `::fz_write_bitmap_as_pwg_page()`. */
  7668. /**
  7669. Write a bitmap as a PWG page.
  7670. Caller should provide a file header by calling
  7671. fz_write_pwg_file_header, but can then write several pages to
  7672. the same file.
  7673. */
  7674. FZ_FUNCTION void ll_fz_write_bitmap_as_pwg_page(::fz_output *out, const ::fz_bitmap *bitmap, const ::fz_pwg_options *pwg);
  7675. /** Low-level wrapper for `::fz_write_bits()`. */
  7676. /**
  7677. Write num_bits of data to the end of the output stream, assumed to be packed
  7678. most significant bits first.
  7679. */
  7680. FZ_FUNCTION void ll_fz_write_bits(::fz_output *out, unsigned int data, int num_bits);
  7681. /** Low-level wrapper for `::fz_write_bits_sync()`. */
  7682. /**
  7683. Sync to byte boundary after writing bits.
  7684. */
  7685. FZ_FUNCTION void ll_fz_write_bits_sync(::fz_output *out);
  7686. /** Low-level wrapper for `::fz_write_buffer()`. */
  7687. FZ_FUNCTION void ll_fz_write_buffer(::fz_output *out, ::fz_buffer *data);
  7688. /** Low-level wrapper for `::fz_write_byte()`. */
  7689. FZ_FUNCTION void ll_fz_write_byte(::fz_output *out, unsigned char x);
  7690. /** Low-level wrapper for `::fz_write_char()`. */
  7691. FZ_FUNCTION void ll_fz_write_char(::fz_output *out, char x);
  7692. /** Low-level wrapper for `::fz_write_data()`. */
  7693. /**
  7694. Write data to output.
  7695. data: Pointer to data to write.
  7696. size: Size of data to write in bytes.
  7697. */
  7698. FZ_FUNCTION void ll_fz_write_data(::fz_output *out, const void *data, size_t size);
  7699. /** Low-level wrapper for `::fz_write_document()`. */
  7700. /**
  7701. Convenience function to feed all the pages of a document to
  7702. fz_begin_page/fz_run_page/fz_end_page.
  7703. */
  7704. FZ_FUNCTION void ll_fz_write_document(::fz_document_writer *wri, ::fz_document *doc);
  7705. /** Low-level wrapper for `::fz_write_float_be()`. */
  7706. FZ_FUNCTION void ll_fz_write_float_be(::fz_output *out, float f);
  7707. /** Low-level wrapper for `::fz_write_float_le()`. */
  7708. FZ_FUNCTION void ll_fz_write_float_le(::fz_output *out, float f);
  7709. /** Low-level wrapper for `::fz_write_header()`. */
  7710. /**
  7711. Cause a band writer to write the header for
  7712. a banded image with the given properties/dimensions etc. This
  7713. also configures the bandwriter for the format of the data to be
  7714. passed in future calls.
  7715. w, h: Width and Height of the entire page.
  7716. n: Number of components (including spots and alphas).
  7717. alpha: Number of alpha components.
  7718. xres, yres: X and Y resolutions in dpi.
  7719. cs: Colorspace (NULL for bitmaps)
  7720. seps: Separation details (or NULL).
  7721. */
  7722. FZ_FUNCTION void ll_fz_write_header(::fz_band_writer *writer, int w, int h, int n, int alpha, int xres, int yres, int pagenum, ::fz_colorspace *cs, ::fz_separations *seps);
  7723. /** Low-level wrapper for `::fz_write_image_as_data_uri()`. */
  7724. /**
  7725. Write image as a data URI (for HTML and SVG output).
  7726. */
  7727. FZ_FUNCTION void ll_fz_write_image_as_data_uri(::fz_output *out, ::fz_image *image);
  7728. /** Low-level wrapper for `::fz_write_int16_be()`. */
  7729. FZ_FUNCTION void ll_fz_write_int16_be(::fz_output *out, int x);
  7730. /** Low-level wrapper for `::fz_write_int16_le()`. */
  7731. FZ_FUNCTION void ll_fz_write_int16_le(::fz_output *out, int x);
  7732. /** Low-level wrapper for `::fz_write_int32_be()`. */
  7733. /**
  7734. Write different sized data to an output stream.
  7735. */
  7736. FZ_FUNCTION void ll_fz_write_int32_be(::fz_output *out, int x);
  7737. /** Low-level wrapper for `::fz_write_int32_le()`. */
  7738. FZ_FUNCTION void ll_fz_write_int32_le(::fz_output *out, int x);
  7739. /** Low-level wrapper for `::fz_write_json()`. */
  7740. FZ_FUNCTION void ll_fz_write_json(::fz_output *out, ::fz_json *value);
  7741. /** Low-level wrapper for `::fz_write_pixmap_as_data_uri()`. */
  7742. FZ_FUNCTION void ll_fz_write_pixmap_as_data_uri(::fz_output *out, ::fz_pixmap *pixmap);
  7743. /** Low-level wrapper for `::fz_write_pixmap_as_jpeg()`. */
  7744. /**
  7745. Write a pixmap as a JPEG.
  7746. */
  7747. FZ_FUNCTION void ll_fz_write_pixmap_as_jpeg(::fz_output *out, ::fz_pixmap *pix, int quality, int invert_cmyk);
  7748. /** Low-level wrapper for `::fz_write_pixmap_as_jpx()`. */
  7749. /**
  7750. Pixmap data as JP2K with no subsampling.
  7751. quality = 100 = lossless
  7752. otherwise for a factor of x compression use 100-x. (so 80 is 1:20 compression)
  7753. */
  7754. FZ_FUNCTION void ll_fz_write_pixmap_as_jpx(::fz_output *out, ::fz_pixmap *pix, int quality);
  7755. /** Low-level wrapper for `::fz_write_pixmap_as_pam()`. */
  7756. /**
  7757. Write a pixmap as a pnm (greyscale, rgb or cmyk, with or without
  7758. alpha).
  7759. */
  7760. FZ_FUNCTION void ll_fz_write_pixmap_as_pam(::fz_output *out, ::fz_pixmap *pixmap);
  7761. /** Low-level wrapper for `::fz_write_pixmap_as_pcl()`. */
  7762. /**
  7763. Write an (RGB) pixmap as color PCL.
  7764. */
  7765. FZ_FUNCTION void ll_fz_write_pixmap_as_pcl(::fz_output *out, const ::fz_pixmap *pixmap, const ::fz_pcl_options *pcl);
  7766. /** Low-level wrapper for `::fz_write_pixmap_as_pclm()`. */
  7767. /**
  7768. Write a (Greyscale or RGB) pixmap as pclm.
  7769. */
  7770. FZ_FUNCTION void ll_fz_write_pixmap_as_pclm(::fz_output *out, const ::fz_pixmap *pixmap, const ::fz_pclm_options *options);
  7771. /** Low-level wrapper for `::fz_write_pixmap_as_pdfocr()`. */
  7772. /**
  7773. Write a (Greyscale or RGB) pixmap as pdfocr.
  7774. */
  7775. FZ_FUNCTION void ll_fz_write_pixmap_as_pdfocr(::fz_output *out, const ::fz_pixmap *pixmap, const ::fz_pdfocr_options *options);
  7776. /** Low-level wrapper for `::fz_write_pixmap_as_png()`. */
  7777. /**
  7778. Write a (Greyscale or RGB) pixmap as a png.
  7779. */
  7780. FZ_FUNCTION void ll_fz_write_pixmap_as_png(::fz_output *out, const ::fz_pixmap *pixmap);
  7781. /** Low-level wrapper for `::fz_write_pixmap_as_pnm()`. */
  7782. /**
  7783. Write a pixmap as a pnm (greyscale or rgb, no alpha).
  7784. */
  7785. FZ_FUNCTION void ll_fz_write_pixmap_as_pnm(::fz_output *out, ::fz_pixmap *pixmap);
  7786. /** Low-level wrapper for `::fz_write_pixmap_as_ps()`. */
  7787. /**
  7788. Write a (gray, rgb, or cmyk, no alpha) pixmap out as postscript.
  7789. */
  7790. FZ_FUNCTION void ll_fz_write_pixmap_as_ps(::fz_output *out, const ::fz_pixmap *pixmap);
  7791. /** Low-level wrapper for `::fz_write_pixmap_as_psd()`. */
  7792. /**
  7793. Write a pixmap as a PSD file.
  7794. */
  7795. FZ_FUNCTION void ll_fz_write_pixmap_as_psd(::fz_output *out, const ::fz_pixmap *pixmap);
  7796. /** Low-level wrapper for `::fz_write_pixmap_as_pwg()`. */
  7797. /**
  7798. Write a pixmap as a PWG.
  7799. */
  7800. FZ_FUNCTION void ll_fz_write_pixmap_as_pwg(::fz_output *out, const ::fz_pixmap *pixmap, const ::fz_pwg_options *pwg);
  7801. /** Low-level wrapper for `::fz_write_pixmap_as_pwg_page()`. */
  7802. /**
  7803. Write a pixmap as a PWG page.
  7804. Caller should provide a file header by calling
  7805. fz_write_pwg_file_header, but can then write several pages to
  7806. the same file.
  7807. */
  7808. FZ_FUNCTION void ll_fz_write_pixmap_as_pwg_page(::fz_output *out, const ::fz_pixmap *pixmap, const ::fz_pwg_options *pwg);
  7809. /** Low-level wrapper for `::fz_write_ps_file_header()`. */
  7810. /**
  7811. Write the file level header for ps band writer output.
  7812. */
  7813. FZ_FUNCTION void ll_fz_write_ps_file_header(::fz_output *out);
  7814. /** Low-level wrapper for `::fz_write_ps_file_trailer()`. */
  7815. /**
  7816. Write the file level trailer for ps band writer output.
  7817. */
  7818. FZ_FUNCTION void ll_fz_write_ps_file_trailer(::fz_output *out, int pages);
  7819. /** Low-level wrapper for `::fz_write_pwg_file_header()`. */
  7820. /**
  7821. Output the file header to a pwg stream, ready for pages to follow it.
  7822. */
  7823. FZ_FUNCTION void ll_fz_write_pwg_file_header(::fz_output *out);
  7824. /** Low-level wrapper for `::fz_write_rune()`. */
  7825. /**
  7826. Write a UTF-8 encoded unicode character.
  7827. */
  7828. FZ_FUNCTION void ll_fz_write_rune(::fz_output *out, int rune);
  7829. /** Low-level wrapper for `::fz_write_stabilized_story()`. */
  7830. FZ_FUNCTION void ll_fz_write_stabilized_story(::fz_document_writer *writer, const char *user_css, float em, ::fz_write_story_contentfn contentfn, void *contentfn_ref, ::fz_write_story_rectfn rectfn, void *rectfn_ref, ::fz_write_story_pagefn pagefn, void *pagefn_ref, ::fz_archive *dir);
  7831. /** Low-level wrapper for `::fz_write_story()`. */
  7832. FZ_FUNCTION void ll_fz_write_story(::fz_document_writer *writer, ::fz_story *story, ::fz_write_story_rectfn rectfn, void *rectfn_ref, ::fz_write_story_positionfn positionfn, void *positionfn_ref, ::fz_write_story_pagefn pagefn, void *pagefn_ref);
  7833. /** Low-level wrapper for `::fz_write_stream()`. */
  7834. /**
  7835. Copy the stream contents to the output.
  7836. */
  7837. FZ_FUNCTION void ll_fz_write_stream(::fz_output *out, ::fz_stream *in);
  7838. /** Low-level wrapper for `::fz_write_string()`. */
  7839. /**
  7840. Write a string. Does not write zero terminator.
  7841. */
  7842. FZ_FUNCTION void ll_fz_write_string(::fz_output *out, const char *s);
  7843. /** Low-level wrapper for `::fz_write_uint16_be()`. */
  7844. FZ_FUNCTION void ll_fz_write_uint16_be(::fz_output *out, unsigned int x);
  7845. /** Low-level wrapper for `::fz_write_uint16_le()`. */
  7846. FZ_FUNCTION void ll_fz_write_uint16_le(::fz_output *out, unsigned int x);
  7847. /** Low-level wrapper for `::fz_write_uint32_be()`. */
  7848. FZ_FUNCTION void ll_fz_write_uint32_be(::fz_output *out, unsigned int x);
  7849. /** Low-level wrapper for `::fz_write_uint32_le()`. */
  7850. FZ_FUNCTION void ll_fz_write_uint32_le(::fz_output *out, unsigned int x);
  7851. /** Low-level wrapper for `::fz_write_vprintf()`. */
  7852. /**
  7853. va_list version of fz_write_printf.
  7854. */
  7855. FZ_FUNCTION void ll_fz_write_vprintf(::fz_output *out, const char *fmt, va_list ap);
  7856. /** Low-level wrapper for `::fz_write_xml()`. */
  7857. /**
  7858. Write our xml structure out to an xml stream.
  7859. Properly formatted XML is only allowed to have a single top-level node
  7860. under which everything must sit. Our structures allow for multiple
  7861. top level nodes. If required, we will output an extra 'ROOT' node
  7862. at the top so that the xml is well-formed.
  7863. If 'indented' is non-zero then additional whitespace will be added to
  7864. make the XML easier to read in a text editor. It will NOT be properly
  7865. compliant.
  7866. */
  7867. FZ_FUNCTION void ll_fz_write_xml(::fz_xml *root, ::fz_output *out, int indented);
  7868. /** Low-level wrapper for `::fz_write_zip_entry()`. */
  7869. /**
  7870. Given a buffer of data, (optionally) compress it, and add it to
  7871. the zip file with the given name.
  7872. */
  7873. FZ_FUNCTION void ll_fz_write_zip_entry(::fz_zip_writer *zip, const char *name, ::fz_buffer *buf, int compress);
  7874. /** Low-level wrapper for `::fz_xml_add_att()`. */
  7875. /**
  7876. Add an attribute to an XML node.
  7877. */
  7878. FZ_FUNCTION void ll_fz_xml_add_att(::fz_pool *pool, ::fz_xml *node, const char *key, const char *val);
  7879. /** Low-level wrapper for `::fz_xml_att()`. */
  7880. /**
  7881. Return the value of an attribute of an XML node.
  7882. NULL if the attribute doesn't exist.
  7883. */
  7884. FZ_FUNCTION char *ll_fz_xml_att(::fz_xml *item, const char *att);
  7885. /** Low-level wrapper for `::fz_xml_att_alt()`. */
  7886. /**
  7887. Return the value of an attribute of an XML node.
  7888. If the first attribute doesn't exist, try the second.
  7889. NULL if neither attribute exists.
  7890. */
  7891. FZ_FUNCTION char *ll_fz_xml_att_alt(::fz_xml *item, const char *one, const char *two);
  7892. /** Low-level wrapper for `::fz_xml_att_eq()`. */
  7893. /**
  7894. Check for a matching attribute on an XML node.
  7895. If the node has the requested attribute (name), and the value
  7896. matches (match) then return 1. Otherwise, 0.
  7897. */
  7898. FZ_FUNCTION int ll_fz_xml_att_eq(::fz_xml *item, const char *name, const char *match);
  7899. /** Low-level wrapper for `::fz_xml_down()`. */
  7900. /**
  7901. Return first child of XML node.
  7902. */
  7903. FZ_FUNCTION ::fz_xml *ll_fz_xml_down(::fz_xml *item);
  7904. /** Low-level wrapper for `::fz_xml_find()`. */
  7905. /**
  7906. Search the siblings of XML nodes starting with item looking for
  7907. the first with the given tag.
  7908. Return NULL if none found.
  7909. */
  7910. FZ_FUNCTION ::fz_xml *ll_fz_xml_find(::fz_xml *item, const char *tag);
  7911. /** Low-level wrapper for `::fz_xml_find_dfs()`. */
  7912. /**
  7913. Perform a depth first search from item, returning the first
  7914. child that matches the given tag (or any tag if tag is NULL),
  7915. with the given attribute (if att is non NULL), that matches
  7916. match (if match is non NULL).
  7917. */
  7918. FZ_FUNCTION ::fz_xml *ll_fz_xml_find_dfs(::fz_xml *item, const char *tag, const char *att, const char *match);
  7919. /** Low-level wrapper for `::fz_xml_find_dfs_top()`. */
  7920. /**
  7921. Perform a depth first search from item, returning the first
  7922. child that matches the given tag (or any tag if tag is NULL),
  7923. with the given attribute (if att is non NULL), that matches
  7924. match (if match is non NULL). The search stops if it ever
  7925. reaches the top of the tree, or the declared 'top' item.
  7926. */
  7927. FZ_FUNCTION ::fz_xml *ll_fz_xml_find_dfs_top(::fz_xml *item, const char *tag, const char *att, const char *match, ::fz_xml *top);
  7928. /** Low-level wrapper for `::fz_xml_find_down()`. */
  7929. /**
  7930. Search the siblings of XML nodes starting with the first child
  7931. of item looking for the first with the given tag.
  7932. Return NULL if none found.
  7933. */
  7934. FZ_FUNCTION ::fz_xml *ll_fz_xml_find_down(::fz_xml *item, const char *tag);
  7935. /** Low-level wrapper for `::fz_xml_find_down_match()`. */
  7936. /**
  7937. Search the siblings of XML nodes starting with the first child
  7938. of item looking for the first with the given tag (or any tag if
  7939. tag is NULL), and with a matching attribute.
  7940. Return NULL if none found.
  7941. */
  7942. FZ_FUNCTION ::fz_xml *ll_fz_xml_find_down_match(::fz_xml *item, const char *tag, const char *att, const char *match);
  7943. /** Low-level wrapper for `::fz_xml_find_match()`. */
  7944. /**
  7945. Search the siblings of XML nodes starting with item looking for
  7946. the first with the given tag (or any tag if tag is NULL), and
  7947. with a matching attribute.
  7948. Return NULL if none found.
  7949. */
  7950. FZ_FUNCTION ::fz_xml *ll_fz_xml_find_match(::fz_xml *item, const char *tag, const char *att, const char *match);
  7951. /** Low-level wrapper for `::fz_xml_find_next()`. */
  7952. /**
  7953. Search the siblings of XML nodes starting with the first sibling
  7954. of item looking for the first with the given tag.
  7955. Return NULL if none found.
  7956. */
  7957. FZ_FUNCTION ::fz_xml *ll_fz_xml_find_next(::fz_xml *item, const char *tag);
  7958. /** Low-level wrapper for `::fz_xml_find_next_dfs()`. */
  7959. /**
  7960. Perform a depth first search onwards from item, returning the first
  7961. child that matches the given tag (or any tag if tag is NULL),
  7962. with the given attribute (if att is non NULL), that matches
  7963. match (if match is non NULL).
  7964. */
  7965. FZ_FUNCTION ::fz_xml *ll_fz_xml_find_next_dfs(::fz_xml *item, const char *tag, const char *att, const char *match);
  7966. /** Low-level wrapper for `::fz_xml_find_next_dfs_top()`. */
  7967. /**
  7968. Perform a depth first search onwards from item, returning the first
  7969. child that matches the given tag (or any tag if tag is NULL),
  7970. with the given attribute (if att is non NULL), that matches
  7971. match (if match is non NULL). The search stops if it ever reaches
  7972. the top of the tree, or the declared 'top' item.
  7973. */
  7974. FZ_FUNCTION ::fz_xml *ll_fz_xml_find_next_dfs_top(::fz_xml *item, const char *tag, const char *att, const char *match, ::fz_xml *top);
  7975. /** Low-level wrapper for `::fz_xml_find_next_match()`. */
  7976. /**
  7977. Search the siblings of XML nodes starting with the first sibling
  7978. of item looking for the first with the given tag (or any tag if tag
  7979. is NULL), and with a matching attribute.
  7980. Return NULL if none found.
  7981. */
  7982. FZ_FUNCTION ::fz_xml *ll_fz_xml_find_next_match(::fz_xml *item, const char *tag, const char *att, const char *match);
  7983. /** Low-level wrapper for `::fz_xml_is_tag()`. */
  7984. /**
  7985. Return true if the tag name matches.
  7986. */
  7987. FZ_FUNCTION int ll_fz_xml_is_tag(::fz_xml *item, const char *name);
  7988. /** Low-level wrapper for `::fz_xml_next()`. */
  7989. /**
  7990. Return next sibling of XML node.
  7991. */
  7992. FZ_FUNCTION ::fz_xml *ll_fz_xml_next(::fz_xml *item);
  7993. /** Low-level wrapper for `::fz_xml_prev()`. */
  7994. /**
  7995. Return previous sibling of XML node.
  7996. */
  7997. FZ_FUNCTION ::fz_xml *ll_fz_xml_prev(::fz_xml *item);
  7998. /** Low-level wrapper for `::fz_xml_root()`. */
  7999. /**
  8000. Return the topmost XML node of a document.
  8001. */
  8002. FZ_FUNCTION ::fz_xml *ll_fz_xml_root(::fz_xml_doc *xml);
  8003. /** Low-level wrapper for `::fz_xml_tag()`. */
  8004. /**
  8005. Return tag of XML node. Return NULL for text nodes.
  8006. */
  8007. FZ_FUNCTION char *ll_fz_xml_tag(::fz_xml *item);
  8008. /** Low-level wrapper for `::fz_xml_text()`. */
  8009. /**
  8010. Return the text content of an XML node.
  8011. Return NULL if the node is a tag.
  8012. */
  8013. FZ_FUNCTION char *ll_fz_xml_text(::fz_xml *item);
  8014. /** Low-level wrapper for `::fz_xml_up()`. */
  8015. /**
  8016. Return parent of XML node.
  8017. */
  8018. FZ_FUNCTION ::fz_xml *ll_fz_xml_up(::fz_xml *item);
  8019. /** Low-level wrapper for `::pdf_abandon_operation()`. */
  8020. FZ_FUNCTION void ll_pdf_abandon_operation(::pdf_document *doc);
  8021. /** Low-level wrapper for `::pdf_access_alert_event()`. */
  8022. FZ_FUNCTION ::pdf_alert_event *ll_pdf_access_alert_event(::pdf_doc_event *evt);
  8023. /** Low-level wrapper for `::pdf_access_exec_menu_item_event()`. */
  8024. FZ_FUNCTION const char *ll_pdf_access_exec_menu_item_event(::pdf_doc_event *evt);
  8025. /** Low-level wrapper for `::pdf_access_launch_url_event()`. */
  8026. FZ_FUNCTION ::pdf_launch_url_event *ll_pdf_access_launch_url_event(::pdf_doc_event *evt);
  8027. /** Low-level wrapper for `::pdf_access_mail_doc_event()`. */
  8028. FZ_FUNCTION ::pdf_mail_doc_event *ll_pdf_access_mail_doc_event(::pdf_doc_event *evt);
  8029. /** Low-level wrapper for `::pdf_add_annot_border_dash_item()`. */
  8030. FZ_FUNCTION void ll_pdf_add_annot_border_dash_item(::pdf_annot *annot, float length);
  8031. /** Low-level wrapper for `::pdf_add_annot_ink_list()`. */
  8032. FZ_FUNCTION void ll_pdf_add_annot_ink_list(::pdf_annot *annot, int n, ::fz_point stroke[]);
  8033. /** Low-level wrapper for `::pdf_add_annot_ink_list_stroke()`. */
  8034. FZ_FUNCTION void ll_pdf_add_annot_ink_list_stroke(::pdf_annot *annot);
  8035. /** Low-level wrapper for `::pdf_add_annot_ink_list_stroke_vertex()`. */
  8036. FZ_FUNCTION void ll_pdf_add_annot_ink_list_stroke_vertex(::pdf_annot *annot, ::fz_point p);
  8037. /** Low-level wrapper for `::pdf_add_annot_quad_point()`. */
  8038. FZ_FUNCTION void ll_pdf_add_annot_quad_point(::pdf_annot *annot, ::fz_quad quad);
  8039. /** Low-level wrapper for `::pdf_add_annot_vertex()`. */
  8040. FZ_FUNCTION void ll_pdf_add_annot_vertex(::pdf_annot *annot, ::fz_point p);
  8041. /** Low-level wrapper for `::pdf_add_cid_font()`. */
  8042. FZ_FUNCTION ::pdf_obj *ll_pdf_add_cid_font(::pdf_document *doc, ::fz_font *font);
  8043. /** Low-level wrapper for `::pdf_add_cjk_font()`. */
  8044. FZ_FUNCTION ::pdf_obj *ll_pdf_add_cjk_font(::pdf_document *doc, ::fz_font *font, int script, int wmode, int serif);
  8045. /** Low-level wrapper for `::pdf_add_codespace()`. */
  8046. FZ_FUNCTION void ll_pdf_add_codespace(::pdf_cmap *cmap, unsigned int low, unsigned int high, size_t n);
  8047. /** Low-level wrapper for `::pdf_add_colorspace()`. */
  8048. FZ_FUNCTION ::pdf_obj *ll_pdf_add_colorspace(::pdf_document *doc, ::fz_colorspace *cs);
  8049. /** Low-level wrapper for `::pdf_add_embedded_file()`. */
  8050. FZ_FUNCTION ::pdf_obj *ll_pdf_add_embedded_file(::pdf_document *doc, const char *filename, const char *mimetype, ::fz_buffer *contents, int64_t created, int64_t modified, int add_checksum);
  8051. /** Low-level wrapper for `::pdf_add_hmtx()`. */
  8052. FZ_FUNCTION void ll_pdf_add_hmtx(::pdf_font_desc *font, int lo, int hi, int w);
  8053. /** Low-level wrapper for `::pdf_add_image()`. */
  8054. FZ_FUNCTION ::pdf_obj *ll_pdf_add_image(::pdf_document *doc, ::fz_image *image);
  8055. /** Low-level wrapper for `::pdf_add_journal_fragment()`. */
  8056. FZ_FUNCTION void ll_pdf_add_journal_fragment(::pdf_document *doc, int parent, ::pdf_obj *copy, ::fz_buffer *copy_stream, int newobj);
  8057. /** Low-level wrapper for `::pdf_add_new_array()`. */
  8058. FZ_FUNCTION ::pdf_obj *ll_pdf_add_new_array(::pdf_document *doc, int initial);
  8059. /** Low-level wrapper for `::pdf_add_new_dict()`. */
  8060. FZ_FUNCTION ::pdf_obj *ll_pdf_add_new_dict(::pdf_document *doc, int initial);
  8061. /** Low-level wrapper for `::pdf_add_object()`. */
  8062. FZ_FUNCTION ::pdf_obj *ll_pdf_add_object(::pdf_document *doc, ::pdf_obj *obj);
  8063. /** Low-level wrapper for `::pdf_add_object_drop()`. */
  8064. FZ_FUNCTION ::pdf_obj *ll_pdf_add_object_drop(::pdf_document *doc, ::pdf_obj *obj);
  8065. /** Low-level wrapper for `::pdf_add_page()`. */
  8066. FZ_FUNCTION ::pdf_obj *ll_pdf_add_page(::pdf_document *doc, ::fz_rect mediabox, int rotate, ::pdf_obj *resources, ::fz_buffer *contents);
  8067. /** Low-level wrapper for `::pdf_add_simple_font()`. */
  8068. FZ_FUNCTION ::pdf_obj *ll_pdf_add_simple_font(::pdf_document *doc, ::fz_font *font, int encoding);
  8069. /** Low-level wrapper for `::pdf_add_stream()`. */
  8070. FZ_FUNCTION ::pdf_obj *ll_pdf_add_stream(::pdf_document *doc, ::fz_buffer *buf, ::pdf_obj *obj, int compressed);
  8071. /** Low-level wrapper for `::pdf_add_substitute_font()`. */
  8072. FZ_FUNCTION ::pdf_obj *ll_pdf_add_substitute_font(::pdf_document *doc, ::fz_font *font);
  8073. /** Low-level wrapper for `::pdf_add_vmtx()`. */
  8074. FZ_FUNCTION void ll_pdf_add_vmtx(::pdf_font_desc *font, int lo, int hi, int x, int y, int w);
  8075. /** Low-level wrapper for `::pdf_annot_MK_BC()`.
  8076. This function has out-params. Python/C# wrappers look like:
  8077. `ll_pdf_annot_MK_BC(::pdf_annot *annot, float color[4])` => int n
  8078. */
  8079. FZ_FUNCTION void ll_pdf_annot_MK_BC(::pdf_annot *annot, int *n, float color[4]);
  8080. /** Low-level wrapper for `::pdf_annot_MK_BC_rgb()`. */
  8081. FZ_FUNCTION int ll_pdf_annot_MK_BC_rgb(::pdf_annot *annot, float rgb[3]);
  8082. /** Low-level wrapper for `::pdf_annot_MK_BG()`.
  8083. This function has out-params. Python/C# wrappers look like:
  8084. `ll_pdf_annot_MK_BG(::pdf_annot *annot, float color[4])` => int n
  8085. */
  8086. FZ_FUNCTION void ll_pdf_annot_MK_BG(::pdf_annot *annot, int *n, float color[4]);
  8087. /** Low-level wrapper for `::pdf_annot_MK_BG_rgb()`. */
  8088. FZ_FUNCTION int ll_pdf_annot_MK_BG_rgb(::pdf_annot *annot, float rgb[3]);
  8089. /** Low-level wrapper for `::pdf_annot_active()`. */
  8090. FZ_FUNCTION int ll_pdf_annot_active(::pdf_annot *annot);
  8091. /** Low-level wrapper for `::pdf_annot_ap()`. */
  8092. FZ_FUNCTION ::pdf_obj *ll_pdf_annot_ap(::pdf_annot *annot);
  8093. /** Low-level wrapper for `::pdf_annot_author()`. */
  8094. FZ_FUNCTION const char *ll_pdf_annot_author(::pdf_annot *annot);
  8095. /** Low-level wrapper for `::pdf_annot_border()`. */
  8096. FZ_FUNCTION float ll_pdf_annot_border(::pdf_annot *annot);
  8097. /** Low-level wrapper for `::pdf_annot_border_dash_count()`. */
  8098. FZ_FUNCTION int ll_pdf_annot_border_dash_count(::pdf_annot *annot);
  8099. /** Low-level wrapper for `::pdf_annot_border_dash_item()`. */
  8100. FZ_FUNCTION float ll_pdf_annot_border_dash_item(::pdf_annot *annot, int i);
  8101. /** Low-level wrapper for `::pdf_annot_border_effect()`. */
  8102. FZ_FUNCTION enum pdf_border_effect ll_pdf_annot_border_effect(::pdf_annot *annot);
  8103. /** Low-level wrapper for `::pdf_annot_border_effect_intensity()`. */
  8104. FZ_FUNCTION float ll_pdf_annot_border_effect_intensity(::pdf_annot *annot);
  8105. /** Low-level wrapper for `::pdf_annot_border_style()`. */
  8106. FZ_FUNCTION enum pdf_border_style ll_pdf_annot_border_style(::pdf_annot *annot);
  8107. /** Low-level wrapper for `::pdf_annot_border_width()`. */
  8108. FZ_FUNCTION float ll_pdf_annot_border_width(::pdf_annot *annot);
  8109. /** Low-level wrapper for `::pdf_annot_callout_line()`.
  8110. This function has out-params. Python/C# wrappers look like:
  8111. `ll_pdf_annot_callout_line(::pdf_annot *annot, ::fz_point callout[3])` => int n
  8112. */
  8113. FZ_FUNCTION void ll_pdf_annot_callout_line(::pdf_annot *annot, ::fz_point callout[3], int *n);
  8114. /** Low-level wrapper for `::pdf_annot_callout_point()`. */
  8115. FZ_FUNCTION ::fz_point ll_pdf_annot_callout_point(::pdf_annot *annot);
  8116. /** Low-level wrapper for `::pdf_annot_callout_style()`. */
  8117. FZ_FUNCTION enum pdf_line_ending ll_pdf_annot_callout_style(::pdf_annot *annot);
  8118. /** Low-level wrapper for `::pdf_annot_color()`.
  8119. This function has out-params. Python/C# wrappers look like:
  8120. `ll_pdf_annot_color(::pdf_annot *annot, float color[4])` => int n
  8121. */
  8122. FZ_FUNCTION void ll_pdf_annot_color(::pdf_annot *annot, int *n, float color[4]);
  8123. /** Low-level wrapper for `::pdf_annot_contents()`. */
  8124. FZ_FUNCTION const char *ll_pdf_annot_contents(::pdf_annot *annot);
  8125. /** Low-level wrapper for `::pdf_annot_creation_date()`. */
  8126. FZ_FUNCTION int64_t ll_pdf_annot_creation_date(::pdf_annot *annot);
  8127. /** Low-level wrapper for `::pdf_annot_default_appearance()`.
  8128. This function has out-params. Python/C# wrappers look like:
  8129. `ll_pdf_annot_default_appearance(::pdf_annot *annot, float color[4])` => `(const char *font, float size, int n)`
  8130. */
  8131. FZ_FUNCTION void ll_pdf_annot_default_appearance(::pdf_annot *annot, const char **font, float *size, int *n, float color[4]);
  8132. /** Low-level wrapper for `::pdf_annot_default_appearance_unmapped()`.
  8133. This function has out-params. Python/C# wrappers look like:
  8134. `ll_pdf_annot_default_appearance_unmapped(::pdf_annot *annot, char *font_name, int font_name_len, float color[4])` => `(float size, int n)`
  8135. */
  8136. FZ_FUNCTION void ll_pdf_annot_default_appearance_unmapped(::pdf_annot *annot, char *font_name, int font_name_len, float *size, int *n, float color[4]);
  8137. /** Low-level wrapper for `::pdf_annot_ensure_local_xref()`. */
  8138. FZ_FUNCTION void ll_pdf_annot_ensure_local_xref(::pdf_annot *annot);
  8139. /** Low-level wrapper for `::pdf_annot_event_blur()`. */
  8140. FZ_FUNCTION void ll_pdf_annot_event_blur(::pdf_annot *annot);
  8141. /** Low-level wrapper for `::pdf_annot_event_down()`. */
  8142. FZ_FUNCTION void ll_pdf_annot_event_down(::pdf_annot *annot);
  8143. /** Low-level wrapper for `::pdf_annot_event_enter()`. */
  8144. FZ_FUNCTION void ll_pdf_annot_event_enter(::pdf_annot *annot);
  8145. /** Low-level wrapper for `::pdf_annot_event_exit()`. */
  8146. FZ_FUNCTION void ll_pdf_annot_event_exit(::pdf_annot *annot);
  8147. /** Low-level wrapper for `::pdf_annot_event_focus()`. */
  8148. FZ_FUNCTION void ll_pdf_annot_event_focus(::pdf_annot *annot);
  8149. /** Low-level wrapper for `::pdf_annot_event_page_close()`. */
  8150. FZ_FUNCTION void ll_pdf_annot_event_page_close(::pdf_annot *annot);
  8151. /** Low-level wrapper for `::pdf_annot_event_page_invisible()`. */
  8152. FZ_FUNCTION void ll_pdf_annot_event_page_invisible(::pdf_annot *annot);
  8153. /** Low-level wrapper for `::pdf_annot_event_page_open()`. */
  8154. FZ_FUNCTION void ll_pdf_annot_event_page_open(::pdf_annot *annot);
  8155. /** Low-level wrapper for `::pdf_annot_event_page_visible()`. */
  8156. FZ_FUNCTION void ll_pdf_annot_event_page_visible(::pdf_annot *annot);
  8157. /** Low-level wrapper for `::pdf_annot_event_up()`. */
  8158. FZ_FUNCTION void ll_pdf_annot_event_up(::pdf_annot *annot);
  8159. /** Low-level wrapper for `::pdf_annot_field_event_keystroke()`. */
  8160. FZ_FUNCTION int ll_pdf_annot_field_event_keystroke(::pdf_document *doc, ::pdf_annot *annot, ::pdf_keystroke_event *evt);
  8161. /** Low-level wrapper for `::pdf_annot_field_flags()`. */
  8162. FZ_FUNCTION int ll_pdf_annot_field_flags(::pdf_annot *annot);
  8163. /** Low-level wrapper for `::pdf_annot_field_label()`. */
  8164. FZ_FUNCTION const char *ll_pdf_annot_field_label(::pdf_annot *widget);
  8165. /** Low-level wrapper for `::pdf_annot_field_value()`. */
  8166. FZ_FUNCTION const char *ll_pdf_annot_field_value(::pdf_annot *annot);
  8167. /** Low-level wrapper for `::pdf_annot_filespec()`. */
  8168. FZ_FUNCTION ::pdf_obj *ll_pdf_annot_filespec(::pdf_annot *annot);
  8169. /** Low-level wrapper for `::pdf_annot_flags()`. */
  8170. FZ_FUNCTION int ll_pdf_annot_flags(::pdf_annot *annot);
  8171. /** Low-level wrapper for `::pdf_annot_has_author()`. */
  8172. FZ_FUNCTION int ll_pdf_annot_has_author(::pdf_annot *annot);
  8173. /** Low-level wrapper for `::pdf_annot_has_border()`. */
  8174. FZ_FUNCTION int ll_pdf_annot_has_border(::pdf_annot *annot);
  8175. /** Low-level wrapper for `::pdf_annot_has_border_effect()`. */
  8176. FZ_FUNCTION int ll_pdf_annot_has_border_effect(::pdf_annot *annot);
  8177. /** Low-level wrapper for `::pdf_annot_has_callout()`. */
  8178. FZ_FUNCTION int ll_pdf_annot_has_callout(::pdf_annot *annot);
  8179. /** Low-level wrapper for `::pdf_annot_has_default_appearance()`. */
  8180. FZ_FUNCTION int ll_pdf_annot_has_default_appearance(::pdf_annot *annot);
  8181. /** Low-level wrapper for `::pdf_annot_has_filespec()`. */
  8182. FZ_FUNCTION int ll_pdf_annot_has_filespec(::pdf_annot *annot);
  8183. /** Low-level wrapper for `::pdf_annot_has_icon_name()`. */
  8184. FZ_FUNCTION int ll_pdf_annot_has_icon_name(::pdf_annot *annot);
  8185. /** Low-level wrapper for `::pdf_annot_has_ink_list()`. */
  8186. FZ_FUNCTION int ll_pdf_annot_has_ink_list(::pdf_annot *annot);
  8187. /** Low-level wrapper for `::pdf_annot_has_intent()`. */
  8188. FZ_FUNCTION int ll_pdf_annot_has_intent(::pdf_annot *annot);
  8189. /** Low-level wrapper for `::pdf_annot_has_interior_color()`. */
  8190. FZ_FUNCTION int ll_pdf_annot_has_interior_color(::pdf_annot *annot);
  8191. /** Low-level wrapper for `::pdf_annot_has_line()`. */
  8192. FZ_FUNCTION int ll_pdf_annot_has_line(::pdf_annot *annot);
  8193. /** Low-level wrapper for `::pdf_annot_has_line_ending_styles()`. */
  8194. FZ_FUNCTION int ll_pdf_annot_has_line_ending_styles(::pdf_annot *annot);
  8195. /** Low-level wrapper for `::pdf_annot_has_open()`. */
  8196. FZ_FUNCTION int ll_pdf_annot_has_open(::pdf_annot *annot);
  8197. /** Low-level wrapper for `::pdf_annot_has_popup()`. */
  8198. FZ_FUNCTION int ll_pdf_annot_has_popup(::pdf_annot *annot);
  8199. /** Low-level wrapper for `::pdf_annot_has_quad_points()`. */
  8200. FZ_FUNCTION int ll_pdf_annot_has_quad_points(::pdf_annot *annot);
  8201. /** Low-level wrapper for `::pdf_annot_has_quadding()`. */
  8202. FZ_FUNCTION int ll_pdf_annot_has_quadding(::pdf_annot *annot);
  8203. /** Low-level wrapper for `::pdf_annot_has_rect()`. */
  8204. FZ_FUNCTION int ll_pdf_annot_has_rect(::pdf_annot *annot);
  8205. /** Low-level wrapper for `::pdf_annot_has_rich_contents()`. */
  8206. FZ_FUNCTION int ll_pdf_annot_has_rich_contents(::pdf_annot *annot);
  8207. /** Low-level wrapper for `::pdf_annot_has_rich_defaults()`. */
  8208. FZ_FUNCTION int ll_pdf_annot_has_rich_defaults(::pdf_annot *annot);
  8209. /** Low-level wrapper for `::pdf_annot_has_vertices()`. */
  8210. FZ_FUNCTION int ll_pdf_annot_has_vertices(::pdf_annot *annot);
  8211. /** Low-level wrapper for `::pdf_annot_hidden_for_editing()`. */
  8212. FZ_FUNCTION int ll_pdf_annot_hidden_for_editing(::pdf_annot *annot);
  8213. /** Low-level wrapper for `::pdf_annot_hot()`. */
  8214. FZ_FUNCTION int ll_pdf_annot_hot(::pdf_annot *annot);
  8215. /** Low-level wrapper for `::pdf_annot_icon_name()`. */
  8216. FZ_FUNCTION const char *ll_pdf_annot_icon_name(::pdf_annot *annot);
  8217. /** Low-level wrapper for `::pdf_annot_ink_list_count()`. */
  8218. FZ_FUNCTION int ll_pdf_annot_ink_list_count(::pdf_annot *annot);
  8219. /** Low-level wrapper for `::pdf_annot_ink_list_stroke_count()`. */
  8220. FZ_FUNCTION int ll_pdf_annot_ink_list_stroke_count(::pdf_annot *annot, int i);
  8221. /** Low-level wrapper for `::pdf_annot_ink_list_stroke_vertex()`. */
  8222. FZ_FUNCTION ::fz_point ll_pdf_annot_ink_list_stroke_vertex(::pdf_annot *annot, int i, int k);
  8223. /** Low-level wrapper for `::pdf_annot_intent()`. */
  8224. FZ_FUNCTION enum pdf_intent ll_pdf_annot_intent(::pdf_annot *annot);
  8225. /** Low-level wrapper for `::pdf_annot_interior_color()`.
  8226. This function has out-params. Python/C# wrappers look like:
  8227. `ll_pdf_annot_interior_color(::pdf_annot *annot, float color[4])` => int n
  8228. */
  8229. FZ_FUNCTION void ll_pdf_annot_interior_color(::pdf_annot *annot, int *n, float color[4]);
  8230. /** Low-level wrapper for `::pdf_annot_is_open()`. */
  8231. FZ_FUNCTION int ll_pdf_annot_is_open(::pdf_annot *annot);
  8232. /** Low-level wrapper for `::pdf_annot_is_standard_stamp()`. */
  8233. FZ_FUNCTION int ll_pdf_annot_is_standard_stamp(::pdf_annot *annot);
  8234. /** Low-level wrapper for `::pdf_annot_language()`. */
  8235. FZ_FUNCTION ::fz_text_language ll_pdf_annot_language(::pdf_annot *annot);
  8236. /** Low-level wrapper for `::pdf_annot_line()`. */
  8237. FZ_FUNCTION void ll_pdf_annot_line(::pdf_annot *annot, ::fz_point *a, ::fz_point *b);
  8238. /** Low-level wrapper for `::pdf_annot_line_caption()`. */
  8239. FZ_FUNCTION int ll_pdf_annot_line_caption(::pdf_annot *annot);
  8240. /** Low-level wrapper for `::pdf_annot_line_caption_offset()`. */
  8241. FZ_FUNCTION ::fz_point ll_pdf_annot_line_caption_offset(::pdf_annot *annot);
  8242. /** Low-level wrapper for `::pdf_annot_line_end_style()`. */
  8243. FZ_FUNCTION enum pdf_line_ending ll_pdf_annot_line_end_style(::pdf_annot *annot);
  8244. /** Low-level wrapper for `::pdf_annot_line_ending_styles()`.
  8245. This function has out-params. Python/C# wrappers look like:
  8246. `ll_pdf_annot_line_ending_styles(::pdf_annot *annot)` => `(enum pdf_line_ending start_style, enum pdf_line_ending end_style)`
  8247. */
  8248. FZ_FUNCTION void ll_pdf_annot_line_ending_styles(::pdf_annot *annot, enum pdf_line_ending *start_style, enum pdf_line_ending *end_style);
  8249. /** Low-level wrapper for `::pdf_annot_line_leader()`. */
  8250. FZ_FUNCTION float ll_pdf_annot_line_leader(::pdf_annot *annot);
  8251. /** Low-level wrapper for `::pdf_annot_line_leader_extension()`. */
  8252. FZ_FUNCTION float ll_pdf_annot_line_leader_extension(::pdf_annot *annot);
  8253. /** Low-level wrapper for `::pdf_annot_line_leader_offset()`. */
  8254. FZ_FUNCTION float ll_pdf_annot_line_leader_offset(::pdf_annot *annot);
  8255. /** Low-level wrapper for `::pdf_annot_line_start_style()`. */
  8256. FZ_FUNCTION enum pdf_line_ending ll_pdf_annot_line_start_style(::pdf_annot *annot);
  8257. /** Low-level wrapper for `::pdf_annot_modification_date()`. */
  8258. FZ_FUNCTION int64_t ll_pdf_annot_modification_date(::pdf_annot *annot);
  8259. /** Low-level wrapper for `::pdf_annot_needs_resynthesis()`. */
  8260. FZ_FUNCTION int ll_pdf_annot_needs_resynthesis(::pdf_annot *annot);
  8261. /** Low-level wrapper for `::pdf_annot_obj()`. */
  8262. FZ_FUNCTION ::pdf_obj *ll_pdf_annot_obj(::pdf_annot *annot);
  8263. /** Low-level wrapper for `::pdf_annot_opacity()`. */
  8264. FZ_FUNCTION float ll_pdf_annot_opacity(::pdf_annot *annot);
  8265. /** Low-level wrapper for `::pdf_annot_page()`. */
  8266. FZ_FUNCTION ::pdf_page *ll_pdf_annot_page(::pdf_annot *annot);
  8267. /** Low-level wrapper for `::pdf_annot_pop_and_discard_local_xref()`. */
  8268. FZ_FUNCTION void ll_pdf_annot_pop_and_discard_local_xref(::pdf_annot *annot);
  8269. /** Low-level wrapper for `::pdf_annot_pop_local_xref()`. */
  8270. FZ_FUNCTION void ll_pdf_annot_pop_local_xref(::pdf_annot *annot);
  8271. /** Low-level wrapper for `::pdf_annot_popup()`. */
  8272. FZ_FUNCTION ::fz_rect ll_pdf_annot_popup(::pdf_annot *annot);
  8273. /** Low-level wrapper for `::pdf_annot_push_local_xref()`. */
  8274. FZ_FUNCTION void ll_pdf_annot_push_local_xref(::pdf_annot *annot);
  8275. /** Low-level wrapper for `::pdf_annot_quad_point()`. */
  8276. FZ_FUNCTION ::fz_quad ll_pdf_annot_quad_point(::pdf_annot *annot, int i);
  8277. /** Low-level wrapper for `::pdf_annot_quad_point_count()`. */
  8278. FZ_FUNCTION int ll_pdf_annot_quad_point_count(::pdf_annot *annot);
  8279. /** Low-level wrapper for `::pdf_annot_quadding()`. */
  8280. FZ_FUNCTION int ll_pdf_annot_quadding(::pdf_annot *annot);
  8281. /** Low-level wrapper for `::pdf_annot_rect()`. */
  8282. FZ_FUNCTION ::fz_rect ll_pdf_annot_rect(::pdf_annot *annot);
  8283. /** Low-level wrapper for `::pdf_annot_request_resynthesis()`. */
  8284. FZ_FUNCTION void ll_pdf_annot_request_resynthesis(::pdf_annot *annot);
  8285. /** Low-level wrapper for `::pdf_annot_request_synthesis()`. */
  8286. FZ_FUNCTION void ll_pdf_annot_request_synthesis(::pdf_annot *annot);
  8287. /** Low-level wrapper for `::pdf_annot_rich_contents()`. */
  8288. FZ_FUNCTION const char *ll_pdf_annot_rich_contents(::pdf_annot *annot);
  8289. /** Low-level wrapper for `::pdf_annot_rich_defaults()`. */
  8290. FZ_FUNCTION const char *ll_pdf_annot_rich_defaults(::pdf_annot *annot);
  8291. /** Low-level wrapper for `::pdf_annot_stamp_image_obj()`. */
  8292. FZ_FUNCTION ::pdf_obj *ll_pdf_annot_stamp_image_obj(::pdf_annot *annot);
  8293. /** Low-level wrapper for `::pdf_annot_transform()`. */
  8294. FZ_FUNCTION ::fz_matrix ll_pdf_annot_transform(::pdf_annot *annot);
  8295. /** Low-level wrapper for `::pdf_annot_type()`. */
  8296. FZ_FUNCTION enum pdf_annot_type ll_pdf_annot_type(::pdf_annot *annot);
  8297. /** Low-level wrapper for `::pdf_annot_type_from_string()`. */
  8298. FZ_FUNCTION enum pdf_annot_type ll_pdf_annot_type_from_string(const char *subtype);
  8299. /** Low-level wrapper for `::pdf_annot_vertex()`. */
  8300. FZ_FUNCTION ::fz_point ll_pdf_annot_vertex(::pdf_annot *annot, int i);
  8301. /** Low-level wrapper for `::pdf_annot_vertex_count()`. */
  8302. FZ_FUNCTION int ll_pdf_annot_vertex_count(::pdf_annot *annot);
  8303. /** Low-level wrapper for `::pdf_append_explicit_dest_to_uri()`. */
  8304. FZ_FUNCTION char *ll_pdf_append_explicit_dest_to_uri(const char *url, ::fz_link_dest dest);
  8305. /** Low-level wrapper for `::pdf_append_named_dest_to_uri()`. */
  8306. FZ_FUNCTION char *ll_pdf_append_named_dest_to_uri(const char *url, const char *name);
  8307. /** Low-level wrapper for `::pdf_append_token()`. */
  8308. FZ_FUNCTION void ll_pdf_append_token(::fz_buffer *buf, int tok, ::pdf_lexbuf *lex);
  8309. /** Low-level wrapper for `::pdf_apply_redaction()`. */
  8310. FZ_FUNCTION int ll_pdf_apply_redaction(::pdf_annot *annot, ::pdf_redact_options *opts);
  8311. /** Low-level wrapper for `::pdf_array_contains()`. */
  8312. FZ_FUNCTION int ll_pdf_array_contains(::pdf_obj *array, ::pdf_obj *obj);
  8313. /** Low-level wrapper for `::pdf_array_delete()`. */
  8314. FZ_FUNCTION void ll_pdf_array_delete(::pdf_obj *array, int index);
  8315. /** Low-level wrapper for `::pdf_array_find()`. */
  8316. FZ_FUNCTION int ll_pdf_array_find(::pdf_obj *array, ::pdf_obj *obj);
  8317. /** Low-level wrapper for `::pdf_array_get()`. */
  8318. FZ_FUNCTION ::pdf_obj *ll_pdf_array_get(::pdf_obj *array, int i);
  8319. /** Low-level wrapper for `::pdf_array_get_bool()`. */
  8320. FZ_FUNCTION int ll_pdf_array_get_bool(::pdf_obj *array, int index);
  8321. /** Low-level wrapper for `::pdf_array_get_int()`. */
  8322. FZ_FUNCTION int ll_pdf_array_get_int(::pdf_obj *array, int index);
  8323. /** Low-level wrapper for `::pdf_array_get_matrix()`. */
  8324. FZ_FUNCTION ::fz_matrix ll_pdf_array_get_matrix(::pdf_obj *array, int index);
  8325. /** Low-level wrapper for `::pdf_array_get_name()`. */
  8326. FZ_FUNCTION const char *ll_pdf_array_get_name(::pdf_obj *array, int index);
  8327. /** Low-level wrapper for `::pdf_array_get_real()`. */
  8328. FZ_FUNCTION float ll_pdf_array_get_real(::pdf_obj *array, int index);
  8329. /** Low-level wrapper for `::pdf_array_get_rect()`. */
  8330. FZ_FUNCTION ::fz_rect ll_pdf_array_get_rect(::pdf_obj *array, int index);
  8331. /** Low-level wrapper for `::pdf_array_get_string()`.
  8332. This function has out-params. Python/C# wrappers look like:
  8333. `ll_pdf_array_get_string(::pdf_obj *array, int index)` => `(const char *, size_t sizep)`
  8334. */
  8335. FZ_FUNCTION const char *ll_pdf_array_get_string(::pdf_obj *array, int index, size_t *sizep);
  8336. /** Low-level wrapper for `::pdf_array_get_text_string()`. */
  8337. FZ_FUNCTION const char *ll_pdf_array_get_text_string(::pdf_obj *array, int index);
  8338. /** Low-level wrapper for `::pdf_array_insert()`. */
  8339. FZ_FUNCTION void ll_pdf_array_insert(::pdf_obj *array, ::pdf_obj *obj, int index);
  8340. /** Low-level wrapper for `::pdf_array_insert_drop()`. */
  8341. FZ_FUNCTION void ll_pdf_array_insert_drop(::pdf_obj *array, ::pdf_obj *obj, int index);
  8342. /** Low-level wrapper for `::pdf_array_len()`. */
  8343. FZ_FUNCTION int ll_pdf_array_len(::pdf_obj *array);
  8344. /** Low-level wrapper for `::pdf_array_push()`. */
  8345. FZ_FUNCTION void ll_pdf_array_push(::pdf_obj *array, ::pdf_obj *obj);
  8346. /** Low-level wrapper for `::pdf_array_push_array()`. */
  8347. FZ_FUNCTION ::pdf_obj *ll_pdf_array_push_array(::pdf_obj *array, int initial);
  8348. /** Low-level wrapper for `::pdf_array_push_bool()`. */
  8349. FZ_FUNCTION void ll_pdf_array_push_bool(::pdf_obj *array, int x);
  8350. /** Low-level wrapper for `::pdf_array_push_dict()`. */
  8351. FZ_FUNCTION ::pdf_obj *ll_pdf_array_push_dict(::pdf_obj *array, int initial);
  8352. /** Low-level wrapper for `::pdf_array_push_drop()`. */
  8353. FZ_FUNCTION void ll_pdf_array_push_drop(::pdf_obj *array, ::pdf_obj *obj);
  8354. /** Low-level wrapper for `::pdf_array_push_int()`. */
  8355. FZ_FUNCTION void ll_pdf_array_push_int(::pdf_obj *array, int64_t x);
  8356. /** Low-level wrapper for `::pdf_array_push_name()`. */
  8357. FZ_FUNCTION void ll_pdf_array_push_name(::pdf_obj *array, const char *x);
  8358. /** Low-level wrapper for `::pdf_array_push_real()`. */
  8359. FZ_FUNCTION void ll_pdf_array_push_real(::pdf_obj *array, double x);
  8360. /** Low-level wrapper for `::pdf_array_push_string()`. */
  8361. FZ_FUNCTION void ll_pdf_array_push_string(::pdf_obj *array, const char *x, size_t n);
  8362. /** Low-level wrapper for `::pdf_array_push_text_string()`. */
  8363. FZ_FUNCTION void ll_pdf_array_push_text_string(::pdf_obj *array, const char *x);
  8364. /** Low-level wrapper for `::pdf_array_put()`. */
  8365. FZ_FUNCTION void ll_pdf_array_put(::pdf_obj *array, int i, ::pdf_obj *obj);
  8366. /** Low-level wrapper for `::pdf_array_put_array()`. */
  8367. FZ_FUNCTION ::pdf_obj *ll_pdf_array_put_array(::pdf_obj *array, int i, int initial);
  8368. /** Low-level wrapper for `::pdf_array_put_bool()`. */
  8369. FZ_FUNCTION void ll_pdf_array_put_bool(::pdf_obj *array, int i, int x);
  8370. /** Low-level wrapper for `::pdf_array_put_dict()`. */
  8371. FZ_FUNCTION ::pdf_obj *ll_pdf_array_put_dict(::pdf_obj *array, int i, int initial);
  8372. /** Low-level wrapper for `::pdf_array_put_drop()`. */
  8373. FZ_FUNCTION void ll_pdf_array_put_drop(::pdf_obj *array, int i, ::pdf_obj *obj);
  8374. /** Low-level wrapper for `::pdf_array_put_int()`. */
  8375. FZ_FUNCTION void ll_pdf_array_put_int(::pdf_obj *array, int i, int64_t x);
  8376. /** Low-level wrapper for `::pdf_array_put_name()`. */
  8377. FZ_FUNCTION void ll_pdf_array_put_name(::pdf_obj *array, int i, const char *x);
  8378. /** Low-level wrapper for `::pdf_array_put_real()`. */
  8379. FZ_FUNCTION void ll_pdf_array_put_real(::pdf_obj *array, int i, double x);
  8380. /** Low-level wrapper for `::pdf_array_put_string()`. */
  8381. FZ_FUNCTION void ll_pdf_array_put_string(::pdf_obj *array, int i, const char *x, size_t n);
  8382. /** Low-level wrapper for `::pdf_array_put_text_string()`. */
  8383. FZ_FUNCTION void ll_pdf_array_put_text_string(::pdf_obj *array, int i, const char *x);
  8384. /** Low-level wrapper for `::pdf_authenticate_password()`. */
  8385. FZ_FUNCTION int ll_pdf_authenticate_password(::pdf_document *doc, const char *pw);
  8386. /** Low-level wrapper for `::pdf_bake_document()`. */
  8387. FZ_FUNCTION void ll_pdf_bake_document(::pdf_document *doc, int bake_annots, int bake_widgets);
  8388. /** Low-level wrapper for `::pdf_begin_implicit_operation()`. */
  8389. FZ_FUNCTION void ll_pdf_begin_implicit_operation(::pdf_document *doc);
  8390. /** Low-level wrapper for `::pdf_begin_operation()`. */
  8391. FZ_FUNCTION void ll_pdf_begin_operation(::pdf_document *doc, const char *operation);
  8392. /** Low-level wrapper for `::pdf_bound_annot()`. */
  8393. FZ_FUNCTION ::fz_rect ll_pdf_bound_annot(::pdf_annot *annot);
  8394. /** Low-level wrapper for `::pdf_bound_page()`. */
  8395. FZ_FUNCTION ::fz_rect ll_pdf_bound_page(::pdf_page *page, ::fz_box_type box);
  8396. /** Low-level wrapper for `::pdf_bound_widget()`. */
  8397. FZ_FUNCTION ::fz_rect ll_pdf_bound_widget(::pdf_annot *widget);
  8398. /** Low-level wrapper for `::pdf_button_field_on_state()`. */
  8399. FZ_FUNCTION ::pdf_obj *ll_pdf_button_field_on_state(::pdf_obj *field);
  8400. /** Low-level wrapper for `::pdf_cache_object()`. */
  8401. /**
  8402. Retrieve the pdf_xref_entry for a given object.
  8403. This can cause xref reorganisations (solidifications etc) due to
  8404. repairs, so all held pdf_xref_entries should be considered
  8405. invalid after this call (other than the returned one).
  8406. */
  8407. FZ_FUNCTION ::pdf_xref_entry *ll_pdf_cache_object(::pdf_document *doc, int num);
  8408. /** Low-level wrapper for `::pdf_calculate_form()`. */
  8409. FZ_FUNCTION void ll_pdf_calculate_form(::pdf_document *doc);
  8410. /** Low-level wrapper for `::pdf_can_be_saved_incrementally()`. */
  8411. FZ_FUNCTION int ll_pdf_can_be_saved_incrementally(::pdf_document *doc);
  8412. /** Low-level wrapper for `::pdf_can_redo()`. */
  8413. FZ_FUNCTION int ll_pdf_can_redo(::pdf_document *doc);
  8414. /** Low-level wrapper for `::pdf_can_undo()`. */
  8415. FZ_FUNCTION int ll_pdf_can_undo(::pdf_document *doc);
  8416. /** Low-level wrapper for `::pdf_check_certificate()`. */
  8417. FZ_FUNCTION ::pdf_signature_error ll_pdf_check_certificate(::pdf_pkcs7_verifier *verifier, ::pdf_document *doc, ::pdf_obj *signature);
  8418. /** Low-level wrapper for `::pdf_check_digest()`. */
  8419. FZ_FUNCTION ::pdf_signature_error ll_pdf_check_digest(::pdf_pkcs7_verifier *verifier, ::pdf_document *doc, ::pdf_obj *signature);
  8420. /** Low-level wrapper for `::pdf_check_widget_certificate()`. */
  8421. FZ_FUNCTION ::pdf_signature_error ll_pdf_check_widget_certificate(::pdf_pkcs7_verifier *verifier, ::pdf_annot *widget);
  8422. /** Low-level wrapper for `::pdf_check_widget_digest()`. */
  8423. FZ_FUNCTION ::pdf_signature_error ll_pdf_check_widget_digest(::pdf_pkcs7_verifier *verifier, ::pdf_annot *widget);
  8424. /** Low-level wrapper for `::pdf_choice_field_option()`. */
  8425. FZ_FUNCTION const char *ll_pdf_choice_field_option(::pdf_obj *field, int exportval, int i);
  8426. /** Low-level wrapper for `::pdf_choice_field_option_count()`. */
  8427. FZ_FUNCTION int ll_pdf_choice_field_option_count(::pdf_obj *field);
  8428. /** Low-level wrapper for `::pdf_choice_widget_is_multiselect()`. */
  8429. FZ_FUNCTION int ll_pdf_choice_widget_is_multiselect(::pdf_annot *tw);
  8430. /** Low-level wrapper for `::pdf_choice_widget_options()`. */
  8431. FZ_FUNCTION int ll_pdf_choice_widget_options(::pdf_annot *tw, int exportval, const char *opts[]);
  8432. /** Low-level wrapper for `::pdf_choice_widget_options2()`. */
  8433. /** Swig-friendly wrapper for pdf_choice_widget_options(), returns the
  8434. options directly in a vector. */
  8435. FZ_FUNCTION std::vector<std::string> ll_pdf_choice_widget_options2(::pdf_annot *tw, int exportval);
  8436. /** Low-level wrapper for `::pdf_choice_widget_set_value()`. */
  8437. FZ_FUNCTION void ll_pdf_choice_widget_set_value(::pdf_annot *tw, int n, const char *opts[]);
  8438. /** Low-level wrapper for `::pdf_choice_widget_value()`. */
  8439. FZ_FUNCTION int ll_pdf_choice_widget_value(::pdf_annot *tw, const char *opts[]);
  8440. /** Low-level wrapper for `::pdf_clean_file()`. */
  8441. FZ_FUNCTION void ll_pdf_clean_file(char *infile, char *outfile, char *password, ::pdf_clean_options *opts, int retainlen, char *retainlist[]);
  8442. /** Low-level wrapper for `::pdf_clean_font_name()`. */
  8443. FZ_FUNCTION const char *ll_pdf_clean_font_name(const char *fontname);
  8444. /** Low-level wrapper for `::pdf_clean_obj()`. */
  8445. FZ_FUNCTION void ll_pdf_clean_obj(::pdf_obj *obj);
  8446. /** Low-level wrapper for `::pdf_clear_annot_border_dash()`. */
  8447. FZ_FUNCTION void ll_pdf_clear_annot_border_dash(::pdf_annot *annot);
  8448. /** Low-level wrapper for `::pdf_clear_annot_ink_list()`. */
  8449. FZ_FUNCTION void ll_pdf_clear_annot_ink_list(::pdf_annot *annot);
  8450. /** Low-level wrapper for `::pdf_clear_annot_quad_points()`. */
  8451. FZ_FUNCTION void ll_pdf_clear_annot_quad_points(::pdf_annot *annot);
  8452. /** Low-level wrapper for `::pdf_clear_annot_vertices()`. */
  8453. FZ_FUNCTION void ll_pdf_clear_annot_vertices(::pdf_annot *annot);
  8454. /** Low-level wrapper for `::pdf_clear_signature()`. */
  8455. FZ_FUNCTION void ll_pdf_clear_signature(::pdf_annot *widget);
  8456. /** Low-level wrapper for `::pdf_clear_xref()`. */
  8457. FZ_FUNCTION void ll_pdf_clear_xref(::pdf_document *doc);
  8458. /** Low-level wrapper for `::pdf_clear_xref_to_mark()`. */
  8459. FZ_FUNCTION void ll_pdf_clear_xref_to_mark(::pdf_document *doc);
  8460. /** Low-level wrapper for `::pdf_clip_page()`. */
  8461. FZ_FUNCTION void ll_pdf_clip_page(::pdf_page *page, ::fz_rect *clip);
  8462. /** Low-level wrapper for `::pdf_close_processor()`. */
  8463. FZ_FUNCTION void ll_pdf_close_processor(::pdf_processor *proc);
  8464. /** Low-level wrapper for `::pdf_cmap_size()`. */
  8465. FZ_FUNCTION size_t ll_pdf_cmap_size(::pdf_cmap *cmap);
  8466. /** Low-level wrapper for `::pdf_cmap_wmode()`. */
  8467. FZ_FUNCTION int ll_pdf_cmap_wmode(::pdf_cmap *cmap);
  8468. /** Low-level wrapper for `::pdf_copy_array()`. */
  8469. FZ_FUNCTION ::pdf_obj *ll_pdf_copy_array(::pdf_obj *array);
  8470. /** Low-level wrapper for `::pdf_copy_dict()`. */
  8471. FZ_FUNCTION ::pdf_obj *ll_pdf_copy_dict(::pdf_obj *dict);
  8472. /** Low-level wrapper for `::pdf_count_document_associated_files()`. */
  8473. FZ_FUNCTION int ll_pdf_count_document_associated_files(::pdf_document *doc);
  8474. /** Low-level wrapper for `::pdf_count_layer_config_ui()`. */
  8475. FZ_FUNCTION int ll_pdf_count_layer_config_ui(::pdf_document *doc);
  8476. /** Low-level wrapper for `::pdf_count_layer_configs()`. */
  8477. FZ_FUNCTION int ll_pdf_count_layer_configs(::pdf_document *doc);
  8478. /** Low-level wrapper for `::pdf_count_layers()`. */
  8479. FZ_FUNCTION int ll_pdf_count_layers(::pdf_document *doc);
  8480. /** Low-level wrapper for `::pdf_count_objects()`. */
  8481. FZ_FUNCTION int ll_pdf_count_objects(::pdf_document *doc);
  8482. /** Low-level wrapper for `::pdf_count_page_associated_files()`. */
  8483. FZ_FUNCTION int ll_pdf_count_page_associated_files(::pdf_page *page);
  8484. /** Low-level wrapper for `::pdf_count_pages()`. */
  8485. FZ_FUNCTION int ll_pdf_count_pages(::pdf_document *doc);
  8486. /** Low-level wrapper for `::pdf_count_pages_imp()`. */
  8487. FZ_FUNCTION int ll_pdf_count_pages_imp(::fz_document *doc, int chapter);
  8488. /** Low-level wrapper for `::pdf_count_q_balance()`.
  8489. This function has out-params. Python/C# wrappers look like:
  8490. `ll_pdf_count_q_balance(::pdf_document *doc, ::pdf_obj *res, ::pdf_obj *stm)` => `(int prepend, int append)`
  8491. */
  8492. FZ_FUNCTION void ll_pdf_count_q_balance(::pdf_document *doc, ::pdf_obj *res, ::pdf_obj *stm, int *prepend, int *append);
  8493. /** Low-level wrapper for `::pdf_count_signatures()`. */
  8494. FZ_FUNCTION int ll_pdf_count_signatures(::pdf_document *doc);
  8495. /** Low-level wrapper for `::pdf_count_unsaved_versions()`. */
  8496. FZ_FUNCTION int ll_pdf_count_unsaved_versions(::pdf_document *doc);
  8497. /** Low-level wrapper for `::pdf_count_versions()`. */
  8498. FZ_FUNCTION int ll_pdf_count_versions(::pdf_document *doc);
  8499. /** Low-level wrapper for `::pdf_create_annot()`. */
  8500. FZ_FUNCTION ::pdf_annot *ll_pdf_create_annot(::pdf_page *page, enum pdf_annot_type type);
  8501. /** Low-level wrapper for `::pdf_create_annot_raw()`. */
  8502. FZ_FUNCTION ::pdf_annot *ll_pdf_create_annot_raw(::pdf_page *page, enum pdf_annot_type type);
  8503. /** Low-level wrapper for `::pdf_create_document()`. */
  8504. FZ_FUNCTION ::pdf_document *ll_pdf_create_document();
  8505. /** Low-level wrapper for `::pdf_create_field_name()`. */
  8506. FZ_FUNCTION void ll_pdf_create_field_name(::pdf_document *doc, const char *prefix, char *buf, size_t len);
  8507. /** Low-level wrapper for `::pdf_create_link()`. */
  8508. FZ_FUNCTION ::fz_link *ll_pdf_create_link(::pdf_page *page, ::fz_rect bbox, const char *uri);
  8509. /** Low-level wrapper for `::pdf_create_object()`. */
  8510. FZ_FUNCTION int ll_pdf_create_object(::pdf_document *doc);
  8511. /** Low-level wrapper for `::pdf_create_signature_widget()`. */
  8512. FZ_FUNCTION ::pdf_annot *ll_pdf_create_signature_widget(::pdf_page *page, char *name);
  8513. /** Low-level wrapper for `::pdf_crypt_encrypt_metadata()`. */
  8514. FZ_FUNCTION int ll_pdf_crypt_encrypt_metadata(::pdf_crypt *crypt);
  8515. /** Low-level wrapper for `::pdf_crypt_key()`. */
  8516. FZ_FUNCTION unsigned char *ll_pdf_crypt_key(::pdf_crypt *crypt);
  8517. /** Low-level wrapper for `::pdf_crypt_length()`. */
  8518. FZ_FUNCTION int ll_pdf_crypt_length(::pdf_crypt *crypt);
  8519. /** Low-level wrapper for `::pdf_crypt_method()`. */
  8520. FZ_FUNCTION const char *ll_pdf_crypt_method(::pdf_crypt *crypt);
  8521. /** Low-level wrapper for `::pdf_crypt_obj()`. */
  8522. FZ_FUNCTION void ll_pdf_crypt_obj(::pdf_crypt *crypt, ::pdf_obj *obj, int num, int gen);
  8523. /** Low-level wrapper for `::pdf_crypt_owner_encryption()`. */
  8524. FZ_FUNCTION unsigned char *ll_pdf_crypt_owner_encryption(::pdf_crypt *crypt);
  8525. /** Low-level wrapper for `::pdf_crypt_owner_password()`. */
  8526. FZ_FUNCTION unsigned char *ll_pdf_crypt_owner_password(::pdf_crypt *crypt);
  8527. /** Low-level wrapper for `::pdf_crypt_permissions()`. */
  8528. FZ_FUNCTION int ll_pdf_crypt_permissions(::pdf_crypt *crypt);
  8529. /** Low-level wrapper for `::pdf_crypt_permissions_encryption()`. */
  8530. FZ_FUNCTION unsigned char *ll_pdf_crypt_permissions_encryption(::pdf_crypt *crypt);
  8531. /** Low-level wrapper for `::pdf_crypt_revision()`. */
  8532. FZ_FUNCTION int ll_pdf_crypt_revision(::pdf_crypt *crypt);
  8533. /** Low-level wrapper for `::pdf_crypt_stream_method()`. */
  8534. FZ_FUNCTION const char *ll_pdf_crypt_stream_method(::pdf_crypt *crypt);
  8535. /** Low-level wrapper for `::pdf_crypt_string_method()`. */
  8536. FZ_FUNCTION const char *ll_pdf_crypt_string_method(::pdf_crypt *crypt);
  8537. /** Low-level wrapper for `::pdf_crypt_user_encryption()`. */
  8538. FZ_FUNCTION unsigned char *ll_pdf_crypt_user_encryption(::pdf_crypt *crypt);
  8539. /** Low-level wrapper for `::pdf_crypt_user_password()`. */
  8540. FZ_FUNCTION unsigned char *ll_pdf_crypt_user_password(::pdf_crypt *crypt);
  8541. /** Low-level wrapper for `::pdf_crypt_version()`. */
  8542. FZ_FUNCTION int ll_pdf_crypt_version(::pdf_crypt *crypt);
  8543. /** Low-level wrapper for `::pdf_cycle()`. */
  8544. FZ_FUNCTION int ll_pdf_cycle(::pdf_cycle_list *here, ::pdf_cycle_list *prev, ::pdf_obj *obj);
  8545. /** Low-level wrapper for `::pdf_debug_doc_changes()`. */
  8546. FZ_FUNCTION void ll_pdf_debug_doc_changes(::pdf_document *doc);
  8547. /** Low-level wrapper for `::pdf_debug_obj()`. */
  8548. FZ_FUNCTION void ll_pdf_debug_obj(::pdf_obj *obj);
  8549. /** Low-level wrapper for `::pdf_debug_ref()`. */
  8550. FZ_FUNCTION void ll_pdf_debug_ref(::pdf_obj *obj);
  8551. /** Low-level wrapper for `::pdf_decode_cmap()`.
  8552. This function has out-params. Python/C# wrappers look like:
  8553. `ll_pdf_decode_cmap(::pdf_cmap *cmap, unsigned char *s, unsigned char *e)` => `(int, unsigned int cpt)`
  8554. */
  8555. FZ_FUNCTION int ll_pdf_decode_cmap(::pdf_cmap *cmap, unsigned char *s, unsigned char *e, unsigned int *cpt);
  8556. /** Low-level wrapper for `::pdf_deep_copy_obj()`. */
  8557. FZ_FUNCTION ::pdf_obj *ll_pdf_deep_copy_obj(::pdf_obj *obj);
  8558. /** Low-level wrapper for `::pdf_delete_annot()`. */
  8559. FZ_FUNCTION void ll_pdf_delete_annot(::pdf_page *page, ::pdf_annot *annot);
  8560. /** Low-level wrapper for `::pdf_delete_link()`. */
  8561. FZ_FUNCTION void ll_pdf_delete_link(::pdf_page *page, ::fz_link *link);
  8562. /** Low-level wrapper for `::pdf_delete_object()`. */
  8563. FZ_FUNCTION void ll_pdf_delete_object(::pdf_document *doc, int num);
  8564. /** Low-level wrapper for `::pdf_delete_page()`. */
  8565. FZ_FUNCTION void ll_pdf_delete_page(::pdf_document *doc, int number);
  8566. /** Low-level wrapper for `::pdf_delete_page_labels()`. */
  8567. FZ_FUNCTION void ll_pdf_delete_page_labels(::pdf_document *doc, int index);
  8568. /** Low-level wrapper for `::pdf_delete_page_range()`. */
  8569. FZ_FUNCTION void ll_pdf_delete_page_range(::pdf_document *doc, int start, int end);
  8570. /** Low-level wrapper for `::pdf_deselect_layer_config_ui()`. */
  8571. FZ_FUNCTION void ll_pdf_deselect_layer_config_ui(::pdf_document *doc, int ui);
  8572. /** Low-level wrapper for `::pdf_deserialise_journal()`. */
  8573. FZ_FUNCTION void ll_pdf_deserialise_journal(::pdf_document *doc, ::fz_stream *stm);
  8574. /** Low-level wrapper for `::pdf_dict_del()`. */
  8575. FZ_FUNCTION void ll_pdf_dict_del(::pdf_obj *dict, ::pdf_obj *key);
  8576. /** Low-level wrapper for `::pdf_dict_dels()`. */
  8577. FZ_FUNCTION void ll_pdf_dict_dels(::pdf_obj *dict, const char *key);
  8578. /** Low-level wrapper for `::pdf_dict_get()`. */
  8579. FZ_FUNCTION ::pdf_obj *ll_pdf_dict_get(::pdf_obj *dict, ::pdf_obj *key);
  8580. /** Low-level wrapper for `::pdf_dict_get_bool()`. */
  8581. FZ_FUNCTION int ll_pdf_dict_get_bool(::pdf_obj *dict, ::pdf_obj *key);
  8582. /** Low-level wrapper for `::pdf_dict_get_bool_default()`. */
  8583. FZ_FUNCTION int ll_pdf_dict_get_bool_default(::pdf_obj *dict, ::pdf_obj *key, int def);
  8584. /** Low-level wrapper for `::pdf_dict_get_date()`. */
  8585. FZ_FUNCTION int64_t ll_pdf_dict_get_date(::pdf_obj *dict, ::pdf_obj *key);
  8586. /** Low-level wrapper for `::pdf_dict_get_inheritable()`. */
  8587. FZ_FUNCTION ::pdf_obj *ll_pdf_dict_get_inheritable(::pdf_obj *dict, ::pdf_obj *key);
  8588. /** Low-level wrapper for `::pdf_dict_get_inheritable_bool()`. */
  8589. FZ_FUNCTION int ll_pdf_dict_get_inheritable_bool(::pdf_obj *dict, ::pdf_obj *key);
  8590. /** Low-level wrapper for `::pdf_dict_get_inheritable_date()`. */
  8591. FZ_FUNCTION int64_t ll_pdf_dict_get_inheritable_date(::pdf_obj *dict, ::pdf_obj *key);
  8592. /** Low-level wrapper for `::pdf_dict_get_inheritable_int()`. */
  8593. FZ_FUNCTION int ll_pdf_dict_get_inheritable_int(::pdf_obj *dict, ::pdf_obj *key);
  8594. /** Low-level wrapper for `::pdf_dict_get_inheritable_int64()`. */
  8595. FZ_FUNCTION int64_t ll_pdf_dict_get_inheritable_int64(::pdf_obj *dict, ::pdf_obj *key);
  8596. /** Low-level wrapper for `::pdf_dict_get_inheritable_matrix()`. */
  8597. FZ_FUNCTION ::fz_matrix ll_pdf_dict_get_inheritable_matrix(::pdf_obj *dict, ::pdf_obj *key);
  8598. /** Low-level wrapper for `::pdf_dict_get_inheritable_name()`. */
  8599. FZ_FUNCTION const char *ll_pdf_dict_get_inheritable_name(::pdf_obj *dict, ::pdf_obj *key);
  8600. /** Low-level wrapper for `::pdf_dict_get_inheritable_real()`. */
  8601. FZ_FUNCTION float ll_pdf_dict_get_inheritable_real(::pdf_obj *dict, ::pdf_obj *key);
  8602. /** Low-level wrapper for `::pdf_dict_get_inheritable_rect()`. */
  8603. FZ_FUNCTION ::fz_rect ll_pdf_dict_get_inheritable_rect(::pdf_obj *dict, ::pdf_obj *key);
  8604. /** Low-level wrapper for `::pdf_dict_get_inheritable_string()`.
  8605. This function has out-params. Python/C# wrappers look like:
  8606. `ll_pdf_dict_get_inheritable_string(::pdf_obj *dict, ::pdf_obj *key)` => `(const char *, size_t sizep)`
  8607. */
  8608. FZ_FUNCTION const char *ll_pdf_dict_get_inheritable_string(::pdf_obj *dict, ::pdf_obj *key, size_t *sizep);
  8609. /** Low-level wrapper for `::pdf_dict_get_inheritable_text_string()`. */
  8610. FZ_FUNCTION const char *ll_pdf_dict_get_inheritable_text_string(::pdf_obj *dict, ::pdf_obj *key);
  8611. /** Low-level wrapper for `::pdf_dict_get_int()`. */
  8612. FZ_FUNCTION int ll_pdf_dict_get_int(::pdf_obj *dict, ::pdf_obj *key);
  8613. /** Low-level wrapper for `::pdf_dict_get_int64()`. */
  8614. FZ_FUNCTION int64_t ll_pdf_dict_get_int64(::pdf_obj *dict, ::pdf_obj *key);
  8615. /** Low-level wrapper for `::pdf_dict_get_int_default()`. */
  8616. FZ_FUNCTION int ll_pdf_dict_get_int_default(::pdf_obj *dict, ::pdf_obj *key, int def);
  8617. /** Low-level wrapper for `::pdf_dict_get_key()`. */
  8618. FZ_FUNCTION ::pdf_obj *ll_pdf_dict_get_key(::pdf_obj *dict, int idx);
  8619. /** Low-level wrapper for `::pdf_dict_get_matrix()`. */
  8620. FZ_FUNCTION ::fz_matrix ll_pdf_dict_get_matrix(::pdf_obj *dict, ::pdf_obj *key);
  8621. /** Low-level wrapper for `::pdf_dict_get_name()`. */
  8622. FZ_FUNCTION const char *ll_pdf_dict_get_name(::pdf_obj *dict, ::pdf_obj *key);
  8623. /** Low-level wrapper for `::pdf_dict_get_point()`. */
  8624. FZ_FUNCTION ::fz_point ll_pdf_dict_get_point(::pdf_obj *dict, ::pdf_obj *key);
  8625. /** Low-level wrapper for `::pdf_dict_get_put_drop()`.
  8626. This function has out-params. Python/C# wrappers look like:
  8627. `ll_pdf_dict_get_put_drop(::pdf_obj *dict, ::pdf_obj *key, ::pdf_obj *val, ::pdf_obj **old_val)` =>
  8628. */
  8629. FZ_FUNCTION void ll_pdf_dict_get_put_drop(::pdf_obj *dict, ::pdf_obj *key, ::pdf_obj *val, ::pdf_obj **old_val);
  8630. /** Low-level wrapper for `::pdf_dict_get_real()`. */
  8631. FZ_FUNCTION float ll_pdf_dict_get_real(::pdf_obj *dict, ::pdf_obj *key);
  8632. /** Low-level wrapper for `::pdf_dict_get_real_default()`. */
  8633. FZ_FUNCTION float ll_pdf_dict_get_real_default(::pdf_obj *dict, ::pdf_obj *key, float def);
  8634. /** Low-level wrapper for `::pdf_dict_get_rect()`. */
  8635. FZ_FUNCTION ::fz_rect ll_pdf_dict_get_rect(::pdf_obj *dict, ::pdf_obj *key);
  8636. /** Low-level wrapper for `::pdf_dict_get_string()`.
  8637. This function has out-params. Python/C# wrappers look like:
  8638. `ll_pdf_dict_get_string(::pdf_obj *dict, ::pdf_obj *key)` => `(const char *, size_t sizep)`
  8639. */
  8640. FZ_FUNCTION const char *ll_pdf_dict_get_string(::pdf_obj *dict, ::pdf_obj *key, size_t *sizep);
  8641. /** Low-level wrapper for `::pdf_dict_get_text_string()`. */
  8642. FZ_FUNCTION const char *ll_pdf_dict_get_text_string(::pdf_obj *dict, ::pdf_obj *key);
  8643. /** Low-level wrapper for `::pdf_dict_get_text_string_opt()`. */
  8644. FZ_FUNCTION const char *ll_pdf_dict_get_text_string_opt(::pdf_obj *dict, ::pdf_obj *key);
  8645. /** Low-level wrapper for `::pdf_dict_get_val()`. */
  8646. FZ_FUNCTION ::pdf_obj *ll_pdf_dict_get_val(::pdf_obj *dict, int idx);
  8647. /** Low-level wrapper for `::pdf_dict_geta()`. */
  8648. FZ_FUNCTION ::pdf_obj *ll_pdf_dict_geta(::pdf_obj *dict, ::pdf_obj *key, ::pdf_obj *abbrev);
  8649. /** Low-level wrapper for `::pdf_dict_getp()`. */
  8650. FZ_FUNCTION ::pdf_obj *ll_pdf_dict_getp(::pdf_obj *dict, const char *path);
  8651. /** Low-level wrapper for `::pdf_dict_getp_inheritable()`. */
  8652. FZ_FUNCTION ::pdf_obj *ll_pdf_dict_getp_inheritable(::pdf_obj *dict, const char *path);
  8653. /** Low-level wrapper for `::pdf_dict_gets()`. */
  8654. FZ_FUNCTION ::pdf_obj *ll_pdf_dict_gets(::pdf_obj *dict, const char *key);
  8655. /** Low-level wrapper for `::pdf_dict_gets_inheritable()`. */
  8656. FZ_FUNCTION ::pdf_obj *ll_pdf_dict_gets_inheritable(::pdf_obj *dict, const char *key);
  8657. /** Low-level wrapper for `::pdf_dict_getsa()`. */
  8658. FZ_FUNCTION ::pdf_obj *ll_pdf_dict_getsa(::pdf_obj *dict, const char *key, const char *abbrev);
  8659. /** Low-level wrapper for `::pdf_dict_len()`. */
  8660. FZ_FUNCTION int ll_pdf_dict_len(::pdf_obj *dict);
  8661. /** Low-level wrapper for `::pdf_dict_put()`. */
  8662. FZ_FUNCTION void ll_pdf_dict_put(::pdf_obj *dict, ::pdf_obj *key, ::pdf_obj *val);
  8663. /** Low-level wrapper for `::pdf_dict_put_array()`. */
  8664. FZ_FUNCTION ::pdf_obj *ll_pdf_dict_put_array(::pdf_obj *dict, ::pdf_obj *key, int initial);
  8665. /** Low-level wrapper for `::pdf_dict_put_bool()`. */
  8666. FZ_FUNCTION void ll_pdf_dict_put_bool(::pdf_obj *dict, ::pdf_obj *key, int x);
  8667. /** Low-level wrapper for `::pdf_dict_put_date()`. */
  8668. FZ_FUNCTION void ll_pdf_dict_put_date(::pdf_obj *dict, ::pdf_obj *key, int64_t time);
  8669. /** Low-level wrapper for `::pdf_dict_put_dict()`. */
  8670. FZ_FUNCTION ::pdf_obj *ll_pdf_dict_put_dict(::pdf_obj *dict, ::pdf_obj *key, int initial);
  8671. /** Low-level wrapper for `::pdf_dict_put_drop()`. */
  8672. FZ_FUNCTION void ll_pdf_dict_put_drop(::pdf_obj *dict, ::pdf_obj *key, ::pdf_obj *val);
  8673. /** Low-level wrapper for `::pdf_dict_put_indirect()`. */
  8674. FZ_FUNCTION void ll_pdf_dict_put_indirect(::pdf_obj *dict, ::pdf_obj *key, int num);
  8675. /** Low-level wrapper for `::pdf_dict_put_int()`. */
  8676. FZ_FUNCTION void ll_pdf_dict_put_int(::pdf_obj *dict, ::pdf_obj *key, int64_t x);
  8677. /** Low-level wrapper for `::pdf_dict_put_matrix()`. */
  8678. FZ_FUNCTION void ll_pdf_dict_put_matrix(::pdf_obj *dict, ::pdf_obj *key, ::fz_matrix x);
  8679. /** Low-level wrapper for `::pdf_dict_put_name()`. */
  8680. FZ_FUNCTION void ll_pdf_dict_put_name(::pdf_obj *dict, ::pdf_obj *key, const char *x);
  8681. /** Low-level wrapper for `::pdf_dict_put_point()`. */
  8682. FZ_FUNCTION void ll_pdf_dict_put_point(::pdf_obj *dict, ::pdf_obj *key, ::fz_point x);
  8683. /** Low-level wrapper for `::pdf_dict_put_real()`. */
  8684. FZ_FUNCTION void ll_pdf_dict_put_real(::pdf_obj *dict, ::pdf_obj *key, double x);
  8685. /** Low-level wrapper for `::pdf_dict_put_rect()`. */
  8686. FZ_FUNCTION void ll_pdf_dict_put_rect(::pdf_obj *dict, ::pdf_obj *key, ::fz_rect x);
  8687. /** Low-level wrapper for `::pdf_dict_put_string()`. */
  8688. FZ_FUNCTION void ll_pdf_dict_put_string(::pdf_obj *dict, ::pdf_obj *key, const char *x, size_t n);
  8689. /** Low-level wrapper for `::pdf_dict_put_text_string()`. */
  8690. FZ_FUNCTION void ll_pdf_dict_put_text_string(::pdf_obj *dict, ::pdf_obj *key, const char *x);
  8691. /** Low-level wrapper for `::pdf_dict_put_val_null()`. */
  8692. FZ_FUNCTION void ll_pdf_dict_put_val_null(::pdf_obj *obj, int idx);
  8693. /** Low-level wrapper for `::pdf_dict_putp()`. */
  8694. FZ_FUNCTION void ll_pdf_dict_putp(::pdf_obj *dict, const char *path, ::pdf_obj *val);
  8695. /** Low-level wrapper for `::pdf_dict_putp_drop()`. */
  8696. FZ_FUNCTION void ll_pdf_dict_putp_drop(::pdf_obj *dict, const char *path, ::pdf_obj *val);
  8697. /** Low-level wrapper for `::pdf_dict_puts()`. */
  8698. FZ_FUNCTION void ll_pdf_dict_puts(::pdf_obj *dict, const char *key, ::pdf_obj *val);
  8699. /** Low-level wrapper for `::pdf_dict_puts_dict()`. */
  8700. FZ_FUNCTION ::pdf_obj *ll_pdf_dict_puts_dict(::pdf_obj *dict, const char *key, int initial);
  8701. /** Low-level wrapper for `::pdf_dict_puts_drop()`. */
  8702. FZ_FUNCTION void ll_pdf_dict_puts_drop(::pdf_obj *dict, const char *key, ::pdf_obj *val);
  8703. /** Low-level wrapper for `::pdf_dirty_annot()`. */
  8704. FZ_FUNCTION void ll_pdf_dirty_annot(::pdf_annot *annot);
  8705. /** Low-level wrapper for `::pdf_dirty_obj()`. */
  8706. FZ_FUNCTION void ll_pdf_dirty_obj(::pdf_obj *obj);
  8707. /** Low-level wrapper for `::pdf_disable_js()`. */
  8708. FZ_FUNCTION void ll_pdf_disable_js(::pdf_document *doc);
  8709. /** Low-level wrapper for `::pdf_discard_journal()`. */
  8710. FZ_FUNCTION void ll_pdf_discard_journal(::pdf_journal *journal);
  8711. /** Low-level wrapper for `::pdf_doc_was_linearized()`. */
  8712. FZ_FUNCTION int ll_pdf_doc_was_linearized(::pdf_document *doc);
  8713. /** Low-level wrapper for `::pdf_document_associated_file()`. */
  8714. FZ_FUNCTION ::pdf_obj *ll_pdf_document_associated_file(::pdf_document *doc, int idx);
  8715. /** Low-level wrapper for `::pdf_document_event_did_print()`. */
  8716. FZ_FUNCTION void ll_pdf_document_event_did_print(::pdf_document *doc);
  8717. /** Low-level wrapper for `::pdf_document_event_did_save()`. */
  8718. FZ_FUNCTION void ll_pdf_document_event_did_save(::pdf_document *doc);
  8719. /** Low-level wrapper for `::pdf_document_event_will_close()`. */
  8720. FZ_FUNCTION void ll_pdf_document_event_will_close(::pdf_document *doc);
  8721. /** Low-level wrapper for `::pdf_document_event_will_print()`. */
  8722. FZ_FUNCTION void ll_pdf_document_event_will_print(::pdf_document *doc);
  8723. /** Low-level wrapper for `::pdf_document_event_will_save()`. */
  8724. FZ_FUNCTION void ll_pdf_document_event_will_save(::pdf_document *doc);
  8725. /** Low-level wrapper for `::pdf_document_from_fz_document()`. */
  8726. FZ_FUNCTION ::pdf_document *ll_pdf_document_from_fz_document(::fz_document *ptr);
  8727. /** Low-level wrapper for `::pdf_document_language()`. */
  8728. FZ_FUNCTION ::fz_text_language ll_pdf_document_language(::pdf_document *doc);
  8729. /** Low-level wrapper for `::pdf_document_output_intent()`. */
  8730. FZ_FUNCTION ::fz_colorspace *ll_pdf_document_output_intent(::pdf_document *doc);
  8731. /** Low-level wrapper for `::pdf_document_permissions()`. */
  8732. FZ_FUNCTION int ll_pdf_document_permissions(::pdf_document *doc);
  8733. /** Low-level wrapper for `::pdf_drop_annot()`. */
  8734. FZ_FUNCTION void ll_pdf_drop_annot(::pdf_annot *annot);
  8735. /** Low-level wrapper for `::pdf_drop_cmap()`. */
  8736. FZ_FUNCTION void ll_pdf_drop_cmap(::pdf_cmap *cmap);
  8737. /** Low-level wrapper for `::pdf_drop_cmap_imp()`. */
  8738. FZ_FUNCTION void ll_pdf_drop_cmap_imp(::fz_storable *cmap);
  8739. /** Low-level wrapper for `::pdf_drop_crypt()`. */
  8740. FZ_FUNCTION void ll_pdf_drop_crypt(::pdf_crypt *crypt);
  8741. /** Low-level wrapper for `::pdf_drop_document()`. */
  8742. FZ_FUNCTION void ll_pdf_drop_document(::pdf_document *doc);
  8743. /** Low-level wrapper for `::pdf_drop_font()`. */
  8744. FZ_FUNCTION void ll_pdf_drop_font(::pdf_font_desc *font);
  8745. /** Low-level wrapper for `::pdf_drop_function()`. */
  8746. FZ_FUNCTION void ll_pdf_drop_function(::pdf_function *func);
  8747. /** Low-level wrapper for `::pdf_drop_graft_map()`. */
  8748. FZ_FUNCTION void ll_pdf_drop_graft_map(::pdf_graft_map *map);
  8749. /** Low-level wrapper for `::pdf_drop_journal()`. */
  8750. FZ_FUNCTION void ll_pdf_drop_journal(::pdf_journal *journal);
  8751. /** Low-level wrapper for `::pdf_drop_js()`. */
  8752. FZ_FUNCTION void ll_pdf_drop_js(::pdf_js *js);
  8753. /** Low-level wrapper for `::pdf_drop_local_xref()`. */
  8754. FZ_FUNCTION void ll_pdf_drop_local_xref(::pdf_xref *xref);
  8755. /** Low-level wrapper for `::pdf_drop_local_xref_and_resources()`. */
  8756. FZ_FUNCTION void ll_pdf_drop_local_xref_and_resources(::pdf_document *doc);
  8757. /** Low-level wrapper for `::pdf_drop_locked_fields()`. */
  8758. FZ_FUNCTION void ll_pdf_drop_locked_fields(::pdf_locked_fields *locked);
  8759. /** Low-level wrapper for `::pdf_drop_mark_bits()`. */
  8760. FZ_FUNCTION void ll_pdf_drop_mark_bits(::pdf_mark_bits *marks);
  8761. /** Low-level wrapper for `::pdf_drop_obj()`. */
  8762. FZ_FUNCTION void ll_pdf_drop_obj(::pdf_obj *obj);
  8763. /** Low-level wrapper for `::pdf_drop_object_labels()`. */
  8764. FZ_FUNCTION void ll_pdf_drop_object_labels(::pdf_object_labels *g);
  8765. /** Low-level wrapper for `::pdf_drop_ocg()`. */
  8766. FZ_FUNCTION void ll_pdf_drop_ocg(::pdf_document *doc);
  8767. /** Low-level wrapper for `::pdf_drop_page()`. */
  8768. FZ_FUNCTION void ll_pdf_drop_page(::pdf_page *page);
  8769. /** Low-level wrapper for `::pdf_drop_page_tree()`. */
  8770. FZ_FUNCTION void ll_pdf_drop_page_tree(::pdf_document *doc);
  8771. /** Low-level wrapper for `::pdf_drop_page_tree_internal()`. */
  8772. FZ_FUNCTION void ll_pdf_drop_page_tree_internal(::pdf_document *doc);
  8773. /** Low-level wrapper for `::pdf_drop_pattern()`. */
  8774. FZ_FUNCTION void ll_pdf_drop_pattern(::pdf_pattern *pat);
  8775. /** Low-level wrapper for `::pdf_drop_processor()`. */
  8776. FZ_FUNCTION void ll_pdf_drop_processor(::pdf_processor *proc);
  8777. /** Low-level wrapper for `::pdf_drop_resource_tables()`. */
  8778. FZ_FUNCTION void ll_pdf_drop_resource_tables(::pdf_document *doc);
  8779. /** Low-level wrapper for `::pdf_drop_signer()`. */
  8780. FZ_FUNCTION void ll_pdf_drop_signer(::pdf_pkcs7_signer *signer);
  8781. /** Low-level wrapper for `::pdf_drop_singleton_obj()`. */
  8782. FZ_FUNCTION ::pdf_obj *ll_pdf_drop_singleton_obj(::pdf_obj *obj);
  8783. /** Low-level wrapper for `::pdf_drop_verifier()`. */
  8784. FZ_FUNCTION void ll_pdf_drop_verifier(::pdf_pkcs7_verifier *verifier);
  8785. /** Low-level wrapper for `::pdf_drop_widget()`. */
  8786. FZ_FUNCTION void ll_pdf_drop_widget(::pdf_annot *widget);
  8787. /** Low-level wrapper for `::pdf_edit_text_field_value()`.
  8788. This function has out-params. Python/C# wrappers look like:
  8789. `ll_pdf_edit_text_field_value(::pdf_annot *widget, const char *value, const char *change)` => `(int, int selStart, int selEnd, char *newvalue)`
  8790. */
  8791. FZ_FUNCTION int ll_pdf_edit_text_field_value(::pdf_annot *widget, const char *value, const char *change, int *selStart, int *selEnd, char **newvalue);
  8792. /** Low-level wrapper for `::pdf_empty_store()`. */
  8793. FZ_FUNCTION void ll_pdf_empty_store(::pdf_document *doc);
  8794. /** Low-level wrapper for `::pdf_enable_journal()`. */
  8795. FZ_FUNCTION void ll_pdf_enable_journal(::pdf_document *doc);
  8796. /** Low-level wrapper for `::pdf_enable_js()`. */
  8797. FZ_FUNCTION void ll_pdf_enable_js(::pdf_document *doc);
  8798. /** Low-level wrapper for `::pdf_enable_layer()`. */
  8799. FZ_FUNCTION void ll_pdf_enable_layer(::pdf_document *doc, int layer, int enabled);
  8800. /** Low-level wrapper for `::pdf_encrypt_data()`. */
  8801. FZ_FUNCTION void ll_pdf_encrypt_data(::pdf_crypt *crypt, int num, int gen, void (*fmt_str_out)(::fz_context *, void *, const unsigned char *, size_t ), void *arg, const unsigned char *s, size_t n);
  8802. /** Low-level wrapper for `::pdf_encrypted_len()`. */
  8803. FZ_FUNCTION size_t ll_pdf_encrypted_len(::pdf_crypt *crypt, int num, int gen, size_t len);
  8804. /** Low-level wrapper for `::pdf_end_hmtx()`. */
  8805. FZ_FUNCTION void ll_pdf_end_hmtx(::pdf_font_desc *font);
  8806. /** Low-level wrapper for `::pdf_end_operation()`. */
  8807. FZ_FUNCTION void ll_pdf_end_operation(::pdf_document *doc);
  8808. /** Low-level wrapper for `::pdf_end_vmtx()`. */
  8809. FZ_FUNCTION void ll_pdf_end_vmtx(::pdf_font_desc *font);
  8810. /** Low-level wrapper for `::pdf_ensure_solid_xref()`. */
  8811. FZ_FUNCTION void ll_pdf_ensure_solid_xref(::pdf_document *doc, int num);
  8812. /** Low-level wrapper for `::pdf_eval_function()`.
  8813. This function has out-params. Python/C# wrappers look like:
  8814. `ll_pdf_eval_function(::pdf_function *func, const float *in, int inlen, int outlen)` => float out
  8815. */
  8816. FZ_FUNCTION void ll_pdf_eval_function(::pdf_function *func, const float *in, int inlen, float *out, int outlen);
  8817. /** Low-level wrapper for `::pdf_event_issue_alert()`. */
  8818. FZ_FUNCTION void ll_pdf_event_issue_alert(::pdf_document *doc, ::pdf_alert_event *evt);
  8819. /** Low-level wrapper for `::pdf_event_issue_exec_menu_item()`. */
  8820. FZ_FUNCTION void ll_pdf_event_issue_exec_menu_item(::pdf_document *doc, const char *item);
  8821. /** Low-level wrapper for `::pdf_event_issue_launch_url()`. */
  8822. FZ_FUNCTION void ll_pdf_event_issue_launch_url(::pdf_document *doc, const char *url, int new_frame);
  8823. /** Low-level wrapper for `::pdf_event_issue_mail_doc()`. */
  8824. FZ_FUNCTION void ll_pdf_event_issue_mail_doc(::pdf_document *doc, ::pdf_mail_doc_event *evt);
  8825. /** Low-level wrapper for `::pdf_event_issue_print()`. */
  8826. FZ_FUNCTION void ll_pdf_event_issue_print(::pdf_document *doc);
  8827. /** Low-level wrapper for `::pdf_field_border_style()`. */
  8828. FZ_FUNCTION char *ll_pdf_field_border_style(::pdf_obj *field);
  8829. /** Low-level wrapper for `::pdf_field_display()`. */
  8830. FZ_FUNCTION int ll_pdf_field_display(::pdf_obj *field);
  8831. /** Low-level wrapper for `::pdf_field_event_calculate()`. */
  8832. FZ_FUNCTION void ll_pdf_field_event_calculate(::pdf_document *doc, ::pdf_obj *field);
  8833. /** Low-level wrapper for `::pdf_field_event_format()`. */
  8834. FZ_FUNCTION char *ll_pdf_field_event_format(::pdf_document *doc, ::pdf_obj *field);
  8835. /** Low-level wrapper for `::pdf_field_event_keystroke()`. */
  8836. FZ_FUNCTION int ll_pdf_field_event_keystroke(::pdf_document *doc, ::pdf_obj *field, ::pdf_keystroke_event *evt);
  8837. /** Low-level wrapper for `::pdf_field_event_validate()`.
  8838. This function has out-params. Python/C# wrappers look like:
  8839. `ll_pdf_field_event_validate(::pdf_document *doc, ::pdf_obj *field, const char *value)` => `(int, char *newvalue)`
  8840. */
  8841. FZ_FUNCTION int ll_pdf_field_event_validate(::pdf_document *doc, ::pdf_obj *field, const char *value, char **newvalue);
  8842. /** Low-level wrapper for `::pdf_field_flags()`. */
  8843. FZ_FUNCTION int ll_pdf_field_flags(::pdf_obj *field);
  8844. /** Low-level wrapper for `::pdf_field_label()`. */
  8845. FZ_FUNCTION const char *ll_pdf_field_label(::pdf_obj *field);
  8846. /** Low-level wrapper for `::pdf_field_reset()`. */
  8847. FZ_FUNCTION void ll_pdf_field_reset(::pdf_document *doc, ::pdf_obj *field);
  8848. /** Low-level wrapper for `::pdf_field_set_border_style()`. */
  8849. FZ_FUNCTION void ll_pdf_field_set_border_style(::pdf_obj *field, const char *text);
  8850. /** Low-level wrapper for `::pdf_field_set_button_caption()`. */
  8851. FZ_FUNCTION void ll_pdf_field_set_button_caption(::pdf_obj *field, const char *text);
  8852. /** Low-level wrapper for `::pdf_field_set_display()`. */
  8853. FZ_FUNCTION void ll_pdf_field_set_display(::pdf_obj *field, int d);
  8854. /** Low-level wrapper for `::pdf_field_set_fill_color()`. */
  8855. FZ_FUNCTION void ll_pdf_field_set_fill_color(::pdf_obj *field, ::pdf_obj *col);
  8856. /** Low-level wrapper for `::pdf_field_set_text_color()`. */
  8857. FZ_FUNCTION void ll_pdf_field_set_text_color(::pdf_obj *field, ::pdf_obj *col);
  8858. /** Low-level wrapper for `::pdf_field_type()`. */
  8859. FZ_FUNCTION int ll_pdf_field_type(::pdf_obj *field);
  8860. /** Low-level wrapper for `::pdf_field_type_string()`. */
  8861. FZ_FUNCTION const char *ll_pdf_field_type_string(::pdf_obj *field);
  8862. /** Low-level wrapper for `::pdf_field_value()`. */
  8863. FZ_FUNCTION const char *ll_pdf_field_value(::pdf_obj *field);
  8864. /** Low-level wrapper for `::pdf_filter_annot_contents()`. */
  8865. FZ_FUNCTION void ll_pdf_filter_annot_contents(::pdf_document *doc, ::pdf_annot *annot, ::pdf_filter_options *options);
  8866. /** Low-level wrapper for `::pdf_filter_page_contents()`. */
  8867. FZ_FUNCTION void ll_pdf_filter_page_contents(::pdf_document *doc, ::pdf_page *page, ::pdf_filter_options *options);
  8868. /** Low-level wrapper for `::pdf_filter_xobject_instance()`. */
  8869. FZ_FUNCTION ::pdf_obj *ll_pdf_filter_xobject_instance(::pdf_obj *old_xobj, ::pdf_obj *page_res, ::fz_matrix ctm, ::pdf_filter_options *options, ::pdf_cycle_list *cycle_up);
  8870. /** Low-level wrapper for `::pdf_find_colorspace_resource()`. */
  8871. FZ_FUNCTION ::pdf_obj *ll_pdf_find_colorspace_resource(::pdf_document *doc, ::fz_colorspace *item, ::pdf_colorspace_resource_key *key);
  8872. /** Low-level wrapper for `::pdf_find_font_resource()`. */
  8873. FZ_FUNCTION ::pdf_obj *ll_pdf_find_font_resource(::pdf_document *doc, int type, int encoding, ::fz_font *item, ::pdf_font_resource_key *key);
  8874. /** Low-level wrapper for `::pdf_find_item()`. */
  8875. FZ_FUNCTION void *ll_pdf_find_item(::fz_store_drop_fn *drop, ::pdf_obj *key);
  8876. /** Low-level wrapper for `::pdf_find_locked_fields()`. */
  8877. FZ_FUNCTION ::pdf_locked_fields *ll_pdf_find_locked_fields(::pdf_document *doc, int version);
  8878. /** Low-level wrapper for `::pdf_find_locked_fields_for_sig()`. */
  8879. FZ_FUNCTION ::pdf_locked_fields *ll_pdf_find_locked_fields_for_sig(::pdf_document *doc, ::pdf_obj *sig);
  8880. /** Low-level wrapper for `::pdf_find_version_for_obj()`. */
  8881. FZ_FUNCTION int ll_pdf_find_version_for_obj(::pdf_document *doc, ::pdf_obj *obj);
  8882. /** Low-level wrapper for `::pdf_first_annot()`. */
  8883. FZ_FUNCTION ::pdf_annot *ll_pdf_first_annot(::pdf_page *page);
  8884. /** Low-level wrapper for `::pdf_first_widget()`. */
  8885. FZ_FUNCTION ::pdf_annot *ll_pdf_first_widget(::pdf_page *page);
  8886. /** Low-level wrapper for `::pdf_flatten_inheritable_page_items()`. */
  8887. FZ_FUNCTION void ll_pdf_flatten_inheritable_page_items(::pdf_obj *page);
  8888. /** Low-level wrapper for `::pdf_font_cid_to_gid()`. */
  8889. FZ_FUNCTION int ll_pdf_font_cid_to_gid(::pdf_font_desc *fontdesc, int cid);
  8890. /** Low-level wrapper for `::pdf_font_writing_supported()`. */
  8891. FZ_FUNCTION int ll_pdf_font_writing_supported(::fz_font *font);
  8892. /** Low-level wrapper for `::pdf_forget_xref()`. */
  8893. FZ_FUNCTION void ll_pdf_forget_xref(::pdf_document *doc);
  8894. /** Low-level wrapper for `::pdf_format_date()`. */
  8895. FZ_FUNCTION char *ll_pdf_format_date(int64_t time, char *s, size_t n);
  8896. /** Low-level wrapper for `::pdf_format_write_options()`. */
  8897. FZ_FUNCTION char *ll_pdf_format_write_options(char *buffer, size_t buffer_len, const ::pdf_write_options *opts);
  8898. /** Low-level wrapper for `::pdf_function_size()`. */
  8899. FZ_FUNCTION size_t ll_pdf_function_size(::pdf_function *func);
  8900. /** Low-level wrapper for `::pdf_get_bound_document()`. */
  8901. FZ_FUNCTION ::pdf_document *ll_pdf_get_bound_document(::pdf_obj *obj);
  8902. /** Low-level wrapper for `::pdf_get_doc_event_callback_data()`. */
  8903. FZ_FUNCTION void *ll_pdf_get_doc_event_callback_data(::pdf_document *doc);
  8904. /** Low-level wrapper for `::pdf_get_filespec_params()`. */
  8905. FZ_FUNCTION void ll_pdf_get_filespec_params(::pdf_obj *fs, ::pdf_filespec_params *out);
  8906. /** Low-level wrapper for `::pdf_get_incremental_xref_entry()`. */
  8907. FZ_FUNCTION ::pdf_xref_entry *ll_pdf_get_incremental_xref_entry(::pdf_document *doc, int i);
  8908. /** Low-level wrapper for `::pdf_get_indirect_document()`. */
  8909. FZ_FUNCTION ::pdf_document *ll_pdf_get_indirect_document(::pdf_obj *obj);
  8910. /** Low-level wrapper for `::pdf_get_populating_xref_entry()`. */
  8911. FZ_FUNCTION ::pdf_xref_entry *ll_pdf_get_populating_xref_entry(::pdf_document *doc, int i);
  8912. /** Low-level wrapper for `::pdf_get_widget_editing_state()`. */
  8913. FZ_FUNCTION int ll_pdf_get_widget_editing_state(::pdf_annot *widget);
  8914. /** Low-level wrapper for `::pdf_get_xref_entry()`. */
  8915. FZ_FUNCTION ::pdf_xref_entry *ll_pdf_get_xref_entry(::pdf_document *doc, int i);
  8916. /** Low-level wrapper for `::pdf_get_xref_entry_no_change()`. */
  8917. FZ_FUNCTION ::pdf_xref_entry *ll_pdf_get_xref_entry_no_change(::pdf_document *doc, int i);
  8918. /** Low-level wrapper for `::pdf_get_xref_entry_no_null()`. */
  8919. FZ_FUNCTION ::pdf_xref_entry *ll_pdf_get_xref_entry_no_null(::pdf_document *doc, int i);
  8920. /** Low-level wrapper for `::pdf_graft_mapped_object()`. */
  8921. FZ_FUNCTION ::pdf_obj *ll_pdf_graft_mapped_object(::pdf_graft_map *map, ::pdf_obj *obj);
  8922. /** Low-level wrapper for `::pdf_graft_mapped_page()`. */
  8923. FZ_FUNCTION void ll_pdf_graft_mapped_page(::pdf_graft_map *map, int page_to, ::pdf_document *src, int page_from);
  8924. /** Low-level wrapper for `::pdf_graft_object()`. */
  8925. FZ_FUNCTION ::pdf_obj *ll_pdf_graft_object(::pdf_document *dst, ::pdf_obj *obj);
  8926. /** Low-level wrapper for `::pdf_graft_page()`. */
  8927. FZ_FUNCTION void ll_pdf_graft_page(::pdf_document *dst, int page_to, ::pdf_document *src, int page_from);
  8928. /** Low-level wrapper for `::pdf_has_permission()`. */
  8929. FZ_FUNCTION int ll_pdf_has_permission(::pdf_document *doc, ::fz_permission p);
  8930. /** Low-level wrapper for `::pdf_has_unsaved_changes()`. */
  8931. FZ_FUNCTION int ll_pdf_has_unsaved_changes(::pdf_document *doc);
  8932. /** Low-level wrapper for `::pdf_has_unsaved_sigs()`. */
  8933. FZ_FUNCTION int ll_pdf_has_unsaved_sigs(::pdf_document *doc);
  8934. /** Low-level wrapper for `::pdf_incremental_change_since_signing_widget()`. */
  8935. FZ_FUNCTION int ll_pdf_incremental_change_since_signing_widget(::pdf_annot *widget);
  8936. /** Low-level wrapper for `::pdf_insert_colorspace_resource()`. */
  8937. FZ_FUNCTION ::pdf_obj *ll_pdf_insert_colorspace_resource(::pdf_document *doc, ::pdf_colorspace_resource_key *key, ::pdf_obj *obj);
  8938. /** Low-level wrapper for `::pdf_insert_font_resource()`. */
  8939. FZ_FUNCTION ::pdf_obj *ll_pdf_insert_font_resource(::pdf_document *doc, ::pdf_font_resource_key *key, ::pdf_obj *obj);
  8940. /** Low-level wrapper for `::pdf_insert_page()`. */
  8941. FZ_FUNCTION void ll_pdf_insert_page(::pdf_document *doc, int at, ::pdf_obj *page);
  8942. /** Low-level wrapper for `::pdf_intent_from_name()`. */
  8943. FZ_FUNCTION enum pdf_intent ll_pdf_intent_from_name(::pdf_obj *obj);
  8944. /** Low-level wrapper for `::pdf_intent_from_string()`. */
  8945. FZ_FUNCTION enum pdf_intent ll_pdf_intent_from_string(const char *str);
  8946. /** Low-level wrapper for `::pdf_invalidate_xfa()`. */
  8947. FZ_FUNCTION void ll_pdf_invalidate_xfa(::pdf_document *doc);
  8948. /** Low-level wrapper for `::pdf_is_array()`. */
  8949. FZ_FUNCTION int ll_pdf_is_array(::pdf_obj *obj);
  8950. /** Low-level wrapper for `::pdf_is_bool()`. */
  8951. FZ_FUNCTION int ll_pdf_is_bool(::pdf_obj *obj);
  8952. /** Low-level wrapper for `::pdf_is_dict()`. */
  8953. FZ_FUNCTION int ll_pdf_is_dict(::pdf_obj *obj);
  8954. /** Low-level wrapper for `::pdf_is_embedded_file()`. */
  8955. FZ_FUNCTION int ll_pdf_is_embedded_file(::pdf_obj *fs);
  8956. /** Low-level wrapper for `::pdf_is_field_locked()`. */
  8957. FZ_FUNCTION int ll_pdf_is_field_locked(::pdf_locked_fields *locked, const char *name);
  8958. /** Low-level wrapper for `::pdf_is_filespec()`. */
  8959. FZ_FUNCTION int ll_pdf_is_filespec(::pdf_obj *fs);
  8960. /** Low-level wrapper for `::pdf_is_image_stream()`. */
  8961. FZ_FUNCTION int ll_pdf_is_image_stream(::pdf_obj *obj);
  8962. /** Low-level wrapper for `::pdf_is_indirect()`. */
  8963. FZ_FUNCTION int ll_pdf_is_indirect(::pdf_obj *obj);
  8964. /** Low-level wrapper for `::pdf_is_int()`. */
  8965. FZ_FUNCTION int ll_pdf_is_int(::pdf_obj *obj);
  8966. /** Low-level wrapper for `::pdf_is_jpx_image()`. */
  8967. FZ_FUNCTION int ll_pdf_is_jpx_image(::pdf_obj *dict);
  8968. /** Low-level wrapper for `::pdf_is_local_object()`. */
  8969. FZ_FUNCTION int ll_pdf_is_local_object(::pdf_document *doc, ::pdf_obj *obj);
  8970. /** Low-level wrapper for `::pdf_is_name()`. */
  8971. FZ_FUNCTION int ll_pdf_is_name(::pdf_obj *obj);
  8972. /** Low-level wrapper for `::pdf_is_null()`. */
  8973. FZ_FUNCTION int ll_pdf_is_null(::pdf_obj *obj);
  8974. /** Low-level wrapper for `::pdf_is_number()`. */
  8975. FZ_FUNCTION int ll_pdf_is_number(::pdf_obj *obj);
  8976. /** Low-level wrapper for `::pdf_is_ocg_hidden()`. */
  8977. FZ_FUNCTION int ll_pdf_is_ocg_hidden(::pdf_document *doc, ::pdf_resource_stack *rdb, const char *usage, ::pdf_obj *ocg);
  8978. /** Low-level wrapper for `::pdf_is_real()`. */
  8979. FZ_FUNCTION int ll_pdf_is_real(::pdf_obj *obj);
  8980. /** Low-level wrapper for `::pdf_is_stream()`. */
  8981. FZ_FUNCTION int ll_pdf_is_stream(::pdf_obj *obj);
  8982. /** Low-level wrapper for `::pdf_is_string()`. */
  8983. FZ_FUNCTION int ll_pdf_is_string(::pdf_obj *obj);
  8984. /** Low-level wrapper for `::pdf_is_tint_colorspace()`. */
  8985. FZ_FUNCTION int ll_pdf_is_tint_colorspace(::fz_colorspace *cs);
  8986. /** Low-level wrapper for `::pdf_js_event_init()`. */
  8987. FZ_FUNCTION void ll_pdf_js_event_init(::pdf_js *js, ::pdf_obj *target, const char *value, int willCommit);
  8988. /** Low-level wrapper for `::pdf_js_event_init_keystroke()`. */
  8989. FZ_FUNCTION void ll_pdf_js_event_init_keystroke(::pdf_js *js, ::pdf_obj *target, ::pdf_keystroke_event *evt);
  8990. /** Low-level wrapper for `::pdf_js_event_result()`. */
  8991. FZ_FUNCTION int ll_pdf_js_event_result(::pdf_js *js);
  8992. /** Low-level wrapper for `::pdf_js_event_result_keystroke()`. */
  8993. FZ_FUNCTION int ll_pdf_js_event_result_keystroke(::pdf_js *js, ::pdf_keystroke_event *evt);
  8994. /** Low-level wrapper for `::pdf_js_event_result_validate()`.
  8995. This function has out-params. Python/C# wrappers look like:
  8996. `ll_pdf_js_event_result_validate(::pdf_js *js)` => `(int, char *newvalue)`
  8997. */
  8998. FZ_FUNCTION int ll_pdf_js_event_result_validate(::pdf_js *js, char **newvalue);
  8999. /** Low-level wrapper for `::pdf_js_event_value()`. */
  9000. FZ_FUNCTION char *ll_pdf_js_event_value(::pdf_js *js);
  9001. /** Low-level wrapper for `::pdf_js_execute()`.
  9002. This function has out-params. Python/C# wrappers look like:
  9003. `ll_pdf_js_execute(::pdf_js *js, const char *name, const char *code)` => char *result
  9004. */
  9005. FZ_FUNCTION void ll_pdf_js_execute(::pdf_js *js, const char *name, const char *code, char **result);
  9006. /** Low-level wrapper for `::pdf_js_get_console()`. */
  9007. FZ_FUNCTION ::pdf_js_console *ll_pdf_js_get_console(::pdf_document *doc);
  9008. /** Low-level wrapper for `::pdf_js_set_console()`. */
  9009. FZ_FUNCTION void ll_pdf_js_set_console(::pdf_document *doc, ::pdf_js_console *console, void *user);
  9010. /** Low-level wrapper for `::pdf_js_supported()`. */
  9011. FZ_FUNCTION int ll_pdf_js_supported(::pdf_document *doc);
  9012. /** Low-level wrapper for `::pdf_keep_annot()`. */
  9013. FZ_FUNCTION ::pdf_annot *ll_pdf_keep_annot(::pdf_annot *annot);
  9014. /** Low-level wrapper for `::pdf_keep_cmap()`. */
  9015. FZ_FUNCTION ::pdf_cmap *ll_pdf_keep_cmap(::pdf_cmap *cmap);
  9016. /** Low-level wrapper for `::pdf_keep_document()`. */
  9017. FZ_FUNCTION ::pdf_document *ll_pdf_keep_document(::pdf_document *doc);
  9018. /** Low-level wrapper for `::pdf_keep_font()`. */
  9019. FZ_FUNCTION ::pdf_font_desc *ll_pdf_keep_font(::pdf_font_desc *fontdesc);
  9020. /** Low-level wrapper for `::pdf_keep_function()`. */
  9021. FZ_FUNCTION ::pdf_function *ll_pdf_keep_function(::pdf_function *func);
  9022. /** Low-level wrapper for `::pdf_keep_graft_map()`. */
  9023. FZ_FUNCTION ::pdf_graft_map *ll_pdf_keep_graft_map(::pdf_graft_map *map);
  9024. /** Low-level wrapper for `::pdf_keep_obj()`. */
  9025. FZ_FUNCTION ::pdf_obj *ll_pdf_keep_obj(::pdf_obj *obj);
  9026. /** Low-level wrapper for `::pdf_keep_page()`. */
  9027. FZ_FUNCTION ::pdf_page *ll_pdf_keep_page(::pdf_page *page);
  9028. /** Low-level wrapper for `::pdf_keep_pattern()`. */
  9029. FZ_FUNCTION ::pdf_pattern *ll_pdf_keep_pattern(::pdf_pattern *pat);
  9030. /** Low-level wrapper for `::pdf_keep_processor()`. */
  9031. FZ_FUNCTION ::pdf_processor *ll_pdf_keep_processor(::pdf_processor *proc);
  9032. /** Low-level wrapper for `::pdf_keep_widget()`. */
  9033. FZ_FUNCTION ::pdf_annot *ll_pdf_keep_widget(::pdf_annot *widget);
  9034. /** Low-level wrapper for `::pdf_label_object()`. */
  9035. FZ_FUNCTION void ll_pdf_label_object(::pdf_object_labels *g, int num, ::pdf_label_object_fn *callback, void *arg);
  9036. /** Low-level wrapper for `::pdf_layer_config_info()`. */
  9037. FZ_FUNCTION void ll_pdf_layer_config_info(::pdf_document *doc, int config_num, ::pdf_layer_config *info);
  9038. /** Low-level wrapper for `::pdf_layer_config_ui_info()`. */
  9039. FZ_FUNCTION void ll_pdf_layer_config_ui_info(::pdf_document *doc, int ui, ::pdf_layer_config_ui *info);
  9040. /** Low-level wrapper for `::pdf_layer_is_enabled()`. */
  9041. FZ_FUNCTION int ll_pdf_layer_is_enabled(::pdf_document *doc, int layer);
  9042. /** Low-level wrapper for `::pdf_layer_name()`. */
  9043. FZ_FUNCTION const char *ll_pdf_layer_name(::pdf_document *doc, int layer);
  9044. /** Low-level wrapper for `::pdf_layout_fit_text()`. */
  9045. FZ_FUNCTION ::fz_text *ll_pdf_layout_fit_text(::fz_font *font, ::fz_text_language lang, const char *str, ::fz_rect bounds);
  9046. /** Low-level wrapper for `::pdf_layout_text_widget()`. */
  9047. FZ_FUNCTION ::fz_layout_block *ll_pdf_layout_text_widget(::pdf_annot *annot);
  9048. /** Low-level wrapper for `::pdf_lex()`. */
  9049. FZ_FUNCTION ::pdf_token ll_pdf_lex(::fz_stream *f, ::pdf_lexbuf *lexbuf);
  9050. /** Low-level wrapper for `::pdf_lex_no_string()`. */
  9051. FZ_FUNCTION ::pdf_token ll_pdf_lex_no_string(::fz_stream *f, ::pdf_lexbuf *lexbuf);
  9052. /** Low-level wrapper for `::pdf_lexbuf_fin()`. */
  9053. FZ_FUNCTION void ll_pdf_lexbuf_fin(::pdf_lexbuf *lexbuf);
  9054. /** Low-level wrapper for `::pdf_lexbuf_grow()`. */
  9055. FZ_FUNCTION ptrdiff_t ll_pdf_lexbuf_grow(::pdf_lexbuf *lexbuf);
  9056. /** Low-level wrapper for `::pdf_lexbuf_init()`. */
  9057. FZ_FUNCTION void ll_pdf_lexbuf_init(::pdf_lexbuf *lexbuf, int size);
  9058. /** Low-level wrapper for `::pdf_line_ending_from_name()`. */
  9059. FZ_FUNCTION enum pdf_line_ending ll_pdf_line_ending_from_name(::pdf_obj *end);
  9060. /** Low-level wrapper for `::pdf_line_ending_from_string()`. */
  9061. FZ_FUNCTION enum pdf_line_ending ll_pdf_line_ending_from_string(const char *end);
  9062. /** Low-level wrapper for `::pdf_load_builtin_cmap()`. */
  9063. FZ_FUNCTION ::pdf_cmap *ll_pdf_load_builtin_cmap(const char *name);
  9064. /** Low-level wrapper for `::pdf_load_cmap()`. */
  9065. FZ_FUNCTION ::pdf_cmap *ll_pdf_load_cmap(::fz_stream *file);
  9066. /** Low-level wrapper for `::pdf_load_colorspace()`. */
  9067. FZ_FUNCTION ::fz_colorspace *ll_pdf_load_colorspace(::pdf_obj *obj);
  9068. /** Low-level wrapper for `::pdf_load_compressed_inline_image()`. */
  9069. FZ_FUNCTION void ll_pdf_load_compressed_inline_image(::pdf_document *doc, ::pdf_obj *dict, int length, ::fz_stream *cstm, int indexed, ::fz_compressed_image *image);
  9070. /** Low-level wrapper for `::pdf_load_compressed_stream()`. */
  9071. FZ_FUNCTION ::fz_compressed_buffer *ll_pdf_load_compressed_stream(::pdf_document *doc, int num, size_t worst_case);
  9072. /** Low-level wrapper for `::pdf_load_default_colorspaces()`. */
  9073. FZ_FUNCTION ::fz_default_colorspaces *ll_pdf_load_default_colorspaces(::pdf_document *doc, ::pdf_page *page);
  9074. /** Low-level wrapper for `::pdf_load_embedded_cmap()`. */
  9075. FZ_FUNCTION ::pdf_cmap *ll_pdf_load_embedded_cmap(::pdf_document *doc, ::pdf_obj *ref);
  9076. /** Low-level wrapper for `::pdf_load_embedded_file_contents()`. */
  9077. FZ_FUNCTION ::fz_buffer *ll_pdf_load_embedded_file_contents(::pdf_obj *fs);
  9078. /** Low-level wrapper for `::pdf_load_encoding()`.
  9079. This function has out-params. Python/C# wrappers look like:
  9080. `ll_pdf_load_encoding(const char *encoding)` => const char *estrings
  9081. */
  9082. FZ_FUNCTION void ll_pdf_load_encoding(const char **estrings, const char *encoding);
  9083. /** Low-level wrapper for `::pdf_load_field_name()`. */
  9084. FZ_FUNCTION char *ll_pdf_load_field_name(::pdf_obj *field);
  9085. /** Alternative to `ll_pdf_load_field_name()` that returns a std::string. */
  9086. FZ_FUNCTION std::string ll_pdf_load_field_name2(pdf_obj* field);
  9087. /** Low-level wrapper for `::pdf_load_font()`. */
  9088. FZ_FUNCTION ::pdf_font_desc *ll_pdf_load_font(::pdf_document *doc, ::pdf_resource_stack *rdb, ::pdf_obj *obj);
  9089. /** Low-level wrapper for `::pdf_load_function()`. */
  9090. FZ_FUNCTION ::pdf_function *ll_pdf_load_function(::pdf_obj *ref, int in, int out);
  9091. /** Low-level wrapper for `::pdf_load_hail_mary_font()`. */
  9092. FZ_FUNCTION ::pdf_font_desc *ll_pdf_load_hail_mary_font(::pdf_document *doc);
  9093. /** Low-level wrapper for `::pdf_load_image()`. */
  9094. FZ_FUNCTION ::fz_image *ll_pdf_load_image(::pdf_document *doc, ::pdf_obj *obj);
  9095. /** Low-level wrapper for `::pdf_load_inline_image()`. */
  9096. FZ_FUNCTION ::fz_image *ll_pdf_load_inline_image(::pdf_document *doc, ::pdf_resource_stack *rdb, ::pdf_obj *dict, ::fz_stream *file);
  9097. /** Low-level wrapper for `::pdf_load_journal()`. */
  9098. FZ_FUNCTION void ll_pdf_load_journal(::pdf_document *doc, const char *filename);
  9099. /** Low-level wrapper for `::pdf_load_link_annots()`. */
  9100. FZ_FUNCTION ::fz_link *ll_pdf_load_link_annots(::pdf_document *arg_1, ::pdf_page *arg_2, ::pdf_obj *annots, int pagenum, ::fz_matrix page_ctm);
  9101. /** Low-level wrapper for `::pdf_load_links()`. */
  9102. FZ_FUNCTION ::fz_link *ll_pdf_load_links(::pdf_page *page);
  9103. /** Low-level wrapper for `::pdf_load_name_tree()`. */
  9104. FZ_FUNCTION ::pdf_obj *ll_pdf_load_name_tree(::pdf_document *doc, ::pdf_obj *which);
  9105. /** Low-level wrapper for `::pdf_load_object()`. */
  9106. /**
  9107. Load a given object.
  9108. This can cause xref reorganisations (solidifications etc) due to
  9109. repairs, so all held pdf_xref_entries should be considered
  9110. invalid after this call (other than the returned one).
  9111. */
  9112. FZ_FUNCTION ::pdf_obj *ll_pdf_load_object(::pdf_document *doc, int num);
  9113. /** Low-level wrapper for `::pdf_load_object_labels()`. */
  9114. FZ_FUNCTION ::pdf_object_labels *ll_pdf_load_object_labels(::pdf_document *doc);
  9115. /** Low-level wrapper for `::pdf_load_outline()`. */
  9116. FZ_FUNCTION ::fz_outline *ll_pdf_load_outline(::pdf_document *doc);
  9117. /** Low-level wrapper for `::pdf_load_page()`. */
  9118. FZ_FUNCTION ::pdf_page *ll_pdf_load_page(::pdf_document *doc, int number);
  9119. /** Low-level wrapper for `::pdf_load_page_imp()`. */
  9120. FZ_FUNCTION ::fz_page *ll_pdf_load_page_imp(::fz_document *doc, int chapter, int number);
  9121. /** Low-level wrapper for `::pdf_load_page_tree()`. */
  9122. FZ_FUNCTION void ll_pdf_load_page_tree(::pdf_document *doc);
  9123. /** Low-level wrapper for `::pdf_load_pattern()`. */
  9124. FZ_FUNCTION ::pdf_pattern *ll_pdf_load_pattern(::pdf_document *doc, ::pdf_obj *obj);
  9125. /** Low-level wrapper for `::pdf_load_raw_stream()`. */
  9126. FZ_FUNCTION ::fz_buffer *ll_pdf_load_raw_stream(::pdf_obj *ref);
  9127. /** Low-level wrapper for `::pdf_load_raw_stream_number()`. */
  9128. FZ_FUNCTION ::fz_buffer *ll_pdf_load_raw_stream_number(::pdf_document *doc, int num);
  9129. /** Low-level wrapper for `::pdf_load_shading()`. */
  9130. FZ_FUNCTION ::fz_shade *ll_pdf_load_shading(::pdf_document *doc, ::pdf_obj *obj);
  9131. /** Low-level wrapper for `::pdf_load_stream()`. */
  9132. FZ_FUNCTION ::fz_buffer *ll_pdf_load_stream(::pdf_obj *ref);
  9133. /** Low-level wrapper for `::pdf_load_stream_number()`. */
  9134. FZ_FUNCTION ::fz_buffer *ll_pdf_load_stream_number(::pdf_document *doc, int num);
  9135. /** Low-level wrapper for `::pdf_load_stream_or_string_as_utf8()`. */
  9136. FZ_FUNCTION char *ll_pdf_load_stream_or_string_as_utf8(::pdf_obj *src);
  9137. /** Low-level wrapper for `::pdf_load_system_cmap()`. */
  9138. FZ_FUNCTION ::pdf_cmap *ll_pdf_load_system_cmap(const char *name);
  9139. /** Low-level wrapper for `::pdf_load_to_unicode()`.
  9140. This function has out-params. Python/C# wrappers look like:
  9141. `ll_pdf_load_to_unicode(::pdf_document *doc, ::pdf_font_desc *font, char *collection, ::pdf_obj *cmapstm)` => const char *strings
  9142. */
  9143. FZ_FUNCTION void ll_pdf_load_to_unicode(::pdf_document *doc, ::pdf_font_desc *font, const char **strings, char *collection, ::pdf_obj *cmapstm);
  9144. /** Low-level wrapper for `::pdf_load_type3_font()`. */
  9145. FZ_FUNCTION ::pdf_font_desc *ll_pdf_load_type3_font(::pdf_document *doc, ::pdf_resource_stack *rdb, ::pdf_obj *obj);
  9146. /** Low-level wrapper for `::pdf_load_type3_glyphs()`. */
  9147. FZ_FUNCTION void ll_pdf_load_type3_glyphs(::pdf_document *doc, ::pdf_font_desc *fontdesc);
  9148. /** Low-level wrapper for `::pdf_load_unencrypted_object()`. */
  9149. FZ_FUNCTION ::pdf_obj *ll_pdf_load_unencrypted_object(::pdf_document *doc, int num);
  9150. /** Low-level wrapper for `::pdf_lookup_cmap()`. */
  9151. FZ_FUNCTION int ll_pdf_lookup_cmap(::pdf_cmap *cmap, unsigned int cpt);
  9152. /** Low-level wrapper for `::pdf_lookup_cmap_full()`.
  9153. This function has out-params. Python/C# wrappers look like:
  9154. `ll_pdf_lookup_cmap_full(::pdf_cmap *cmap, unsigned int cpt)` => `(int, int out)`
  9155. */
  9156. FZ_FUNCTION int ll_pdf_lookup_cmap_full(::pdf_cmap *cmap, unsigned int cpt, int *out);
  9157. /** Low-level wrapper for `::pdf_lookup_dest()`. */
  9158. FZ_FUNCTION ::pdf_obj *ll_pdf_lookup_dest(::pdf_document *doc, ::pdf_obj *needle);
  9159. /** Low-level wrapper for `::pdf_lookup_field()`. */
  9160. FZ_FUNCTION ::pdf_obj *ll_pdf_lookup_field(::pdf_obj *form, const char *name);
  9161. /** Low-level wrapper for `::pdf_lookup_hmtx()`. */
  9162. FZ_FUNCTION ::pdf_hmtx ll_pdf_lookup_hmtx(::pdf_font_desc *font, int cid);
  9163. /** Low-level wrapper for `::pdf_lookup_metadata()`. */
  9164. FZ_FUNCTION int ll_pdf_lookup_metadata(::pdf_document *doc, const char *key, char *ptr, size_t size);
  9165. /** Low-level wrapper for `::pdf_lookup_metadata2()`. */
  9166. /**
  9167. C++ alternative to `pdf_lookup_metadata()` that returns a `std::string`
  9168. or calls `fz_throw()` if not found.
  9169. */
  9170. FZ_FUNCTION std::string ll_pdf_lookup_metadata2(::pdf_document *doc, const char *key);
  9171. /** Low-level wrapper for `::pdf_lookup_name()`. */
  9172. FZ_FUNCTION ::pdf_obj *ll_pdf_lookup_name(::pdf_document *doc, ::pdf_obj *which, ::pdf_obj *needle);
  9173. /** Low-level wrapper for `::pdf_lookup_number()`. */
  9174. FZ_FUNCTION ::pdf_obj *ll_pdf_lookup_number(::pdf_obj *root, int needle);
  9175. /** Low-level wrapper for `::pdf_lookup_page_loc()`.
  9176. This function has out-params. Python/C# wrappers look like:
  9177. `ll_pdf_lookup_page_loc(::pdf_document *doc, int needle, ::pdf_obj **parentp)` => `(pdf_obj *, int indexp)`
  9178. */
  9179. FZ_FUNCTION ::pdf_obj *ll_pdf_lookup_page_loc(::pdf_document *doc, int needle, ::pdf_obj **parentp, int *indexp);
  9180. /** Low-level wrapper for `::pdf_lookup_page_number()`. */
  9181. FZ_FUNCTION int ll_pdf_lookup_page_number(::pdf_document *doc, ::pdf_obj *pageobj);
  9182. /** Low-level wrapper for `::pdf_lookup_page_obj()`. */
  9183. FZ_FUNCTION ::pdf_obj *ll_pdf_lookup_page_obj(::pdf_document *doc, int needle);
  9184. /** Low-level wrapper for `::pdf_lookup_resource()`. */
  9185. FZ_FUNCTION ::pdf_obj *ll_pdf_lookup_resource(::pdf_resource_stack *stack, ::pdf_obj *type, const char *name);
  9186. /** Low-level wrapper for `::pdf_lookup_substitute_font()`.
  9187. This function has out-params. Python/C# wrappers look like:
  9188. `ll_pdf_lookup_substitute_font(int mono, int serif, int bold, int italic)` => `(const unsigned char *, int len)`
  9189. */
  9190. FZ_FUNCTION const unsigned char *ll_pdf_lookup_substitute_font(int mono, int serif, int bold, int italic, int *len);
  9191. /** Low-level wrapper for `::pdf_lookup_vmtx()`. */
  9192. FZ_FUNCTION ::pdf_vmtx ll_pdf_lookup_vmtx(::pdf_font_desc *font, int cid);
  9193. /** Low-level wrapper for `::pdf_map_one_to_many()`.
  9194. This function has out-params. Python/C# wrappers look like:
  9195. `ll_pdf_map_one_to_many(::pdf_cmap *cmap, unsigned int one, size_t len)` => int many
  9196. */
  9197. FZ_FUNCTION void ll_pdf_map_one_to_many(::pdf_cmap *cmap, unsigned int one, int *many, size_t len);
  9198. /** Low-level wrapper for `::pdf_map_range_to_range()`. */
  9199. FZ_FUNCTION void ll_pdf_map_range_to_range(::pdf_cmap *cmap, unsigned int srclo, unsigned int srchi, int dstlo);
  9200. /** Low-level wrapper for `::pdf_mark_bits_reset()`. */
  9201. FZ_FUNCTION void ll_pdf_mark_bits_reset(::pdf_mark_bits *marks);
  9202. /** Low-level wrapper for `::pdf_mark_bits_set()`. */
  9203. FZ_FUNCTION int ll_pdf_mark_bits_set(::pdf_mark_bits *marks, ::pdf_obj *obj);
  9204. /** Low-level wrapper for `::pdf_mark_list_check()`. */
  9205. FZ_FUNCTION int ll_pdf_mark_list_check(::pdf_mark_list *list, ::pdf_obj *obj);
  9206. /** Low-level wrapper for `::pdf_mark_list_free()`. */
  9207. FZ_FUNCTION void ll_pdf_mark_list_free(::pdf_mark_list *list);
  9208. /** Low-level wrapper for `::pdf_mark_list_init()`. */
  9209. FZ_FUNCTION void ll_pdf_mark_list_init(::pdf_mark_list *list);
  9210. /** Low-level wrapper for `::pdf_mark_list_pop()`. */
  9211. FZ_FUNCTION void ll_pdf_mark_list_pop(::pdf_mark_list *list);
  9212. /** Low-level wrapper for `::pdf_mark_list_push()`. */
  9213. FZ_FUNCTION int ll_pdf_mark_list_push(::pdf_mark_list *list, ::pdf_obj *obj);
  9214. /** Low-level wrapper for `::pdf_mark_obj()`. */
  9215. FZ_FUNCTION int ll_pdf_mark_obj(::pdf_obj *obj);
  9216. /** Low-level wrapper for `::pdf_mark_xref()`. */
  9217. FZ_FUNCTION void ll_pdf_mark_xref(::pdf_document *doc);
  9218. /** Low-level wrapper for `::pdf_metadata()`. */
  9219. FZ_FUNCTION ::pdf_obj *ll_pdf_metadata(::pdf_document *doc);
  9220. /** Low-level wrapper for `::pdf_minimize_document()`. */
  9221. FZ_FUNCTION void ll_pdf_minimize_document(::pdf_document *doc);
  9222. /** Low-level wrapper for `::pdf_name_eq()`. */
  9223. FZ_FUNCTION int ll_pdf_name_eq(::pdf_obj *a, ::pdf_obj *b);
  9224. /** Low-level wrapper for `::pdf_name_from_intent()`. */
  9225. FZ_FUNCTION ::pdf_obj *ll_pdf_name_from_intent(enum pdf_intent intent);
  9226. /** Low-level wrapper for `::pdf_name_from_line_ending()`. */
  9227. FZ_FUNCTION ::pdf_obj *ll_pdf_name_from_line_ending(enum pdf_line_ending end);
  9228. /** Low-level wrapper for `::pdf_needs_password()`. */
  9229. FZ_FUNCTION int ll_pdf_needs_password(::pdf_document *doc);
  9230. /** Low-level wrapper for `::pdf_new_action_from_link()`. */
  9231. FZ_FUNCTION ::pdf_obj *ll_pdf_new_action_from_link(::pdf_document *doc, const char *uri);
  9232. /** Low-level wrapper for `::pdf_new_array()`. */
  9233. FZ_FUNCTION ::pdf_obj *ll_pdf_new_array(::pdf_document *doc, int initialcap);
  9234. /** Low-level wrapper for `::pdf_new_buffer_processor()`. */
  9235. FZ_FUNCTION ::pdf_processor *ll_pdf_new_buffer_processor(::fz_buffer *buffer, int ahxencode, int newlines);
  9236. /** Low-level wrapper for `::pdf_new_cmap()`. */
  9237. FZ_FUNCTION ::pdf_cmap *ll_pdf_new_cmap();
  9238. /** Low-level wrapper for `::pdf_new_color_filter()`. */
  9239. FZ_FUNCTION ::pdf_processor *ll_pdf_new_color_filter(::pdf_document *doc, ::pdf_processor *chain, int struct_parents, ::fz_matrix transform, ::pdf_filter_options *options, void *copts);
  9240. /** Low-level wrapper for `::pdf_new_crypt()`. */
  9241. FZ_FUNCTION ::pdf_crypt *ll_pdf_new_crypt(::pdf_obj *enc, ::pdf_obj *id);
  9242. /** Low-level wrapper for `::pdf_new_date()`. */
  9243. FZ_FUNCTION ::pdf_obj *ll_pdf_new_date(::pdf_document *doc, int64_t time);
  9244. /** Low-level wrapper for `::pdf_new_dest_from_link()`. */
  9245. FZ_FUNCTION ::pdf_obj *ll_pdf_new_dest_from_link(::pdf_document *doc, const char *uri, int is_remote);
  9246. /** Low-level wrapper for `::pdf_new_dict()`. */
  9247. FZ_FUNCTION ::pdf_obj *ll_pdf_new_dict(::pdf_document *doc, int initialcap);
  9248. /** Low-level wrapper for `::pdf_new_display_list_from_annot()`. */
  9249. FZ_FUNCTION ::fz_display_list *ll_pdf_new_display_list_from_annot(::pdf_annot *annot);
  9250. /** Low-level wrapper for `::pdf_new_encrypt()`. */
  9251. FZ_FUNCTION ::pdf_crypt *ll_pdf_new_encrypt(const char *opwd_utf8, const char *upwd_utf8, ::pdf_obj *id, int permissions, int algorithm);
  9252. /** Low-level wrapper for `::pdf_new_font_desc()`. */
  9253. FZ_FUNCTION ::pdf_font_desc *ll_pdf_new_font_desc();
  9254. /** Low-level wrapper for `::pdf_new_graft_map()`. */
  9255. FZ_FUNCTION ::pdf_graft_map *ll_pdf_new_graft_map(::pdf_document *dst);
  9256. /** Low-level wrapper for `::pdf_new_identity_cmap()`. */
  9257. FZ_FUNCTION ::pdf_cmap *ll_pdf_new_identity_cmap(int wmode, int bytes);
  9258. /** Low-level wrapper for `::pdf_new_indirect()`. */
  9259. FZ_FUNCTION ::pdf_obj *ll_pdf_new_indirect(::pdf_document *doc, int num, int gen);
  9260. /** Low-level wrapper for `::pdf_new_int()`. */
  9261. FZ_FUNCTION ::pdf_obj *ll_pdf_new_int(int64_t i);
  9262. /** Low-level wrapper for `::pdf_new_link()`. */
  9263. FZ_FUNCTION ::fz_link *ll_pdf_new_link(::pdf_page *page, ::fz_rect rect, const char *uri, ::pdf_obj *obj);
  9264. /** Low-level wrapper for `::pdf_new_local_xref()`. */
  9265. FZ_FUNCTION ::pdf_xref *ll_pdf_new_local_xref(::pdf_document *doc);
  9266. /** Low-level wrapper for `::pdf_new_mark_bits()`. */
  9267. FZ_FUNCTION ::pdf_mark_bits *ll_pdf_new_mark_bits(::pdf_document *doc);
  9268. /** Low-level wrapper for `::pdf_new_matrix()`. */
  9269. FZ_FUNCTION ::pdf_obj *ll_pdf_new_matrix(::pdf_document *doc, ::fz_matrix mtx);
  9270. /** Low-level wrapper for `::pdf_new_name()`. */
  9271. FZ_FUNCTION ::pdf_obj *ll_pdf_new_name(const char *str);
  9272. /** Low-level wrapper for `::pdf_new_outline_iterator()`. */
  9273. FZ_FUNCTION ::fz_outline_iterator *ll_pdf_new_outline_iterator(::pdf_document *doc);
  9274. /** Low-level wrapper for `::pdf_new_output_processor()`. */
  9275. FZ_FUNCTION ::pdf_processor *ll_pdf_new_output_processor(::fz_output *out, int ahxencode, int newlines);
  9276. /** Low-level wrapper for `::pdf_new_pdf_device()`. */
  9277. FZ_FUNCTION ::fz_device *ll_pdf_new_pdf_device(::pdf_document *doc, ::fz_matrix topctm, ::pdf_obj *resources, ::fz_buffer *contents);
  9278. /** Low-level wrapper for `::pdf_new_pixmap_from_annot()`. */
  9279. FZ_FUNCTION ::fz_pixmap *ll_pdf_new_pixmap_from_annot(::pdf_annot *annot, ::fz_matrix ctm, ::fz_colorspace *cs, ::fz_separations *seps, int alpha);
  9280. /** Low-level wrapper for `::pdf_new_pixmap_from_page_contents_with_separations_and_usage()`. */
  9281. FZ_FUNCTION ::fz_pixmap *ll_pdf_new_pixmap_from_page_contents_with_separations_and_usage(::pdf_page *page, ::fz_matrix ctm, ::fz_colorspace *cs, ::fz_separations *seps, int alpha, const char *usage, ::fz_box_type box);
  9282. /** Low-level wrapper for `::pdf_new_pixmap_from_page_contents_with_usage()`. */
  9283. FZ_FUNCTION ::fz_pixmap *ll_pdf_new_pixmap_from_page_contents_with_usage(::pdf_page *page, ::fz_matrix ctm, ::fz_colorspace *cs, int alpha, const char *usage, ::fz_box_type box);
  9284. /** Low-level wrapper for `::pdf_new_pixmap_from_page_with_separations_and_usage()`. */
  9285. FZ_FUNCTION ::fz_pixmap *ll_pdf_new_pixmap_from_page_with_separations_and_usage(::pdf_page *page, ::fz_matrix ctm, ::fz_colorspace *cs, ::fz_separations *seps, int alpha, const char *usage, ::fz_box_type box);
  9286. /** Low-level wrapper for `::pdf_new_pixmap_from_page_with_usage()`. */
  9287. FZ_FUNCTION ::fz_pixmap *ll_pdf_new_pixmap_from_page_with_usage(::pdf_page *page, ::fz_matrix ctm, ::fz_colorspace *cs, int alpha, const char *usage, ::fz_box_type box);
  9288. /** Low-level wrapper for `::pdf_new_point()`. */
  9289. FZ_FUNCTION ::pdf_obj *ll_pdf_new_point(::pdf_document *doc, ::fz_point point);
  9290. /** Low-level wrapper for `::pdf_new_processor()`. */
  9291. FZ_FUNCTION void *ll_pdf_new_processor(int size);
  9292. /** Low-level wrapper for `::pdf_new_real()`. */
  9293. FZ_FUNCTION ::pdf_obj *ll_pdf_new_real(float f);
  9294. /** Low-level wrapper for `::pdf_new_rect()`. */
  9295. FZ_FUNCTION ::pdf_obj *ll_pdf_new_rect(::pdf_document *doc, ::fz_rect rect);
  9296. /** Low-level wrapper for `::pdf_new_run_processor()`. */
  9297. FZ_FUNCTION ::pdf_processor *ll_pdf_new_run_processor(::pdf_document *doc, ::fz_device *dev, ::fz_matrix ctm, int struct_parent, const char *usage, ::pdf_gstate *gstate, ::fz_default_colorspaces *default_cs, ::fz_cookie *cookie, ::pdf_gstate *fill_gstate, ::pdf_gstate *stroke_gstate);
  9298. /** Low-level wrapper for `::pdf_new_sanitize_filter()`. */
  9299. FZ_FUNCTION ::pdf_processor *ll_pdf_new_sanitize_filter(::pdf_document *doc, ::pdf_processor *chain, int struct_parents, ::fz_matrix transform, ::pdf_filter_options *options, void *sopts);
  9300. /** Low-level wrapper for `::pdf_new_stext_page_from_annot()`. */
  9301. FZ_FUNCTION ::fz_stext_page *ll_pdf_new_stext_page_from_annot(::pdf_annot *annot, const ::fz_stext_options *options);
  9302. /** Low-level wrapper for `::pdf_new_string()`. */
  9303. FZ_FUNCTION ::pdf_obj *ll_pdf_new_string(const char *str, size_t len);
  9304. /** Low-level wrapper for `::pdf_new_text_string()`. */
  9305. FZ_FUNCTION ::pdf_obj *ll_pdf_new_text_string(const char *s);
  9306. /** Low-level wrapper for `::pdf_new_uri_from_explicit_dest()`. */
  9307. FZ_FUNCTION char *ll_pdf_new_uri_from_explicit_dest(::fz_link_dest dest);
  9308. /** Low-level wrapper for `::pdf_new_uri_from_path_and_explicit_dest()`. */
  9309. FZ_FUNCTION char *ll_pdf_new_uri_from_path_and_explicit_dest(const char *path, ::fz_link_dest dest);
  9310. /** Low-level wrapper for `::pdf_new_uri_from_path_and_named_dest()`. */
  9311. FZ_FUNCTION char *ll_pdf_new_uri_from_path_and_named_dest(const char *path, const char *name);
  9312. /** Low-level wrapper for `::pdf_new_utf8_from_pdf_stream_obj()`. */
  9313. FZ_FUNCTION char *ll_pdf_new_utf8_from_pdf_stream_obj(::pdf_obj *src);
  9314. /** Low-level wrapper for `::pdf_new_utf8_from_pdf_string()`. */
  9315. FZ_FUNCTION char *ll_pdf_new_utf8_from_pdf_string(const char *srcptr, size_t srclen);
  9316. /** Low-level wrapper for `::pdf_new_utf8_from_pdf_string_obj()`. */
  9317. FZ_FUNCTION char *ll_pdf_new_utf8_from_pdf_string_obj(::pdf_obj *src);
  9318. /** Low-level wrapper for `::pdf_new_xobject()`. */
  9319. FZ_FUNCTION ::pdf_obj *ll_pdf_new_xobject(::pdf_document *doc, ::fz_rect bbox, ::fz_matrix matrix, ::pdf_obj *res, ::fz_buffer *buffer);
  9320. /** Low-level wrapper for `::pdf_next_annot()`. */
  9321. FZ_FUNCTION ::pdf_annot *ll_pdf_next_annot(::pdf_annot *annot);
  9322. /** Low-level wrapper for `::pdf_next_widget()`. */
  9323. FZ_FUNCTION ::pdf_annot *ll_pdf_next_widget(::pdf_annot *previous);
  9324. /** Low-level wrapper for `::pdf_nuke_annots()`. */
  9325. FZ_FUNCTION void ll_pdf_nuke_annots(::pdf_page *page);
  9326. /** Low-level wrapper for `::pdf_nuke_links()`. */
  9327. FZ_FUNCTION void ll_pdf_nuke_links(::pdf_page *page);
  9328. /** Low-level wrapper for `::pdf_nuke_page()`. */
  9329. FZ_FUNCTION void ll_pdf_nuke_page(::pdf_page *page);
  9330. /** Low-level wrapper for `::pdf_obj_is_dirty()`. */
  9331. FZ_FUNCTION int ll_pdf_obj_is_dirty(::pdf_obj *obj);
  9332. /** Low-level wrapper for `::pdf_obj_is_incremental()`. */
  9333. FZ_FUNCTION int ll_pdf_obj_is_incremental(::pdf_obj *obj);
  9334. /** Low-level wrapper for `::pdf_obj_marked()`. */
  9335. FZ_FUNCTION int ll_pdf_obj_marked(::pdf_obj *obj);
  9336. /** Low-level wrapper for `::pdf_obj_memo()`.
  9337. This function has out-params. Python/C# wrappers look like:
  9338. `ll_pdf_obj_memo(::pdf_obj *obj, int bit)` => `(int, int memo)`
  9339. */
  9340. FZ_FUNCTION int ll_pdf_obj_memo(::pdf_obj *obj, int bit, int *memo);
  9341. /** Low-level wrapper for `::pdf_obj_num_is_stream()`. */
  9342. FZ_FUNCTION int ll_pdf_obj_num_is_stream(::pdf_document *doc, int num);
  9343. /** Low-level wrapper for `::pdf_obj_parent_num()`. */
  9344. FZ_FUNCTION int ll_pdf_obj_parent_num(::pdf_obj *obj);
  9345. /** Low-level wrapper for `::pdf_obj_refs()`. */
  9346. FZ_FUNCTION int ll_pdf_obj_refs(::pdf_obj *ref);
  9347. /** Low-level wrapper for `::pdf_objcmp()`. */
  9348. FZ_FUNCTION int ll_pdf_objcmp(::pdf_obj *a, ::pdf_obj *b);
  9349. /** Low-level wrapper for `::pdf_objcmp_deep()`. */
  9350. FZ_FUNCTION int ll_pdf_objcmp_deep(::pdf_obj *a, ::pdf_obj *b);
  9351. /** Low-level wrapper for `::pdf_objcmp_resolve()`. */
  9352. FZ_FUNCTION int ll_pdf_objcmp_resolve(::pdf_obj *a, ::pdf_obj *b);
  9353. /** Low-level wrapper for `::pdf_object_exists()`. */
  9354. FZ_FUNCTION int ll_pdf_object_exists(::pdf_document *doc, int num);
  9355. /** Low-level wrapper for `::pdf_open_contents_stream()`. */
  9356. FZ_FUNCTION ::fz_stream *ll_pdf_open_contents_stream(::pdf_document *doc, ::pdf_obj *obj);
  9357. /** Low-level wrapper for `::pdf_open_crypt()`. */
  9358. FZ_FUNCTION ::fz_stream *ll_pdf_open_crypt(::fz_stream *chain, ::pdf_crypt *crypt, int num, int gen);
  9359. /** Low-level wrapper for `::pdf_open_crypt_with_filter()`. */
  9360. FZ_FUNCTION ::fz_stream *ll_pdf_open_crypt_with_filter(::fz_stream *chain, ::pdf_crypt *crypt, ::pdf_obj *name, int num, int gen);
  9361. /** Low-level wrapper for `::pdf_open_document()`. */
  9362. FZ_FUNCTION ::pdf_document *ll_pdf_open_document(const char *filename);
  9363. /** Low-level wrapper for `::pdf_open_document_with_stream()`. */
  9364. FZ_FUNCTION ::pdf_document *ll_pdf_open_document_with_stream(::fz_stream *file);
  9365. /** Low-level wrapper for `::pdf_open_inline_stream()`. */
  9366. FZ_FUNCTION ::fz_stream *ll_pdf_open_inline_stream(::pdf_document *doc, ::pdf_obj *stmobj, int length, ::fz_stream *chain, ::fz_compression_params *params);
  9367. /** Low-level wrapper for `::pdf_open_raw_stream()`. */
  9368. FZ_FUNCTION ::fz_stream *ll_pdf_open_raw_stream(::pdf_obj *ref);
  9369. /** Low-level wrapper for `::pdf_open_raw_stream_number()`. */
  9370. FZ_FUNCTION ::fz_stream *ll_pdf_open_raw_stream_number(::pdf_document *doc, int num);
  9371. /** Low-level wrapper for `::pdf_open_stream()`. */
  9372. FZ_FUNCTION ::fz_stream *ll_pdf_open_stream(::pdf_obj *ref);
  9373. /** Low-level wrapper for `::pdf_open_stream_number()`. */
  9374. FZ_FUNCTION ::fz_stream *ll_pdf_open_stream_number(::pdf_document *doc, int num);
  9375. /** Low-level wrapper for `::pdf_open_stream_with_offset()`. */
  9376. FZ_FUNCTION ::fz_stream *ll_pdf_open_stream_with_offset(::pdf_document *doc, int num, ::pdf_obj *dict, int64_t stm_ofs);
  9377. /** Low-level wrapper for `::pdf_page_associated_file()`. */
  9378. FZ_FUNCTION ::pdf_obj *ll_pdf_page_associated_file(::pdf_page *page, int idx);
  9379. /** Low-level wrapper for `::pdf_page_contents()`. */
  9380. FZ_FUNCTION ::pdf_obj *ll_pdf_page_contents(::pdf_page *page);
  9381. /** Low-level wrapper for `::pdf_page_event_close()`. */
  9382. FZ_FUNCTION void ll_pdf_page_event_close(::pdf_page *page);
  9383. /** Low-level wrapper for `::pdf_page_event_open()`. */
  9384. FZ_FUNCTION void ll_pdf_page_event_open(::pdf_page *page);
  9385. /** Low-level wrapper for `::pdf_page_from_fz_page()`. */
  9386. FZ_FUNCTION ::pdf_page *ll_pdf_page_from_fz_page(::fz_page *ptr);
  9387. /** Low-level wrapper for `::pdf_page_group()`. */
  9388. FZ_FUNCTION ::pdf_obj *ll_pdf_page_group(::pdf_page *page);
  9389. /** Low-level wrapper for `::pdf_page_has_transparency()`. */
  9390. FZ_FUNCTION int ll_pdf_page_has_transparency(::pdf_page *page);
  9391. /** Low-level wrapper for `::pdf_page_label()`. */
  9392. FZ_FUNCTION void ll_pdf_page_label(::pdf_document *doc, int page, char *buf, size_t size);
  9393. /** Low-level wrapper for `::pdf_page_label_imp()`. */
  9394. FZ_FUNCTION void ll_pdf_page_label_imp(::fz_document *doc, int chapter, int page, char *buf, size_t size);
  9395. /** Low-level wrapper for `::pdf_page_obj_transform()`. */
  9396. FZ_FUNCTION void ll_pdf_page_obj_transform(::pdf_obj *pageobj, ::fz_rect *outbox, ::fz_matrix *outctm);
  9397. /** Low-level wrapper for `::pdf_page_obj_transform_box()`. */
  9398. FZ_FUNCTION void ll_pdf_page_obj_transform_box(::pdf_obj *pageobj, ::fz_rect *outbox, ::fz_matrix *out, ::fz_box_type box);
  9399. /** Low-level wrapper for `::pdf_page_presentation()`.
  9400. This function has out-params. Python/C# wrappers look like:
  9401. `ll_pdf_page_presentation(::pdf_page *page, ::fz_transition *transition)` => `(fz_transition *, float duration)`
  9402. */
  9403. FZ_FUNCTION ::fz_transition *ll_pdf_page_presentation(::pdf_page *page, ::fz_transition *transition, float *duration);
  9404. /** Low-level wrapper for `::pdf_page_resources()`. */
  9405. FZ_FUNCTION ::pdf_obj *ll_pdf_page_resources(::pdf_page *page);
  9406. /** Low-level wrapper for `::pdf_page_separations()`. */
  9407. FZ_FUNCTION ::fz_separations *ll_pdf_page_separations(::pdf_page *page);
  9408. /** Low-level wrapper for `::pdf_page_transform()`. */
  9409. FZ_FUNCTION void ll_pdf_page_transform(::pdf_page *page, ::fz_rect *mediabox, ::fz_matrix *ctm);
  9410. /** Low-level wrapper for `::pdf_page_transform_box()`. */
  9411. FZ_FUNCTION void ll_pdf_page_transform_box(::pdf_page *page, ::fz_rect *mediabox, ::fz_matrix *ctm, ::fz_box_type box);
  9412. /** Low-level wrapper for `::pdf_page_write()`.
  9413. This function has out-params. Python/C# wrappers look like:
  9414. `ll_pdf_page_write(::pdf_document *doc, ::fz_rect mediabox, ::pdf_obj **presources, ::fz_buffer **pcontents)` => `(fz_device *)`
  9415. */
  9416. FZ_FUNCTION ::fz_device *ll_pdf_page_write(::pdf_document *doc, ::fz_rect mediabox, ::pdf_obj **presources, ::fz_buffer **pcontents);
  9417. /** Low-level wrapper for `::pdf_parse_array()`. */
  9418. FZ_FUNCTION ::pdf_obj *ll_pdf_parse_array(::pdf_document *doc, ::fz_stream *f, ::pdf_lexbuf *buf);
  9419. /** Low-level wrapper for `::pdf_parse_date()`. */
  9420. FZ_FUNCTION int64_t ll_pdf_parse_date(const char *s);
  9421. /** Low-level wrapper for `::pdf_parse_default_appearance()`.
  9422. This function has out-params. Python/C# wrappers look like:
  9423. `ll_pdf_parse_default_appearance(const char *da, float color[4])` => `(const char *font, float size, int n)`
  9424. */
  9425. FZ_FUNCTION void ll_pdf_parse_default_appearance(const char *da, const char **font, float *size, int *n, float color[4]);
  9426. /** Low-level wrapper for `::pdf_parse_default_appearance_unmapped()`.
  9427. This function has out-params. Python/C# wrappers look like:
  9428. `ll_pdf_parse_default_appearance_unmapped(const char *da, char *font_name, int font_name_len, float color[4])` => `(float size, int n)`
  9429. */
  9430. FZ_FUNCTION void ll_pdf_parse_default_appearance_unmapped(const char *da, char *font_name, int font_name_len, float *size, int *n, float color[4]);
  9431. /** Low-level wrapper for `::pdf_parse_dict()`. */
  9432. FZ_FUNCTION ::pdf_obj *ll_pdf_parse_dict(::pdf_document *doc, ::fz_stream *f, ::pdf_lexbuf *buf);
  9433. /** Low-level wrapper for `::pdf_parse_ind_obj()`.
  9434. This function has out-params. Python/C# wrappers look like:
  9435. `ll_pdf_parse_ind_obj(::pdf_document *doc, ::fz_stream *f)` => `(pdf_obj *, int num, int gen, int64_t stm_ofs, int try_repair)`
  9436. */
  9437. FZ_FUNCTION ::pdf_obj *ll_pdf_parse_ind_obj(::pdf_document *doc, ::fz_stream *f, int *num, int *gen, int64_t *stm_ofs, int *try_repair);
  9438. /** Low-level wrapper for `::pdf_parse_journal_obj()`.
  9439. This function has out-params. Python/C# wrappers look like:
  9440. `ll_pdf_parse_journal_obj(::pdf_document *doc, ::fz_stream *stm, ::fz_buffer **ostm)` => `(pdf_obj *, int onum, int newobj)`
  9441. */
  9442. FZ_FUNCTION ::pdf_obj *ll_pdf_parse_journal_obj(::pdf_document *doc, ::fz_stream *stm, int *onum, ::fz_buffer **ostm, int *newobj);
  9443. /** Low-level wrapper for `::pdf_parse_stm_obj()`. */
  9444. FZ_FUNCTION ::pdf_obj *ll_pdf_parse_stm_obj(::pdf_document *doc, ::fz_stream *f, ::pdf_lexbuf *buf);
  9445. /** Low-level wrapper for `::pdf_parse_write_options()`. */
  9446. FZ_FUNCTION ::pdf_write_options *ll_pdf_parse_write_options(::pdf_write_options *opts, const char *args);
  9447. /** Low-level wrapper for `::pdf_pin_document()`. */
  9448. FZ_FUNCTION ::pdf_document *ll_pdf_pin_document(::pdf_obj *obj);
  9449. /** Low-level wrapper for `::pdf_preview_signature_as_display_list()`. */
  9450. FZ_FUNCTION ::fz_display_list *ll_pdf_preview_signature_as_display_list(float w, float h, ::fz_text_language lang, ::pdf_pkcs7_signer *signer, int appearance_flags, ::fz_image *graphic, const char *reason, const char *location);
  9451. /** Low-level wrapper for `::pdf_preview_signature_as_pixmap()`. */
  9452. FZ_FUNCTION ::fz_pixmap *ll_pdf_preview_signature_as_pixmap(int w, int h, ::fz_text_language lang, ::pdf_pkcs7_signer *signer, int appearance_flags, ::fz_image *graphic, const char *reason, const char *location);
  9453. /** Low-level wrapper for `::pdf_print_crypt()`. */
  9454. FZ_FUNCTION void ll_pdf_print_crypt(::fz_output *out, ::pdf_crypt *crypt);
  9455. /** Low-level wrapper for `::pdf_print_default_appearance()`. */
  9456. FZ_FUNCTION void ll_pdf_print_default_appearance(char *buf, int nbuf, const char *font, float size, int n, const float *color);
  9457. /** Low-level wrapper for `::pdf_print_encrypted_obj()`.
  9458. This function has out-params. Python/C# wrappers look like:
  9459. `ll_pdf_print_encrypted_obj(::fz_output *out, ::pdf_obj *obj, int tight, int ascii, ::pdf_crypt *crypt, int num, int gen)` => int sep
  9460. */
  9461. FZ_FUNCTION void ll_pdf_print_encrypted_obj(::fz_output *out, ::pdf_obj *obj, int tight, int ascii, ::pdf_crypt *crypt, int num, int gen, int *sep);
  9462. /** Low-level wrapper for `::pdf_print_font()`. */
  9463. FZ_FUNCTION void ll_pdf_print_font(::fz_output *out, ::pdf_font_desc *fontdesc);
  9464. /** Low-level wrapper for `::pdf_print_obj()`. */
  9465. FZ_FUNCTION void ll_pdf_print_obj(::fz_output *out, ::pdf_obj *obj, int tight, int ascii);
  9466. /** Low-level wrapper for `::pdf_process_annot()`. */
  9467. FZ_FUNCTION void ll_pdf_process_annot(::pdf_processor *proc, ::pdf_annot *annot, ::fz_cookie *cookie);
  9468. /** Low-level wrapper for `::pdf_process_contents()`.
  9469. This function has out-params. Python/C# wrappers look like:
  9470. `ll_pdf_process_contents(::pdf_processor *proc, ::pdf_document *doc, ::pdf_obj *res, ::pdf_obj *stm, ::fz_cookie *cookie, ::pdf_obj **out_res)` =>
  9471. */
  9472. FZ_FUNCTION void ll_pdf_process_contents(::pdf_processor *proc, ::pdf_document *doc, ::pdf_obj *res, ::pdf_obj *stm, ::fz_cookie *cookie, ::pdf_obj **out_res);
  9473. /** Low-level wrapper for `::pdf_process_glyph()`. */
  9474. FZ_FUNCTION void ll_pdf_process_glyph(::pdf_processor *proc, ::pdf_document *doc, ::pdf_obj *resources, ::fz_buffer *contents);
  9475. /** Low-level wrapper for `::pdf_process_raw_contents()`. */
  9476. FZ_FUNCTION void ll_pdf_process_raw_contents(::pdf_processor *proc, ::pdf_document *doc, ::pdf_obj *stmobj, ::fz_cookie *cookie);
  9477. /** Low-level wrapper for `::pdf_processor_pop_resources()`. */
  9478. FZ_FUNCTION ::pdf_obj *ll_pdf_processor_pop_resources(::pdf_processor *proc);
  9479. /** Low-level wrapper for `::pdf_processor_push_resources()`. */
  9480. FZ_FUNCTION void ll_pdf_processor_push_resources(::pdf_processor *proc, ::pdf_obj *res);
  9481. /** Low-level wrapper for `::pdf_progressive_advance()`. */
  9482. FZ_FUNCTION ::pdf_obj *ll_pdf_progressive_advance(::pdf_document *doc, int pagenum);
  9483. /** Low-level wrapper for `::pdf_purge_local_resources()`. */
  9484. FZ_FUNCTION void ll_pdf_purge_local_resources(::pdf_document *doc);
  9485. /** Low-level wrapper for `::pdf_purge_locals_from_store()`. */
  9486. FZ_FUNCTION void ll_pdf_purge_locals_from_store(::pdf_document *doc);
  9487. /** Low-level wrapper for `::pdf_purge_object_from_store()`. */
  9488. FZ_FUNCTION void ll_pdf_purge_object_from_store(::pdf_document *doc, int num);
  9489. /** Low-level wrapper for `::pdf_read_journal()`. */
  9490. FZ_FUNCTION void ll_pdf_read_journal(::pdf_document *doc, ::fz_stream *stm);
  9491. /** Low-level wrapper for `::pdf_read_ocg()`. */
  9492. FZ_FUNCTION ::pdf_ocg_descriptor *ll_pdf_read_ocg(::pdf_document *doc);
  9493. /** Low-level wrapper for `::pdf_rearrange_pages()`. */
  9494. FZ_FUNCTION void ll_pdf_rearrange_pages(::pdf_document *doc, int count, const int *pages, ::pdf_clean_options_structure structure);
  9495. /** Low-level wrapper for `::pdf_rearrange_pages2()`. */
  9496. /** Swig-friendly wrapper for pdf_rearrange_pages(). */
  9497. FZ_FUNCTION void ll_pdf_rearrange_pages2(::pdf_document *doc, const std::vector<int> &pages, ::pdf_clean_options_structure structure);
  9498. /** Low-level wrapper for `::pdf_recolor_page()`. */
  9499. FZ_FUNCTION void ll_pdf_recolor_page(::pdf_document *doc, int pagenum, const ::pdf_recolor_options *opts);
  9500. /** Low-level wrapper for `::pdf_recolor_shade()`. */
  9501. /**
  9502. Recolor a shade.
  9503. */
  9504. FZ_FUNCTION ::pdf_obj *ll_pdf_recolor_shade(::pdf_obj *shade, ::pdf_shade_recolorer *reshade, void *opaque);
  9505. /** Low-level wrapper for `::pdf_redact_page()`. */
  9506. FZ_FUNCTION int ll_pdf_redact_page(::pdf_document *doc, ::pdf_page *page, ::pdf_redact_options *opts);
  9507. /** Low-level wrapper for `::pdf_redo()`. */
  9508. FZ_FUNCTION void ll_pdf_redo(::pdf_document *doc);
  9509. /** Low-level wrapper for `::pdf_remove_item()`. */
  9510. FZ_FUNCTION void ll_pdf_remove_item(::fz_store_drop_fn *drop, ::pdf_obj *key);
  9511. /** Low-level wrapper for `::pdf_remove_output_intents()`. */
  9512. FZ_FUNCTION void ll_pdf_remove_output_intents(::pdf_document *doc);
  9513. /** Low-level wrapper for `::pdf_repair_obj()`.
  9514. This function has out-params. Python/C# wrappers look like:
  9515. `ll_pdf_repair_obj(::pdf_document *doc, ::pdf_lexbuf *buf, ::pdf_obj **encrypt, ::pdf_obj **id, ::pdf_obj **page, ::pdf_obj **root)` => `(int, int64_t stmofsp, int64_t stmlenp, int64_t tmpofs)`
  9516. */
  9517. FZ_FUNCTION int ll_pdf_repair_obj(::pdf_document *doc, ::pdf_lexbuf *buf, int64_t *stmofsp, int64_t *stmlenp, ::pdf_obj **encrypt, ::pdf_obj **id, ::pdf_obj **page, int64_t *tmpofs, ::pdf_obj **root);
  9518. /** Low-level wrapper for `::pdf_repair_xref()`. */
  9519. FZ_FUNCTION void ll_pdf_repair_xref(::pdf_document *doc);
  9520. /** Low-level wrapper for `::pdf_replace_xref()`. */
  9521. FZ_FUNCTION void ll_pdf_replace_xref(::pdf_document *doc, ::pdf_xref_entry *entries, int n);
  9522. /** Low-level wrapper for `::pdf_reset_form()`. */
  9523. FZ_FUNCTION void ll_pdf_reset_form(::pdf_document *doc, ::pdf_obj *fields, int exclude);
  9524. /** Low-level wrapper for `::pdf_reset_processor()`. */
  9525. FZ_FUNCTION void ll_pdf_reset_processor(::pdf_processor *proc);
  9526. /** Low-level wrapper for `::pdf_resolve_indirect()`. */
  9527. /**
  9528. Resolve an indirect object (or chain of objects).
  9529. This can cause xref reorganisations (solidifications etc) due to
  9530. repairs, so all held pdf_xref_entries should be considered
  9531. invalid after this call (other than the returned one).
  9532. */
  9533. FZ_FUNCTION ::pdf_obj *ll_pdf_resolve_indirect(::pdf_obj *ref);
  9534. /** Low-level wrapper for `::pdf_resolve_indirect_chain()`. */
  9535. FZ_FUNCTION ::pdf_obj *ll_pdf_resolve_indirect_chain(::pdf_obj *ref);
  9536. /** Low-level wrapper for `::pdf_resolve_link()`.
  9537. This function has out-params. Python/C# wrappers look like:
  9538. `ll_pdf_resolve_link(::pdf_document *doc, const char *uri)` => `(int, float xp, float yp)`
  9539. */
  9540. FZ_FUNCTION int ll_pdf_resolve_link(::pdf_document *doc, const char *uri, float *xp, float *yp);
  9541. /** Low-level wrapper for `::pdf_resolve_link_dest()`. */
  9542. FZ_FUNCTION ::fz_link_dest ll_pdf_resolve_link_dest(::pdf_document *doc, const char *uri);
  9543. /** Low-level wrapper for `::pdf_rewrite_images()`. */
  9544. FZ_FUNCTION void ll_pdf_rewrite_images(::pdf_document *doc, ::pdf_image_rewriter_options *opts);
  9545. /** Low-level wrapper for `::pdf_run_annot()`. */
  9546. FZ_FUNCTION void ll_pdf_run_annot(::pdf_annot *annot, ::fz_device *dev, ::fz_matrix ctm, ::fz_cookie *cookie);
  9547. /** Low-level wrapper for `::pdf_run_document_structure()`. */
  9548. FZ_FUNCTION void ll_pdf_run_document_structure(::pdf_document *doc, ::fz_device *dev, ::fz_cookie *cookie);
  9549. /** Low-level wrapper for `::pdf_run_glyph()`. */
  9550. FZ_FUNCTION void ll_pdf_run_glyph(::pdf_document *doc, ::pdf_obj *resources, ::fz_buffer *contents, ::fz_device *dev, ::fz_matrix ctm, void *gstate, ::fz_default_colorspaces *default_cs, void *fill_gstate, void *stroke_gstate);
  9551. /** Low-level wrapper for `::pdf_run_page()`. */
  9552. FZ_FUNCTION void ll_pdf_run_page(::pdf_page *page, ::fz_device *dev, ::fz_matrix ctm, ::fz_cookie *cookie);
  9553. /** Low-level wrapper for `::pdf_run_page_annots()`. */
  9554. FZ_FUNCTION void ll_pdf_run_page_annots(::pdf_page *page, ::fz_device *dev, ::fz_matrix ctm, ::fz_cookie *cookie);
  9555. /** Low-level wrapper for `::pdf_run_page_annots_with_usage()`. */
  9556. FZ_FUNCTION void ll_pdf_run_page_annots_with_usage(::pdf_page *page, ::fz_device *dev, ::fz_matrix ctm, const char *usage, ::fz_cookie *cookie);
  9557. /** Low-level wrapper for `::pdf_run_page_contents()`. */
  9558. FZ_FUNCTION void ll_pdf_run_page_contents(::pdf_page *page, ::fz_device *dev, ::fz_matrix ctm, ::fz_cookie *cookie);
  9559. /** Low-level wrapper for `::pdf_run_page_contents_with_usage()`. */
  9560. FZ_FUNCTION void ll_pdf_run_page_contents_with_usage(::pdf_page *page, ::fz_device *dev, ::fz_matrix ctm, const char *usage, ::fz_cookie *cookie);
  9561. /** Low-level wrapper for `::pdf_run_page_widgets()`. */
  9562. FZ_FUNCTION void ll_pdf_run_page_widgets(::pdf_page *page, ::fz_device *dev, ::fz_matrix ctm, ::fz_cookie *cookie);
  9563. /** Low-level wrapper for `::pdf_run_page_widgets_with_usage()`. */
  9564. FZ_FUNCTION void ll_pdf_run_page_widgets_with_usage(::pdf_page *page, ::fz_device *dev, ::fz_matrix ctm, const char *usage, ::fz_cookie *cookie);
  9565. /** Low-level wrapper for `::pdf_run_page_with_usage()`. */
  9566. FZ_FUNCTION void ll_pdf_run_page_with_usage(::pdf_page *page, ::fz_device *dev, ::fz_matrix ctm, const char *usage, ::fz_cookie *cookie);
  9567. /** Low-level wrapper for `::pdf_sample_shade_function()`.
  9568. This function has out-params. Python/C# wrappers look like:
  9569. `ll_pdf_sample_shade_function(int n, int funcs, ::pdf_function **func, float t0, float t1)` => `(float samples)`
  9570. */
  9571. FZ_FUNCTION void ll_pdf_sample_shade_function(float *samples, int n, int funcs, ::pdf_function **func, float t0, float t1);
  9572. /** Low-level wrapper for `::pdf_save_document()`. */
  9573. FZ_FUNCTION void ll_pdf_save_document(::pdf_document *doc, const char *filename, const ::pdf_write_options *opts);
  9574. /** Low-level wrapper for `::pdf_save_journal()`. */
  9575. FZ_FUNCTION void ll_pdf_save_journal(::pdf_document *doc, const char *filename);
  9576. /** Low-level wrapper for `::pdf_save_snapshot()`. */
  9577. FZ_FUNCTION void ll_pdf_save_snapshot(::pdf_document *doc, const char *filename);
  9578. /** Low-level wrapper for `::pdf_select_layer_config()`. */
  9579. FZ_FUNCTION void ll_pdf_select_layer_config(::pdf_document *doc, int config_num);
  9580. /** Low-level wrapper for `::pdf_select_layer_config_ui()`. */
  9581. FZ_FUNCTION void ll_pdf_select_layer_config_ui(::pdf_document *doc, int ui);
  9582. /** Low-level wrapper for `::pdf_serialise_journal()`. */
  9583. FZ_FUNCTION void ll_pdf_serialise_journal(::pdf_document *doc, ::fz_output *out);
  9584. /** Low-level wrapper for `::pdf_set_annot_active()`. */
  9585. FZ_FUNCTION void ll_pdf_set_annot_active(::pdf_annot *annot, int active);
  9586. /** Low-level wrapper for `::pdf_set_annot_appearance()`. */
  9587. FZ_FUNCTION void ll_pdf_set_annot_appearance(::pdf_annot *annot, const char *appearance, const char *state, ::fz_matrix ctm, ::fz_rect bbox, ::pdf_obj *res, ::fz_buffer *contents);
  9588. /** Low-level wrapper for `::pdf_set_annot_appearance_from_display_list()`. */
  9589. FZ_FUNCTION void ll_pdf_set_annot_appearance_from_display_list(::pdf_annot *annot, const char *appearance, const char *state, ::fz_matrix ctm, ::fz_display_list *list);
  9590. /** Low-level wrapper for `::pdf_set_annot_author()`. */
  9591. FZ_FUNCTION void ll_pdf_set_annot_author(::pdf_annot *annot, const char *author);
  9592. /** Low-level wrapper for `::pdf_set_annot_border()`. */
  9593. FZ_FUNCTION void ll_pdf_set_annot_border(::pdf_annot *annot, float width);
  9594. /** Low-level wrapper for `::pdf_set_annot_border_effect()`. */
  9595. FZ_FUNCTION void ll_pdf_set_annot_border_effect(::pdf_annot *annot, enum pdf_border_effect effect);
  9596. /** Low-level wrapper for `::pdf_set_annot_border_effect_intensity()`. */
  9597. FZ_FUNCTION void ll_pdf_set_annot_border_effect_intensity(::pdf_annot *annot, float intensity);
  9598. /** Low-level wrapper for `::pdf_set_annot_border_style()`. */
  9599. FZ_FUNCTION void ll_pdf_set_annot_border_style(::pdf_annot *annot, enum pdf_border_style style);
  9600. /** Low-level wrapper for `::pdf_set_annot_border_width()`. */
  9601. FZ_FUNCTION void ll_pdf_set_annot_border_width(::pdf_annot *annot, float width);
  9602. /** Low-level wrapper for `::pdf_set_annot_callout_line()`. */
  9603. FZ_FUNCTION void ll_pdf_set_annot_callout_line(::pdf_annot *annot, ::fz_point callout[3], int n);
  9604. /** Low-level wrapper for `::pdf_set_annot_callout_line2()`. */
  9605. /** SWIG-friendly wrapper for pdf_set_annot_callout_line(). */
  9606. FZ_FUNCTION void ll_pdf_set_annot_callout_line2(::pdf_annot *annot, std::vector<fz_point> &callout);
  9607. /** Low-level wrapper for `::pdf_set_annot_callout_point()`. */
  9608. FZ_FUNCTION void ll_pdf_set_annot_callout_point(::pdf_annot *annot, ::fz_point p);
  9609. /** Low-level wrapper for `::pdf_set_annot_callout_style()`. */
  9610. FZ_FUNCTION void ll_pdf_set_annot_callout_style(::pdf_annot *annot, enum pdf_line_ending style);
  9611. /** Low-level wrapper for `::pdf_set_annot_color()`. */
  9612. FZ_FUNCTION void ll_pdf_set_annot_color(::pdf_annot *annot, int n, const float *color);
  9613. /** Low-level wrapper for `::pdf_set_annot_contents()`. */
  9614. FZ_FUNCTION void ll_pdf_set_annot_contents(::pdf_annot *annot, const char *text);
  9615. /** Low-level wrapper for `::pdf_set_annot_creation_date()`. */
  9616. FZ_FUNCTION void ll_pdf_set_annot_creation_date(::pdf_annot *annot, int64_t time);
  9617. /** Low-level wrapper for `::pdf_set_annot_default_appearance()`. */
  9618. FZ_FUNCTION void ll_pdf_set_annot_default_appearance(::pdf_annot *annot, const char *font, float size, int n, const float *color);
  9619. /** Low-level wrapper for `::pdf_set_annot_field_value()`. */
  9620. FZ_FUNCTION int ll_pdf_set_annot_field_value(::pdf_document *doc, ::pdf_annot *widget, const char *text, int ignore_trigger_events);
  9621. /** Low-level wrapper for `::pdf_set_annot_filespec()`. */
  9622. FZ_FUNCTION void ll_pdf_set_annot_filespec(::pdf_annot *annot, ::pdf_obj *obj);
  9623. /** Low-level wrapper for `::pdf_set_annot_flags()`. */
  9624. FZ_FUNCTION void ll_pdf_set_annot_flags(::pdf_annot *annot, int flags);
  9625. /** Low-level wrapper for `::pdf_set_annot_hidden_for_editing()`. */
  9626. FZ_FUNCTION void ll_pdf_set_annot_hidden_for_editing(::pdf_annot *annot, int hidden);
  9627. /** Low-level wrapper for `::pdf_set_annot_hot()`. */
  9628. FZ_FUNCTION void ll_pdf_set_annot_hot(::pdf_annot *annot, int hot);
  9629. /** Low-level wrapper for `::pdf_set_annot_icon_name()`. */
  9630. FZ_FUNCTION void ll_pdf_set_annot_icon_name(::pdf_annot *annot, const char *name);
  9631. /** Low-level wrapper for `::pdf_set_annot_ink_list()`. */
  9632. FZ_FUNCTION void ll_pdf_set_annot_ink_list(::pdf_annot *annot, int n, const int *count, const ::fz_point *v);
  9633. /** Low-level wrapper for `::pdf_set_annot_intent()`. */
  9634. FZ_FUNCTION void ll_pdf_set_annot_intent(::pdf_annot *annot, enum pdf_intent it);
  9635. /** Low-level wrapper for `::pdf_set_annot_interior_color()`. */
  9636. FZ_FUNCTION void ll_pdf_set_annot_interior_color(::pdf_annot *annot, int n, const float *color);
  9637. /** Low-level wrapper for `::pdf_set_annot_is_open()`. */
  9638. FZ_FUNCTION void ll_pdf_set_annot_is_open(::pdf_annot *annot, int is_open);
  9639. /** Low-level wrapper for `::pdf_set_annot_language()`. */
  9640. FZ_FUNCTION void ll_pdf_set_annot_language(::pdf_annot *annot, ::fz_text_language lang);
  9641. /** Low-level wrapper for `::pdf_set_annot_line()`. */
  9642. FZ_FUNCTION void ll_pdf_set_annot_line(::pdf_annot *annot, ::fz_point a, ::fz_point b);
  9643. /** Low-level wrapper for `::pdf_set_annot_line_caption()`. */
  9644. FZ_FUNCTION void ll_pdf_set_annot_line_caption(::pdf_annot *annot, int cap);
  9645. /** Low-level wrapper for `::pdf_set_annot_line_caption_offset()`. */
  9646. FZ_FUNCTION void ll_pdf_set_annot_line_caption_offset(::pdf_annot *annot, ::fz_point offset);
  9647. /** Low-level wrapper for `::pdf_set_annot_line_end_style()`. */
  9648. FZ_FUNCTION void ll_pdf_set_annot_line_end_style(::pdf_annot *annot, enum pdf_line_ending e);
  9649. /** Low-level wrapper for `::pdf_set_annot_line_ending_styles()`. */
  9650. FZ_FUNCTION void ll_pdf_set_annot_line_ending_styles(::pdf_annot *annot, enum pdf_line_ending start_style, enum pdf_line_ending end_style);
  9651. /** Low-level wrapper for `::pdf_set_annot_line_leader()`. */
  9652. FZ_FUNCTION void ll_pdf_set_annot_line_leader(::pdf_annot *annot, float ll);
  9653. /** Low-level wrapper for `::pdf_set_annot_line_leader_extension()`. */
  9654. FZ_FUNCTION void ll_pdf_set_annot_line_leader_extension(::pdf_annot *annot, float lle);
  9655. /** Low-level wrapper for `::pdf_set_annot_line_leader_offset()`. */
  9656. FZ_FUNCTION void ll_pdf_set_annot_line_leader_offset(::pdf_annot *annot, float llo);
  9657. /** Low-level wrapper for `::pdf_set_annot_line_start_style()`. */
  9658. FZ_FUNCTION void ll_pdf_set_annot_line_start_style(::pdf_annot *annot, enum pdf_line_ending s);
  9659. /** Low-level wrapper for `::pdf_set_annot_modification_date()`. */
  9660. FZ_FUNCTION void ll_pdf_set_annot_modification_date(::pdf_annot *annot, int64_t time);
  9661. /** Low-level wrapper for `::pdf_set_annot_opacity()`. */
  9662. FZ_FUNCTION void ll_pdf_set_annot_opacity(::pdf_annot *annot, float opacity);
  9663. /** Low-level wrapper for `::pdf_set_annot_popup()`. */
  9664. FZ_FUNCTION void ll_pdf_set_annot_popup(::pdf_annot *annot, ::fz_rect rect);
  9665. /** Low-level wrapper for `::pdf_set_annot_quad_points()`. */
  9666. FZ_FUNCTION void ll_pdf_set_annot_quad_points(::pdf_annot *annot, int n, const ::fz_quad *qv);
  9667. /** Low-level wrapper for `::pdf_set_annot_quadding()`. */
  9668. FZ_FUNCTION void ll_pdf_set_annot_quadding(::pdf_annot *annot, int q);
  9669. /** Low-level wrapper for `::pdf_set_annot_rect()`. */
  9670. FZ_FUNCTION void ll_pdf_set_annot_rect(::pdf_annot *annot, ::fz_rect rect);
  9671. /** Low-level wrapper for `::pdf_set_annot_resynthesised()`. */
  9672. FZ_FUNCTION void ll_pdf_set_annot_resynthesised(::pdf_annot *annot);
  9673. /** Low-level wrapper for `::pdf_set_annot_rich_contents()`. */
  9674. FZ_FUNCTION void ll_pdf_set_annot_rich_contents(::pdf_annot *annot, const char *plain, const char *rich);
  9675. /** Low-level wrapper for `::pdf_set_annot_rich_defaults()`. */
  9676. FZ_FUNCTION void ll_pdf_set_annot_rich_defaults(::pdf_annot *annot, const char *style);
  9677. /** Low-level wrapper for `::pdf_set_annot_stamp_image()`. */
  9678. FZ_FUNCTION void ll_pdf_set_annot_stamp_image(::pdf_annot *annot, ::fz_image *image);
  9679. /** Low-level wrapper for `::pdf_set_annot_stamp_image_obj()`. */
  9680. FZ_FUNCTION void ll_pdf_set_annot_stamp_image_obj(::pdf_annot *annot, ::pdf_obj *ref);
  9681. /** Low-level wrapper for `::pdf_set_annot_vertex()`. */
  9682. FZ_FUNCTION void ll_pdf_set_annot_vertex(::pdf_annot *annot, int i, ::fz_point p);
  9683. /** Low-level wrapper for `::pdf_set_annot_vertices()`. */
  9684. FZ_FUNCTION void ll_pdf_set_annot_vertices(::pdf_annot *annot, int n, const ::fz_point *v);
  9685. /** Low-level wrapper for `::pdf_set_choice_field_value()`. */
  9686. FZ_FUNCTION int ll_pdf_set_choice_field_value(::pdf_annot *widget, const char *value);
  9687. /** Low-level wrapper for `::pdf_set_cmap_wmode()`. */
  9688. FZ_FUNCTION void ll_pdf_set_cmap_wmode(::pdf_cmap *cmap, int wmode);
  9689. /** Low-level wrapper for `::pdf_set_default_hmtx()`. */
  9690. FZ_FUNCTION void ll_pdf_set_default_hmtx(::pdf_font_desc *font, int w);
  9691. /** Low-level wrapper for `::pdf_set_default_vmtx()`. */
  9692. FZ_FUNCTION void ll_pdf_set_default_vmtx(::pdf_font_desc *font, int y, int w);
  9693. /** Low-level wrapper for `::pdf_set_doc_event_callback()`. */
  9694. FZ_FUNCTION void ll_pdf_set_doc_event_callback(::pdf_document *doc, ::pdf_doc_event_cb *event_cb, ::pdf_free_doc_event_data_cb *free_event_data_cb, void *data);
  9695. /** Low-level wrapper for `::pdf_set_document_language()`. */
  9696. FZ_FUNCTION void ll_pdf_set_document_language(::pdf_document *doc, ::fz_text_language lang);
  9697. /** Low-level wrapper for `::pdf_set_field_value()`. */
  9698. FZ_FUNCTION int ll_pdf_set_field_value(::pdf_document *doc, ::pdf_obj *field, const char *text, int ignore_trigger_events);
  9699. /** Low-level wrapper for `::pdf_set_font_wmode()`. */
  9700. FZ_FUNCTION void ll_pdf_set_font_wmode(::pdf_font_desc *font, int wmode);
  9701. /** Low-level wrapper for `::pdf_set_int()`. */
  9702. FZ_FUNCTION void ll_pdf_set_int(::pdf_obj *obj, int64_t i);
  9703. /** Low-level wrapper for `::pdf_set_layer_config_as_default()`. */
  9704. FZ_FUNCTION void ll_pdf_set_layer_config_as_default(::pdf_document *doc);
  9705. /** Low-level wrapper for `::pdf_set_obj_memo()`. */
  9706. FZ_FUNCTION void ll_pdf_set_obj_memo(::pdf_obj *obj, int bit, int memo);
  9707. /** Low-level wrapper for `::pdf_set_obj_parent()`. */
  9708. FZ_FUNCTION void ll_pdf_set_obj_parent(::pdf_obj *obj, int num);
  9709. /** Low-level wrapper for `::pdf_set_page_box()`. */
  9710. FZ_FUNCTION void ll_pdf_set_page_box(::pdf_page *page, ::fz_box_type box, ::fz_rect rect);
  9711. /** Low-level wrapper for `::pdf_set_page_labels()`. */
  9712. FZ_FUNCTION void ll_pdf_set_page_labels(::pdf_document *doc, int index, ::pdf_page_label_style style, const char *prefix, int start);
  9713. /** Low-level wrapper for `::pdf_set_populating_xref_trailer()`. */
  9714. FZ_FUNCTION void ll_pdf_set_populating_xref_trailer(::pdf_document *doc, ::pdf_obj *trailer);
  9715. /** Low-level wrapper for `::pdf_set_str_len()`. */
  9716. FZ_FUNCTION void ll_pdf_set_str_len(::pdf_obj *obj, size_t newlen);
  9717. /** Low-level wrapper for `::pdf_set_text_field_value()`. */
  9718. FZ_FUNCTION int ll_pdf_set_text_field_value(::pdf_annot *widget, const char *value);
  9719. /** Low-level wrapper for `::pdf_set_usecmap()`. */
  9720. FZ_FUNCTION void ll_pdf_set_usecmap(::pdf_cmap *cmap, ::pdf_cmap *usecmap);
  9721. /** Low-level wrapper for `::pdf_set_widget_editing_state()`. */
  9722. FZ_FUNCTION void ll_pdf_set_widget_editing_state(::pdf_annot *widget, int editing);
  9723. /** Low-level wrapper for `::pdf_sign_signature()`. */
  9724. FZ_FUNCTION void ll_pdf_sign_signature(::pdf_annot *widget, ::pdf_pkcs7_signer *signer, int appearance_flags, ::fz_image *graphic, const char *reason, const char *location);
  9725. /** Low-level wrapper for `::pdf_sign_signature_with_appearance()`. */
  9726. FZ_FUNCTION void ll_pdf_sign_signature_with_appearance(::pdf_annot *widget, ::pdf_pkcs7_signer *signer, int64_t date, ::fz_display_list *disp_list);
  9727. /** Low-level wrapper for `::pdf_signature_appearance_signed()`. */
  9728. FZ_FUNCTION ::fz_display_list *ll_pdf_signature_appearance_signed(::fz_rect rect, ::fz_text_language lang, ::fz_image *img, const char *left_text, const char *right_text, int include_logo);
  9729. /** Low-level wrapper for `::pdf_signature_appearance_unsigned()`. */
  9730. FZ_FUNCTION ::fz_display_list *ll_pdf_signature_appearance_unsigned(::fz_rect rect, ::fz_text_language lang);
  9731. /** Low-level wrapper for `::pdf_signature_byte_range()`. */
  9732. FZ_FUNCTION int ll_pdf_signature_byte_range(::pdf_document *doc, ::pdf_obj *signature, ::fz_range *byte_range);
  9733. /** Low-level wrapper for `::pdf_signature_contents()`.
  9734. This function has out-params. Python/C# wrappers look like:
  9735. `ll_pdf_signature_contents(::pdf_document *doc, ::pdf_obj *signature)` => `(size_t, char *contents)`
  9736. */
  9737. FZ_FUNCTION size_t ll_pdf_signature_contents(::pdf_document *doc, ::pdf_obj *signature, char **contents);
  9738. /** Low-level wrapper for `::pdf_signature_drop_distinguished_name()`. */
  9739. FZ_FUNCTION void ll_pdf_signature_drop_distinguished_name(::pdf_pkcs7_distinguished_name *name);
  9740. /** Low-level wrapper for `::pdf_signature_error_description()`. */
  9741. FZ_FUNCTION char *ll_pdf_signature_error_description(::pdf_signature_error err);
  9742. /** Low-level wrapper for `::pdf_signature_format_distinguished_name()`. */
  9743. FZ_FUNCTION char *ll_pdf_signature_format_distinguished_name(::pdf_pkcs7_distinguished_name *name);
  9744. /** Low-level wrapper for `::pdf_signature_get_signatory()`. */
  9745. FZ_FUNCTION ::pdf_pkcs7_distinguished_name *ll_pdf_signature_get_signatory(::pdf_pkcs7_verifier *verifier, ::pdf_document *doc, ::pdf_obj *signature);
  9746. /** Low-level wrapper for `::pdf_signature_get_widget_signatory()`. */
  9747. FZ_FUNCTION ::pdf_pkcs7_distinguished_name *ll_pdf_signature_get_widget_signatory(::pdf_pkcs7_verifier *verifier, ::pdf_annot *widget);
  9748. /** Low-level wrapper for `::pdf_signature_hash_bytes()`. */
  9749. FZ_FUNCTION ::fz_stream *ll_pdf_signature_hash_bytes(::pdf_document *doc, ::pdf_obj *signature);
  9750. /** Low-level wrapper for `::pdf_signature_incremental_change_since_signing()`. */
  9751. FZ_FUNCTION int ll_pdf_signature_incremental_change_since_signing(::pdf_document *doc, ::pdf_obj *signature);
  9752. /** Low-level wrapper for `::pdf_signature_info()`. */
  9753. FZ_FUNCTION char *ll_pdf_signature_info(const char *name, ::pdf_pkcs7_distinguished_name *dn, const char *reason, const char *location, int64_t date, int include_labels);
  9754. /** Low-level wrapper for `::pdf_signature_is_signed()`. */
  9755. FZ_FUNCTION int ll_pdf_signature_is_signed(::pdf_document *doc, ::pdf_obj *field);
  9756. /** Low-level wrapper for `::pdf_signature_set_value()`. */
  9757. FZ_FUNCTION void ll_pdf_signature_set_value(::pdf_document *doc, ::pdf_obj *field, ::pdf_pkcs7_signer *signer, int64_t stime);
  9758. /** Low-level wrapper for `::pdf_sort_cmap()`. */
  9759. FZ_FUNCTION void ll_pdf_sort_cmap(::pdf_cmap *cmap);
  9760. /** Low-level wrapper for `::pdf_sort_dict()`. */
  9761. FZ_FUNCTION void ll_pdf_sort_dict(::pdf_obj *dict);
  9762. /** Low-level wrapper for `::pdf_specifics()`. */
  9763. FZ_FUNCTION ::pdf_document *ll_pdf_specifics(::fz_document *doc);
  9764. /** Low-level wrapper for `::pdf_sprint_obj()`.
  9765. This function has out-params. Python/C# wrappers look like:
  9766. `ll_pdf_sprint_obj(char *buf, size_t cap, ::pdf_obj *obj, int tight, int ascii)` => `(char *, size_t len)`
  9767. */
  9768. FZ_FUNCTION char *ll_pdf_sprint_obj(char *buf, size_t cap, size_t *len, ::pdf_obj *obj, int tight, int ascii);
  9769. /** Low-level wrapper for `::pdf_store_item()`. */
  9770. FZ_FUNCTION void ll_pdf_store_item(::pdf_obj *key, void *val, size_t itemsize);
  9771. /** Low-level wrapper for `::pdf_string_from_annot_type()`. */
  9772. FZ_FUNCTION const char *ll_pdf_string_from_annot_type(enum pdf_annot_type type);
  9773. /** Low-level wrapper for `::pdf_string_from_intent()`. */
  9774. FZ_FUNCTION const char *ll_pdf_string_from_intent(enum pdf_intent intent);
  9775. /** Low-level wrapper for `::pdf_string_from_line_ending()`. */
  9776. FZ_FUNCTION const char *ll_pdf_string_from_line_ending(enum pdf_line_ending end);
  9777. /** Low-level wrapper for `::pdf_structure_type()`. */
  9778. FZ_FUNCTION ::fz_structure ll_pdf_structure_type(::pdf_obj *role_map, ::pdf_obj *tag);
  9779. /** Low-level wrapper for `::pdf_subset_fonts()`. */
  9780. FZ_FUNCTION void ll_pdf_subset_fonts(::pdf_document *doc, int pages_len, const int *pages);
  9781. /** Low-level wrapper for `::pdf_subset_fonts2()`. */
  9782. /** Swig-friendly wrapper for pdf_subset_fonts(). */
  9783. FZ_FUNCTION void ll_pdf_subset_fonts2(::pdf_document *doc, const std::vector<int> &pages);
  9784. /** Low-level wrapper for `::pdf_sync_annots()`. */
  9785. FZ_FUNCTION void ll_pdf_sync_annots(::pdf_page *page);
  9786. /** Low-level wrapper for `::pdf_sync_links()`. */
  9787. FZ_FUNCTION void ll_pdf_sync_links(::pdf_page *page);
  9788. /** Low-level wrapper for `::pdf_sync_open_pages()`. */
  9789. FZ_FUNCTION void ll_pdf_sync_open_pages(::pdf_document *doc);
  9790. /** Low-level wrapper for `::pdf_sync_page()`. */
  9791. FZ_FUNCTION void ll_pdf_sync_page(::pdf_page *page);
  9792. /** Low-level wrapper for `::pdf_text_widget_format()`. */
  9793. FZ_FUNCTION int ll_pdf_text_widget_format(::pdf_annot *tw);
  9794. /** Low-level wrapper for `::pdf_text_widget_max_len()`. */
  9795. FZ_FUNCTION int ll_pdf_text_widget_max_len(::pdf_annot *tw);
  9796. /** Low-level wrapper for `::pdf_to_bool()`. */
  9797. FZ_FUNCTION int ll_pdf_to_bool(::pdf_obj *obj);
  9798. /** Low-level wrapper for `::pdf_to_bool_default()`. */
  9799. FZ_FUNCTION int ll_pdf_to_bool_default(::pdf_obj *obj, int def);
  9800. /** Low-level wrapper for `::pdf_to_date()`. */
  9801. FZ_FUNCTION int64_t ll_pdf_to_date(::pdf_obj *time);
  9802. /** Low-level wrapper for `::pdf_to_gen()`. */
  9803. FZ_FUNCTION int ll_pdf_to_gen(::pdf_obj *obj);
  9804. /** Low-level wrapper for `::pdf_to_int()`. */
  9805. FZ_FUNCTION int ll_pdf_to_int(::pdf_obj *obj);
  9806. /** Low-level wrapper for `::pdf_to_int64()`. */
  9807. FZ_FUNCTION int64_t ll_pdf_to_int64(::pdf_obj *obj);
  9808. /** Low-level wrapper for `::pdf_to_int_default()`. */
  9809. FZ_FUNCTION int ll_pdf_to_int_default(::pdf_obj *obj, int def);
  9810. /** Low-level wrapper for `::pdf_to_matrix()`. */
  9811. FZ_FUNCTION ::fz_matrix ll_pdf_to_matrix(::pdf_obj *array);
  9812. /** Low-level wrapper for `::pdf_to_name()`. */
  9813. FZ_FUNCTION const char *ll_pdf_to_name(::pdf_obj *obj);
  9814. /** Low-level wrapper for `::pdf_to_num()`. */
  9815. FZ_FUNCTION int ll_pdf_to_num(::pdf_obj *obj);
  9816. /** Low-level wrapper for `::pdf_to_point()`. */
  9817. FZ_FUNCTION ::fz_point ll_pdf_to_point(::pdf_obj *array, int offset);
  9818. /** Low-level wrapper for `::pdf_to_quad()`. */
  9819. FZ_FUNCTION ::fz_quad ll_pdf_to_quad(::pdf_obj *array, int offset);
  9820. /** Low-level wrapper for `::pdf_to_real()`. */
  9821. FZ_FUNCTION float ll_pdf_to_real(::pdf_obj *obj);
  9822. /** Low-level wrapper for `::pdf_to_real_default()`. */
  9823. FZ_FUNCTION float ll_pdf_to_real_default(::pdf_obj *obj, float def);
  9824. /** Low-level wrapper for `::pdf_to_rect()`. */
  9825. FZ_FUNCTION ::fz_rect ll_pdf_to_rect(::pdf_obj *array);
  9826. /** Low-level wrapper for `::pdf_to_str_buf()`. */
  9827. FZ_FUNCTION char *ll_pdf_to_str_buf(::pdf_obj *obj);
  9828. /** Low-level wrapper for `::pdf_to_str_len()`. */
  9829. FZ_FUNCTION size_t ll_pdf_to_str_len(::pdf_obj *obj);
  9830. /** Low-level wrapper for `::pdf_to_string()`.
  9831. This function has out-params. Python/C# wrappers look like:
  9832. `ll_pdf_to_string(::pdf_obj *obj)` => `(const char *, size_t sizep)`
  9833. */
  9834. FZ_FUNCTION const char *ll_pdf_to_string(::pdf_obj *obj, size_t *sizep);
  9835. /** Low-level wrapper for `::pdf_to_text_string()`. */
  9836. FZ_FUNCTION const char *ll_pdf_to_text_string(::pdf_obj *obj);
  9837. /** Low-level wrapper for `::pdf_toggle_layer_config_ui()`. */
  9838. FZ_FUNCTION void ll_pdf_toggle_layer_config_ui(::pdf_document *doc, int ui);
  9839. /** Low-level wrapper for `::pdf_toggle_widget()`. */
  9840. FZ_FUNCTION int ll_pdf_toggle_widget(::pdf_annot *widget);
  9841. /** Low-level wrapper for `::pdf_tos_get_text()`. */
  9842. FZ_FUNCTION ::fz_text *ll_pdf_tos_get_text(::pdf_text_object_state *tos);
  9843. /** Low-level wrapper for `::pdf_tos_make_trm()`.
  9844. This function has out-params. Python/C# wrappers look like:
  9845. `ll_pdf_tos_make_trm(::pdf_text_object_state *tos, ::pdf_text_state *text, ::pdf_font_desc *fontdesc, int cid, ::fz_matrix *trm)` => `(int, float adv)`
  9846. */
  9847. FZ_FUNCTION int ll_pdf_tos_make_trm(::pdf_text_object_state *tos, ::pdf_text_state *text, ::pdf_font_desc *fontdesc, int cid, ::fz_matrix *trm, float *adv);
  9848. /** Low-level wrapper for `::pdf_tos_move_after_char()`. */
  9849. FZ_FUNCTION void ll_pdf_tos_move_after_char(::pdf_text_object_state *tos);
  9850. /** Low-level wrapper for `::pdf_tos_newline()`. */
  9851. FZ_FUNCTION void ll_pdf_tos_newline(::pdf_text_object_state *tos, float leading);
  9852. /** Low-level wrapper for `::pdf_tos_reset()`. */
  9853. FZ_FUNCTION void ll_pdf_tos_reset(::pdf_text_object_state *tos, int render);
  9854. /** Low-level wrapper for `::pdf_tos_restore()`. */
  9855. FZ_FUNCTION void ll_pdf_tos_restore(::pdf_text_object_state *tos, ::fz_matrix save[2]);
  9856. /** Low-level wrapper for `::pdf_tos_save()`. */
  9857. FZ_FUNCTION void ll_pdf_tos_save(::pdf_text_object_state *tos, ::fz_matrix save[2]);
  9858. /** Low-level wrapper for `::pdf_tos_set_matrix()`. */
  9859. FZ_FUNCTION void ll_pdf_tos_set_matrix(::pdf_text_object_state *tos, float a, float b, float c, float d, float e, float f);
  9860. /** Low-level wrapper for `::pdf_tos_translate()`. */
  9861. FZ_FUNCTION void ll_pdf_tos_translate(::pdf_text_object_state *tos, float tx, float ty);
  9862. /** Low-level wrapper for `::pdf_trailer()`. */
  9863. FZ_FUNCTION ::pdf_obj *ll_pdf_trailer(::pdf_document *doc);
  9864. /** Low-level wrapper for `::pdf_undo()`. */
  9865. FZ_FUNCTION void ll_pdf_undo(::pdf_document *doc);
  9866. /** Low-level wrapper for `::pdf_undoredo_state()`.
  9867. This function has out-params. Python/C# wrappers look like:
  9868. `ll_pdf_undoredo_state(::pdf_document *doc)` => `(int, int steps)`
  9869. */
  9870. FZ_FUNCTION int ll_pdf_undoredo_state(::pdf_document *doc, int *steps);
  9871. /** Low-level wrapper for `::pdf_undoredo_step()`. */
  9872. FZ_FUNCTION const char *ll_pdf_undoredo_step(::pdf_document *doc, int step);
  9873. /** Low-level wrapper for `::pdf_unmark_obj()`. */
  9874. FZ_FUNCTION void ll_pdf_unmark_obj(::pdf_obj *obj);
  9875. /** Low-level wrapper for `::pdf_update_annot()`. */
  9876. FZ_FUNCTION int ll_pdf_update_annot(::pdf_annot *annot);
  9877. /** Low-level wrapper for `::pdf_update_default_colorspaces()`. */
  9878. FZ_FUNCTION ::fz_default_colorspaces *ll_pdf_update_default_colorspaces(::fz_default_colorspaces *old_cs, ::pdf_obj *res);
  9879. /** Low-level wrapper for `::pdf_update_object()`. */
  9880. FZ_FUNCTION void ll_pdf_update_object(::pdf_document *doc, int num, ::pdf_obj *obj);
  9881. /** Low-level wrapper for `::pdf_update_page()`. */
  9882. FZ_FUNCTION int ll_pdf_update_page(::pdf_page *page);
  9883. /** Low-level wrapper for `::pdf_update_stream()`. */
  9884. FZ_FUNCTION void ll_pdf_update_stream(::pdf_document *doc, ::pdf_obj *ref, ::fz_buffer *buf, int compressed);
  9885. /** Low-level wrapper for `::pdf_update_widget()`. */
  9886. FZ_FUNCTION int ll_pdf_update_widget(::pdf_annot *widget);
  9887. /** Low-level wrapper for `::pdf_update_xobject()`. */
  9888. FZ_FUNCTION void ll_pdf_update_xobject(::pdf_document *doc, ::pdf_obj *xobj, ::fz_rect bbox, ::fz_matrix mat, ::pdf_obj *res, ::fz_buffer *buffer);
  9889. /** Low-level wrapper for `::pdf_validate_change_history()`. */
  9890. FZ_FUNCTION int ll_pdf_validate_change_history(::pdf_document *doc);
  9891. /** Low-level wrapper for `::pdf_validate_changes()`. */
  9892. FZ_FUNCTION int ll_pdf_validate_changes(::pdf_document *doc, int version);
  9893. /** Low-level wrapper for `::pdf_validate_signature()`. */
  9894. FZ_FUNCTION int ll_pdf_validate_signature(::pdf_annot *widget);
  9895. /** Low-level wrapper for `::pdf_verify_embedded_file_checksum()`. */
  9896. FZ_FUNCTION int ll_pdf_verify_embedded_file_checksum(::pdf_obj *fs);
  9897. /** Low-level wrapper for `::pdf_version()`. */
  9898. FZ_FUNCTION int ll_pdf_version(::pdf_document *doc);
  9899. /** Low-level wrapper for `::pdf_walk_tree()`.
  9900. This function has out-params. Python/C# wrappers look like:
  9901. `ll_pdf_walk_tree(::pdf_obj *tree, ::pdf_obj *kid_name, void (*arrive)(::fz_context *, ::pdf_obj *, void *, ::pdf_obj **), void (*leave)(::fz_context *, ::pdf_obj *, void *), void *arg, ::pdf_obj **names, ::pdf_obj **values)` => `()`
  9902. */
  9903. FZ_FUNCTION void ll_pdf_walk_tree(::pdf_obj *tree, ::pdf_obj *kid_name, void (*arrive)(::fz_context *, ::pdf_obj *, void *, ::pdf_obj **), void (*leave)(::fz_context *, ::pdf_obj *, void *), void *arg, ::pdf_obj **names, ::pdf_obj **values);
  9904. /** Low-level wrapper for `::pdf_was_pure_xfa()`. */
  9905. FZ_FUNCTION int ll_pdf_was_pure_xfa(::pdf_document *doc);
  9906. /** Low-level wrapper for `::pdf_was_repaired()`. */
  9907. FZ_FUNCTION int ll_pdf_was_repaired(::pdf_document *doc);
  9908. /** Low-level wrapper for `::pdf_widget_is_readonly()`. */
  9909. FZ_FUNCTION int ll_pdf_widget_is_readonly(::pdf_annot *widget);
  9910. /** Low-level wrapper for `::pdf_widget_is_signed()`. */
  9911. FZ_FUNCTION int ll_pdf_widget_is_signed(::pdf_annot *widget);
  9912. /** Low-level wrapper for `::pdf_widget_type()`. */
  9913. FZ_FUNCTION enum pdf_widget_type ll_pdf_widget_type(::pdf_annot *widget);
  9914. /** Low-level wrapper for `::pdf_write_digest()`. */
  9915. FZ_FUNCTION void ll_pdf_write_digest(::fz_output *out, ::pdf_obj *byte_range, ::pdf_obj *field, size_t digest_offset, size_t digest_length, ::pdf_pkcs7_signer *signer);
  9916. /** Low-level wrapper for `::pdf_write_document()`. */
  9917. FZ_FUNCTION void ll_pdf_write_document(::pdf_document *doc, ::fz_output *out, const ::pdf_write_options *opts);
  9918. /** Low-level wrapper for `::pdf_write_journal()`. */
  9919. FZ_FUNCTION void ll_pdf_write_journal(::pdf_document *doc, ::fz_output *out);
  9920. /** Low-level wrapper for `::pdf_write_snapshot()`. */
  9921. FZ_FUNCTION void ll_pdf_write_snapshot(::pdf_document *doc, ::fz_output *out);
  9922. /** Low-level wrapper for `::pdf_xobject_bbox()`. */
  9923. FZ_FUNCTION ::fz_rect ll_pdf_xobject_bbox(::pdf_obj *xobj);
  9924. /** Low-level wrapper for `::pdf_xobject_colorspace()`. */
  9925. FZ_FUNCTION ::fz_colorspace *ll_pdf_xobject_colorspace(::pdf_obj *xobj);
  9926. /** Low-level wrapper for `::pdf_xobject_isolated()`. */
  9927. FZ_FUNCTION int ll_pdf_xobject_isolated(::pdf_obj *xobj);
  9928. /** Low-level wrapper for `::pdf_xobject_knockout()`. */
  9929. FZ_FUNCTION int ll_pdf_xobject_knockout(::pdf_obj *xobj);
  9930. /** Low-level wrapper for `::pdf_xobject_matrix()`. */
  9931. FZ_FUNCTION ::fz_matrix ll_pdf_xobject_matrix(::pdf_obj *xobj);
  9932. /** Low-level wrapper for `::pdf_xobject_resources()`. */
  9933. FZ_FUNCTION ::pdf_obj *ll_pdf_xobject_resources(::pdf_obj *xobj);
  9934. /** Low-level wrapper for `::pdf_xobject_transparency()`. */
  9935. FZ_FUNCTION int ll_pdf_xobject_transparency(::pdf_obj *xobj);
  9936. /** Low-level wrapper for `::pdf_xref_ensure_incremental_object()`. */
  9937. FZ_FUNCTION int ll_pdf_xref_ensure_incremental_object(::pdf_document *doc, int num);
  9938. /** Low-level wrapper for `::pdf_xref_ensure_local_object()`. */
  9939. FZ_FUNCTION void ll_pdf_xref_ensure_local_object(::pdf_document *doc, int num);
  9940. /** Low-level wrapper for `::pdf_xref_entry_map()`. */
  9941. FZ_FUNCTION void ll_pdf_xref_entry_map(::pdf_document *doc, void (*fn)(::fz_context *, ::pdf_xref_entry *, int , ::pdf_document *, void *), void *arg);
  9942. /** Low-level wrapper for `::pdf_xref_is_incremental()`. */
  9943. FZ_FUNCTION int ll_pdf_xref_is_incremental(::pdf_document *doc, int num);
  9944. /** Low-level wrapper for `::pdf_xref_len()`. */
  9945. FZ_FUNCTION int ll_pdf_xref_len(::pdf_document *doc);
  9946. /** Low-level wrapper for `::pdf_xref_obj_is_unsaved_signature()`. */
  9947. FZ_FUNCTION int ll_pdf_xref_obj_is_unsaved_signature(::pdf_document *doc, ::pdf_obj *obj);
  9948. /** Low-level wrapper for `::pdf_xref_remove_unsaved_signature()`. */
  9949. FZ_FUNCTION void ll_pdf_xref_remove_unsaved_signature(::pdf_document *doc, ::pdf_obj *field);
  9950. /** Low-level wrapper for `::pdf_xref_store_unsaved_signature()`. */
  9951. FZ_FUNCTION void ll_pdf_xref_store_unsaved_signature(::pdf_document *doc, ::pdf_obj *field, ::pdf_pkcs7_signer *signer);
  9952. /** Low-level wrapper for `::pdf_zugferd_profile()`.
  9953. This function has out-params. Python/C# wrappers look like:
  9954. `ll_pdf_zugferd_profile(::pdf_document *doc)` => `(enum pdf_zugferd_profile, float version)`
  9955. */
  9956. FZ_FUNCTION enum pdf_zugferd_profile ll_pdf_zugferd_profile(::pdf_document *doc, float *version);
  9957. /** Low-level wrapper for `::pdf_zugferd_profile_to_string()`. */
  9958. FZ_FUNCTION const char *ll_pdf_zugferd_profile_to_string(enum pdf_zugferd_profile profile);
  9959. /** Low-level wrapper for `::pdf_zugferd_xml()`. */
  9960. FZ_FUNCTION ::fz_buffer *ll_pdf_zugferd_xml(::pdf_document *doc);
  9961. /* Low-level wrapper for `pdf_dict_getl()`. `keys` must be null-terminated list of `pdf_obj*`'s. */
  9962. FZ_FUNCTION pdf_obj* ll_pdf_dict_getlv( pdf_obj* dict, va_list keys);
  9963. /* Low-level wrapper for `pdf_dict_getl()`. `...` must be null-terminated list of `pdf_obj*`'s. */
  9964. FZ_FUNCTION pdf_obj* ll_pdf_dict_getl( pdf_obj* dict, ...);
  9965. /** Returns string containing a fz_aa_context's members, labelled and inside (...), using operator<<. */
  9966. FZ_FUNCTION std::string to_string_fz_aa_context(const ::fz_aa_context& s);
  9967. /** Returns string containing a fz_aa_context's members, labelled and inside (...), using operator<<.
  9968. (Convenience overload). */
  9969. FZ_FUNCTION std::string to_string(const ::fz_aa_context& s);
  9970. /** Returns string containing a fz_color_params's members, labelled and inside (...), using operator<<. */
  9971. FZ_FUNCTION std::string to_string_fz_color_params(const ::fz_color_params& s);
  9972. /** Returns string containing a fz_color_params's members, labelled and inside (...), using operator<<.
  9973. (Convenience overload). */
  9974. FZ_FUNCTION std::string to_string(const ::fz_color_params& s);
  9975. /** Returns string containing a fz_cookie's members, labelled and inside (...), using operator<<. */
  9976. FZ_FUNCTION std::string to_string_fz_cookie(const ::fz_cookie& s);
  9977. /** Returns string containing a fz_cookie's members, labelled and inside (...), using operator<<.
  9978. (Convenience overload). */
  9979. FZ_FUNCTION std::string to_string(const ::fz_cookie& s);
  9980. /** Returns string containing a fz_draw_options's members, labelled and inside (...), using operator<<. */
  9981. FZ_FUNCTION std::string to_string_fz_draw_options(const ::fz_draw_options& s);
  9982. /** Returns string containing a fz_draw_options's members, labelled and inside (...), using operator<<.
  9983. (Convenience overload). */
  9984. FZ_FUNCTION std::string to_string(const ::fz_draw_options& s);
  9985. /** Returns string containing a fz_install_load_system_font_funcs_args's members, labelled and inside (...), using operator<<. */
  9986. FZ_FUNCTION std::string to_string_fz_install_load_system_font_funcs_args(const ::fz_install_load_system_font_funcs_args& s);
  9987. /** Returns string containing a fz_install_load_system_font_funcs_args's members, labelled and inside (...), using operator<<.
  9988. (Convenience overload). */
  9989. FZ_FUNCTION std::string to_string(const ::fz_install_load_system_font_funcs_args& s);
  9990. /** Returns string containing a fz_irect's members, labelled and inside (...), using operator<<. */
  9991. FZ_FUNCTION std::string to_string_fz_irect(const ::fz_irect& s);
  9992. /** Returns string containing a fz_irect's members, labelled and inside (...), using operator<<.
  9993. (Convenience overload). */
  9994. FZ_FUNCTION std::string to_string(const ::fz_irect& s);
  9995. /** Returns string containing a fz_location's members, labelled and inside (...), using operator<<. */
  9996. FZ_FUNCTION std::string to_string_fz_location(const ::fz_location& s);
  9997. /** Returns string containing a fz_location's members, labelled and inside (...), using operator<<.
  9998. (Convenience overload). */
  9999. FZ_FUNCTION std::string to_string(const ::fz_location& s);
  10000. /** Returns string containing a fz_matrix's members, labelled and inside (...), using operator<<. */
  10001. FZ_FUNCTION std::string to_string_fz_matrix(const ::fz_matrix& s);
  10002. /** Returns string containing a fz_matrix's members, labelled and inside (...), using operator<<.
  10003. (Convenience overload). */
  10004. FZ_FUNCTION std::string to_string(const ::fz_matrix& s);
  10005. /** Returns string containing a fz_md5's members, labelled and inside (...), using operator<<. */
  10006. FZ_FUNCTION std::string to_string_fz_md5(const ::fz_md5& s);
  10007. /** Returns string containing a fz_md5's members, labelled and inside (...), using operator<<.
  10008. (Convenience overload). */
  10009. FZ_FUNCTION std::string to_string(const ::fz_md5& s);
  10010. /** Returns string containing a fz_outline_item's members, labelled and inside (...), using operator<<. */
  10011. FZ_FUNCTION std::string to_string_fz_outline_item(const ::fz_outline_item& s);
  10012. /** Returns string containing a fz_outline_item's members, labelled and inside (...), using operator<<.
  10013. (Convenience overload). */
  10014. FZ_FUNCTION std::string to_string(const ::fz_outline_item& s);
  10015. /** Returns string containing a fz_pdfocr_options's members, labelled and inside (...), using operator<<. */
  10016. FZ_FUNCTION std::string to_string_fz_pdfocr_options(const ::fz_pdfocr_options& s);
  10017. /** Returns string containing a fz_pdfocr_options's members, labelled and inside (...), using operator<<.
  10018. (Convenience overload). */
  10019. FZ_FUNCTION std::string to_string(const ::fz_pdfocr_options& s);
  10020. /** Returns string containing a fz_point's members, labelled and inside (...), using operator<<. */
  10021. FZ_FUNCTION std::string to_string_fz_point(const ::fz_point& s);
  10022. /** Returns string containing a fz_point's members, labelled and inside (...), using operator<<.
  10023. (Convenience overload). */
  10024. FZ_FUNCTION std::string to_string(const ::fz_point& s);
  10025. /** Returns string containing a fz_pwg_options's members, labelled and inside (...), using operator<<. */
  10026. FZ_FUNCTION std::string to_string_fz_pwg_options(const ::fz_pwg_options& s);
  10027. /** Returns string containing a fz_pwg_options's members, labelled and inside (...), using operator<<.
  10028. (Convenience overload). */
  10029. FZ_FUNCTION std::string to_string(const ::fz_pwg_options& s);
  10030. /** Returns string containing a fz_quad's members, labelled and inside (...), using operator<<. */
  10031. FZ_FUNCTION std::string to_string_fz_quad(const ::fz_quad& s);
  10032. /** Returns string containing a fz_quad's members, labelled and inside (...), using operator<<.
  10033. (Convenience overload). */
  10034. FZ_FUNCTION std::string to_string(const ::fz_quad& s);
  10035. /** Returns string containing a fz_rect's members, labelled and inside (...), using operator<<. */
  10036. FZ_FUNCTION std::string to_string_fz_rect(const ::fz_rect& s);
  10037. /** Returns string containing a fz_rect's members, labelled and inside (...), using operator<<.
  10038. (Convenience overload). */
  10039. FZ_FUNCTION std::string to_string(const ::fz_rect& s);
  10040. /** Returns string containing a fz_stext_options's members, labelled and inside (...), using operator<<. */
  10041. FZ_FUNCTION std::string to_string_fz_stext_options(const ::fz_stext_options& s);
  10042. /** Returns string containing a fz_stext_options's members, labelled and inside (...), using operator<<.
  10043. (Convenience overload). */
  10044. FZ_FUNCTION std::string to_string(const ::fz_stext_options& s);
  10045. /** Returns string containing a fz_story_element_position's members, labelled and inside (...), using operator<<. */
  10046. FZ_FUNCTION std::string to_string_fz_story_element_position(const ::fz_story_element_position& s);
  10047. /** Returns string containing a fz_story_element_position's members, labelled and inside (...), using operator<<.
  10048. (Convenience overload). */
  10049. FZ_FUNCTION std::string to_string(const ::fz_story_element_position& s);
  10050. /** Returns string containing a fz_transition's members, labelled and inside (...), using operator<<. */
  10051. FZ_FUNCTION std::string to_string_fz_transition(const ::fz_transition& s);
  10052. /** Returns string containing a fz_transition's members, labelled and inside (...), using operator<<.
  10053. (Convenience overload). */
  10054. FZ_FUNCTION std::string to_string(const ::fz_transition& s);
  10055. /** Returns string containing a pdf_clean_options's members, labelled and inside (...), using operator<<. */
  10056. FZ_FUNCTION std::string to_string_pdf_clean_options(const ::pdf_clean_options& s);
  10057. /** Returns string containing a pdf_clean_options's members, labelled and inside (...), using operator<<.
  10058. (Convenience overload). */
  10059. FZ_FUNCTION std::string to_string(const ::pdf_clean_options& s);
  10060. /** Returns string containing a pdf_filter_factory's members, labelled and inside (...), using operator<<. */
  10061. FZ_FUNCTION std::string to_string_pdf_filter_factory(const ::pdf_filter_factory& s);
  10062. /** Returns string containing a pdf_filter_factory's members, labelled and inside (...), using operator<<.
  10063. (Convenience overload). */
  10064. FZ_FUNCTION std::string to_string(const ::pdf_filter_factory& s);
  10065. /** Returns string containing a pdf_filter_options's members, labelled and inside (...), using operator<<. */
  10066. FZ_FUNCTION std::string to_string_pdf_filter_options(const ::pdf_filter_options& s);
  10067. /** Returns string containing a pdf_filter_options's members, labelled and inside (...), using operator<<.
  10068. (Convenience overload). */
  10069. FZ_FUNCTION std::string to_string(const ::pdf_filter_options& s);
  10070. /** Returns string containing a pdf_image_rewriter_options's members, labelled and inside (...), using operator<<. */
  10071. FZ_FUNCTION std::string to_string_pdf_image_rewriter_options(const ::pdf_image_rewriter_options& s);
  10072. /** Returns string containing a pdf_image_rewriter_options's members, labelled and inside (...), using operator<<.
  10073. (Convenience overload). */
  10074. FZ_FUNCTION std::string to_string(const ::pdf_image_rewriter_options& s);
  10075. /** Returns string containing a pdf_layer_config's members, labelled and inside (...), using operator<<. */
  10076. FZ_FUNCTION std::string to_string_pdf_layer_config(const ::pdf_layer_config& s);
  10077. /** Returns string containing a pdf_layer_config's members, labelled and inside (...), using operator<<.
  10078. (Convenience overload). */
  10079. FZ_FUNCTION std::string to_string(const ::pdf_layer_config& s);
  10080. /** Returns string containing a pdf_layer_config_ui's members, labelled and inside (...), using operator<<. */
  10081. FZ_FUNCTION std::string to_string_pdf_layer_config_ui(const ::pdf_layer_config_ui& s);
  10082. /** Returns string containing a pdf_layer_config_ui's members, labelled and inside (...), using operator<<.
  10083. (Convenience overload). */
  10084. FZ_FUNCTION std::string to_string(const ::pdf_layer_config_ui& s);
  10085. /** Returns string containing a pdf_recolor_options's members, labelled and inside (...), using operator<<. */
  10086. FZ_FUNCTION std::string to_string_pdf_recolor_options(const ::pdf_recolor_options& s);
  10087. /** Returns string containing a pdf_recolor_options's members, labelled and inside (...), using operator<<.
  10088. (Convenience overload). */
  10089. FZ_FUNCTION std::string to_string(const ::pdf_recolor_options& s);
  10090. /** Returns string containing a pdf_redact_options's members, labelled and inside (...), using operator<<. */
  10091. FZ_FUNCTION std::string to_string_pdf_redact_options(const ::pdf_redact_options& s);
  10092. /** Returns string containing a pdf_redact_options's members, labelled and inside (...), using operator<<.
  10093. (Convenience overload). */
  10094. FZ_FUNCTION std::string to_string(const ::pdf_redact_options& s);
  10095. /** Returns string containing a pdf_sanitize_filter_options's members, labelled and inside (...), using operator<<. */
  10096. FZ_FUNCTION std::string to_string_pdf_sanitize_filter_options(const ::pdf_sanitize_filter_options& s);
  10097. /** Returns string containing a pdf_sanitize_filter_options's members, labelled and inside (...), using operator<<.
  10098. (Convenience overload). */
  10099. FZ_FUNCTION std::string to_string(const ::pdf_sanitize_filter_options& s);
  10100. /** Returns string containing a pdf_write_options's members, labelled and inside (...), using operator<<. */
  10101. FZ_FUNCTION std::string to_string_pdf_write_options(const ::pdf_write_options& s);
  10102. /** Returns string containing a pdf_write_options's members, labelled and inside (...), using operator<<.
  10103. (Convenience overload). */
  10104. FZ_FUNCTION std::string to_string(const ::pdf_write_options& s);
  10105. /** Reinitializes the MuPDF context for single-threaded use, which
  10106. is slightly faster when calling code is single threaded.
  10107. This should be called before any other use of MuPDF.
  10108. */
  10109. FZ_FUNCTION void reinit_singlethreaded();
  10110. } /* End of namespace mupdf. */
  10111. /** fz_aa_context: writes members, labelled and inside (...), to a stream. */
  10112. FZ_FUNCTION std::ostream& operator<< (std::ostream& out, const ::fz_aa_context& rhs);
  10113. /** fz_aa_context: comparison function. */
  10114. FZ_FUNCTION bool operator==( const ::fz_aa_context& lhs, const ::fz_aa_context& rhs);
  10115. /** fz_aa_context: comparison function. */
  10116. FZ_FUNCTION bool operator!=( const ::fz_aa_context& lhs, const ::fz_aa_context& rhs);
  10117. /** fz_color_params: writes members, labelled and inside (...), to a stream. */
  10118. FZ_FUNCTION std::ostream& operator<< (std::ostream& out, const ::fz_color_params& rhs);
  10119. /** fz_color_params: comparison function. */
  10120. FZ_FUNCTION bool operator==( const ::fz_color_params& lhs, const ::fz_color_params& rhs);
  10121. /** fz_color_params: comparison function. */
  10122. FZ_FUNCTION bool operator!=( const ::fz_color_params& lhs, const ::fz_color_params& rhs);
  10123. /** fz_cookie: writes members, labelled and inside (...), to a stream. */
  10124. FZ_FUNCTION std::ostream& operator<< (std::ostream& out, const ::fz_cookie& rhs);
  10125. /** fz_cookie: comparison function. */
  10126. FZ_FUNCTION bool operator==( const ::fz_cookie& lhs, const ::fz_cookie& rhs);
  10127. /** fz_cookie: comparison function. */
  10128. FZ_FUNCTION bool operator!=( const ::fz_cookie& lhs, const ::fz_cookie& rhs);
  10129. /** fz_draw_options: writes members, labelled and inside (...), to a stream. */
  10130. FZ_FUNCTION std::ostream& operator<< (std::ostream& out, const ::fz_draw_options& rhs);
  10131. /** fz_draw_options: comparison function. */
  10132. FZ_FUNCTION bool operator==( const ::fz_draw_options& lhs, const ::fz_draw_options& rhs);
  10133. /** fz_draw_options: comparison function. */
  10134. FZ_FUNCTION bool operator!=( const ::fz_draw_options& lhs, const ::fz_draw_options& rhs);
  10135. /** fz_install_load_system_font_funcs_args: writes members, labelled and inside (...), to a stream. */
  10136. FZ_FUNCTION std::ostream& operator<< (std::ostream& out, const ::fz_install_load_system_font_funcs_args& rhs);
  10137. /** fz_install_load_system_font_funcs_args: comparison function. */
  10138. FZ_FUNCTION bool operator==( const ::fz_install_load_system_font_funcs_args& lhs, const ::fz_install_load_system_font_funcs_args& rhs);
  10139. /** fz_install_load_system_font_funcs_args: comparison function. */
  10140. FZ_FUNCTION bool operator!=( const ::fz_install_load_system_font_funcs_args& lhs, const ::fz_install_load_system_font_funcs_args& rhs);
  10141. /** fz_irect: writes members, labelled and inside (...), to a stream. */
  10142. FZ_FUNCTION std::ostream& operator<< (std::ostream& out, const ::fz_irect& rhs);
  10143. /** fz_irect: comparison function. */
  10144. FZ_FUNCTION bool operator==( const ::fz_irect& lhs, const ::fz_irect& rhs);
  10145. /** fz_irect: comparison function. */
  10146. FZ_FUNCTION bool operator!=( const ::fz_irect& lhs, const ::fz_irect& rhs);
  10147. /** fz_location: writes members, labelled and inside (...), to a stream. */
  10148. FZ_FUNCTION std::ostream& operator<< (std::ostream& out, const ::fz_location& rhs);
  10149. /** fz_location: comparison function. */
  10150. FZ_FUNCTION bool operator==( const ::fz_location& lhs, const ::fz_location& rhs);
  10151. /** fz_location: comparison function. */
  10152. FZ_FUNCTION bool operator!=( const ::fz_location& lhs, const ::fz_location& rhs);
  10153. /** fz_matrix: writes members, labelled and inside (...), to a stream. */
  10154. FZ_FUNCTION std::ostream& operator<< (std::ostream& out, const ::fz_matrix& rhs);
  10155. /** fz_matrix: comparison function. */
  10156. FZ_FUNCTION bool operator==( const ::fz_matrix& lhs, const ::fz_matrix& rhs);
  10157. /** fz_matrix: comparison function. */
  10158. FZ_FUNCTION bool operator!=( const ::fz_matrix& lhs, const ::fz_matrix& rhs);
  10159. /** fz_md5: writes members, labelled and inside (...), to a stream. */
  10160. FZ_FUNCTION std::ostream& operator<< (std::ostream& out, const ::fz_md5& rhs);
  10161. /** fz_md5: comparison function. */
  10162. FZ_FUNCTION bool operator==( const ::fz_md5& lhs, const ::fz_md5& rhs);
  10163. /** fz_md5: comparison function. */
  10164. FZ_FUNCTION bool operator!=( const ::fz_md5& lhs, const ::fz_md5& rhs);
  10165. /** fz_outline_item: writes members, labelled and inside (...), to a stream. */
  10166. FZ_FUNCTION std::ostream& operator<< (std::ostream& out, const ::fz_outline_item& rhs);
  10167. /** fz_outline_item: comparison function. */
  10168. FZ_FUNCTION bool operator==( const ::fz_outline_item& lhs, const ::fz_outline_item& rhs);
  10169. /** fz_outline_item: comparison function. */
  10170. FZ_FUNCTION bool operator!=( const ::fz_outline_item& lhs, const ::fz_outline_item& rhs);
  10171. /** fz_pdfocr_options: writes members, labelled and inside (...), to a stream. */
  10172. FZ_FUNCTION std::ostream& operator<< (std::ostream& out, const ::fz_pdfocr_options& rhs);
  10173. /** fz_pdfocr_options: comparison function. */
  10174. FZ_FUNCTION bool operator==( const ::fz_pdfocr_options& lhs, const ::fz_pdfocr_options& rhs);
  10175. /** fz_pdfocr_options: comparison function. */
  10176. FZ_FUNCTION bool operator!=( const ::fz_pdfocr_options& lhs, const ::fz_pdfocr_options& rhs);
  10177. /** fz_point: writes members, labelled and inside (...), to a stream. */
  10178. FZ_FUNCTION std::ostream& operator<< (std::ostream& out, const ::fz_point& rhs);
  10179. /** fz_point: comparison function. */
  10180. FZ_FUNCTION bool operator==( const ::fz_point& lhs, const ::fz_point& rhs);
  10181. /** fz_point: comparison function. */
  10182. FZ_FUNCTION bool operator!=( const ::fz_point& lhs, const ::fz_point& rhs);
  10183. /** fz_pwg_options: writes members, labelled and inside (...), to a stream. */
  10184. FZ_FUNCTION std::ostream& operator<< (std::ostream& out, const ::fz_pwg_options& rhs);
  10185. /** fz_pwg_options: comparison function. */
  10186. FZ_FUNCTION bool operator==( const ::fz_pwg_options& lhs, const ::fz_pwg_options& rhs);
  10187. /** fz_pwg_options: comparison function. */
  10188. FZ_FUNCTION bool operator!=( const ::fz_pwg_options& lhs, const ::fz_pwg_options& rhs);
  10189. /** fz_quad: writes members, labelled and inside (...), to a stream. */
  10190. FZ_FUNCTION std::ostream& operator<< (std::ostream& out, const ::fz_quad& rhs);
  10191. /** fz_quad: comparison function. */
  10192. FZ_FUNCTION bool operator==( const ::fz_quad& lhs, const ::fz_quad& rhs);
  10193. /** fz_quad: comparison function. */
  10194. FZ_FUNCTION bool operator!=( const ::fz_quad& lhs, const ::fz_quad& rhs);
  10195. /** fz_rect: writes members, labelled and inside (...), to a stream. */
  10196. FZ_FUNCTION std::ostream& operator<< (std::ostream& out, const ::fz_rect& rhs);
  10197. /** fz_rect: comparison function. */
  10198. FZ_FUNCTION bool operator==( const ::fz_rect& lhs, const ::fz_rect& rhs);
  10199. /** fz_rect: comparison function. */
  10200. FZ_FUNCTION bool operator!=( const ::fz_rect& lhs, const ::fz_rect& rhs);
  10201. /** fz_stext_options: writes members, labelled and inside (...), to a stream. */
  10202. FZ_FUNCTION std::ostream& operator<< (std::ostream& out, const ::fz_stext_options& rhs);
  10203. /** fz_stext_options: comparison function. */
  10204. FZ_FUNCTION bool operator==( const ::fz_stext_options& lhs, const ::fz_stext_options& rhs);
  10205. /** fz_stext_options: comparison function. */
  10206. FZ_FUNCTION bool operator!=( const ::fz_stext_options& lhs, const ::fz_stext_options& rhs);
  10207. /** fz_story_element_position: writes members, labelled and inside (...), to a stream. */
  10208. FZ_FUNCTION std::ostream& operator<< (std::ostream& out, const ::fz_story_element_position& rhs);
  10209. /** fz_story_element_position: comparison function. */
  10210. FZ_FUNCTION bool operator==( const ::fz_story_element_position& lhs, const ::fz_story_element_position& rhs);
  10211. /** fz_story_element_position: comparison function. */
  10212. FZ_FUNCTION bool operator!=( const ::fz_story_element_position& lhs, const ::fz_story_element_position& rhs);
  10213. /** fz_transition: writes members, labelled and inside (...), to a stream. */
  10214. FZ_FUNCTION std::ostream& operator<< (std::ostream& out, const ::fz_transition& rhs);
  10215. /** fz_transition: comparison function. */
  10216. FZ_FUNCTION bool operator==( const ::fz_transition& lhs, const ::fz_transition& rhs);
  10217. /** fz_transition: comparison function. */
  10218. FZ_FUNCTION bool operator!=( const ::fz_transition& lhs, const ::fz_transition& rhs);
  10219. /** pdf_clean_options: writes members, labelled and inside (...), to a stream. */
  10220. FZ_FUNCTION std::ostream& operator<< (std::ostream& out, const ::pdf_clean_options& rhs);
  10221. /** pdf_clean_options: comparison function. */
  10222. FZ_FUNCTION bool operator==( const ::pdf_clean_options& lhs, const ::pdf_clean_options& rhs);
  10223. /** pdf_clean_options: comparison function. */
  10224. FZ_FUNCTION bool operator!=( const ::pdf_clean_options& lhs, const ::pdf_clean_options& rhs);
  10225. /** pdf_filter_factory: writes members, labelled and inside (...), to a stream. */
  10226. FZ_FUNCTION std::ostream& operator<< (std::ostream& out, const ::pdf_filter_factory& rhs);
  10227. /** pdf_filter_factory: comparison function. */
  10228. FZ_FUNCTION bool operator==( const ::pdf_filter_factory& lhs, const ::pdf_filter_factory& rhs);
  10229. /** pdf_filter_factory: comparison function. */
  10230. FZ_FUNCTION bool operator!=( const ::pdf_filter_factory& lhs, const ::pdf_filter_factory& rhs);
  10231. /** pdf_filter_options: writes members, labelled and inside (...), to a stream. */
  10232. FZ_FUNCTION std::ostream& operator<< (std::ostream& out, const ::pdf_filter_options& rhs);
  10233. /** pdf_filter_options: comparison function. */
  10234. FZ_FUNCTION bool operator==( const ::pdf_filter_options& lhs, const ::pdf_filter_options& rhs);
  10235. /** pdf_filter_options: comparison function. */
  10236. FZ_FUNCTION bool operator!=( const ::pdf_filter_options& lhs, const ::pdf_filter_options& rhs);
  10237. /** pdf_image_rewriter_options: writes members, labelled and inside (...), to a stream. */
  10238. FZ_FUNCTION std::ostream& operator<< (std::ostream& out, const ::pdf_image_rewriter_options& rhs);
  10239. /** pdf_image_rewriter_options: comparison function. */
  10240. FZ_FUNCTION bool operator==( const ::pdf_image_rewriter_options& lhs, const ::pdf_image_rewriter_options& rhs);
  10241. /** pdf_image_rewriter_options: comparison function. */
  10242. FZ_FUNCTION bool operator!=( const ::pdf_image_rewriter_options& lhs, const ::pdf_image_rewriter_options& rhs);
  10243. /** pdf_layer_config: writes members, labelled and inside (...), to a stream. */
  10244. FZ_FUNCTION std::ostream& operator<< (std::ostream& out, const ::pdf_layer_config& rhs);
  10245. /** pdf_layer_config: comparison function. */
  10246. FZ_FUNCTION bool operator==( const ::pdf_layer_config& lhs, const ::pdf_layer_config& rhs);
  10247. /** pdf_layer_config: comparison function. */
  10248. FZ_FUNCTION bool operator!=( const ::pdf_layer_config& lhs, const ::pdf_layer_config& rhs);
  10249. /** pdf_layer_config_ui: writes members, labelled and inside (...), to a stream. */
  10250. FZ_FUNCTION std::ostream& operator<< (std::ostream& out, const ::pdf_layer_config_ui& rhs);
  10251. /** pdf_layer_config_ui: comparison function. */
  10252. FZ_FUNCTION bool operator==( const ::pdf_layer_config_ui& lhs, const ::pdf_layer_config_ui& rhs);
  10253. /** pdf_layer_config_ui: comparison function. */
  10254. FZ_FUNCTION bool operator!=( const ::pdf_layer_config_ui& lhs, const ::pdf_layer_config_ui& rhs);
  10255. /** pdf_recolor_options: writes members, labelled and inside (...), to a stream. */
  10256. FZ_FUNCTION std::ostream& operator<< (std::ostream& out, const ::pdf_recolor_options& rhs);
  10257. /** pdf_recolor_options: comparison function. */
  10258. FZ_FUNCTION bool operator==( const ::pdf_recolor_options& lhs, const ::pdf_recolor_options& rhs);
  10259. /** pdf_recolor_options: comparison function. */
  10260. FZ_FUNCTION bool operator!=( const ::pdf_recolor_options& lhs, const ::pdf_recolor_options& rhs);
  10261. /** pdf_redact_options: writes members, labelled and inside (...), to a stream. */
  10262. FZ_FUNCTION std::ostream& operator<< (std::ostream& out, const ::pdf_redact_options& rhs);
  10263. /** pdf_redact_options: comparison function. */
  10264. FZ_FUNCTION bool operator==( const ::pdf_redact_options& lhs, const ::pdf_redact_options& rhs);
  10265. /** pdf_redact_options: comparison function. */
  10266. FZ_FUNCTION bool operator!=( const ::pdf_redact_options& lhs, const ::pdf_redact_options& rhs);
  10267. /** pdf_sanitize_filter_options: writes members, labelled and inside (...), to a stream. */
  10268. FZ_FUNCTION std::ostream& operator<< (std::ostream& out, const ::pdf_sanitize_filter_options& rhs);
  10269. /** pdf_sanitize_filter_options: comparison function. */
  10270. FZ_FUNCTION bool operator==( const ::pdf_sanitize_filter_options& lhs, const ::pdf_sanitize_filter_options& rhs);
  10271. /** pdf_sanitize_filter_options: comparison function. */
  10272. FZ_FUNCTION bool operator!=( const ::pdf_sanitize_filter_options& lhs, const ::pdf_sanitize_filter_options& rhs);
  10273. /** pdf_write_options: writes members, labelled and inside (...), to a stream. */
  10274. FZ_FUNCTION std::ostream& operator<< (std::ostream& out, const ::pdf_write_options& rhs);
  10275. /** pdf_write_options: comparison function. */
  10276. FZ_FUNCTION bool operator==( const ::pdf_write_options& lhs, const ::pdf_write_options& rhs);
  10277. /** pdf_write_options: comparison function. */
  10278. FZ_FUNCTION bool operator!=( const ::pdf_write_options& lhs, const ::pdf_write_options& rhs);
  10279. #endif