@img/sharp-libvips-dev-wasm32 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (475) hide show
  1. package/README.md +35 -0
  2. package/include/aom/aom.h +127 -0
  3. package/include/aom/aom_codec.h +577 -0
  4. package/include/aom/aom_decoder.h +257 -0
  5. package/include/aom/aom_encoder.h +1144 -0
  6. package/include/aom/aom_external_partition.h +452 -0
  7. package/include/aom/aom_frame_buffer.h +84 -0
  8. package/include/aom/aom_image.h +448 -0
  9. package/include/aom/aom_integer.h +68 -0
  10. package/include/aom/aomcx.h +2181 -0
  11. package/include/aom/aomdx.h +604 -0
  12. package/include/cgif.h +80 -0
  13. package/include/expat.h +1064 -0
  14. package/include/expat_config.h +140 -0
  15. package/include/expat_external.h +165 -0
  16. package/include/ffi.h +531 -0
  17. package/include/ffitarget.h +62 -0
  18. package/include/glib-2.0/gio/gaction.h +100 -0
  19. package/include/glib-2.0/gio/gactiongroup.h +163 -0
  20. package/include/glib-2.0/gio/gactiongroupexporter.h +47 -0
  21. package/include/glib-2.0/gio/gactionmap.h +101 -0
  22. package/include/glib-2.0/gio/gappinfo.h +369 -0
  23. package/include/glib-2.0/gio/gapplication.h +257 -0
  24. package/include/glib-2.0/gio/gapplicationcommandline.h +124 -0
  25. package/include/glib-2.0/gio/gasyncinitable.h +132 -0
  26. package/include/glib-2.0/gio/gasyncresult.h +87 -0
  27. package/include/glib-2.0/gio/gbufferedinputstream.h +135 -0
  28. package/include/glib-2.0/gio/gbufferedoutputstream.h +88 -0
  29. package/include/glib-2.0/gio/gbytesicon.h +54 -0
  30. package/include/glib-2.0/gio/gcancellable.h +120 -0
  31. package/include/glib-2.0/gio/gcharsetconverter.h +65 -0
  32. package/include/glib-2.0/gio/gcontenttype.h +84 -0
  33. package/include/glib-2.0/gio/gconverter.h +98 -0
  34. package/include/glib-2.0/gio/gconverterinputstream.h +82 -0
  35. package/include/glib-2.0/gio/gconverteroutputstream.h +82 -0
  36. package/include/glib-2.0/gio/gcredentials.h +87 -0
  37. package/include/glib-2.0/gio/gdatagrambased.h +146 -0
  38. package/include/glib-2.0/gio/gdatainputstream.h +182 -0
  39. package/include/glib-2.0/gio/gdataoutputstream.h +127 -0
  40. package/include/glib-2.0/gio/gdbusactiongroup.h +56 -0
  41. package/include/glib-2.0/gio/gdbusaddress.h +67 -0
  42. package/include/glib-2.0/gio/gdbusauthobserver.h +53 -0
  43. package/include/glib-2.0/gio/gdbusconnection.h +691 -0
  44. package/include/glib-2.0/gio/gdbuserror.h +111 -0
  45. package/include/glib-2.0/gio/gdbusinterface.h +83 -0
  46. package/include/glib-2.0/gio/gdbusinterfaceskeleton.h +129 -0
  47. package/include/glib-2.0/gio/gdbusintrospection.h +327 -0
  48. package/include/glib-2.0/gio/gdbusmenumodel.h +47 -0
  49. package/include/glib-2.0/gio/gdbusmessage.h +204 -0
  50. package/include/glib-2.0/gio/gdbusmethodinvocation.h +136 -0
  51. package/include/glib-2.0/gio/gdbusnameowning.h +117 -0
  52. package/include/glib-2.0/gio/gdbusnamewatching.h +104 -0
  53. package/include/glib-2.0/gio/gdbusobject.h +80 -0
  54. package/include/glib-2.0/gio/gdbusobjectmanager.h +96 -0
  55. package/include/glib-2.0/gio/gdbusobjectmanagerclient.h +148 -0
  56. package/include/glib-2.0/gio/gdbusobjectmanagerserver.h +95 -0
  57. package/include/glib-2.0/gio/gdbusobjectproxy.h +81 -0
  58. package/include/glib-2.0/gio/gdbusobjectskeleton.h +98 -0
  59. package/include/glib-2.0/gio/gdbusproxy.h +220 -0
  60. package/include/glib-2.0/gio/gdbusserver.h +62 -0
  61. package/include/glib-2.0/gio/gdbusutils.h +65 -0
  62. package/include/glib-2.0/gio/gdebugcontroller.h +81 -0
  63. package/include/glib-2.0/gio/gdebugcontrollerdbus.h +71 -0
  64. package/include/glib-2.0/gio/gdrive.h +274 -0
  65. package/include/glib-2.0/gio/gdtlsclientconnection.h +77 -0
  66. package/include/glib-2.0/gio/gdtlsconnection.h +230 -0
  67. package/include/glib-2.0/gio/gdtlsserverconnection.h +71 -0
  68. package/include/glib-2.0/gio/gemblem.h +63 -0
  69. package/include/glib-2.0/gio/gemblemedicon.h +83 -0
  70. package/include/glib-2.0/gio/gfile.h +1359 -0
  71. package/include/glib-2.0/gio/gfileattribute.h +86 -0
  72. package/include/glib-2.0/gio/gfileenumerator.h +154 -0
  73. package/include/glib-2.0/gio/gfileicon.h +59 -0
  74. package/include/glib-2.0/gio/gfileinfo.h +1546 -0
  75. package/include/glib-2.0/gio/gfileinputstream.h +116 -0
  76. package/include/glib-2.0/gio/gfileiostream.h +123 -0
  77. package/include/glib-2.0/gio/gfilemonitor.h +100 -0
  78. package/include/glib-2.0/gio/gfilenamecompleter.h +81 -0
  79. package/include/glib-2.0/gio/gfileoutputstream.h +124 -0
  80. package/include/glib-2.0/gio/gfilterinputstream.h +80 -0
  81. package/include/glib-2.0/gio/gfilteroutputstream.h +80 -0
  82. package/include/glib-2.0/gio/gicon.h +133 -0
  83. package/include/glib-2.0/gio/ginetaddress.h +125 -0
  84. package/include/glib-2.0/gio/ginetaddressmask.h +86 -0
  85. package/include/glib-2.0/gio/ginetsocketaddress.h +80 -0
  86. package/include/glib-2.0/gio/ginitable.h +107 -0
  87. package/include/glib-2.0/gio/ginputstream.h +218 -0
  88. package/include/glib-2.0/gio/gio-autocleanups.h +155 -0
  89. package/include/glib-2.0/gio/gio-visibility.h +952 -0
  90. package/include/glib-2.0/gio/gio.h +186 -0
  91. package/include/glib-2.0/gio/gioenums.h +2149 -0
  92. package/include/glib-2.0/gio/gioenumtypes.h +207 -0
  93. package/include/glib-2.0/gio/gioerror.h +58 -0
  94. package/include/glib-2.0/gio/giomodule.h +199 -0
  95. package/include/glib-2.0/gio/gioscheduler.h +56 -0
  96. package/include/glib-2.0/gio/giostream.h +137 -0
  97. package/include/glib-2.0/gio/giotypes.h +660 -0
  98. package/include/glib-2.0/gio/glistmodel.h +74 -0
  99. package/include/glib-2.0/gio/gliststore.h +97 -0
  100. package/include/glib-2.0/gio/gloadableicon.h +101 -0
  101. package/include/glib-2.0/gio/gmemoryinputstream.h +92 -0
  102. package/include/glib-2.0/gio/gmemorymonitor.h +64 -0
  103. package/include/glib-2.0/gio/gmemoryoutputstream.h +109 -0
  104. package/include/glib-2.0/gio/gmenu.h +184 -0
  105. package/include/glib-2.0/gio/gmenuexporter.h +55 -0
  106. package/include/glib-2.0/gio/gmenumodel.h +307 -0
  107. package/include/glib-2.0/gio/gmount.h +278 -0
  108. package/include/glib-2.0/gio/gmountoperation.h +179 -0
  109. package/include/glib-2.0/gio/gnativesocketaddress.h +67 -0
  110. package/include/glib-2.0/gio/gnativevolumemonitor.h +63 -0
  111. package/include/glib-2.0/gio/gnetworkaddress.h +82 -0
  112. package/include/glib-2.0/gio/gnetworking.h +81 -0
  113. package/include/glib-2.0/gio/gnetworkmonitor.h +101 -0
  114. package/include/glib-2.0/gio/gnetworkservice.h +77 -0
  115. package/include/glib-2.0/gio/gnotification.h +103 -0
  116. package/include/glib-2.0/gio/goutputstream.h +334 -0
  117. package/include/glib-2.0/gio/gpermission.h +129 -0
  118. package/include/glib-2.0/gio/gpollableinputstream.h +106 -0
  119. package/include/glib-2.0/gio/gpollableoutputstream.h +127 -0
  120. package/include/glib-2.0/gio/gpollableutils.h +66 -0
  121. package/include/glib-2.0/gio/gpowerprofilemonitor.h +65 -0
  122. package/include/glib-2.0/gio/gpropertyaction.h +49 -0
  123. package/include/glib-2.0/gio/gproxy.h +130 -0
  124. package/include/glib-2.0/gio/gproxyaddress.h +88 -0
  125. package/include/glib-2.0/gio/gproxyaddressenumerator.h +83 -0
  126. package/include/glib-2.0/gio/gproxyresolver.h +97 -0
  127. package/include/glib-2.0/gio/gremoteactiongroup.h +77 -0
  128. package/include/glib-2.0/gio/gresolver.h +299 -0
  129. package/include/glib-2.0/gio/gresource.h +132 -0
  130. package/include/glib-2.0/gio/gseekable.h +105 -0
  131. package/include/glib-2.0/gio/gsettings.h +347 -0
  132. package/include/glib-2.0/gio/gsettingsbackend.h +176 -0
  133. package/include/glib-2.0/gio/gsettingsschema.h +115 -0
  134. package/include/glib-2.0/gio/gsimpleaction.h +65 -0
  135. package/include/glib-2.0/gio/gsimpleactiongroup.h +99 -0
  136. package/include/glib-2.0/gio/gsimpleasyncresult.h +164 -0
  137. package/include/glib-2.0/gio/gsimpleiostream.h +47 -0
  138. package/include/glib-2.0/gio/gsimplepermission.h +47 -0
  139. package/include/glib-2.0/gio/gsimpleproxyresolver.h +91 -0
  140. package/include/glib-2.0/gio/gsocket.h +330 -0
  141. package/include/glib-2.0/gio/gsocketaddress.h +84 -0
  142. package/include/glib-2.0/gio/gsocketaddressenumerator.h +103 -0
  143. package/include/glib-2.0/gio/gsocketclient.h +199 -0
  144. package/include/glib-2.0/gio/gsocketconnectable.h +83 -0
  145. package/include/glib-2.0/gio/gsocketconnection.h +117 -0
  146. package/include/glib-2.0/gio/gsocketcontrolmessage.h +113 -0
  147. package/include/glib-2.0/gio/gsocketlistener.h +157 -0
  148. package/include/glib-2.0/gio/gsocketservice.h +95 -0
  149. package/include/glib-2.0/gio/gsrvtarget.h +60 -0
  150. package/include/glib-2.0/gio/gsubprocess.h +169 -0
  151. package/include/glib-2.0/gio/gsubprocesslauncher.h +121 -0
  152. package/include/glib-2.0/gio/gtask.h +207 -0
  153. package/include/glib-2.0/gio/gtcpconnection.h +71 -0
  154. package/include/glib-2.0/gio/gtcpwrapperconnection.h +71 -0
  155. package/include/glib-2.0/gio/gtestdbus.h +74 -0
  156. package/include/glib-2.0/gio/gthemedicon.h +70 -0
  157. package/include/glib-2.0/gio/gthreadedsocketservice.h +83 -0
  158. package/include/glib-2.0/gio/gtlsbackend.h +115 -0
  159. package/include/glib-2.0/gio/gtlscertificate.h +125 -0
  160. package/include/glib-2.0/gio/gtlsclientconnection.h +88 -0
  161. package/include/glib-2.0/gio/gtlsconnection.h +214 -0
  162. package/include/glib-2.0/gio/gtlsdatabase.h +249 -0
  163. package/include/glib-2.0/gio/gtlsfiledatabase.h +60 -0
  164. package/include/glib-2.0/gio/gtlsinteraction.h +150 -0
  165. package/include/glib-2.0/gio/gtlspassword.h +121 -0
  166. package/include/glib-2.0/gio/gtlsserverconnection.h +71 -0
  167. package/include/glib-2.0/gio/gunixconnection.h +102 -0
  168. package/include/glib-2.0/gio/gunixcredentialsmessage.h +89 -0
  169. package/include/glib-2.0/gio/gunixfdlist.h +97 -0
  170. package/include/glib-2.0/gio/gunixsocketaddress.h +83 -0
  171. package/include/glib-2.0/gio/gvfs.h +170 -0
  172. package/include/glib-2.0/gio/gvolume.h +255 -0
  173. package/include/glib-2.0/gio/gvolumemonitor.h +156 -0
  174. package/include/glib-2.0/gio/gzlibcompressor.h +64 -0
  175. package/include/glib-2.0/gio/gzlibdecompressor.h +60 -0
  176. package/include/glib-2.0/glib/deprecated/gallocator.h +88 -0
  177. package/include/glib-2.0/glib/deprecated/gcache.h +77 -0
  178. package/include/glib-2.0/glib/deprecated/gcompletion.h +85 -0
  179. package/include/glib-2.0/glib/deprecated/gmain.h +137 -0
  180. package/include/glib-2.0/glib/deprecated/grel.h +107 -0
  181. package/include/glib-2.0/glib/deprecated/gthread.h +295 -0
  182. package/include/glib-2.0/glib/galloca.h +147 -0
  183. package/include/glib-2.0/glib/garray.h +323 -0
  184. package/include/glib-2.0/glib/gasyncqueue.h +126 -0
  185. package/include/glib-2.0/glib/gatomic.h +587 -0
  186. package/include/glib-2.0/glib/gbacktrace.h +74 -0
  187. package/include/glib-2.0/glib/gbase64.h +63 -0
  188. package/include/glib-2.0/glib/gbitlock.h +78 -0
  189. package/include/glib-2.0/glib/gbookmarkfile.h +300 -0
  190. package/include/glib-2.0/glib/gbytes.h +99 -0
  191. package/include/glib-2.0/glib/gcharset.h +49 -0
  192. package/include/glib-2.0/glib/gchecksum.h +106 -0
  193. package/include/glib-2.0/glib/gconvert.h +179 -0
  194. package/include/glib-2.0/glib/gdataset.h +156 -0
  195. package/include/glib-2.0/glib/gdate.h +309 -0
  196. package/include/glib-2.0/glib/gdatetime.h +275 -0
  197. package/include/glib-2.0/glib/gdir.h +54 -0
  198. package/include/glib-2.0/glib/genviron.h +65 -0
  199. package/include/glib-2.0/glib/gerror.h +263 -0
  200. package/include/glib-2.0/glib/gfileutils.h +223 -0
  201. package/include/glib-2.0/glib/ggettext.h +65 -0
  202. package/include/glib-2.0/glib/ghash.h +206 -0
  203. package/include/glib-2.0/glib/ghmac.h +85 -0
  204. package/include/glib-2.0/glib/ghook.h +204 -0
  205. package/include/glib-2.0/glib/ghostutils.h +45 -0
  206. package/include/glib-2.0/glib/gi18n-lib.h +29 -0
  207. package/include/glib-2.0/glib/gi18n.h +34 -0
  208. package/include/glib-2.0/glib/giochannel.h +407 -0
  209. package/include/glib-2.0/glib/gkeyfile.h +332 -0
  210. package/include/glib-2.0/glib/glib-autocleanups.h +105 -0
  211. package/include/glib-2.0/glib/glib-typeof.h +47 -0
  212. package/include/glib-2.0/glib/glib-visibility.h +952 -0
  213. package/include/glib-2.0/glib/glist.h +179 -0
  214. package/include/glib-2.0/glib/gmacros.h +1425 -0
  215. package/include/glib-2.0/glib/gmain.h +862 -0
  216. package/include/glib-2.0/glib/gmappedfile.h +60 -0
  217. package/include/glib-2.0/glib/gmarkup.h +265 -0
  218. package/include/glib-2.0/glib/gmem.h +425 -0
  219. package/include/glib-2.0/glib/gmessages.h +690 -0
  220. package/include/glib-2.0/glib/gnode.h +309 -0
  221. package/include/glib-2.0/glib/goption.h +409 -0
  222. package/include/glib-2.0/glib/gpathbuf.h +90 -0
  223. package/include/glib-2.0/glib/gpattern.h +65 -0
  224. package/include/glib-2.0/glib/gpoll.h +122 -0
  225. package/include/glib-2.0/glib/gprimes.h +52 -0
  226. package/include/glib-2.0/glib/gprintf.h +59 -0
  227. package/include/glib-2.0/glib/gqsort.h +47 -0
  228. package/include/glib-2.0/glib/gquark.h +70 -0
  229. package/include/glib-2.0/glib/gqueue.h +205 -0
  230. package/include/glib-2.0/glib/grand.h +101 -0
  231. package/include/glib-2.0/glib/grcbox.h +91 -0
  232. package/include/glib-2.0/glib/grefcount.h +179 -0
  233. package/include/glib-2.0/glib/grefstring.h +59 -0
  234. package/include/glib-2.0/glib/gscanner.h +301 -0
  235. package/include/glib-2.0/glib/gsequence.h +175 -0
  236. package/include/glib-2.0/glib/gshell.h +59 -0
  237. package/include/glib-2.0/glib/gslice.h +117 -0
  238. package/include/glib-2.0/glib/gslist.h +166 -0
  239. package/include/glib-2.0/glib/gspawn.h +323 -0
  240. package/include/glib-2.0/glib/gstdio.h +231 -0
  241. package/include/glib-2.0/glib/gstrfuncs.h +504 -0
  242. package/include/glib-2.0/glib/gstring.h +296 -0
  243. package/include/glib-2.0/glib/gstringchunk.h +59 -0
  244. package/include/glib-2.0/glib/gstrvbuilder.h +69 -0
  245. package/include/glib-2.0/glib/gtestutils.h +763 -0
  246. package/include/glib-2.0/glib/gthread.h +603 -0
  247. package/include/glib-2.0/glib/gthreadpool.h +105 -0
  248. package/include/glib-2.0/glib/gtimer.h +80 -0
  249. package/include/glib-2.0/glib/gtimezone.h +98 -0
  250. package/include/glib-2.0/glib/gtrashstack.h +60 -0
  251. package/include/glib-2.0/glib/gtree.h +181 -0
  252. package/include/glib-2.0/glib/gtypes.h +591 -0
  253. package/include/glib-2.0/glib/gunicode.h +974 -0
  254. package/include/glib-2.0/glib/guri.h +420 -0
  255. package/include/glib-2.0/glib/gutils.h +479 -0
  256. package/include/glib-2.0/glib/guuid.h +42 -0
  257. package/include/glib-2.0/glib/gvariant.h +541 -0
  258. package/include/glib-2.0/glib/gvarianttype.h +384 -0
  259. package/include/glib-2.0/glib/gversion.h +57 -0
  260. package/include/glib-2.0/glib/gversionmacros.h +490 -0
  261. package/include/glib-2.0/glib/gwin32.h +142 -0
  262. package/include/glib-2.0/glib-object.h +46 -0
  263. package/include/glib-2.0/glib-unix.h +125 -0
  264. package/include/glib-2.0/glib.h +121 -0
  265. package/include/glib-2.0/gmodule/gmodule-visibility.h +952 -0
  266. package/include/glib-2.0/gmodule.h +147 -0
  267. package/include/glib-2.0/gobject/gbinding.h +156 -0
  268. package/include/glib-2.0/gobject/gbindinggroup.h +85 -0
  269. package/include/glib-2.0/gobject/gboxed.h +124 -0
  270. package/include/glib-2.0/gobject/gclosure.h +323 -0
  271. package/include/glib-2.0/gobject/genums.h +381 -0
  272. package/include/glib-2.0/gobject/glib-enumtypes.h +25 -0
  273. package/include/glib-2.0/gobject/glib-types.h +400 -0
  274. package/include/glib-2.0/gobject/gmarshal.h +434 -0
  275. package/include/glib-2.0/gobject/gobject-autocleanups.h +33 -0
  276. package/include/glib-2.0/gobject/gobject-visibility.h +952 -0
  277. package/include/glib-2.0/gobject/gobject.h +953 -0
  278. package/include/glib-2.0/gobject/gobjectnotifyqueue.c +199 -0
  279. package/include/glib-2.0/gobject/gparam.h +477 -0
  280. package/include/glib-2.0/gobject/gparamspecs.h +1151 -0
  281. package/include/glib-2.0/gobject/gsignal.h +647 -0
  282. package/include/glib-2.0/gobject/gsignalgroup.h +98 -0
  283. package/include/glib-2.0/gobject/gsourceclosure.h +40 -0
  284. package/include/glib-2.0/gobject/gtype.h +2715 -0
  285. package/include/glib-2.0/gobject/gtypemodule.h +302 -0
  286. package/include/glib-2.0/gobject/gtypeplugin.h +136 -0
  287. package/include/glib-2.0/gobject/gvalue.h +212 -0
  288. package/include/glib-2.0/gobject/gvaluearray.h +106 -0
  289. package/include/glib-2.0/gobject/gvaluecollector.h +290 -0
  290. package/include/glib-2.0/gobject/gvaluetypes.h +318 -0
  291. package/include/hwy/aligned_allocator.h +211 -0
  292. package/include/hwy/base.h +1517 -0
  293. package/include/hwy/cache_control.h +108 -0
  294. package/include/hwy/detect_compiler_arch.h +281 -0
  295. package/include/hwy/detect_targets.h +644 -0
  296. package/include/hwy/foreach_target.h +340 -0
  297. package/include/hwy/highway.h +435 -0
  298. package/include/hwy/highway_export.h +74 -0
  299. package/include/hwy/nanobenchmark.h +171 -0
  300. package/include/hwy/ops/arm_neon-inl.h +8913 -0
  301. package/include/hwy/ops/arm_sve-inl.h +5105 -0
  302. package/include/hwy/ops/emu128-inl.h +2811 -0
  303. package/include/hwy/ops/generic_ops-inl.h +4745 -0
  304. package/include/hwy/ops/ppc_vsx-inl.h +5716 -0
  305. package/include/hwy/ops/rvv-inl.h +5070 -0
  306. package/include/hwy/ops/scalar-inl.h +1995 -0
  307. package/include/hwy/ops/set_macros-inl.h +578 -0
  308. package/include/hwy/ops/shared-inl.h +539 -0
  309. package/include/hwy/ops/tuple-inl.h +125 -0
  310. package/include/hwy/ops/wasm_128-inl.h +5917 -0
  311. package/include/hwy/ops/x86_128-inl.h +11173 -0
  312. package/include/hwy/ops/x86_256-inl.h +7529 -0
  313. package/include/hwy/ops/x86_512-inl.h +6849 -0
  314. package/include/hwy/per_target.h +44 -0
  315. package/include/hwy/print-inl.h +62 -0
  316. package/include/hwy/print.h +75 -0
  317. package/include/hwy/robust_statistics.h +148 -0
  318. package/include/hwy/targets.h +338 -0
  319. package/include/hwy/timer-inl.h +200 -0
  320. package/include/hwy/timer.h +55 -0
  321. package/include/index.js +1 -0
  322. package/include/jconfig.h +37 -0
  323. package/include/jerror.h +335 -0
  324. package/include/jmorecfg.h +382 -0
  325. package/include/jpeglib.h +1211 -0
  326. package/include/lcms2.h +1958 -0
  327. package/include/lcms2_plugin.h +700 -0
  328. package/include/libexif/_stdint.h +2 -0
  329. package/include/libexif/exif-byte-order.h +48 -0
  330. package/include/libexif/exif-content.h +181 -0
  331. package/include/libexif/exif-data-type.h +46 -0
  332. package/include/libexif/exif-data.h +267 -0
  333. package/include/libexif/exif-entry.h +186 -0
  334. package/include/libexif/exif-format.h +65 -0
  335. package/include/libexif/exif-ifd.h +51 -0
  336. package/include/libexif/exif-loader.h +128 -0
  337. package/include/libexif/exif-log.h +116 -0
  338. package/include/libexif/exif-mem.h +91 -0
  339. package/include/libexif/exif-mnote-data.h +122 -0
  340. package/include/libexif/exif-tag.h +307 -0
  341. package/include/libexif/exif-utils.h +194 -0
  342. package/include/libheif/heif.h +2169 -0
  343. package/include/libheif/heif_cxx.h +1362 -0
  344. package/include/libheif/heif_plugin.h +306 -0
  345. package/include/libheif/heif_properties.h +138 -0
  346. package/include/libheif/heif_regions.h +866 -0
  347. package/include/libheif/heif_version.h +38 -0
  348. package/include/libimagequant.h +111 -0
  349. package/include/resvg.h +491 -0
  350. package/include/spng.h +537 -0
  351. package/include/tiff.h +899 -0
  352. package/include/tiffconf.h +145 -0
  353. package/include/tiffio.h +653 -0
  354. package/include/tiffvers.h +36 -0
  355. package/include/vips/VConnection8.h +144 -0
  356. package/include/vips/VError8.h +79 -0
  357. package/include/vips/VImage8.h +6329 -0
  358. package/include/vips/VInterpolate8.h +74 -0
  359. package/include/vips/VRegion8.h +154 -0
  360. package/include/vips/arithmetic.h +571 -0
  361. package/include/vips/basic.h +113 -0
  362. package/include/vips/buf.h +120 -0
  363. package/include/vips/colour.h +306 -0
  364. package/include/vips/connection.h +567 -0
  365. package/include/vips/conversion.h +357 -0
  366. package/include/vips/convolution.h +101 -0
  367. package/include/vips/create.h +161 -0
  368. package/include/vips/dbuf.h +101 -0
  369. package/include/vips/debug.h +106 -0
  370. package/include/vips/draw.h +113 -0
  371. package/include/vips/enumtypes.h +184 -0
  372. package/include/vips/error.h +142 -0
  373. package/include/vips/foreign.h +1033 -0
  374. package/include/vips/format.h +135 -0
  375. package/include/vips/freqfilt.h +64 -0
  376. package/include/vips/gate.h +90 -0
  377. package/include/vips/generate.h +92 -0
  378. package/include/vips/header.h +322 -0
  379. package/include/vips/histogram.h +85 -0
  380. package/include/vips/image.h +605 -0
  381. package/include/vips/interpolate.h +140 -0
  382. package/include/vips/memory.h +105 -0
  383. package/include/vips/morphology.h +73 -0
  384. package/include/vips/mosaicing.h +79 -0
  385. package/include/vips/object.h +720 -0
  386. package/include/vips/operation.h +183 -0
  387. package/include/vips/private.h +225 -0
  388. package/include/vips/rect.h +80 -0
  389. package/include/vips/region.h +238 -0
  390. package/include/vips/resample.h +123 -0
  391. package/include/vips/sbuf.h +143 -0
  392. package/include/vips/semaphore.h +77 -0
  393. package/include/vips/thread.h +75 -0
  394. package/include/vips/threadpool.h +159 -0
  395. package/include/vips/transform.h +89 -0
  396. package/include/vips/type.h +310 -0
  397. package/include/vips/util.h +451 -0
  398. package/include/vips/vector.h +63 -0
  399. package/include/vips/version.h +26 -0
  400. package/include/vips/vips.h +195 -0
  401. package/include/vips/vips8 +60 -0
  402. package/include/webp/decode.h +504 -0
  403. package/include/webp/demux.h +363 -0
  404. package/include/webp/encode.h +552 -0
  405. package/include/webp/mux.h +530 -0
  406. package/include/webp/mux_types.h +98 -0
  407. package/include/webp/sharpyuv/sharpyuv.h +103 -0
  408. package/include/webp/sharpyuv/sharpyuv_csp.h +60 -0
  409. package/include/webp/types.h +72 -0
  410. package/include/zconf.h +203 -0
  411. package/include/zlib.h +1859 -0
  412. package/include/zlib_name_mangling.h +8 -0
  413. package/lib/glib-2.0/include/glibconfig.h +220 -0
  414. package/lib/index.js +1 -0
  415. package/lib/libaom.a +0 -0
  416. package/lib/libcgif.a +0 -0
  417. package/lib/libexif.a +0 -0
  418. package/lib/libexif.la +41 -0
  419. package/lib/libexpat.a +0 -0
  420. package/lib/libexpat.la +41 -0
  421. package/lib/libffi.a +0 -0
  422. package/lib/libffi.la +41 -0
  423. package/lib/libgio-2.0.a +0 -0
  424. package/lib/libglib-2.0.a +0 -0
  425. package/lib/libgmodule-2.0.a +0 -0
  426. package/lib/libgobject-2.0.a +0 -0
  427. package/lib/libgthread-2.0.a +0 -0
  428. package/lib/libheif.a +0 -0
  429. package/lib/libhwy.a +0 -0
  430. package/lib/libimagequant.a +0 -0
  431. package/lib/libjpeg.a +0 -0
  432. package/lib/liblcms2.a +0 -0
  433. package/lib/libresvg.a +0 -0
  434. package/lib/libsharpyuv.a +0 -0
  435. package/lib/libsharpyuv.la +41 -0
  436. package/lib/libspng.a +0 -0
  437. package/lib/libtiff.a +0 -0
  438. package/lib/libtiff.la +41 -0
  439. package/lib/libvips-cpp.a +0 -0
  440. package/lib/libvips.a +0 -0
  441. package/lib/libwebp.a +0 -0
  442. package/lib/libwebp.la +41 -0
  443. package/lib/libwebpdemux.a +0 -0
  444. package/lib/libwebpdemux.la +41 -0
  445. package/lib/libwebpmux.a +0 -0
  446. package/lib/libwebpmux.la +41 -0
  447. package/lib/libz.a +0 -0
  448. package/lib/pkgconfig/aom.pc +14 -0
  449. package/lib/pkgconfig/cgif.pc +9 -0
  450. package/lib/pkgconfig/expat.pc +12 -0
  451. package/lib/pkgconfig/gio-2.0.pc +24 -0
  452. package/lib/pkgconfig/glib-2.0.pc +16 -0
  453. package/lib/pkgconfig/gmodule-2.0.pc +12 -0
  454. package/lib/pkgconfig/gmodule-export-2.0.pc +12 -0
  455. package/lib/pkgconfig/gmodule-no-export-2.0.pc +12 -0
  456. package/lib/pkgconfig/gobject-2.0.pc +10 -0
  457. package/lib/pkgconfig/gthread-2.0.pc +10 -0
  458. package/lib/pkgconfig/imagequant.pc +9 -0
  459. package/lib/pkgconfig/lcms2.pc +9 -0
  460. package/lib/pkgconfig/libexif.pc +12 -0
  461. package/lib/pkgconfig/libffi.pc +11 -0
  462. package/lib/pkgconfig/libheif.pc +23 -0
  463. package/lib/pkgconfig/libhwy.pc +10 -0
  464. package/lib/pkgconfig/libjpeg.pc +10 -0
  465. package/lib/pkgconfig/libsharpyuv.pc +11 -0
  466. package/lib/pkgconfig/libtiff-4.pc +12 -0
  467. package/lib/pkgconfig/libwebp.pc +12 -0
  468. package/lib/pkgconfig/libwebpdemux.pc +11 -0
  469. package/lib/pkgconfig/libwebpmux.pc +12 -0
  470. package/lib/pkgconfig/spng.pc +10 -0
  471. package/lib/pkgconfig/vips-cpp.pc +10 -0
  472. package/lib/pkgconfig/vips.pc +10 -0
  473. package/lib/pkgconfig/zlib.pc +14 -0
  474. package/package.json +31 -0
  475. package/versions.json +19 -0
@@ -0,0 +1,2169 @@
1
+ /*
2
+ * HEIF codec.
3
+ * Copyright (c) 2017-2023 Dirk Farin <dirk.farin@gmail.com>
4
+ *
5
+ * This file is part of libheif.
6
+ *
7
+ * libheif is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU Lesser General Public License as
9
+ * published by the Free Software Foundation, either version 3 of
10
+ * the License, or (at your option) any later version.
11
+ *
12
+ * libheif is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU Lesser General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public License
18
+ * along with libheif. If not, see <http://www.gnu.org/licenses/>.
19
+ */
20
+
21
+ #ifndef LIBHEIF_HEIF_H
22
+ #define LIBHEIF_HEIF_H
23
+
24
+ #ifdef __cplusplus
25
+ extern "C" {
26
+ #endif
27
+
28
+ /*! \file heif.h
29
+ *
30
+ * Public API for libheif.
31
+ */
32
+
33
+ #include <stddef.h>
34
+ #include <stdint.h>
35
+
36
+ #include <libheif/heif_version.h>
37
+
38
+
39
+ // API versions table
40
+ //
41
+ // release dec.options enc.options heif_reader heif_writer depth.rep col.profile
42
+ // ------------------------------------------------------------------------------------------
43
+ // 1.0 1 N/A N/A N/A 1 N/A
44
+ // 1.1 1 N/A N/A 1 1 N/A
45
+ // 1.3 1 1 1 1 1 N/A
46
+ // 1.4 1 1 1 1 1 1
47
+ // 1.7 2 1 1 1 1 1
48
+ // 1.9.2 2 2 1 1 1 1
49
+ // 1.10 2 3 1 1 1 1
50
+ // 1.11 2 4 1 1 1 1
51
+ // 1.13 3 4 1 1 1 1
52
+ // 1.14 3 5 1 1 1 1
53
+ // 1.15 4 5 1 1 1 1
54
+ // 1.16 5 6 1 1 1 1
55
+
56
+ #if defined(_MSC_VER) && !defined(LIBHEIF_STATIC_BUILD)
57
+ #ifdef LIBHEIF_EXPORTS
58
+ #define LIBHEIF_API __declspec(dllexport)
59
+ #else
60
+ #define LIBHEIF_API __declspec(dllimport)
61
+ #endif
62
+ #elif defined(HAVE_VISIBILITY) && HAVE_VISIBILITY
63
+ #ifdef LIBHEIF_EXPORTS
64
+ #define LIBHEIF_API __attribute__((__visibility__("default")))
65
+ #else
66
+ #define LIBHEIF_API
67
+ #endif
68
+ #else
69
+ #define LIBHEIF_API
70
+ #endif
71
+
72
+ #define heif_fourcc(a, b, c, d) ((uint32_t)((a<<24) | (b<<16) | (c<<8) | d))
73
+
74
+
75
+ /* === version numbers === */
76
+
77
+ // Version string of linked libheif library.
78
+ LIBHEIF_API const char* heif_get_version(void);
79
+
80
+ // Numeric version of linked libheif library, encoded as 0xHHMMLL00 = hh.mm.ll, where hh, mm, ll is the decimal representation of HH, MM, LL.
81
+ // For example: 0x02150300 is version 2.21.3
82
+ LIBHEIF_API uint32_t heif_get_version_number(void);
83
+
84
+ // Numeric part "HH" from above. Returned as a decimal number.
85
+ LIBHEIF_API int heif_get_version_number_major(void);
86
+ // Numeric part "MM" from above. Returned as a decimal number.
87
+ LIBHEIF_API int heif_get_version_number_minor(void);
88
+ // Numeric part "LL" from above. Returned as a decimal number.
89
+ LIBHEIF_API int heif_get_version_number_maintenance(void);
90
+
91
+ // Helper macros to check for given versions of libheif at compile time.
92
+ #define LIBHEIF_MAKE_VERSION(h, m, l) ((h) << 24 | (m) << 16 | (l) << 8)
93
+ #define LIBHEIF_HAVE_VERSION(h, m, l) (LIBHEIF_NUMERIC_VERSION >= LIBHEIF_MAKE_VERSION(h, m, l))
94
+
95
+ struct heif_context;
96
+ struct heif_image_handle;
97
+ struct heif_image;
98
+
99
+
100
+ enum heif_error_code
101
+ {
102
+ // Everything ok, no error occurred.
103
+ heif_error_Ok = 0,
104
+
105
+ // Input file does not exist.
106
+ heif_error_Input_does_not_exist = 1,
107
+
108
+ // Error in input file. Corrupted or invalid content.
109
+ heif_error_Invalid_input = 2,
110
+
111
+ // Input file type is not supported.
112
+ heif_error_Unsupported_filetype = 3,
113
+
114
+ // Image requires an unsupported decoder feature.
115
+ heif_error_Unsupported_feature = 4,
116
+
117
+ // Library API has been used in an invalid way.
118
+ heif_error_Usage_error = 5,
119
+
120
+ // Could not allocate enough memory.
121
+ heif_error_Memory_allocation_error = 6,
122
+
123
+ // The decoder plugin generated an error
124
+ heif_error_Decoder_plugin_error = 7,
125
+
126
+ // The encoder plugin generated an error
127
+ heif_error_Encoder_plugin_error = 8,
128
+
129
+ // Error during encoding or when writing to the output
130
+ heif_error_Encoding_error = 9,
131
+
132
+ // Application has asked for a color profile type that does not exist
133
+ heif_error_Color_profile_does_not_exist = 10,
134
+
135
+ // Error loading a dynamic plugin
136
+ heif_error_Plugin_loading_error = 11
137
+ };
138
+
139
+
140
+ enum heif_suberror_code
141
+ {
142
+ // no further information available
143
+ heif_suberror_Unspecified = 0,
144
+
145
+ // --- Invalid_input ---
146
+
147
+ // End of data reached unexpectedly.
148
+ heif_suberror_End_of_data = 100,
149
+
150
+ // Size of box (defined in header) is wrong
151
+ heif_suberror_Invalid_box_size = 101,
152
+
153
+ // Mandatory 'ftyp' box is missing
154
+ heif_suberror_No_ftyp_box = 102,
155
+
156
+ heif_suberror_No_idat_box = 103,
157
+
158
+ heif_suberror_No_meta_box = 104,
159
+
160
+ heif_suberror_No_hdlr_box = 105,
161
+
162
+ heif_suberror_No_hvcC_box = 106,
163
+
164
+ heif_suberror_No_pitm_box = 107,
165
+
166
+ heif_suberror_No_ipco_box = 108,
167
+
168
+ heif_suberror_No_ipma_box = 109,
169
+
170
+ heif_suberror_No_iloc_box = 110,
171
+
172
+ heif_suberror_No_iinf_box = 111,
173
+
174
+ heif_suberror_No_iprp_box = 112,
175
+
176
+ heif_suberror_No_iref_box = 113,
177
+
178
+ heif_suberror_No_pict_handler = 114,
179
+
180
+ // An item property referenced in the 'ipma' box is not existing in the 'ipco' container.
181
+ heif_suberror_Ipma_box_references_nonexisting_property = 115,
182
+
183
+ // No properties have been assigned to an item.
184
+ heif_suberror_No_properties_assigned_to_item = 116,
185
+
186
+ // Image has no (compressed) data
187
+ heif_suberror_No_item_data = 117,
188
+
189
+ // Invalid specification of image grid (tiled image)
190
+ heif_suberror_Invalid_grid_data = 118,
191
+
192
+ // Tile-images in a grid image are missing
193
+ heif_suberror_Missing_grid_images = 119,
194
+
195
+ heif_suberror_Invalid_clean_aperture = 120,
196
+
197
+ // Invalid specification of overlay image
198
+ heif_suberror_Invalid_overlay_data = 121,
199
+
200
+ // Overlay image completely outside of visible canvas area
201
+ heif_suberror_Overlay_image_outside_of_canvas = 122,
202
+
203
+ heif_suberror_Auxiliary_image_type_unspecified = 123,
204
+
205
+ heif_suberror_No_or_invalid_primary_item = 124,
206
+
207
+ heif_suberror_No_infe_box = 125,
208
+
209
+ heif_suberror_Unknown_color_profile_type = 126,
210
+
211
+ heif_suberror_Wrong_tile_image_chroma_format = 127,
212
+
213
+ heif_suberror_Invalid_fractional_number = 128,
214
+
215
+ heif_suberror_Invalid_image_size = 129,
216
+
217
+ heif_suberror_Invalid_pixi_box = 130,
218
+
219
+ heif_suberror_No_av1C_box = 131,
220
+
221
+ heif_suberror_Wrong_tile_image_pixel_depth = 132,
222
+
223
+ heif_suberror_Unknown_NCLX_color_primaries = 133,
224
+
225
+ heif_suberror_Unknown_NCLX_transfer_characteristics = 134,
226
+
227
+ heif_suberror_Unknown_NCLX_matrix_coefficients = 135,
228
+
229
+ // Invalid specification of region item
230
+ heif_suberror_Invalid_region_data = 136,
231
+
232
+
233
+ // --- Memory_allocation_error ---
234
+
235
+ // A security limit preventing unreasonable memory allocations was exceeded by the input file.
236
+ // Please check whether the file is valid. If it is, contact us so that we could increase the
237
+ // security limits further.
238
+ heif_suberror_Security_limit_exceeded = 1000,
239
+
240
+
241
+ // --- Usage_error ---
242
+
243
+ // An item ID was used that is not present in the file.
244
+ heif_suberror_Nonexisting_item_referenced = 2000, // also used for Invalid_input
245
+
246
+ // An API argument was given a NULL pointer, which is not allowed for that function.
247
+ heif_suberror_Null_pointer_argument = 2001,
248
+
249
+ // Image channel referenced that does not exist in the image
250
+ heif_suberror_Nonexisting_image_channel_referenced = 2002,
251
+
252
+ // The version of the passed plugin is not supported.
253
+ heif_suberror_Unsupported_plugin_version = 2003,
254
+
255
+ // The version of the passed writer is not supported.
256
+ heif_suberror_Unsupported_writer_version = 2004,
257
+
258
+ // The given (encoder) parameter name does not exist.
259
+ heif_suberror_Unsupported_parameter = 2005,
260
+
261
+ // The value for the given parameter is not in the valid range.
262
+ heif_suberror_Invalid_parameter_value = 2006,
263
+
264
+ // Error in property specification
265
+ heif_suberror_Invalid_property = 2007,
266
+
267
+ // Image reference cycle found in iref
268
+ heif_suberror_Item_reference_cycle = 2008,
269
+
270
+
271
+ // --- Unsupported_feature ---
272
+
273
+ // Image was coded with an unsupported compression method.
274
+ heif_suberror_Unsupported_codec = 3000,
275
+
276
+ // Image is specified in an unknown way, e.g. as tiled grid image (which is supported)
277
+ heif_suberror_Unsupported_image_type = 3001,
278
+
279
+ heif_suberror_Unsupported_data_version = 3002,
280
+
281
+ // The conversion of the source image to the requested chroma / colorspace is not supported.
282
+ heif_suberror_Unsupported_color_conversion = 3003,
283
+
284
+ heif_suberror_Unsupported_item_construction_method = 3004,
285
+
286
+ heif_suberror_Unsupported_header_compression_method = 3005,
287
+
288
+
289
+ // --- Encoder_plugin_error ---
290
+
291
+ heif_suberror_Unsupported_bit_depth = 4000,
292
+
293
+
294
+ // --- Encoding_error ---
295
+
296
+ heif_suberror_Cannot_write_output_data = 5000,
297
+
298
+ heif_suberror_Encoder_initialization = 5001,
299
+ heif_suberror_Encoder_encoding = 5002,
300
+ heif_suberror_Encoder_cleanup = 5003,
301
+
302
+ heif_suberror_Too_many_regions = 5004,
303
+
304
+
305
+ // --- Plugin loading error ---
306
+
307
+ heif_suberror_Plugin_loading_error = 6000, // a specific plugin file cannot be loaded
308
+ heif_suberror_Plugin_is_not_loaded = 6001, // trying to remove a plugin that is not loaded
309
+ heif_suberror_Cannot_read_plugin_directory = 6002 // error while scanning the directory for plugins
310
+ };
311
+
312
+
313
+ struct heif_error
314
+ {
315
+ // main error category
316
+ enum heif_error_code code;
317
+
318
+ // more detailed error code
319
+ enum heif_suberror_code subcode;
320
+
321
+ // textual error message (is always defined, you do not have to check for NULL)
322
+ const char* message;
323
+ };
324
+
325
+ // Default success return value. Intended for use in user-supplied callback functions.
326
+ LIBHEIF_API extern const struct heif_error heif_error_success;
327
+
328
+
329
+ typedef uint32_t heif_item_id;
330
+ typedef uint32_t heif_property_id;
331
+
332
+
333
+
334
+ // ========================= enum types ======================
335
+
336
+ /**
337
+ * libheif known compression formats.
338
+ */
339
+ enum heif_compression_format
340
+ {
341
+ /**
342
+ * Unspecified / undefined compression format.
343
+ *
344
+ * This is used to mean "no match" or "any decoder" for some parts of the
345
+ * API. It does not indicate a specific compression format.
346
+ */
347
+ heif_compression_undefined = 0,
348
+ /**
349
+ * HEVC compression, used for HEIC images.
350
+ *
351
+ * This is equivalent to H.265.
352
+ */
353
+ heif_compression_HEVC = 1,
354
+ /**
355
+ * AVC compression. (Currently unused in libheif.)
356
+ *
357
+ * The compression is defined in ISO/IEC 14496-10. This is equivalent to H.264.
358
+ *
359
+ * The encapsulation is defined in ISO/IEC 23008-12:2022 Annex E.
360
+ */
361
+ heif_compression_AVC = 2,
362
+ /**
363
+ * JPEG compression.
364
+ *
365
+ * The compression format is defined in ISO/IEC 10918-1. The encapsulation
366
+ * of JPEG is specified in ISO/IEC 23008-12:2022 Annex H.
367
+ */
368
+ heif_compression_JPEG = 3,
369
+ /**
370
+ * AV1 compression, used for AVIF images.
371
+ *
372
+ * The compression format is provided at https://aomediacodec.github.io/av1-spec/
373
+ *
374
+ * The encapsulation is defined in https://aomediacodec.github.io/av1-avif/
375
+ */
376
+ heif_compression_AV1 = 4,
377
+ /**
378
+ * VVC compression. (Currently unused in libheif.)
379
+ *
380
+ * The compression format is defined in ISO/IEC 23090-3. This is equivalent to H.266.
381
+ *
382
+ * The encapsulation is defined in ISO/IEC 23008-12:2022 Annex L.
383
+ */
384
+ heif_compression_VVC = 5,
385
+ /**
386
+ * EVC compression. (Currently unused in libheif.)
387
+ *
388
+ * The compression format is defined in ISO/IEC 23094-1. This is equivalent to H.266.
389
+ *
390
+ * The encapsulation is defined in ISO/IEC 23008-12:2022 Annex M.
391
+ */
392
+ heif_compression_EVC = 6,
393
+ /**
394
+ * JPEG 2000 compression.
395
+ *
396
+ * The encapsulation of JPEG 2000 is specified in ISO/IEC 15444-16:2021.
397
+ * The core encoding is defined in ISO/IEC 15444-1, or ITU-T T.800.
398
+ */
399
+ heif_compression_JPEG2000 = 7,
400
+ /**
401
+ * Uncompressed encoding.
402
+ *
403
+ * This is defined in ISO/IEC 23001-17:2023 (Final Draft International Standard).
404
+ */
405
+ heif_compression_uncompressed = 8,
406
+ /**
407
+ * Mask image encoding.
408
+ *
409
+ * See ISO/IEC 23008-12:2022 Section 6.10.2
410
+ */
411
+ heif_compression_mask = 9
412
+ };
413
+
414
+ enum heif_chroma
415
+ {
416
+ heif_chroma_undefined = 99,
417
+ heif_chroma_monochrome = 0,
418
+ heif_chroma_420 = 1,
419
+ heif_chroma_422 = 2,
420
+ heif_chroma_444 = 3,
421
+ heif_chroma_interleaved_RGB = 10,
422
+ heif_chroma_interleaved_RGBA = 11,
423
+ heif_chroma_interleaved_RRGGBB_BE = 12, // HDR, big endian.
424
+ heif_chroma_interleaved_RRGGBBAA_BE = 13, // HDR, big endian.
425
+ heif_chroma_interleaved_RRGGBB_LE = 14, // HDR, little endian.
426
+ heif_chroma_interleaved_RRGGBBAA_LE = 15 // HDR, little endian.
427
+ };
428
+
429
+ // DEPRECATED ENUM NAMES
430
+ #define heif_chroma_interleaved_24bit heif_chroma_interleaved_RGB
431
+ #define heif_chroma_interleaved_32bit heif_chroma_interleaved_RGBA
432
+
433
+
434
+ enum heif_colorspace
435
+ {
436
+ heif_colorspace_undefined = 99,
437
+
438
+ // heif_colorspace_YCbCr should be used with one of these heif_chroma values:
439
+ // * heif_chroma_444
440
+ // * heif_chroma_422
441
+ // * heif_chroma_420
442
+ heif_colorspace_YCbCr = 0,
443
+
444
+ // heif_colorspace_RGB should be used with one of these heif_chroma values:
445
+ // * heif_chroma_444 (for planar RGB)
446
+ // * heif_chroma_interleaved_RGB
447
+ // * heif_chroma_interleaved_RGBA
448
+ // * heif_chroma_interleaved_RRGGBB_BE
449
+ // * heif_chroma_interleaved_RRGGBBAA_BE
450
+ // * heif_chroma_interleaved_RRGGBB_LE
451
+ // * heif_chroma_interleaved_RRGGBBAA_LE
452
+ heif_colorspace_RGB = 1,
453
+
454
+ // heif_colorspace_monochrome should only be used with heif_chroma = heif_chroma_monochrome
455
+ heif_colorspace_monochrome = 2
456
+ };
457
+
458
+ enum heif_channel
459
+ {
460
+ heif_channel_Y = 0,
461
+ heif_channel_Cb = 1,
462
+ heif_channel_Cr = 2,
463
+ heif_channel_R = 3,
464
+ heif_channel_G = 4,
465
+ heif_channel_B = 5,
466
+ heif_channel_Alpha = 6,
467
+ heif_channel_interleaved = 10
468
+ };
469
+
470
+
471
+ // ========================= library initialization ======================
472
+
473
+ struct heif_init_params
474
+ {
475
+ int version;
476
+
477
+ // currently no parameters
478
+ };
479
+
480
+
481
+ /**
482
+ * Initialise library.
483
+ *
484
+ * You should call heif_init() when you start using libheif and heif_deinit() when you are finished.
485
+ * These calls are reference counted. Each call to heif_init() should be matched by one call to heif_deinit().
486
+ *
487
+ * For backwards compatibility, it is not really necessary to call heif_init(), but some library memory objects
488
+ * will never be freed if you do not call heif_init()/heif_deinit().
489
+ *
490
+ * heif_init() will load the external modules installed in the default plugin path. Thus, you need it when you
491
+ * want to load external plugins from the default path.
492
+ * Codec plugins that are compiled into the library directly (selected by the compile-time parameters of libheif)
493
+ * will be available even without heif_init().
494
+ *
495
+ * Make sure that you do not have one part of your program use heif_init()/heif_deinit() and another part that does
496
+ * not use it as the latter may try to use an uninitialized library. If in doubt, enclose everything with init/deinit.
497
+ *
498
+ * You may pass nullptr to get default parameters. Currently, no parameters are supported.
499
+ */
500
+ LIBHEIF_API
501
+ struct heif_error heif_init(struct heif_init_params*);
502
+
503
+ /**
504
+ * Deinitialise and clean up library.
505
+ *
506
+ * You should call heif_init() when you start using libheif and heif_deinit() when you are finished.
507
+ * These calls are reference counted. Each call to heif_init() should be matched by one call to heif_deinit().
508
+ *
509
+ * \sa heif_init()
510
+ */
511
+ LIBHEIF_API
512
+ void heif_deinit(void);
513
+
514
+
515
+ // --- Plugins are currently only supported on Unix platforms.
516
+
517
+ enum heif_plugin_type
518
+ {
519
+ heif_plugin_type_encoder,
520
+ heif_plugin_type_decoder
521
+ };
522
+
523
+ struct heif_plugin_info
524
+ {
525
+ int version; // version of this info struct
526
+ enum heif_plugin_type type;
527
+ const void* plugin;
528
+ void* internal_handle; // for internal use only
529
+ };
530
+
531
+ LIBHEIF_API
532
+ struct heif_error heif_load_plugin(const char* filename, struct heif_plugin_info const** out_plugin);
533
+
534
+ LIBHEIF_API
535
+ struct heif_error heif_load_plugins(const char* directory,
536
+ const struct heif_plugin_info** out_plugins,
537
+ int* out_nPluginsLoaded,
538
+ int output_array_size);
539
+
540
+ LIBHEIF_API
541
+ struct heif_error heif_unload_plugin(const struct heif_plugin_info* plugin);
542
+
543
+ // Get a NULL terminated array of the plugin directories that are searched by libheif.
544
+ // This includes the paths specified in the environment variable LIBHEIF_PLUGIN_PATHS and the built-in path
545
+ // (if not overridden by the environment variable).
546
+ LIBHEIF_API
547
+ const char*const* heif_get_plugin_directories(void);
548
+
549
+ LIBHEIF_API
550
+ void heif_free_plugin_directories(const char*const*);
551
+
552
+
553
+ // ========================= file type check ======================
554
+
555
+ enum heif_filetype_result
556
+ {
557
+ heif_filetype_no,
558
+ heif_filetype_yes_supported, // it is heif and can be read by libheif
559
+ heif_filetype_yes_unsupported, // it is heif, but cannot be read by libheif
560
+ heif_filetype_maybe // not sure whether it is an heif, try detection with more input data
561
+ };
562
+
563
+ // input data should be at least 12 bytes
564
+ LIBHEIF_API
565
+ enum heif_filetype_result heif_check_filetype(const uint8_t* data, int len);
566
+
567
+ LIBHEIF_API
568
+ int heif_check_jpeg_filetype(const uint8_t* data, int len);
569
+
570
+
571
+ // DEPRECATED, use heif_brand2 and the heif_brand2_* constants below instead
572
+ enum heif_brand
573
+ {
574
+ heif_unknown_brand,
575
+ heif_heic, // HEIF image with h265
576
+ heif_heix, // 10bit images, or anything that uses h265 with range extension
577
+ heif_hevc, heif_hevx, // brands for image sequences
578
+ heif_heim, // multiview
579
+ heif_heis, // scalable
580
+ heif_hevm, // multiview sequence
581
+ heif_hevs, // scalable sequence
582
+ heif_mif1, // image, any coding algorithm
583
+ heif_msf1, // sequence, any coding algorithm
584
+ heif_avif, // HEIF image with AV1
585
+ heif_avis,
586
+ heif_vvic, // VVC image
587
+ heif_vvis, // VVC sequence
588
+ heif_evbi, // EVC image
589
+ heif_evbs, // EVC sequence
590
+ heif_j2ki, // JPEG2000 image
591
+ heif_j2is, // JPEG2000 image sequence
592
+ };
593
+
594
+ // input data should be at least 12 bytes
595
+ // DEPRECATED, use heif_read_main_brand() instead
596
+ LIBHEIF_API
597
+ enum heif_brand heif_main_brand(const uint8_t* data, int len);
598
+
599
+
600
+ typedef uint32_t heif_brand2;
601
+
602
+ /**
603
+ * HEVC image (`heic`) brand.
604
+ *
605
+ * Image conforms to HEVC (H.265) Main or Main Still profile.
606
+ *
607
+ * See ISO/IEC 23008-12:2022 Section B.4.1.
608
+ */
609
+ #define heif_brand2_heic heif_fourcc('h','e','i','c')
610
+
611
+ /**
612
+ * HEVC image (`heix`) brand.
613
+ *
614
+ * Image conforms to HEVC (H.265) Main 10 profile.
615
+ *
616
+ * See ISO/IEC 23008-12:2022 Section B.4.1.
617
+ */
618
+ #define heif_brand2_heix heif_fourcc('h','e','i','x')
619
+
620
+ /**
621
+ * HEVC image sequence (`hevc`) brand.
622
+ *
623
+ * Image sequence conforms to HEVC (H.265) Main profile.
624
+ *
625
+ * See ISO/IEC 23008-12:2022 Section B.4.2.
626
+ */
627
+ #define heif_brand2_hevc heif_fourcc('h','e','v','c')
628
+
629
+ /**
630
+ * HEVC image sequence (`hevx`) brand.
631
+ *
632
+ * Image sequence conforms to HEVC (H.265) Main 10 profile.
633
+ *
634
+ * See ISO/IEC 23008-12:2022 Section B.4.2.
635
+ */
636
+ #define heif_brand2_hevx heif_fourcc('h','e','v','x')
637
+
638
+ /**
639
+ * HEVC layered image (`heim`) brand.
640
+ *
641
+ * Image layers conform to HEVC (H.265) Main or Multiview Main profile.
642
+ *
643
+ * See ISO/IEC 23008-12:2022 Section B.4.3.
644
+ */
645
+ #define heif_brand2_heim heif_fourcc('h','e','i','m')
646
+
647
+ /**
648
+ * HEVC layered image (`heis`) brand.
649
+ *
650
+ * Image layers conform to HEVC (H.265) Main, Main 10, Scalable Main
651
+ * or Scalable Main 10 profile.
652
+ *
653
+ * See ISO/IEC 23008-12:2022 Section B.4.3.
654
+ */
655
+ #define heif_brand2_heis heif_fourcc('h','e','i','s')
656
+
657
+ /**
658
+ * HEVC layered image sequence (`hevm`) brand.
659
+ *
660
+ * Image sequence layers conform to HEVC (H.265) Main or Multiview Main profile.
661
+ *
662
+ * See ISO/IEC 23008-12:2022 Section B.4.4.
663
+ */
664
+ #define heif_brand2_hevm heif_fourcc('h','e','v','m')
665
+
666
+ /**
667
+ * HEVC layered image sequence (`hevs`) brand.
668
+ *
669
+ * Image sequence layers conform to HEVC (H.265) Main, Main 10, Scalable Main
670
+ * or Scalable Main 10 profile.
671
+ *
672
+ * See ISO/IEC 23008-12:2022 Section B.4.4.
673
+ */
674
+ #define heif_brand2_hevs heif_fourcc('h','e','v','s')
675
+
676
+ /**
677
+ * AV1 image (`avif`) brand.
678
+ *
679
+ * See https://aomediacodec.github.io/av1-avif/#image-and-image-collection-brand
680
+ */
681
+ #define heif_brand2_avif heif_fourcc('a','v','i','f')
682
+
683
+ /**
684
+ * AV1 image sequence (`avis`) brand.
685
+ *
686
+ * See https://aomediacodec.github.io/av1-avif/#image-sequence-brand
687
+ */
688
+ #define heif_brand2_avis heif_fourcc('a','v','i','s') // AVIF sequence
689
+
690
+ /**
691
+ * HEIF image structural brand (`mif1`).
692
+ *
693
+ * This does not imply a specific coding algorithm.
694
+ *
695
+ * See ISO/IEC 23008-12:2022 Section 10.2.2.
696
+ */
697
+ #define heif_brand2_mif1 heif_fourcc('m','i','f','1')
698
+
699
+ /**
700
+ * HEIF image structural brand (`mif2`).
701
+ *
702
+ * This does not imply a specific coding algorithm. `mif2` extends
703
+ * the requirements of `mif1` to include the `rref` and `iscl` item
704
+ * properties.
705
+ *
706
+ * See ISO/IEC 23008-12:2022 Section 10.2.3.
707
+ */
708
+ #define heif_brand2_mif2 heif_fourcc('m','i','f','2')
709
+
710
+ /**
711
+ * HEIF image sequence structural brand (`msf1`).
712
+ *
713
+ * This does not imply a specific coding algorithm.
714
+ *
715
+ * See ISO/IEC 23008-12:2022 Section 10.3.1.
716
+ */
717
+ #define heif_brand2_msf1 heif_fourcc('m','s','f','1')
718
+
719
+ /**
720
+ * VVC image (`vvic`) brand.
721
+ *
722
+ * See ISO/IEC 23008-12:2022 Section L.4.1.
723
+ */
724
+ #define heif_brand2_vvic heif_fourcc('v','v','i','c')
725
+
726
+ /**
727
+ * VVC image sequence (`vvis`) brand.
728
+ *
729
+ * See ISO/IEC 23008-12:2022 Section L.4.2.
730
+ */
731
+ #define heif_brand2_vvis heif_fourcc('v','v','i','s')
732
+
733
+ /**
734
+ * EVC baseline image (`evbi`) brand.
735
+ *
736
+ * See ISO/IEC 23008-12:2022 Section M.4.1.
737
+ */
738
+ #define heif_brand2_evbi heif_fourcc('e','v','b','i')
739
+
740
+ /**
741
+ * EVC main profile image (`evmi`) brand.
742
+ *
743
+ * See ISO/IEC 23008-12:2022 Section M.4.2.
744
+ */
745
+ #define heif_brand2_evmi heif_fourcc('e','v','m','i')
746
+
747
+ /**
748
+ * EVC baseline image sequence (`evbs`) brand.
749
+ *
750
+ * See ISO/IEC 23008-12:2022 Section M.4.3.
751
+ */
752
+ #define heif_brand2_evbs heif_fourcc('e','v','b','s')
753
+
754
+ /**
755
+ * EVC main profile image sequence (`evms`) brand.
756
+ *
757
+ * See ISO/IEC 23008-12:2022 Section M.4.4.
758
+ */
759
+ #define heif_brand2_evms heif_fourcc('e','v','m','s')
760
+
761
+ /**
762
+ * JPEG image (`jpeg`) brand.
763
+ *
764
+ * See ISO/IEC 23008-12:2022 Annex H.4
765
+ */
766
+ #define heif_brand2_jpeg heif_fourcc('j','p','e','g')
767
+
768
+ /**
769
+ * JPEG image sequence (`jpgs`) brand.
770
+ *
771
+ * See ISO/IEC 23008-12:2022 Annex H.5
772
+ */
773
+ #define heif_brand2_jpgs heif_fourcc('j','p','g','s')
774
+
775
+ /**
776
+ * JPEG 2000 image (`j2ki`) brand.
777
+ *
778
+ * See ISO/IEC 15444-16:2021 Section 6.5
779
+ */
780
+ #define heif_brand2_j2ki heif_fourcc('j','2','k','i')
781
+
782
+ /**
783
+ * JPEG 2000 image sequence (`j2is`) brand.
784
+ *
785
+ * See ISO/IEC 15444-16:2021 Section 7.6
786
+ */
787
+ #define heif_brand2_j2is heif_fourcc('j','2','i','s')
788
+
789
+ /**
790
+ * Multi-image application format (MIAF) brand.
791
+ *
792
+ * This is HEIF with additional constraints for interoperability.
793
+ *
794
+ * See ISO/IEC 23000-22.
795
+ */
796
+ #define heif_brand2_miaf heif_fourcc('m','i','a','f')
797
+
798
+ /**
799
+ * Single picture file brand.
800
+ *
801
+ * This is a compatible brand indicating the file contains a single intra-coded picture.
802
+ *
803
+ * See ISO/IEC 23008-12:2022 Section 10.2.5.
804
+ */
805
+ #define heif_brand2_1pic heif_fourcc('1','p','i','c')
806
+
807
+ // input data should be at least 12 bytes
808
+ LIBHEIF_API
809
+ heif_brand2 heif_read_main_brand(const uint8_t* data, int len);
810
+
811
+ // 'brand_fourcc' must be 4 character long, but need not be 0-terminated
812
+ LIBHEIF_API
813
+ heif_brand2 heif_fourcc_to_brand(const char* brand_fourcc);
814
+
815
+ // the output buffer must be at least 4 bytes long
816
+ LIBHEIF_API
817
+ void heif_brand_to_fourcc(heif_brand2 brand, char* out_fourcc);
818
+
819
+ // 'brand_fourcc' must be 4 character long, but need not be 0-terminated
820
+ // returns 1 if file includes the brand, and 0 if it does not
821
+ // returns -1 if the provided data is not sufficient
822
+ // (you should input at least as many bytes as indicated in the first 4 bytes of the file, usually ~50 bytes will do)
823
+ // returns -2 on other errors
824
+ LIBHEIF_API
825
+ int heif_has_compatible_brand(const uint8_t* data, int len, const char* brand_fourcc);
826
+
827
+ // Returns an array of compatible brands. The array is allocated by this function and has to be freed with 'heif_free_list_of_compatible_brands()'.
828
+ // The number of entries is returned in out_size.
829
+ LIBHEIF_API
830
+ struct heif_error heif_list_compatible_brands(const uint8_t* data, int len, heif_brand2** out_brands, int* out_size);
831
+
832
+ LIBHEIF_API
833
+ void heif_free_list_of_compatible_brands(heif_brand2* brands_list);
834
+
835
+
836
+ // Returns one of these MIME types:
837
+ // - image/heic HEIF file using h265 compression
838
+ // - image/heif HEIF file using any other compression
839
+ // - image/heic-sequence HEIF image sequence using h265 compression
840
+ // - image/heif-sequence HEIF image sequence using any other compression
841
+ // - image/avif AVIF image
842
+ // - image/avif-sequence AVIF sequence
843
+ // - image/jpeg JPEG image
844
+ // - image/png PNG image
845
+ // If the format could not be detected, an empty string is returned.
846
+ //
847
+ // Provide at least 12 bytes of input. With less input, its format might not
848
+ // be detected. You may also provide more input to increase detection accuracy.
849
+ //
850
+ // Note that JPEG and PNG images cannot be decoded by libheif even though the
851
+ // formats are detected by this function.
852
+ LIBHEIF_API
853
+ const char* heif_get_file_mime_type(const uint8_t* data, int len);
854
+
855
+
856
+
857
+ // ========================= heif_context =========================
858
+ // A heif_context represents a HEIF file that has been read.
859
+ // In the future, you will also be able to add pictures to a heif_context
860
+ // and write it into a file again.
861
+
862
+
863
+ // Allocate a new context for reading HEIF files.
864
+ // Has to be freed again with heif_context_free().
865
+ LIBHEIF_API
866
+ struct heif_context* heif_context_alloc(void);
867
+
868
+ // Free a previously allocated HEIF context. You should not free a context twice.
869
+ LIBHEIF_API
870
+ void heif_context_free(struct heif_context*);
871
+
872
+
873
+ struct heif_reading_options;
874
+
875
+ enum heif_reader_grow_status
876
+ {
877
+ heif_reader_grow_status_size_reached, // requested size has been reached, we can read until this point
878
+ heif_reader_grow_status_timeout, // size has not been reached yet, but it may still grow further
879
+ heif_reader_grow_status_size_beyond_eof // size has not been reached and never will. The file has grown to its full size
880
+ };
881
+
882
+ struct heif_reader
883
+ {
884
+ // API version supported by this reader
885
+ int reader_api_version;
886
+
887
+ // --- version 1 functions ---
888
+ int64_t (* get_position)(void* userdata);
889
+
890
+ // The functions read(), and seek() return heif_error_ok on success.
891
+ // Generally, libheif will make sure that we do not read past the file size.
892
+ int (* read)(void* data,
893
+ size_t size,
894
+ void* userdata);
895
+
896
+ int (* seek)(int64_t position,
897
+ void* userdata);
898
+
899
+ // When calling this function, libheif wants to make sure that it can read the file
900
+ // up to 'target_size'. This is useful when the file is currently downloaded and may
901
+ // grow with time. You may, for example, extract the image sizes even before the actual
902
+ // compressed image data has been completely downloaded.
903
+ //
904
+ // Even if your input files will not grow, you will have to implement at least
905
+ // detection whether the target_size is above the (fixed) file length
906
+ // (in this case, return 'size_beyond_eof').
907
+ enum heif_reader_grow_status (* wait_for_file_size)(int64_t target_size, void* userdata);
908
+ };
909
+
910
+
911
+ // Read a HEIF file from a named disk file.
912
+ // The heif_reading_options should currently be set to NULL.
913
+ LIBHEIF_API
914
+ struct heif_error heif_context_read_from_file(struct heif_context*, const char* filename,
915
+ const struct heif_reading_options*);
916
+
917
+ // Read a HEIF file stored completely in memory.
918
+ // The heif_reading_options should currently be set to NULL.
919
+ // DEPRECATED: use heif_context_read_from_memory_without_copy() instead.
920
+ LIBHEIF_API
921
+ struct heif_error heif_context_read_from_memory(struct heif_context*,
922
+ const void* mem, size_t size,
923
+ const struct heif_reading_options*);
924
+
925
+ // Same as heif_context_read_from_memory() except that the provided memory is not copied.
926
+ // That means, you will have to keep the memory area alive as long as you use the heif_context.
927
+ LIBHEIF_API
928
+ struct heif_error heif_context_read_from_memory_without_copy(struct heif_context*,
929
+ const void* mem, size_t size,
930
+ const struct heif_reading_options*);
931
+
932
+ LIBHEIF_API
933
+ struct heif_error heif_context_read_from_reader(struct heif_context*,
934
+ const struct heif_reader* reader,
935
+ void* userdata,
936
+ const struct heif_reading_options*);
937
+
938
+ // Number of top-level images in the HEIF file. This does not include the thumbnails or the
939
+ // tile images that are composed to an image grid. You can get access to the thumbnails via
940
+ // the main image handle.
941
+ LIBHEIF_API
942
+ int heif_context_get_number_of_top_level_images(struct heif_context* ctx);
943
+
944
+ LIBHEIF_API
945
+ int heif_context_is_top_level_image_ID(struct heif_context* ctx, heif_item_id id);
946
+
947
+ // Fills in image IDs into the user-supplied int-array 'ID_array', preallocated with 'count' entries.
948
+ // Function returns the total number of IDs filled into the array.
949
+ LIBHEIF_API
950
+ int heif_context_get_list_of_top_level_image_IDs(struct heif_context* ctx,
951
+ heif_item_id* ID_array,
952
+ int count);
953
+
954
+ LIBHEIF_API
955
+ struct heif_error heif_context_get_primary_image_ID(struct heif_context* ctx, heif_item_id* id);
956
+
957
+ // Get a handle to the primary image of the HEIF file.
958
+ // This is the image that should be displayed primarily when there are several images in the file.
959
+ LIBHEIF_API
960
+ struct heif_error heif_context_get_primary_image_handle(struct heif_context* ctx,
961
+ struct heif_image_handle**);
962
+
963
+ // Get the image handle for a known image ID.
964
+ LIBHEIF_API
965
+ struct heif_error heif_context_get_image_handle(struct heif_context* ctx,
966
+ heif_item_id id,
967
+ struct heif_image_handle**);
968
+
969
+ // Print information about the boxes of a HEIF file to file descriptor.
970
+ // This is for debugging and informational purposes only. You should not rely on
971
+ // the output having a specific format. At best, you should not use this at all.
972
+ LIBHEIF_API
973
+ void heif_context_debug_dump_boxes_to_file(struct heif_context* ctx, int fd);
974
+
975
+
976
+ LIBHEIF_API
977
+ void heif_context_set_maximum_image_size_limit(struct heif_context* ctx, int maximum_width);
978
+
979
+ // If the maximum threads number is set to 0, the image tiles are decoded in the main thread.
980
+ // This is different from setting it to 1, which will generate a single background thread to decode the tiles.
981
+ // Note that this setting only affects libheif itself. The codecs itself may still use multi-threaded decoding.
982
+ // You can use it, for example, in cases where you are decoding several images in parallel anyway you thus want
983
+ // to minimize parallelism in each decoder.
984
+ LIBHEIF_API
985
+ void heif_context_set_max_decoding_threads(struct heif_context* ctx, int max_threads);
986
+
987
+
988
+ // ========================= heif_image_handle =========================
989
+
990
+ // An heif_image_handle is a handle to a logical image in the HEIF file.
991
+ // To get the actual pixel data, you have to decode the handle to an heif_image.
992
+ // An heif_image_handle also gives you access to the thumbnails and Exif data
993
+ // associated with an image.
994
+
995
+ // Once you obtained an heif_image_handle, you can already release the heif_context,
996
+ // since it is internally ref-counted.
997
+
998
+ // Release image handle.
999
+ LIBHEIF_API
1000
+ void heif_image_handle_release(const struct heif_image_handle*);
1001
+
1002
+ // Check whether the given image_handle is the primary image of the file.
1003
+ LIBHEIF_API
1004
+ int heif_image_handle_is_primary_image(const struct heif_image_handle* handle);
1005
+
1006
+ LIBHEIF_API
1007
+ heif_item_id heif_image_handle_get_item_id(const struct heif_image_handle* handle);
1008
+
1009
+ // Get the resolution of an image.
1010
+ LIBHEIF_API
1011
+ int heif_image_handle_get_width(const struct heif_image_handle* handle);
1012
+
1013
+ LIBHEIF_API
1014
+ int heif_image_handle_get_height(const struct heif_image_handle* handle);
1015
+
1016
+ LIBHEIF_API
1017
+ int heif_image_handle_has_alpha_channel(const struct heif_image_handle*);
1018
+
1019
+ LIBHEIF_API
1020
+ int heif_image_handle_is_premultiplied_alpha(const struct heif_image_handle*);
1021
+
1022
+ // Returns -1 on error, e.g. if this information is not present in the image.
1023
+ LIBHEIF_API
1024
+ int heif_image_handle_get_luma_bits_per_pixel(const struct heif_image_handle*);
1025
+
1026
+ // Returns -1 on error, e.g. if this information is not present in the image.
1027
+ LIBHEIF_API
1028
+ int heif_image_handle_get_chroma_bits_per_pixel(const struct heif_image_handle*);
1029
+
1030
+ // Return the colorspace that libheif proposes to use for decoding.
1031
+ // Usually, these will be either YCbCr or Monochrome, but it may also propose RGB for images
1032
+ // encoded with matrix_coefficients=0.
1033
+ // It may also return *_undefined if the file misses relevant information to determine this without decoding.
1034
+ LIBHEIF_API
1035
+ struct heif_error heif_image_handle_get_preferred_decoding_colorspace(const struct heif_image_handle* image_handle,
1036
+ enum heif_colorspace* out_colorspace,
1037
+ enum heif_chroma* out_chroma);
1038
+
1039
+ // Get the image width from the 'ispe' box. This is the original image size without
1040
+ // any transformations applied to it. Do not use this unless you know exactly what
1041
+ // you are doing.
1042
+ LIBHEIF_API
1043
+ int heif_image_handle_get_ispe_width(const struct heif_image_handle* handle);
1044
+
1045
+ LIBHEIF_API
1046
+ int heif_image_handle_get_ispe_height(const struct heif_image_handle* handle);
1047
+
1048
+ // This gets the context associated with the image handle.
1049
+ // Note that you have to release the returned context with heif_context_free() in any case.
1050
+ //
1051
+ // This means: when you have several image-handles that originate from the same file and you get the
1052
+ // context of each of them, the returned pointer may be different even though it refers to the same
1053
+ // logical context. You have to call heif_context_free() on all those context pointers.
1054
+ // After you freed a context pointer, you can still use the context through a different pointer that you
1055
+ // might have acquired from elsewhere.
1056
+ LIBHEIF_API
1057
+ struct heif_context* heif_image_handle_get_context(const struct heif_image_handle* handle);
1058
+
1059
+
1060
+ // ------------------------- depth images -------------------------
1061
+
1062
+ LIBHEIF_API
1063
+ int heif_image_handle_has_depth_image(const struct heif_image_handle*);
1064
+
1065
+ LIBHEIF_API
1066
+ int heif_image_handle_get_number_of_depth_images(const struct heif_image_handle* handle);
1067
+
1068
+ LIBHEIF_API
1069
+ int heif_image_handle_get_list_of_depth_image_IDs(const struct heif_image_handle* handle,
1070
+ heif_item_id* ids, int count);
1071
+
1072
+ LIBHEIF_API
1073
+ struct heif_error heif_image_handle_get_depth_image_handle(const struct heif_image_handle* handle,
1074
+ heif_item_id depth_image_id,
1075
+ struct heif_image_handle** out_depth_handle);
1076
+
1077
+
1078
+ enum heif_depth_representation_type
1079
+ {
1080
+ heif_depth_representation_type_uniform_inverse_Z = 0,
1081
+ heif_depth_representation_type_uniform_disparity = 1,
1082
+ heif_depth_representation_type_uniform_Z = 2,
1083
+ heif_depth_representation_type_nonuniform_disparity = 3
1084
+ };
1085
+
1086
+ struct heif_depth_representation_info
1087
+ {
1088
+ uint8_t version;
1089
+
1090
+ // version 1 fields
1091
+
1092
+ uint8_t has_z_near;
1093
+ uint8_t has_z_far;
1094
+ uint8_t has_d_min;
1095
+ uint8_t has_d_max;
1096
+
1097
+ double z_near;
1098
+ double z_far;
1099
+ double d_min;
1100
+ double d_max;
1101
+
1102
+ enum heif_depth_representation_type depth_representation_type;
1103
+ uint32_t disparity_reference_view;
1104
+
1105
+ uint32_t depth_nonlinear_representation_model_size;
1106
+ uint8_t* depth_nonlinear_representation_model;
1107
+
1108
+ // version 2 fields below
1109
+ };
1110
+
1111
+
1112
+ LIBHEIF_API
1113
+ void heif_depth_representation_info_free(const struct heif_depth_representation_info* info);
1114
+
1115
+ // Returns true when there is depth_representation_info available
1116
+ // Note 1: depth_image_id is currently unused because we support only one depth channel per image, but
1117
+ // you should still provide the correct ID for future compatibility.
1118
+ // Note 2: Because of an API bug before v1.11.0, the function also works when 'handle' is the handle of the depth image.
1119
+ // However, you should pass the handle of the main image. Please adapt your code if needed.
1120
+ LIBHEIF_API
1121
+ int heif_image_handle_get_depth_image_representation_info(const struct heif_image_handle* handle,
1122
+ heif_item_id depth_image_id,
1123
+ const struct heif_depth_representation_info** out);
1124
+
1125
+
1126
+
1127
+ // ------------------------- thumbnails -------------------------
1128
+
1129
+ // List the number of thumbnails assigned to this image handle. Usually 0 or 1.
1130
+ LIBHEIF_API
1131
+ int heif_image_handle_get_number_of_thumbnails(const struct heif_image_handle* handle);
1132
+
1133
+ LIBHEIF_API
1134
+ int heif_image_handle_get_list_of_thumbnail_IDs(const struct heif_image_handle* handle,
1135
+ heif_item_id* ids, int count);
1136
+
1137
+ // Get the image handle of a thumbnail image.
1138
+ LIBHEIF_API
1139
+ struct heif_error heif_image_handle_get_thumbnail(const struct heif_image_handle* main_image_handle,
1140
+ heif_item_id thumbnail_id,
1141
+ struct heif_image_handle** out_thumbnail_handle);
1142
+
1143
+
1144
+ // ------------------------- auxiliary images -------------------------
1145
+
1146
+ #define LIBHEIF_AUX_IMAGE_FILTER_OMIT_ALPHA (1UL<<1)
1147
+ #define LIBHEIF_AUX_IMAGE_FILTER_OMIT_DEPTH (2UL<<1)
1148
+
1149
+ // List the number of auxiliary images assigned to this image handle.
1150
+ LIBHEIF_API
1151
+ int heif_image_handle_get_number_of_auxiliary_images(const struct heif_image_handle* handle,
1152
+ int aux_filter);
1153
+
1154
+ LIBHEIF_API
1155
+ int heif_image_handle_get_list_of_auxiliary_image_IDs(const struct heif_image_handle* handle,
1156
+ int aux_filter,
1157
+ heif_item_id* ids, int count);
1158
+
1159
+ // You are responsible to deallocate the returned buffer with heif_image_handle_release_auxiliary_type().
1160
+ LIBHEIF_API
1161
+ struct heif_error heif_image_handle_get_auxiliary_type(const struct heif_image_handle* handle,
1162
+ const char** out_type);
1163
+
1164
+ LIBHEIF_API
1165
+ void heif_image_handle_release_auxiliary_type(const struct heif_image_handle* handle,
1166
+ const char** out_type);
1167
+
1168
+ // DEPRECATED (because typo in function name). Use heif_image_handle_release_auxiliary_type() instead.
1169
+ LIBHEIF_API
1170
+ void heif_image_handle_free_auxiliary_types(const struct heif_image_handle* handle,
1171
+ const char** out_type);
1172
+
1173
+ // Get the image handle of an auxiliary image.
1174
+ LIBHEIF_API
1175
+ struct heif_error heif_image_handle_get_auxiliary_image_handle(const struct heif_image_handle* main_image_handle,
1176
+ heif_item_id auxiliary_id,
1177
+ struct heif_image_handle** out_auxiliary_handle);
1178
+
1179
+
1180
+ // ------------------------- metadata (Exif / XMP) -------------------------
1181
+
1182
+ // How many metadata blocks are attached to an image. If you only want to get EXIF data,
1183
+ // set the type_filter to "Exif". Otherwise, set the type_filter to NULL.
1184
+ LIBHEIF_API
1185
+ int heif_image_handle_get_number_of_metadata_blocks(const struct heif_image_handle* handle,
1186
+ const char* type_filter);
1187
+
1188
+ // 'type_filter' can be used to get only metadata of specific types, like "Exif".
1189
+ // If 'type_filter' is NULL, it will return all types of metadata IDs.
1190
+ LIBHEIF_API
1191
+ int heif_image_handle_get_list_of_metadata_block_IDs(const struct heif_image_handle* handle,
1192
+ const char* type_filter,
1193
+ heif_item_id* ids, int count);
1194
+
1195
+ // Return a string indicating the type of the metadata, as specified in the HEIF file.
1196
+ // Exif data will have the type string "Exif".
1197
+ // This string will be valid until the next call to a libheif function.
1198
+ // You do not have to free this string.
1199
+ LIBHEIF_API
1200
+ const char* heif_image_handle_get_metadata_type(const struct heif_image_handle* handle,
1201
+ heif_item_id metadata_id);
1202
+
1203
+ // For EXIF, the content type is empty.
1204
+ // For XMP, the content type is "application/rdf+xml".
1205
+ LIBHEIF_API
1206
+ const char* heif_image_handle_get_metadata_content_type(const struct heif_image_handle* handle,
1207
+ heif_item_id metadata_id);
1208
+
1209
+ // Get the size of the raw metadata, as stored in the HEIF file.
1210
+ LIBHEIF_API
1211
+ size_t heif_image_handle_get_metadata_size(const struct heif_image_handle* handle,
1212
+ heif_item_id metadata_id);
1213
+
1214
+ // 'out_data' must point to a memory area of the size reported by heif_image_handle_get_metadata_size().
1215
+ // The data is returned exactly as stored in the HEIF file.
1216
+ // For Exif data, you probably have to skip the first four bytes of the data, since they
1217
+ // indicate the offset to the start of the TIFF header of the Exif data.
1218
+ LIBHEIF_API
1219
+ struct heif_error heif_image_handle_get_metadata(const struct heif_image_handle* handle,
1220
+ heif_item_id metadata_id,
1221
+ void* out_data);
1222
+
1223
+ // Only valid for item type == "uri ", an absolute URI
1224
+ LIBHEIF_API
1225
+ const char* heif_image_handle_get_metadata_item_uri_type(const struct heif_image_handle* handle,
1226
+ heif_item_id metadata_id);
1227
+
1228
+ // ------------------------- color profiles -------------------------
1229
+
1230
+ enum heif_color_profile_type
1231
+ {
1232
+ heif_color_profile_type_not_present = 0,
1233
+ heif_color_profile_type_nclx = heif_fourcc('n', 'c', 'l', 'x'),
1234
+ heif_color_profile_type_rICC = heif_fourcc('r', 'I', 'C', 'C'),
1235
+ heif_color_profile_type_prof = heif_fourcc('p', 'r', 'o', 'f')
1236
+ };
1237
+
1238
+
1239
+ // Returns 'heif_color_profile_type_not_present' if there is no color profile.
1240
+ // If there is an ICC profile and an NCLX profile, the ICC profile is returned.
1241
+ // TODO: we need a new API for this function as images can contain both NCLX and ICC at the same time.
1242
+ // However, you can still use heif_image_handle_get_raw_color_profile() and
1243
+ // heif_image_handle_get_nclx_color_profile() to access both profiles.
1244
+ LIBHEIF_API
1245
+ enum heif_color_profile_type heif_image_handle_get_color_profile_type(const struct heif_image_handle* handle);
1246
+
1247
+ LIBHEIF_API
1248
+ size_t heif_image_handle_get_raw_color_profile_size(const struct heif_image_handle* handle);
1249
+
1250
+ // Returns 'heif_error_Color_profile_does_not_exist' when there is no ICC profile.
1251
+ LIBHEIF_API
1252
+ struct heif_error heif_image_handle_get_raw_color_profile(const struct heif_image_handle* handle,
1253
+ void* out_data);
1254
+
1255
+
1256
+ enum heif_color_primaries
1257
+ {
1258
+ heif_color_primaries_ITU_R_BT_709_5 = 1, // g=0.3;0.6, b=0.15;0.06, r=0.64;0.33, w=0.3127,0.3290
1259
+ heif_color_primaries_unspecified = 2,
1260
+ heif_color_primaries_ITU_R_BT_470_6_System_M = 4,
1261
+ heif_color_primaries_ITU_R_BT_470_6_System_B_G = 5,
1262
+ heif_color_primaries_ITU_R_BT_601_6 = 6,
1263
+ heif_color_primaries_SMPTE_240M = 7,
1264
+ heif_color_primaries_generic_film = 8,
1265
+ heif_color_primaries_ITU_R_BT_2020_2_and_2100_0 = 9,
1266
+ heif_color_primaries_SMPTE_ST_428_1 = 10,
1267
+ heif_color_primaries_SMPTE_RP_431_2 = 11,
1268
+ heif_color_primaries_SMPTE_EG_432_1 = 12,
1269
+ heif_color_primaries_EBU_Tech_3213_E = 22
1270
+ };
1271
+
1272
+ enum heif_transfer_characteristics
1273
+ {
1274
+ heif_transfer_characteristic_ITU_R_BT_709_5 = 1,
1275
+ heif_transfer_characteristic_unspecified = 2,
1276
+ heif_transfer_characteristic_ITU_R_BT_470_6_System_M = 4,
1277
+ heif_transfer_characteristic_ITU_R_BT_470_6_System_B_G = 5,
1278
+ heif_transfer_characteristic_ITU_R_BT_601_6 = 6,
1279
+ heif_transfer_characteristic_SMPTE_240M = 7,
1280
+ heif_transfer_characteristic_linear = 8,
1281
+ heif_transfer_characteristic_logarithmic_100 = 9,
1282
+ heif_transfer_characteristic_logarithmic_100_sqrt10 = 10,
1283
+ heif_transfer_characteristic_IEC_61966_2_4 = 11,
1284
+ heif_transfer_characteristic_ITU_R_BT_1361 = 12,
1285
+ heif_transfer_characteristic_IEC_61966_2_1 = 13,
1286
+ heif_transfer_characteristic_ITU_R_BT_2020_2_10bit = 14,
1287
+ heif_transfer_characteristic_ITU_R_BT_2020_2_12bit = 15,
1288
+ heif_transfer_characteristic_ITU_R_BT_2100_0_PQ = 16,
1289
+ heif_transfer_characteristic_SMPTE_ST_428_1 = 17,
1290
+ heif_transfer_characteristic_ITU_R_BT_2100_0_HLG = 18
1291
+ };
1292
+
1293
+ enum heif_matrix_coefficients
1294
+ {
1295
+ heif_matrix_coefficients_RGB_GBR = 0,
1296
+ heif_matrix_coefficients_ITU_R_BT_709_5 = 1, // TODO: or 709-6 according to h.273
1297
+ heif_matrix_coefficients_unspecified = 2,
1298
+ heif_matrix_coefficients_US_FCC_T47 = 4,
1299
+ heif_matrix_coefficients_ITU_R_BT_470_6_System_B_G = 5,
1300
+ heif_matrix_coefficients_ITU_R_BT_601_6 = 6, // TODO: or 601-7 according to h.273
1301
+ heif_matrix_coefficients_SMPTE_240M = 7,
1302
+ heif_matrix_coefficients_YCgCo = 8,
1303
+ heif_matrix_coefficients_ITU_R_BT_2020_2_non_constant_luminance = 9,
1304
+ heif_matrix_coefficients_ITU_R_BT_2020_2_constant_luminance = 10,
1305
+ heif_matrix_coefficients_SMPTE_ST_2085 = 11,
1306
+ heif_matrix_coefficients_chromaticity_derived_non_constant_luminance = 12,
1307
+ heif_matrix_coefficients_chromaticity_derived_constant_luminance = 13,
1308
+ heif_matrix_coefficients_ICtCp = 14
1309
+ };
1310
+
1311
+ struct heif_color_profile_nclx
1312
+ {
1313
+ // === version 1 fields
1314
+
1315
+ uint8_t version;
1316
+
1317
+ enum heif_color_primaries color_primaries;
1318
+ enum heif_transfer_characteristics transfer_characteristics;
1319
+ enum heif_matrix_coefficients matrix_coefficients;
1320
+ uint8_t full_range_flag;
1321
+
1322
+ // --- decoded values (not used when saving nclx)
1323
+
1324
+ float color_primary_red_x, color_primary_red_y;
1325
+ float color_primary_green_x, color_primary_green_y;
1326
+ float color_primary_blue_x, color_primary_blue_y;
1327
+ float color_primary_white_x, color_primary_white_y;
1328
+ };
1329
+
1330
+ LIBHEIF_API
1331
+ struct heif_error heif_nclx_color_profile_set_color_primaries(struct heif_color_profile_nclx* nclx, uint16_t cp);
1332
+
1333
+ LIBHEIF_API
1334
+ struct heif_error heif_nclx_color_profile_set_transfer_characteristics(struct heif_color_profile_nclx* nclx, uint16_t transfer_characteristics);
1335
+
1336
+ LIBHEIF_API
1337
+ struct heif_error heif_nclx_color_profile_set_matrix_coefficients(struct heif_color_profile_nclx* nclx, uint16_t matrix_coefficients);
1338
+
1339
+ // Returns 'heif_error_Color_profile_does_not_exist' when there is no NCLX profile.
1340
+ // TODO: This function does currently not return an NCLX profile if it is stored in the image bitstream.
1341
+ // Only NCLX profiles stored as colr boxes are returned. This may change in the future.
1342
+ LIBHEIF_API
1343
+ struct heif_error heif_image_handle_get_nclx_color_profile(const struct heif_image_handle* handle,
1344
+ struct heif_color_profile_nclx** out_data);
1345
+
1346
+ // Returned color profile has 'version' field set to the maximum allowed.
1347
+ // Do not fill values for higher versions as these might be outside the allocated structure size.
1348
+ // May return NULL.
1349
+ LIBHEIF_API
1350
+ struct heif_color_profile_nclx* heif_nclx_color_profile_alloc(void);
1351
+
1352
+ LIBHEIF_API
1353
+ void heif_nclx_color_profile_free(struct heif_color_profile_nclx* nclx_profile);
1354
+
1355
+
1356
+ LIBHEIF_API
1357
+ enum heif_color_profile_type heif_image_get_color_profile_type(const struct heif_image* image);
1358
+
1359
+ LIBHEIF_API
1360
+ size_t heif_image_get_raw_color_profile_size(const struct heif_image* image);
1361
+
1362
+ LIBHEIF_API
1363
+ struct heif_error heif_image_get_raw_color_profile(const struct heif_image* image,
1364
+ void* out_data);
1365
+
1366
+ LIBHEIF_API
1367
+ struct heif_error heif_image_get_nclx_color_profile(const struct heif_image* image,
1368
+ struct heif_color_profile_nclx** out_data);
1369
+
1370
+
1371
+ // ========================= heif_image =========================
1372
+
1373
+ // An heif_image contains a decoded pixel image in various colorspaces, chroma formats,
1374
+ // and bit depths.
1375
+
1376
+ // Note: when converting images to an interleaved chroma format, the resulting
1377
+ // image contains only a single channel of type channel_interleaved with, e.g., 3 bytes per pixel,
1378
+ // containing the interleaved R,G,B values.
1379
+
1380
+ // Planar RGB images are specified as heif_colorspace_RGB / heif_chroma_444.
1381
+
1382
+ enum heif_progress_step
1383
+ {
1384
+ heif_progress_step_total = 0,
1385
+ heif_progress_step_load_tile = 1
1386
+ };
1387
+
1388
+
1389
+ enum heif_chroma_downsampling_algorithm
1390
+ {
1391
+ heif_chroma_downsampling_nearest_neighbor = 1,
1392
+ heif_chroma_downsampling_average = 2,
1393
+
1394
+ // Combine with 'heif_chroma_upsampling_bilinear' for best quality.
1395
+ // Makes edges look sharper when using YUV 420 with bilinear chroma upsampling.
1396
+ heif_chroma_downsampling_sharp_yuv = 3
1397
+ };
1398
+
1399
+ enum heif_chroma_upsampling_algorithm
1400
+ {
1401
+ heif_chroma_upsampling_nearest_neighbor = 1,
1402
+ heif_chroma_upsampling_bilinear = 2
1403
+ };
1404
+
1405
+ struct heif_color_conversion_options
1406
+ {
1407
+ uint8_t version;
1408
+
1409
+ // --- version 1 options
1410
+
1411
+ enum heif_chroma_downsampling_algorithm preferred_chroma_downsampling_algorithm;
1412
+ enum heif_chroma_upsampling_algorithm preferred_chroma_upsampling_algorithm;
1413
+
1414
+ // When set to 'false' libheif may also use a different algorithm if the preferred one is not available
1415
+ // or using a different algorithm is computationally less complex. Note that currently (v1.17.0) this
1416
+ // means that for RGB input it will usually choose nearest-neighbor sampling because this is computationally
1417
+ // the simplest.
1418
+ // Set this field to 'true' if you want to make sure that the specified algorithm is used even
1419
+ // at the cost of slightly higher computation times.
1420
+ uint8_t only_use_preferred_chroma_algorithm;
1421
+ };
1422
+
1423
+
1424
+ struct heif_decoding_options
1425
+ {
1426
+ uint8_t version;
1427
+
1428
+ // version 1 options
1429
+
1430
+ // Ignore geometric transformations like cropping, rotation, mirroring.
1431
+ // Default: false (do not ignore).
1432
+ uint8_t ignore_transformations;
1433
+
1434
+ void (* start_progress)(enum heif_progress_step step, int max_progress, void* progress_user_data);
1435
+
1436
+ void (* on_progress)(enum heif_progress_step step, int progress, void* progress_user_data);
1437
+
1438
+ void (* end_progress)(enum heif_progress_step step, void* progress_user_data);
1439
+
1440
+ void* progress_user_data;
1441
+
1442
+ // version 2 options
1443
+
1444
+ uint8_t convert_hdr_to_8bit;
1445
+
1446
+ // version 3 options
1447
+
1448
+ // When enabled, an error is returned for invalid input. Otherwise, it will try its best and
1449
+ // add decoding warnings to the decoded heif_image. Default is non-strict.
1450
+ uint8_t strict_decoding;
1451
+
1452
+ // version 4 options
1453
+
1454
+ // name_id of the decoder to use for the decoding.
1455
+ // If set to NULL (default), the highest priority decoder is chosen.
1456
+ // The priority is defined in the plugin.
1457
+ const char* decoder_id;
1458
+
1459
+
1460
+ // version 5 options
1461
+
1462
+ struct heif_color_conversion_options color_conversion_options;
1463
+ };
1464
+
1465
+
1466
+ // Allocate decoding options and fill with default values.
1467
+ // Note: you should always get the decoding options through this function since the
1468
+ // option structure may grow in size in future versions.
1469
+ LIBHEIF_API
1470
+ struct heif_decoding_options* heif_decoding_options_alloc(void);
1471
+
1472
+ LIBHEIF_API
1473
+ void heif_decoding_options_free(struct heif_decoding_options*);
1474
+
1475
+ // Decode an heif_image_handle into the actual pixel image and also carry out
1476
+ // all geometric transformations specified in the HEIF file (rotation, cropping, mirroring).
1477
+ //
1478
+ // If colorspace or chroma is set to heif_colorspace_undefined or heif_chroma_undefined,
1479
+ // respectively, the original colorspace is taken.
1480
+ // Decoding options may be NULL. If you want to supply options, always use
1481
+ // heif_decoding_options_alloc() to get the structure.
1482
+ LIBHEIF_API
1483
+ struct heif_error heif_decode_image(const struct heif_image_handle* in_handle,
1484
+ struct heif_image** out_img,
1485
+ enum heif_colorspace colorspace,
1486
+ enum heif_chroma chroma,
1487
+ const struct heif_decoding_options* options);
1488
+
1489
+ // Get the colorspace format of the image.
1490
+ LIBHEIF_API
1491
+ enum heif_colorspace heif_image_get_colorspace(const struct heif_image*);
1492
+
1493
+ // Get the chroma format of the image.
1494
+ LIBHEIF_API
1495
+ enum heif_chroma heif_image_get_chroma_format(const struct heif_image*);
1496
+
1497
+ /**
1498
+ * Get the width of a specified image channel.
1499
+ *
1500
+ * @param img the image to get the width for
1501
+ * @param channel the channel to select
1502
+ * @return the width of the channel in pixels, or -1 the channel does not exist in the image
1503
+ */
1504
+ LIBHEIF_API
1505
+ int heif_image_get_width(const struct heif_image* img, enum heif_channel channel);
1506
+
1507
+ /**
1508
+ * Get the height of a specified image channel.
1509
+ *
1510
+ * @param img the image to get the height for
1511
+ * @param channel the channel to select
1512
+ * @return the height of the channel in pixels, or -1 the channel does not exist in the image
1513
+ */
1514
+ LIBHEIF_API
1515
+ int heif_image_get_height(const struct heif_image* img, enum heif_channel channel);
1516
+
1517
+ /**
1518
+ * Get the width of the main channel.
1519
+ *
1520
+ * This is the Y channel in YCbCr or mono, or any in RGB.
1521
+ *
1522
+ * @param img the image to get the primary width for
1523
+ * @return the width in pixels
1524
+ */
1525
+ LIBHEIF_API
1526
+ int heif_image_get_primary_width(const struct heif_image* img);
1527
+
1528
+ /**
1529
+ * Get the height of the main channel.
1530
+ *
1531
+ * This is the Y channel in YCbCr or mono, or any in RGB.
1532
+ *
1533
+ * @param img the image to get the primary height for
1534
+ * @return the height in pixels
1535
+ */
1536
+ LIBHEIF_API
1537
+ int heif_image_get_primary_height(const struct heif_image* img);
1538
+
1539
+ LIBHEIF_API
1540
+ struct heif_error heif_image_crop(struct heif_image* img,
1541
+ int left, int right, int top, int bottom);
1542
+
1543
+ // Get the number of bits per pixel in the given image channel. Returns -1 if
1544
+ // a non-existing channel was given.
1545
+ // Note that the number of bits per pixel may be different for each color channel.
1546
+ // This function returns the number of bits used for storage of each pixel.
1547
+ // Especially for HDR images, this is probably not what you want. Have a look at
1548
+ // heif_image_get_bits_per_pixel_range() instead.
1549
+ LIBHEIF_API
1550
+ int heif_image_get_bits_per_pixel(const struct heif_image*, enum heif_channel channel);
1551
+
1552
+
1553
+ // Get the number of bits per pixel in the given image channel. This function returns
1554
+ // the number of bits used for representing the pixel value, which might be smaller
1555
+ // than the number of bits used in memory.
1556
+ // For example, in 12bit HDR images, this function returns '12', while still 16 bits
1557
+ // are reserved for storage. For interleaved RGBA with 12 bit, this function also returns
1558
+ // '12', not '48' or '64' (heif_image_get_bits_per_pixel returns 64 in this case).
1559
+ LIBHEIF_API
1560
+ int heif_image_get_bits_per_pixel_range(const struct heif_image*, enum heif_channel channel);
1561
+
1562
+ LIBHEIF_API
1563
+ int heif_image_has_channel(const struct heif_image*, enum heif_channel channel);
1564
+
1565
+ // Get a pointer to the actual pixel data.
1566
+ // The 'out_stride' is returned as "bytes per line".
1567
+ // When out_stride is NULL, no value will be written.
1568
+ // Returns NULL if a non-existing channel was given.
1569
+ LIBHEIF_API
1570
+ const uint8_t* heif_image_get_plane_readonly(const struct heif_image*,
1571
+ enum heif_channel channel,
1572
+ int* out_stride);
1573
+
1574
+ LIBHEIF_API
1575
+ uint8_t* heif_image_get_plane(struct heif_image*,
1576
+ enum heif_channel channel,
1577
+ int* out_stride);
1578
+
1579
+
1580
+ struct heif_scaling_options;
1581
+
1582
+ // Currently, heif_scaling_options is not defined yet. Pass a NULL pointer.
1583
+ LIBHEIF_API
1584
+ struct heif_error heif_image_scale_image(const struct heif_image* input,
1585
+ struct heif_image** output,
1586
+ int width, int height,
1587
+ const struct heif_scaling_options* options);
1588
+
1589
+ // The color profile is not attached to the image handle because we might need it
1590
+ // for color space transform and encoding.
1591
+ LIBHEIF_API
1592
+ struct heif_error heif_image_set_raw_color_profile(struct heif_image* image,
1593
+ const char* profile_type_fourcc_string,
1594
+ const void* profile_data,
1595
+ const size_t profile_size);
1596
+
1597
+ LIBHEIF_API
1598
+ struct heif_error heif_image_set_nclx_color_profile(struct heif_image* image,
1599
+ const struct heif_color_profile_nclx* color_profile);
1600
+
1601
+
1602
+ // TODO: this function does not make any sense yet, since we currently cannot modify existing HEIF files.
1603
+ //LIBHEIF_API
1604
+ //void heif_image_remove_color_profile(struct heif_image* image);
1605
+
1606
+ // Fills the image decoding warnings into the provided 'out_warnings' array.
1607
+ // The size of the array has to be provided in max_output_buffer_entries.
1608
+ // If max_output_buffer_entries==0, the number of decoder warnings is returned.
1609
+ // The function fills the warnings into the provided buffer, starting with 'first_warning_idx'.
1610
+ // It returns the number of warnings filled into the buffer.
1611
+ // Note: you can iterate through all warnings by using 'max_output_buffer_entries=1' and iterate 'first_warning_idx'.
1612
+ LIBHEIF_API
1613
+ int heif_image_get_decoding_warnings(struct heif_image* image,
1614
+ int first_warning_idx,
1615
+ struct heif_error* out_warnings,
1616
+ int max_output_buffer_entries);
1617
+
1618
+ // This function is only for decoder plugin implementors.
1619
+ LIBHEIF_API
1620
+ void heif_image_add_decoding_warning(struct heif_image* image,
1621
+ struct heif_error err);
1622
+
1623
+ // Release heif_image.
1624
+ LIBHEIF_API
1625
+ void heif_image_release(const struct heif_image*);
1626
+
1627
+
1628
+ // Note: a value of 0 for any of these values indicates that the value is undefined.
1629
+ // The unit of these values is Candelas per square meter.
1630
+ struct heif_content_light_level
1631
+ {
1632
+ uint16_t max_content_light_level;
1633
+ uint16_t max_pic_average_light_level;
1634
+ };
1635
+
1636
+ LIBHEIF_API
1637
+ int heif_image_has_content_light_level(const struct heif_image*);
1638
+
1639
+ LIBHEIF_API
1640
+ void heif_image_get_content_light_level(const struct heif_image*, struct heif_content_light_level* out);
1641
+
1642
+ LIBHEIF_API
1643
+ void heif_image_set_content_light_level(const struct heif_image*, const struct heif_content_light_level* in);
1644
+
1645
+
1646
+ // Note: color coordinates are defined according to the CIE 1931 definition of x as specified in ISO 11664-1 (see also ISO 11664-3 and CIE 15).
1647
+ struct heif_mastering_display_colour_volume
1648
+ {
1649
+ uint16_t display_primaries_x[3];
1650
+ uint16_t display_primaries_y[3];
1651
+ uint16_t white_point_x;
1652
+ uint16_t white_point_y;
1653
+ uint32_t max_display_mastering_luminance;
1654
+ uint32_t min_display_mastering_luminance;
1655
+ };
1656
+
1657
+ // The units for max_display_mastering_luminance and min_display_mastering_luminance is Candelas per square meter.
1658
+ struct heif_decoded_mastering_display_colour_volume
1659
+ {
1660
+ float display_primaries_x[3];
1661
+ float display_primaries_y[3];
1662
+ float white_point_x;
1663
+ float white_point_y;
1664
+ double max_display_mastering_luminance;
1665
+ double min_display_mastering_luminance;
1666
+ };
1667
+
1668
+ LIBHEIF_API
1669
+ int heif_image_has_mastering_display_colour_volume(const struct heif_image*);
1670
+
1671
+ LIBHEIF_API
1672
+ void heif_image_get_mastering_display_colour_volume(const struct heif_image*, struct heif_mastering_display_colour_volume* out);
1673
+
1674
+ LIBHEIF_API
1675
+ void heif_image_set_mastering_display_colour_volume(const struct heif_image*, const struct heif_mastering_display_colour_volume* in);
1676
+
1677
+ // Converts the internal numeric representation of heif_mastering_display_colour_volume to the
1678
+ // normalized values, collected in heif_decoded_mastering_display_colour_volume.
1679
+ // Values that are out-of-range are decoded to 0, indicating an undefined value (as specified in ISO/IEC 23008-2).
1680
+ LIBHEIF_API
1681
+ struct heif_error heif_mastering_display_colour_volume_decode(const struct heif_mastering_display_colour_volume* in,
1682
+ struct heif_decoded_mastering_display_colour_volume* out);
1683
+
1684
+ LIBHEIF_API
1685
+ void heif_image_get_pixel_aspect_ratio(const struct heif_image*, uint32_t* aspect_h, uint32_t* aspect_v);
1686
+
1687
+ LIBHEIF_API
1688
+ void heif_image_set_pixel_aspect_ratio(struct heif_image*, uint32_t aspect_h, uint32_t aspect_v);
1689
+
1690
+ // ====================================================================================================
1691
+ // Encoding API
1692
+
1693
+ LIBHEIF_API
1694
+ struct heif_error heif_context_write_to_file(struct heif_context*,
1695
+ const char* filename);
1696
+
1697
+ struct heif_writer
1698
+ {
1699
+ // API version supported by this writer
1700
+ int writer_api_version;
1701
+
1702
+ // --- version 1 functions ---
1703
+ struct heif_error (* write)(struct heif_context* ctx, // TODO: why do we need this parameter?
1704
+ const void* data,
1705
+ size_t size,
1706
+ void* userdata);
1707
+ };
1708
+
1709
+ LIBHEIF_API
1710
+ struct heif_error heif_context_write(struct heif_context*,
1711
+ struct heif_writer* writer,
1712
+ void* userdata);
1713
+
1714
+
1715
+ // ----- encoder -----
1716
+
1717
+ // The encoder used for actually encoding an image.
1718
+ struct heif_encoder;
1719
+
1720
+ // A description of the encoder's capabilities and name.
1721
+ struct heif_encoder_descriptor;
1722
+
1723
+ // A configuration parameter of the encoder. Each encoder implementation may have a different
1724
+ // set of parameters. For the most common settings (e.q. quality), special functions to set
1725
+ // the parameters are provided.
1726
+ struct heif_encoder_parameter;
1727
+
1728
+ struct heif_decoder_descriptor;
1729
+
1730
+ // Get a list of available decoders. You can filter the encoders by compression format.
1731
+ // Use format_filter==heif_compression_undefined to get all available decoders.
1732
+ // The returned list of decoders is sorted by their priority (which is a plugin property).
1733
+ // The number of decoders is returned, which are not more than 'count' if (out_decoders != nullptr).
1734
+ // By setting out_decoders==nullptr, you can query the number of decoders, 'count' is ignored.
1735
+ LIBHEIF_API
1736
+ int heif_get_decoder_descriptors(enum heif_compression_format format_filter,
1737
+ const struct heif_decoder_descriptor** out_decoders,
1738
+ int count);
1739
+
1740
+ // Return a long, descriptive name of the decoder (including version information).
1741
+ LIBHEIF_API
1742
+ const char* heif_decoder_descriptor_get_name(const struct heif_decoder_descriptor*);
1743
+
1744
+ // Return a short, symbolic name for identifying the decoder.
1745
+ // This name should stay constant over different decoder versions.
1746
+ // Note: the returned ID may be NULL for old plugins that don't support this yet.
1747
+ LIBHEIF_API
1748
+ const char* heif_decoder_descriptor_get_id_name(const struct heif_decoder_descriptor*);
1749
+
1750
+ // DEPRECATED: use heif_get_encoder_descriptors() instead.
1751
+ // Get a list of available encoders. You can filter the encoders by compression format and name.
1752
+ // Use format_filter==heif_compression_undefined and name_filter==NULL as wildcards.
1753
+ // The returned list of encoders is sorted by their priority (which is a plugin property).
1754
+ // The number of encoders is returned, which are not more than 'count' if (out_encoders != nullptr).
1755
+ // By setting out_encoders==nullptr, you can query the number of encoders, 'count' is ignored.
1756
+ // Note: to get the actual encoder from the descriptors returned here, use heif_context_get_encoder().
1757
+ LIBHEIF_API
1758
+ int heif_context_get_encoder_descriptors(struct heif_context*, // TODO: why do we need this parameter?
1759
+ enum heif_compression_format format_filter,
1760
+ const char* name_filter,
1761
+ const struct heif_encoder_descriptor** out_encoders,
1762
+ int count);
1763
+
1764
+ // Get a list of available encoders. You can filter the encoders by compression format and name.
1765
+ // Use format_filter==heif_compression_undefined and name_filter==NULL as wildcards.
1766
+ // The returned list of encoders is sorted by their priority (which is a plugin property).
1767
+ // The number of encoders is returned, which are not more than 'count' if (out_encoders != nullptr).
1768
+ // By setting out_encoders==nullptr, you can query the number of encoders, 'count' is ignored.
1769
+ // Note: to get the actual encoder from the descriptors returned here, use heif_context_get_encoder().
1770
+ LIBHEIF_API
1771
+ int heif_get_encoder_descriptors(enum heif_compression_format format_filter,
1772
+ const char* name_filter,
1773
+ const struct heif_encoder_descriptor** out_encoders,
1774
+ int count);
1775
+
1776
+ // Return a long, descriptive name of the encoder (including version information).
1777
+ LIBHEIF_API
1778
+ const char* heif_encoder_descriptor_get_name(const struct heif_encoder_descriptor*);
1779
+
1780
+ // Return a short, symbolic name for identifying the encoder.
1781
+ // This name should stay constant over different encoder versions.
1782
+ LIBHEIF_API
1783
+ const char* heif_encoder_descriptor_get_id_name(const struct heif_encoder_descriptor*);
1784
+
1785
+ LIBHEIF_API
1786
+ enum heif_compression_format
1787
+ heif_encoder_descriptor_get_compression_format(const struct heif_encoder_descriptor*);
1788
+
1789
+ LIBHEIF_API
1790
+ int heif_encoder_descriptor_supports_lossy_compression(const struct heif_encoder_descriptor*);
1791
+
1792
+ LIBHEIF_API
1793
+ int heif_encoder_descriptor_supports_lossless_compression(const struct heif_encoder_descriptor*);
1794
+
1795
+
1796
+ // Get an encoder instance that can be used to actually encode images from a descriptor.
1797
+ LIBHEIF_API
1798
+ struct heif_error heif_context_get_encoder(struct heif_context* context,
1799
+ const struct heif_encoder_descriptor*,
1800
+ struct heif_encoder** out_encoder);
1801
+
1802
+ // Quick check whether there is a decoder available for the given format.
1803
+ // Note that the decoder still may not be able to decode all variants of that format.
1804
+ // You will have to query that further (todo) or just try to decode and check the returned error.
1805
+ LIBHEIF_API
1806
+ int heif_have_decoder_for_format(enum heif_compression_format format);
1807
+
1808
+ // Quick check whether there is an enoder available for the given format.
1809
+ // Note that the encoder may be limited to a certain subset of features (e.g. only 8 bit, only lossy).
1810
+ // You will have to query the specific capabilities further.
1811
+ LIBHEIF_API
1812
+ int heif_have_encoder_for_format(enum heif_compression_format format);
1813
+
1814
+ // Get an encoder for the given compression format. If there are several encoder plugins
1815
+ // for this format, the encoder with the highest plugin priority will be returned.
1816
+ LIBHEIF_API
1817
+ struct heif_error heif_context_get_encoder_for_format(struct heif_context* context,
1818
+ enum heif_compression_format format,
1819
+ struct heif_encoder**);
1820
+
1821
+ // You have to release the encoder after use.
1822
+ LIBHEIF_API
1823
+ void heif_encoder_release(struct heif_encoder*);
1824
+
1825
+ // Get the encoder name from the encoder itself.
1826
+ LIBHEIF_API
1827
+ const char* heif_encoder_get_name(const struct heif_encoder*);
1828
+
1829
+
1830
+ // --- Encoder Parameters ---
1831
+
1832
+ // Libheif supports settings parameters through specialized functions and through
1833
+ // generic functions by parameter name. Sometimes, the same parameter can be set
1834
+ // in both ways.
1835
+ // We consider it best practice to use the generic parameter functions only in
1836
+ // dynamically generated user interfaces, as no guarantees are made that some specific
1837
+ // parameter names are supported by all plugins.
1838
+
1839
+
1840
+ // Set a 'quality' factor (0-100). How this is mapped to actual encoding parameters is
1841
+ // encoder dependent.
1842
+ LIBHEIF_API
1843
+ struct heif_error heif_encoder_set_lossy_quality(struct heif_encoder*, int quality);
1844
+
1845
+ LIBHEIF_API
1846
+ struct heif_error heif_encoder_set_lossless(struct heif_encoder*, int enable);
1847
+
1848
+ // level should be between 0 (= none) to 4 (= full)
1849
+ LIBHEIF_API
1850
+ struct heif_error heif_encoder_set_logging_level(struct heif_encoder*, int level);
1851
+
1852
+ // Get a generic list of encoder parameters.
1853
+ // Each encoder may define its own, additional set of parameters.
1854
+ // You do not have to free the returned list.
1855
+ LIBHEIF_API
1856
+ const struct heif_encoder_parameter* const* heif_encoder_list_parameters(struct heif_encoder*);
1857
+
1858
+ // Return the parameter name.
1859
+ LIBHEIF_API
1860
+ const char* heif_encoder_parameter_get_name(const struct heif_encoder_parameter*);
1861
+
1862
+
1863
+ enum heif_encoder_parameter_type
1864
+ {
1865
+ heif_encoder_parameter_type_integer = 1,
1866
+ heif_encoder_parameter_type_boolean = 2,
1867
+ heif_encoder_parameter_type_string = 3
1868
+ };
1869
+
1870
+ // Return the parameter type.
1871
+ LIBHEIF_API
1872
+ enum heif_encoder_parameter_type heif_encoder_parameter_get_type(const struct heif_encoder_parameter*);
1873
+
1874
+ // DEPRECATED. Use heif_encoder_parameter_get_valid_integer_values() instead.
1875
+ LIBHEIF_API
1876
+ struct heif_error heif_encoder_parameter_get_valid_integer_range(const struct heif_encoder_parameter*,
1877
+ int* have_minimum_maximum,
1878
+ int* minimum, int* maximum);
1879
+
1880
+ // If integer is limited by a range, have_minimum and/or have_maximum will be != 0 and *minimum, *maximum is set.
1881
+ // If integer is limited by a fixed set of values, *num_valid_values will be >0 and *out_integer_array is set.
1882
+ LIBHEIF_API
1883
+ struct heif_error heif_encoder_parameter_get_valid_integer_values(const struct heif_encoder_parameter*,
1884
+ int* have_minimum, int* have_maximum,
1885
+ int* minimum, int* maximum,
1886
+ int* num_valid_values,
1887
+ const int** out_integer_array);
1888
+
1889
+ LIBHEIF_API
1890
+ struct heif_error heif_encoder_parameter_get_valid_string_values(const struct heif_encoder_parameter*,
1891
+ const char* const** out_stringarray);
1892
+
1893
+
1894
+ LIBHEIF_API
1895
+ struct heif_error heif_encoder_set_parameter_integer(struct heif_encoder*,
1896
+ const char* parameter_name,
1897
+ int value);
1898
+
1899
+ LIBHEIF_API
1900
+ struct heif_error heif_encoder_get_parameter_integer(struct heif_encoder*,
1901
+ const char* parameter_name,
1902
+ int* value);
1903
+
1904
+ // TODO: name should be changed to heif_encoder_get_valid_integer_parameter_range
1905
+ LIBHEIF_API // DEPRECATED.
1906
+ struct heif_error heif_encoder_parameter_integer_valid_range(struct heif_encoder*,
1907
+ const char* parameter_name,
1908
+ int* have_minimum_maximum,
1909
+ int* minimum, int* maximum);
1910
+
1911
+ LIBHEIF_API
1912
+ struct heif_error heif_encoder_set_parameter_boolean(struct heif_encoder*,
1913
+ const char* parameter_name,
1914
+ int value);
1915
+
1916
+ LIBHEIF_API
1917
+ struct heif_error heif_encoder_get_parameter_boolean(struct heif_encoder*,
1918
+ const char* parameter_name,
1919
+ int* value);
1920
+
1921
+ LIBHEIF_API
1922
+ struct heif_error heif_encoder_set_parameter_string(struct heif_encoder*,
1923
+ const char* parameter_name,
1924
+ const char* value);
1925
+
1926
+ LIBHEIF_API
1927
+ struct heif_error heif_encoder_get_parameter_string(struct heif_encoder*,
1928
+ const char* parameter_name,
1929
+ char* value, int value_size);
1930
+
1931
+ // returns a NULL-terminated list of valid strings or NULL if all values are allowed
1932
+ LIBHEIF_API
1933
+ struct heif_error heif_encoder_parameter_string_valid_values(struct heif_encoder*,
1934
+ const char* parameter_name,
1935
+ const char* const** out_stringarray);
1936
+
1937
+ LIBHEIF_API
1938
+ struct heif_error heif_encoder_parameter_integer_valid_values(struct heif_encoder*,
1939
+ const char* parameter_name,
1940
+ int* have_minimum, int* have_maximum,
1941
+ int* minimum, int* maximum,
1942
+ int* num_valid_values,
1943
+ const int** out_integer_array);
1944
+
1945
+ // Set a parameter of any type to the string value.
1946
+ // Integer values are parsed from the string.
1947
+ // Boolean values can be "true"/"false"/"1"/"0"
1948
+ //
1949
+ // x265 encoder specific note:
1950
+ // When using the x265 encoder, you may pass any of its parameters by
1951
+ // prefixing the parameter name with 'x265:'. Hence, to set the 'ctu' parameter,
1952
+ // you will have to set 'x265:ctu' in libheif.
1953
+ // Note that there is no checking for valid parameters when using the prefix.
1954
+ LIBHEIF_API
1955
+ struct heif_error heif_encoder_set_parameter(struct heif_encoder*,
1956
+ const char* parameter_name,
1957
+ const char* value);
1958
+
1959
+ // Get the current value of a parameter of any type as a human readable string.
1960
+ // The returned string is compatible with heif_encoder_set_parameter().
1961
+ LIBHEIF_API
1962
+ struct heif_error heif_encoder_get_parameter(struct heif_encoder*,
1963
+ const char* parameter_name,
1964
+ char* value_ptr, int value_size);
1965
+
1966
+ // Query whether a specific parameter has a default value.
1967
+ LIBHEIF_API
1968
+ int heif_encoder_has_default(struct heif_encoder*,
1969
+ const char* parameter_name);
1970
+
1971
+
1972
+ // The orientation values are defined equal to the EXIF Orientation tag.
1973
+ enum heif_orientation
1974
+ {
1975
+ heif_orientation_normal = 1,
1976
+ heif_orientation_flip_horizontally = 2,
1977
+ heif_orientation_rotate_180 = 3,
1978
+ heif_orientation_flip_vertically = 4,
1979
+ heif_orientation_rotate_90_cw_then_flip_horizontally = 5,
1980
+ heif_orientation_rotate_90_cw = 6,
1981
+ heif_orientation_rotate_90_cw_then_flip_vertically = 7,
1982
+ heif_orientation_rotate_270_cw = 8
1983
+ };
1984
+
1985
+
1986
+ struct heif_encoding_options
1987
+ {
1988
+ uint8_t version;
1989
+
1990
+ // version 1 options
1991
+
1992
+ uint8_t save_alpha_channel; // default: true
1993
+
1994
+ // version 2 options
1995
+
1996
+ // DEPRECATED. This option is not required anymore. Its value will be ignored.
1997
+ uint8_t macOS_compatibility_workaround;
1998
+
1999
+ // version 3 options
2000
+
2001
+ uint8_t save_two_colr_boxes_when_ICC_and_nclx_available; // default: false
2002
+
2003
+ // version 4 options
2004
+
2005
+ // Set this to the NCLX parameters to be used in the output image or set to NULL
2006
+ // when the same parameters as in the input image should be used.
2007
+ struct heif_color_profile_nclx* output_nclx_profile;
2008
+
2009
+ uint8_t macOS_compatibility_workaround_no_nclx_profile;
2010
+
2011
+ // version 5 options
2012
+
2013
+ // libheif will generate irot/imir boxes to match these orientations
2014
+ enum heif_orientation image_orientation;
2015
+
2016
+ // version 6 options
2017
+
2018
+ struct heif_color_conversion_options color_conversion_options;
2019
+ };
2020
+
2021
+ LIBHEIF_API
2022
+ struct heif_encoding_options* heif_encoding_options_alloc(void);
2023
+
2024
+ LIBHEIF_API
2025
+ void heif_encoding_options_free(struct heif_encoding_options*);
2026
+
2027
+
2028
+ // Compress the input image.
2029
+ // Returns a handle to the coded image in 'out_image_handle' unless out_image_handle = NULL.
2030
+ // 'options' should be NULL for now.
2031
+ // The first image added to the context is also automatically set the primary image, but
2032
+ // you can change the primary image later with heif_context_set_primary_image().
2033
+ LIBHEIF_API
2034
+ struct heif_error heif_context_encode_image(struct heif_context*,
2035
+ const struct heif_image* image,
2036
+ struct heif_encoder* encoder,
2037
+ const struct heif_encoding_options* options,
2038
+ struct heif_image_handle** out_image_handle);
2039
+
2040
+ LIBHEIF_API
2041
+ struct heif_error heif_context_set_primary_image(struct heif_context*,
2042
+ struct heif_image_handle* image_handle);
2043
+
2044
+ // Encode the 'image' as a scaled down thumbnail image.
2045
+ // The image is scaled down to fit into a square area of width 'bbox_size'.
2046
+ // If the input image is already so small that it fits into this bounding box, no thumbnail
2047
+ // image is encoded and NULL is returned in 'out_thumb_image_handle'.
2048
+ // No error is returned in this case.
2049
+ // The encoded thumbnail is automatically assigned to the 'master_image_handle'. Hence, you
2050
+ // do not have to call heif_context_assign_thumbnail().
2051
+ LIBHEIF_API
2052
+ struct heif_error heif_context_encode_thumbnail(struct heif_context*,
2053
+ const struct heif_image* image,
2054
+ const struct heif_image_handle* master_image_handle,
2055
+ struct heif_encoder* encoder,
2056
+ const struct heif_encoding_options* options,
2057
+ int bbox_size,
2058
+ struct heif_image_handle** out_thumb_image_handle);
2059
+
2060
+ enum heif_metadata_compression
2061
+ {
2062
+ heif_metadata_compression_off,
2063
+ heif_metadata_compression_auto,
2064
+ heif_metadata_compression_deflate
2065
+ };
2066
+
2067
+ // Assign 'thumbnail_image' as the thumbnail image of 'master_image'.
2068
+ LIBHEIF_API
2069
+ struct heif_error heif_context_assign_thumbnail(struct heif_context*,
2070
+ const struct heif_image_handle* master_image,
2071
+ const struct heif_image_handle* thumbnail_image);
2072
+
2073
+ // Add EXIF metadata to an image.
2074
+ LIBHEIF_API
2075
+ struct heif_error heif_context_add_exif_metadata(struct heif_context*,
2076
+ const struct heif_image_handle* image_handle,
2077
+ const void* data, int size);
2078
+
2079
+ // Add XMP metadata to an image.
2080
+ LIBHEIF_API
2081
+ struct heif_error heif_context_add_XMP_metadata(struct heif_context*,
2082
+ const struct heif_image_handle* image_handle,
2083
+ const void* data, int size);
2084
+
2085
+ // New version of heif_context_add_XMP_metadata() with data compression (experimental).
2086
+ LIBHEIF_API
2087
+ struct heif_error heif_context_add_XMP_metadata2(struct heif_context*,
2088
+ const struct heif_image_handle* image_handle,
2089
+ const void* data, int size,
2090
+ enum heif_metadata_compression compression);
2091
+
2092
+ // Add generic, proprietary metadata to an image. You have to specify an 'item_type' that will
2093
+ // identify your metadata. 'content_type' can be an additional type, or it can be NULL.
2094
+ // For example, this function can be used to add IPTC metadata (IIM stream, not XMP) to an image.
2095
+ // Although not standard, we propose to store IPTC data with item type="iptc", content_type=NULL.
2096
+ LIBHEIF_API
2097
+ struct heif_error heif_context_add_generic_metadata(struct heif_context* ctx,
2098
+ const struct heif_image_handle* image_handle,
2099
+ const void* data, int size,
2100
+ const char* item_type, const char* content_type);
2101
+
2102
+ // --- heif_image allocation
2103
+
2104
+ // Create a new image of the specified resolution and colorspace.
2105
+ // Note: no memory for the actual image data is reserved yet. You have to use
2106
+ // heif_image_add_plane() to add the image planes required by your colorspace/chroma.
2107
+ LIBHEIF_API
2108
+ struct heif_error heif_image_create(int width, int height,
2109
+ enum heif_colorspace colorspace,
2110
+ enum heif_chroma chroma,
2111
+ struct heif_image** out_image);
2112
+
2113
+ // The indicated bit_depth corresponds to the bit depth per channel.
2114
+ // I.e. for interleaved formats like RRGGBB, the bit_depth would be, e.g., 10 bit instead
2115
+ // of 30 bits or 3*16=48 bits.
2116
+ // For backward compatibility, one can also specify 24bits for RGB and 32bits for RGBA,
2117
+ // instead of the preferred 8 bits.
2118
+ LIBHEIF_API
2119
+ struct heif_error heif_image_add_plane(struct heif_image* image,
2120
+ enum heif_channel channel,
2121
+ int width, int height, int bit_depth);
2122
+
2123
+ // Signal that the image is premultiplied by the alpha pixel values.
2124
+ LIBHEIF_API
2125
+ void heif_image_set_premultiplied_alpha(struct heif_image* image,
2126
+ int is_premultiplied_alpha);
2127
+
2128
+ LIBHEIF_API
2129
+ int heif_image_is_premultiplied_alpha(struct heif_image* image);
2130
+
2131
+ // This function extends the padding of the image so that it has at least the given physical size.
2132
+ // The padding border is filled with the pixels along the right/bottom border.
2133
+ // This function may be useful if you want to process the image, but have some external padding requirements.
2134
+ // The image size will not be modified if it is already larger/equal than the given physical size.
2135
+ // I.e. you cannot assume that after calling this function, the stride will be equal to min_physical_width.
2136
+ LIBHEIF_API
2137
+ struct heif_error heif_image_extend_padding_to_size(struct heif_image* image, int min_physical_width, int min_physical_height);
2138
+
2139
+
2140
+
2141
+ // --- register plugins
2142
+
2143
+ struct heif_decoder_plugin;
2144
+ struct heif_encoder_plugin;
2145
+
2146
+ // DEPRECATED. Use heif_register_decoder_plugin(const struct heif_decoder_plugin*) instead.
2147
+ LIBHEIF_API
2148
+ struct heif_error heif_register_decoder(struct heif_context* heif, const struct heif_decoder_plugin*);
2149
+
2150
+ LIBHEIF_API
2151
+ struct heif_error heif_register_decoder_plugin(const struct heif_decoder_plugin*);
2152
+
2153
+ LIBHEIF_API
2154
+ struct heif_error heif_register_encoder_plugin(const struct heif_encoder_plugin*);
2155
+
2156
+ // DEPRECATED, typo in function name
2157
+ LIBHEIF_API
2158
+ int heif_encoder_descriptor_supportes_lossy_compression(const struct heif_encoder_descriptor*);
2159
+
2160
+ // DEPRECATED, typo in function name
2161
+ LIBHEIF_API
2162
+ int heif_encoder_descriptor_supportes_lossless_compression(const struct heif_encoder_descriptor*);
2163
+
2164
+
2165
+ #ifdef __cplusplus
2166
+ }
2167
+ #endif
2168
+
2169
+ #endif