@img/sharp-libvips-dev 0.0.1
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.
- package/README.md +47 -0
- package/cplusplus/VConnection.cpp +151 -0
- package/cplusplus/VError.cpp +49 -0
- package/cplusplus/VImage.cpp +1548 -0
- package/cplusplus/VInterpolate.cpp +62 -0
- package/cplusplus/VRegion.cpp +27 -0
- package/cplusplus/index.js +1 -0
- package/cplusplus/vips-operators.cpp +3760 -0
- package/include/aom/aom.h +127 -0
- package/include/aom/aom_codec.h +573 -0
- package/include/aom/aom_decoder.h +257 -0
- package/include/aom/aom_encoder.h +1137 -0
- package/include/aom/aom_external_partition.h +452 -0
- package/include/aom/aom_frame_buffer.h +84 -0
- package/include/aom/aom_image.h +448 -0
- package/include/aom/aom_integer.h +68 -0
- package/include/aom/aomcx.h +2112 -0
- package/include/aom/aomdx.h +604 -0
- package/include/archive.h +1212 -0
- package/include/archive_entry.h +723 -0
- package/include/cairo/cairo-deprecated.h +123 -0
- package/include/cairo/cairo-features.h +29 -0
- package/include/cairo/cairo-ft.h +118 -0
- package/include/cairo/cairo-gobject.h +192 -0
- package/include/cairo/cairo-svg.h +130 -0
- package/include/cairo/cairo-version.h +8 -0
- package/include/cairo/cairo.h +3281 -0
- package/include/cgif.h +80 -0
- package/include/expat.h +1064 -0
- package/include/expat_config.h +140 -0
- package/include/expat_external.h +165 -0
- package/include/ffi.h +531 -0
- package/include/ffitarget.h +164 -0
- package/include/fontconfig/fcfreetype.h +59 -0
- package/include/fontconfig/fcprivate.h +134 -0
- package/include/fontconfig/fontconfig.h +1158 -0
- package/include/freetype2/freetype/config/ftconfig.h +51 -0
- package/include/freetype2/freetype/config/ftheader.h +836 -0
- package/include/freetype2/freetype/config/ftmodule.h +21 -0
- package/include/freetype2/freetype/config/ftoption.h +1014 -0
- package/include/freetype2/freetype/config/ftstdlib.h +185 -0
- package/include/freetype2/freetype/config/integer-types.h +250 -0
- package/include/freetype2/freetype/config/mac-support.h +49 -0
- package/include/freetype2/freetype/config/public-macros.h +138 -0
- package/include/freetype2/freetype/freetype.h +5337 -0
- package/include/freetype2/freetype/ftadvanc.h +188 -0
- package/include/freetype2/freetype/ftbbox.h +101 -0
- package/include/freetype2/freetype/ftbdf.h +212 -0
- package/include/freetype2/freetype/ftbitmap.h +329 -0
- package/include/freetype2/freetype/ftbzip2.h +102 -0
- package/include/freetype2/freetype/ftcache.h +1087 -0
- package/include/freetype2/freetype/ftchapters.h +168 -0
- package/include/freetype2/freetype/ftcid.h +167 -0
- package/include/freetype2/freetype/ftcolor.h +1667 -0
- package/include/freetype2/freetype/ftdriver.h +1246 -0
- package/include/freetype2/freetype/fterrdef.h +283 -0
- package/include/freetype2/freetype/fterrors.h +296 -0
- package/include/freetype2/freetype/ftfntfmt.h +93 -0
- package/include/freetype2/freetype/ftgasp.h +143 -0
- package/include/freetype2/freetype/ftglyph.h +750 -0
- package/include/freetype2/freetype/ftgxval.h +354 -0
- package/include/freetype2/freetype/ftgzip.h +151 -0
- package/include/freetype2/freetype/ftimage.h +1284 -0
- package/include/freetype2/freetype/ftincrem.h +348 -0
- package/include/freetype2/freetype/ftlcdfil.h +323 -0
- package/include/freetype2/freetype/ftlist.h +296 -0
- package/include/freetype2/freetype/ftlzw.h +100 -0
- package/include/freetype2/freetype/ftmac.h +289 -0
- package/include/freetype2/freetype/ftmm.h +805 -0
- package/include/freetype2/freetype/ftmodapi.h +807 -0
- package/include/freetype2/freetype/ftmoderr.h +204 -0
- package/include/freetype2/freetype/ftotval.h +206 -0
- package/include/freetype2/freetype/ftoutln.h +588 -0
- package/include/freetype2/freetype/ftparams.h +218 -0
- package/include/freetype2/freetype/ftpfr.h +179 -0
- package/include/freetype2/freetype/ftrender.h +244 -0
- package/include/freetype2/freetype/ftsizes.h +159 -0
- package/include/freetype2/freetype/ftsnames.h +272 -0
- package/include/freetype2/freetype/ftstroke.h +773 -0
- package/include/freetype2/freetype/ftsynth.h +104 -0
- package/include/freetype2/freetype/ftsystem.h +350 -0
- package/include/freetype2/freetype/fttrigon.h +350 -0
- package/include/freetype2/freetype/fttypes.h +617 -0
- package/include/freetype2/freetype/ftwinfnt.h +276 -0
- package/include/freetype2/freetype/otsvg.h +336 -0
- package/include/freetype2/freetype/t1tables.h +793 -0
- package/include/freetype2/freetype/ttnameid.h +1235 -0
- package/include/freetype2/freetype/tttables.h +855 -0
- package/include/freetype2/freetype/tttags.h +124 -0
- package/include/freetype2/ft2build.h +42 -0
- package/include/fribidi/fribidi-arabic.h +81 -0
- package/include/fribidi/fribidi-begindecls.h +3 -0
- package/include/fribidi/fribidi-bidi-types-list.h +96 -0
- package/include/fribidi/fribidi-bidi-types.h +405 -0
- package/include/fribidi/fribidi-bidi.h +142 -0
- package/include/fribidi/fribidi-brackets.h +89 -0
- package/include/fribidi/fribidi-char-sets-list.h +54 -0
- package/include/fribidi/fribidi-char-sets.h +106 -0
- package/include/fribidi/fribidi-common.h +152 -0
- package/include/fribidi/fribidi-config.h +23 -0
- package/include/fribidi/fribidi-deprecated.h +175 -0
- package/include/fribidi/fribidi-enddecls.h +3 -0
- package/include/fribidi/fribidi-flags.h +72 -0
- package/include/fribidi/fribidi-joining-types-list.h +44 -0
- package/include/fribidi/fribidi-joining-types.h +249 -0
- package/include/fribidi/fribidi-joining.h +74 -0
- package/include/fribidi/fribidi-mirroring.h +86 -0
- package/include/fribidi/fribidi-shape.h +71 -0
- package/include/fribidi/fribidi-types.h +79 -0
- package/include/fribidi/fribidi-unicode-version.h +10 -0
- package/include/fribidi/fribidi-unicode.h +105 -0
- package/include/fribidi/fribidi.h +129 -0
- package/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf-animation.h +221 -0
- package/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf-autocleanups.h +37 -0
- package/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf-core.h +525 -0
- package/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf-enum-types.h +40 -0
- package/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf-features.h +115 -0
- package/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf-io.h +481 -0
- package/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf-loader.h +113 -0
- package/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf-macros.h +718 -0
- package/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf-marshal.h +33 -0
- package/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf-simple-anim.h +70 -0
- package/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf-transform.h +168 -0
- package/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf.h +46 -0
- package/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixdata.h +165 -0
- package/include/gio-unix-2.0/gio/gdesktopappinfo.h +200 -0
- package/include/gio-unix-2.0/gio/gfiledescriptorbased.h +67 -0
- package/include/gio-unix-2.0/gio/gunixfdmessage.h +86 -0
- package/include/gio-unix-2.0/gio/gunixinputstream.h +85 -0
- package/include/gio-unix-2.0/gio/gunixmounts.h +172 -0
- package/include/gio-unix-2.0/gio/gunixoutputstream.h +84 -0
- package/include/glib-2.0/gio/gaction.h +100 -0
- package/include/glib-2.0/gio/gactiongroup.h +163 -0
- package/include/glib-2.0/gio/gactiongroupexporter.h +47 -0
- package/include/glib-2.0/gio/gactionmap.h +101 -0
- package/include/glib-2.0/gio/gappinfo.h +369 -0
- package/include/glib-2.0/gio/gapplication.h +257 -0
- package/include/glib-2.0/gio/gapplicationcommandline.h +124 -0
- package/include/glib-2.0/gio/gasyncinitable.h +132 -0
- package/include/glib-2.0/gio/gasyncresult.h +87 -0
- package/include/glib-2.0/gio/gbufferedinputstream.h +135 -0
- package/include/glib-2.0/gio/gbufferedoutputstream.h +88 -0
- package/include/glib-2.0/gio/gbytesicon.h +54 -0
- package/include/glib-2.0/gio/gcancellable.h +120 -0
- package/include/glib-2.0/gio/gcharsetconverter.h +65 -0
- package/include/glib-2.0/gio/gcontenttype.h +84 -0
- package/include/glib-2.0/gio/gconverter.h +98 -0
- package/include/glib-2.0/gio/gconverterinputstream.h +82 -0
- package/include/glib-2.0/gio/gconverteroutputstream.h +82 -0
- package/include/glib-2.0/gio/gcredentials.h +87 -0
- package/include/glib-2.0/gio/gdatagrambased.h +146 -0
- package/include/glib-2.0/gio/gdatainputstream.h +182 -0
- package/include/glib-2.0/gio/gdataoutputstream.h +127 -0
- package/include/glib-2.0/gio/gdbusactiongroup.h +56 -0
- package/include/glib-2.0/gio/gdbusaddress.h +67 -0
- package/include/glib-2.0/gio/gdbusauthobserver.h +53 -0
- package/include/glib-2.0/gio/gdbusconnection.h +691 -0
- package/include/glib-2.0/gio/gdbuserror.h +111 -0
- package/include/glib-2.0/gio/gdbusinterface.h +83 -0
- package/include/glib-2.0/gio/gdbusinterfaceskeleton.h +129 -0
- package/include/glib-2.0/gio/gdbusintrospection.h +327 -0
- package/include/glib-2.0/gio/gdbusmenumodel.h +47 -0
- package/include/glib-2.0/gio/gdbusmessage.h +204 -0
- package/include/glib-2.0/gio/gdbusmethodinvocation.h +136 -0
- package/include/glib-2.0/gio/gdbusnameowning.h +117 -0
- package/include/glib-2.0/gio/gdbusnamewatching.h +104 -0
- package/include/glib-2.0/gio/gdbusobject.h +80 -0
- package/include/glib-2.0/gio/gdbusobjectmanager.h +96 -0
- package/include/glib-2.0/gio/gdbusobjectmanagerclient.h +148 -0
- package/include/glib-2.0/gio/gdbusobjectmanagerserver.h +95 -0
- package/include/glib-2.0/gio/gdbusobjectproxy.h +81 -0
- package/include/glib-2.0/gio/gdbusobjectskeleton.h +98 -0
- package/include/glib-2.0/gio/gdbusproxy.h +220 -0
- package/include/glib-2.0/gio/gdbusserver.h +62 -0
- package/include/glib-2.0/gio/gdbusutils.h +65 -0
- package/include/glib-2.0/gio/gdebugcontroller.h +81 -0
- package/include/glib-2.0/gio/gdebugcontrollerdbus.h +71 -0
- package/include/glib-2.0/gio/gdrive.h +274 -0
- package/include/glib-2.0/gio/gdtlsclientconnection.h +77 -0
- package/include/glib-2.0/gio/gdtlsconnection.h +230 -0
- package/include/glib-2.0/gio/gdtlsserverconnection.h +71 -0
- package/include/glib-2.0/gio/gemblem.h +63 -0
- package/include/glib-2.0/gio/gemblemedicon.h +83 -0
- package/include/glib-2.0/gio/gfile.h +1359 -0
- package/include/glib-2.0/gio/gfileattribute.h +86 -0
- package/include/glib-2.0/gio/gfileenumerator.h +154 -0
- package/include/glib-2.0/gio/gfileicon.h +59 -0
- package/include/glib-2.0/gio/gfileinfo.h +1546 -0
- package/include/glib-2.0/gio/gfileinputstream.h +116 -0
- package/include/glib-2.0/gio/gfileiostream.h +123 -0
- package/include/glib-2.0/gio/gfilemonitor.h +100 -0
- package/include/glib-2.0/gio/gfilenamecompleter.h +81 -0
- package/include/glib-2.0/gio/gfileoutputstream.h +124 -0
- package/include/glib-2.0/gio/gfilterinputstream.h +80 -0
- package/include/glib-2.0/gio/gfilteroutputstream.h +80 -0
- package/include/glib-2.0/gio/gicon.h +133 -0
- package/include/glib-2.0/gio/ginetaddress.h +125 -0
- package/include/glib-2.0/gio/ginetaddressmask.h +86 -0
- package/include/glib-2.0/gio/ginetsocketaddress.h +80 -0
- package/include/glib-2.0/gio/ginitable.h +107 -0
- package/include/glib-2.0/gio/ginputstream.h +218 -0
- package/include/glib-2.0/gio/gio-autocleanups.h +155 -0
- package/include/glib-2.0/gio/gio-visibility.h +952 -0
- package/include/glib-2.0/gio/gio.h +186 -0
- package/include/glib-2.0/gio/gioenums.h +2149 -0
- package/include/glib-2.0/gio/gioenumtypes.h +207 -0
- package/include/glib-2.0/gio/gioerror.h +58 -0
- package/include/glib-2.0/gio/giomodule.h +199 -0
- package/include/glib-2.0/gio/gioscheduler.h +56 -0
- package/include/glib-2.0/gio/giostream.h +137 -0
- package/include/glib-2.0/gio/giotypes.h +660 -0
- package/include/glib-2.0/gio/glistmodel.h +74 -0
- package/include/glib-2.0/gio/gliststore.h +97 -0
- package/include/glib-2.0/gio/gloadableicon.h +101 -0
- package/include/glib-2.0/gio/gmemoryinputstream.h +92 -0
- package/include/glib-2.0/gio/gmemorymonitor.h +64 -0
- package/include/glib-2.0/gio/gmemoryoutputstream.h +109 -0
- package/include/glib-2.0/gio/gmenu.h +184 -0
- package/include/glib-2.0/gio/gmenuexporter.h +55 -0
- package/include/glib-2.0/gio/gmenumodel.h +307 -0
- package/include/glib-2.0/gio/gmount.h +278 -0
- package/include/glib-2.0/gio/gmountoperation.h +179 -0
- package/include/glib-2.0/gio/gnativesocketaddress.h +67 -0
- package/include/glib-2.0/gio/gnativevolumemonitor.h +63 -0
- package/include/glib-2.0/gio/gnetworkaddress.h +82 -0
- package/include/glib-2.0/gio/gnetworking.h +81 -0
- package/include/glib-2.0/gio/gnetworkmonitor.h +101 -0
- package/include/glib-2.0/gio/gnetworkservice.h +77 -0
- package/include/glib-2.0/gio/gnotification.h +103 -0
- package/include/glib-2.0/gio/goutputstream.h +334 -0
- package/include/glib-2.0/gio/gpermission.h +129 -0
- package/include/glib-2.0/gio/gpollableinputstream.h +106 -0
- package/include/glib-2.0/gio/gpollableoutputstream.h +127 -0
- package/include/glib-2.0/gio/gpollableutils.h +66 -0
- package/include/glib-2.0/gio/gpowerprofilemonitor.h +65 -0
- package/include/glib-2.0/gio/gpropertyaction.h +49 -0
- package/include/glib-2.0/gio/gproxy.h +130 -0
- package/include/glib-2.0/gio/gproxyaddress.h +88 -0
- package/include/glib-2.0/gio/gproxyaddressenumerator.h +83 -0
- package/include/glib-2.0/gio/gproxyresolver.h +97 -0
- package/include/glib-2.0/gio/gremoteactiongroup.h +77 -0
- package/include/glib-2.0/gio/gresolver.h +299 -0
- package/include/glib-2.0/gio/gresource.h +132 -0
- package/include/glib-2.0/gio/gseekable.h +105 -0
- package/include/glib-2.0/gio/gsettings.h +347 -0
- package/include/glib-2.0/gio/gsettingsbackend.h +176 -0
- package/include/glib-2.0/gio/gsettingsschema.h +115 -0
- package/include/glib-2.0/gio/gsimpleaction.h +65 -0
- package/include/glib-2.0/gio/gsimpleactiongroup.h +99 -0
- package/include/glib-2.0/gio/gsimpleasyncresult.h +164 -0
- package/include/glib-2.0/gio/gsimpleiostream.h +47 -0
- package/include/glib-2.0/gio/gsimplepermission.h +47 -0
- package/include/glib-2.0/gio/gsimpleproxyresolver.h +91 -0
- package/include/glib-2.0/gio/gsocket.h +330 -0
- package/include/glib-2.0/gio/gsocketaddress.h +84 -0
- package/include/glib-2.0/gio/gsocketaddressenumerator.h +103 -0
- package/include/glib-2.0/gio/gsocketclient.h +199 -0
- package/include/glib-2.0/gio/gsocketconnectable.h +83 -0
- package/include/glib-2.0/gio/gsocketconnection.h +117 -0
- package/include/glib-2.0/gio/gsocketcontrolmessage.h +113 -0
- package/include/glib-2.0/gio/gsocketlistener.h +157 -0
- package/include/glib-2.0/gio/gsocketservice.h +95 -0
- package/include/glib-2.0/gio/gsrvtarget.h +60 -0
- package/include/glib-2.0/gio/gsubprocess.h +169 -0
- package/include/glib-2.0/gio/gsubprocesslauncher.h +121 -0
- package/include/glib-2.0/gio/gtask.h +207 -0
- package/include/glib-2.0/gio/gtcpconnection.h +71 -0
- package/include/glib-2.0/gio/gtcpwrapperconnection.h +71 -0
- package/include/glib-2.0/gio/gtestdbus.h +74 -0
- package/include/glib-2.0/gio/gthemedicon.h +70 -0
- package/include/glib-2.0/gio/gthreadedsocketservice.h +83 -0
- package/include/glib-2.0/gio/gtlsbackend.h +115 -0
- package/include/glib-2.0/gio/gtlscertificate.h +125 -0
- package/include/glib-2.0/gio/gtlsclientconnection.h +88 -0
- package/include/glib-2.0/gio/gtlsconnection.h +214 -0
- package/include/glib-2.0/gio/gtlsdatabase.h +249 -0
- package/include/glib-2.0/gio/gtlsfiledatabase.h +60 -0
- package/include/glib-2.0/gio/gtlsinteraction.h +150 -0
- package/include/glib-2.0/gio/gtlspassword.h +121 -0
- package/include/glib-2.0/gio/gtlsserverconnection.h +71 -0
- package/include/glib-2.0/gio/gunixconnection.h +102 -0
- package/include/glib-2.0/gio/gunixcredentialsmessage.h +89 -0
- package/include/glib-2.0/gio/gunixfdlist.h +97 -0
- package/include/glib-2.0/gio/gunixsocketaddress.h +83 -0
- package/include/glib-2.0/gio/gvfs.h +170 -0
- package/include/glib-2.0/gio/gvolume.h +255 -0
- package/include/glib-2.0/gio/gvolumemonitor.h +156 -0
- package/include/glib-2.0/gio/gzlibcompressor.h +64 -0
- package/include/glib-2.0/gio/gzlibdecompressor.h +60 -0
- package/include/glib-2.0/glib/deprecated/gallocator.h +88 -0
- package/include/glib-2.0/glib/deprecated/gcache.h +77 -0
- package/include/glib-2.0/glib/deprecated/gcompletion.h +85 -0
- package/include/glib-2.0/glib/deprecated/gmain.h +137 -0
- package/include/glib-2.0/glib/deprecated/grel.h +107 -0
- package/include/glib-2.0/glib/deprecated/gthread.h +295 -0
- package/include/glib-2.0/glib/galloca.h +147 -0
- package/include/glib-2.0/glib/garray.h +323 -0
- package/include/glib-2.0/glib/gasyncqueue.h +126 -0
- package/include/glib-2.0/glib/gatomic.h +587 -0
- package/include/glib-2.0/glib/gbacktrace.h +74 -0
- package/include/glib-2.0/glib/gbase64.h +63 -0
- package/include/glib-2.0/glib/gbitlock.h +78 -0
- package/include/glib-2.0/glib/gbookmarkfile.h +300 -0
- package/include/glib-2.0/glib/gbytes.h +99 -0
- package/include/glib-2.0/glib/gcharset.h +49 -0
- package/include/glib-2.0/glib/gchecksum.h +106 -0
- package/include/glib-2.0/glib/gconvert.h +179 -0
- package/include/glib-2.0/glib/gdataset.h +156 -0
- package/include/glib-2.0/glib/gdate.h +309 -0
- package/include/glib-2.0/glib/gdatetime.h +275 -0
- package/include/glib-2.0/glib/gdir.h +54 -0
- package/include/glib-2.0/glib/genviron.h +65 -0
- package/include/glib-2.0/glib/gerror.h +263 -0
- package/include/glib-2.0/glib/gfileutils.h +223 -0
- package/include/glib-2.0/glib/ggettext.h +65 -0
- package/include/glib-2.0/glib/ghash.h +206 -0
- package/include/glib-2.0/glib/ghmac.h +85 -0
- package/include/glib-2.0/glib/ghook.h +204 -0
- package/include/glib-2.0/glib/ghostutils.h +45 -0
- package/include/glib-2.0/glib/gi18n-lib.h +38 -0
- package/include/glib-2.0/glib/gi18n.h +34 -0
- package/include/glib-2.0/glib/giochannel.h +407 -0
- package/include/glib-2.0/glib/gkeyfile.h +332 -0
- package/include/glib-2.0/glib/glib-autocleanups.h +105 -0
- package/include/glib-2.0/glib/glib-typeof.h +47 -0
- package/include/glib-2.0/glib/glib-visibility.h +952 -0
- package/include/glib-2.0/glib/glist.h +179 -0
- package/include/glib-2.0/glib/gmacros.h +1425 -0
- package/include/glib-2.0/glib/gmain.h +862 -0
- package/include/glib-2.0/glib/gmappedfile.h +60 -0
- package/include/glib-2.0/glib/gmarkup.h +265 -0
- package/include/glib-2.0/glib/gmem.h +425 -0
- package/include/glib-2.0/glib/gmessages.h +690 -0
- package/include/glib-2.0/glib/gnode.h +309 -0
- package/include/glib-2.0/glib/goption.h +409 -0
- package/include/glib-2.0/glib/gpathbuf.h +90 -0
- package/include/glib-2.0/glib/gpattern.h +65 -0
- package/include/glib-2.0/glib/gpoll.h +122 -0
- package/include/glib-2.0/glib/gprimes.h +52 -0
- package/include/glib-2.0/glib/gprintf.h +59 -0
- package/include/glib-2.0/glib/gqsort.h +47 -0
- package/include/glib-2.0/glib/gquark.h +70 -0
- package/include/glib-2.0/glib/gqueue.h +205 -0
- package/include/glib-2.0/glib/grand.h +101 -0
- package/include/glib-2.0/glib/grcbox.h +91 -0
- package/include/glib-2.0/glib/grefcount.h +179 -0
- package/include/glib-2.0/glib/grefstring.h +59 -0
- package/include/glib-2.0/glib/gscanner.h +301 -0
- package/include/glib-2.0/glib/gsequence.h +175 -0
- package/include/glib-2.0/glib/gshell.h +59 -0
- package/include/glib-2.0/glib/gslice.h +117 -0
- package/include/glib-2.0/glib/gslist.h +166 -0
- package/include/glib-2.0/glib/gspawn.h +323 -0
- package/include/glib-2.0/glib/gstdio.h +231 -0
- package/include/glib-2.0/glib/gstrfuncs.h +504 -0
- package/include/glib-2.0/glib/gstring.h +296 -0
- package/include/glib-2.0/glib/gstringchunk.h +59 -0
- package/include/glib-2.0/glib/gstrvbuilder.h +69 -0
- package/include/glib-2.0/glib/gtestutils.h +763 -0
- package/include/glib-2.0/glib/gthread.h +603 -0
- package/include/glib-2.0/glib/gthreadpool.h +105 -0
- package/include/glib-2.0/glib/gtimer.h +80 -0
- package/include/glib-2.0/glib/gtimezone.h +98 -0
- package/include/glib-2.0/glib/gtrashstack.h +60 -0
- package/include/glib-2.0/glib/gtree.h +181 -0
- package/include/glib-2.0/glib/gtypes.h +591 -0
- package/include/glib-2.0/glib/gunicode.h +974 -0
- package/include/glib-2.0/glib/guri.h +420 -0
- package/include/glib-2.0/glib/gutils.h +479 -0
- package/include/glib-2.0/glib/guuid.h +42 -0
- package/include/glib-2.0/glib/gvariant.h +541 -0
- package/include/glib-2.0/glib/gvarianttype.h +384 -0
- package/include/glib-2.0/glib/gversion.h +57 -0
- package/include/glib-2.0/glib/gversionmacros.h +490 -0
- package/include/glib-2.0/glib/gwin32.h +142 -0
- package/include/glib-2.0/glib-object.h +46 -0
- package/include/glib-2.0/glib-unix.h +125 -0
- package/include/glib-2.0/glib.h +121 -0
- package/include/glib-2.0/gmodule/gmodule-visibility.h +952 -0
- package/include/glib-2.0/gmodule.h +147 -0
- package/include/glib-2.0/gobject/gbinding.h +156 -0
- package/include/glib-2.0/gobject/gbindinggroup.h +85 -0
- package/include/glib-2.0/gobject/gboxed.h +124 -0
- package/include/glib-2.0/gobject/gclosure.h +323 -0
- package/include/glib-2.0/gobject/genums.h +381 -0
- package/include/glib-2.0/gobject/glib-enumtypes.h +25 -0
- package/include/glib-2.0/gobject/glib-types.h +400 -0
- package/include/glib-2.0/gobject/gmarshal.h +434 -0
- package/include/glib-2.0/gobject/gobject-autocleanups.h +33 -0
- package/include/glib-2.0/gobject/gobject-visibility.h +952 -0
- package/include/glib-2.0/gobject/gobject.h +953 -0
- package/include/glib-2.0/gobject/gobjectnotifyqueue.c +199 -0
- package/include/glib-2.0/gobject/gparam.h +476 -0
- package/include/glib-2.0/gobject/gparamspecs.h +1151 -0
- package/include/glib-2.0/gobject/gsignal.h +647 -0
- package/include/glib-2.0/gobject/gsignalgroup.h +98 -0
- package/include/glib-2.0/gobject/gsourceclosure.h +40 -0
- package/include/glib-2.0/gobject/gtype.h +2703 -0
- package/include/glib-2.0/gobject/gtypemodule.h +302 -0
- package/include/glib-2.0/gobject/gtypeplugin.h +136 -0
- package/include/glib-2.0/gobject/gvalue.h +212 -0
- package/include/glib-2.0/gobject/gvaluearray.h +106 -0
- package/include/glib-2.0/gobject/gvaluecollector.h +290 -0
- package/include/glib-2.0/gobject/gvaluetypes.h +318 -0
- package/include/harfbuzz/hb-aat-layout.h +795 -0
- package/include/harfbuzz/hb-aat.h +38 -0
- package/include/harfbuzz/hb-blob.h +160 -0
- package/include/harfbuzz/hb-buffer.h +799 -0
- package/include/harfbuzz/hb-common.h +938 -0
- package/include/harfbuzz/hb-cplusplus.hh +223 -0
- package/include/harfbuzz/hb-deprecated.h +309 -0
- package/include/harfbuzz/hb-draw.h +340 -0
- package/include/harfbuzz/hb-face.h +187 -0
- package/include/harfbuzz/hb-features.h +119 -0
- package/include/harfbuzz/hb-font.h +1153 -0
- package/include/harfbuzz/hb-ft.h +145 -0
- package/include/harfbuzz/hb-glib.h +56 -0
- package/include/harfbuzz/hb-map.h +143 -0
- package/include/harfbuzz/hb-ot-color.h +155 -0
- package/include/harfbuzz/hb-ot-deprecated.h +147 -0
- package/include/harfbuzz/hb-ot-font.h +45 -0
- package/include/harfbuzz/hb-ot-layout.h +549 -0
- package/include/harfbuzz/hb-ot-math.h +333 -0
- package/include/harfbuzz/hb-ot-meta.h +72 -0
- package/include/harfbuzz/hb-ot-metrics.h +129 -0
- package/include/harfbuzz/hb-ot-name.h +164 -0
- package/include/harfbuzz/hb-ot-shape.h +53 -0
- package/include/harfbuzz/hb-ot-var.h +191 -0
- package/include/harfbuzz/hb-ot.h +49 -0
- package/include/harfbuzz/hb-paint.h +1029 -0
- package/include/harfbuzz/hb-set.h +203 -0
- package/include/harfbuzz/hb-shape-plan.h +122 -0
- package/include/harfbuzz/hb-shape.h +74 -0
- package/include/harfbuzz/hb-style.h +81 -0
- package/include/harfbuzz/hb-subset-repacker.h +81 -0
- package/include/harfbuzz/hb-subset.h +241 -0
- package/include/harfbuzz/hb-unicode.h +643 -0
- package/include/harfbuzz/hb-version.h +95 -0
- package/include/harfbuzz/hb.h +51 -0
- package/include/index.js +1 -0
- package/include/jconfig.h +37 -0
- package/include/jerror.h +335 -0
- package/include/jmorecfg.h +382 -0
- package/include/jpeglib.h +1210 -0
- package/include/lcms2.h +1958 -0
- package/include/lcms2_plugin.h +700 -0
- package/include/libexif/_stdint.h +2 -0
- package/include/libexif/exif-byte-order.h +48 -0
- package/include/libexif/exif-content.h +181 -0
- package/include/libexif/exif-data-type.h +46 -0
- package/include/libexif/exif-data.h +267 -0
- package/include/libexif/exif-entry.h +186 -0
- package/include/libexif/exif-format.h +65 -0
- package/include/libexif/exif-ifd.h +51 -0
- package/include/libexif/exif-loader.h +128 -0
- package/include/libexif/exif-log.h +116 -0
- package/include/libexif/exif-mem.h +91 -0
- package/include/libexif/exif-mnote-data.h +122 -0
- package/include/libexif/exif-tag.h +307 -0
- package/include/libexif/exif-utils.h +194 -0
- package/include/libheif/heif.h +2092 -0
- package/include/libheif/heif_cxx.h +1359 -0
- package/include/libheif/heif_plugin.h +306 -0
- package/include/libheif/heif_version.h +38 -0
- package/include/libimagequant.h +111 -0
- package/include/libpng16/png.h +3247 -0
- package/include/libpng16/pngconf.h +623 -0
- package/include/libpng16/pnglibconf.h +219 -0
- package/include/librsvg-2.0/librsvg/rsvg-cairo.h +395 -0
- package/include/librsvg-2.0/librsvg/rsvg-features.h +184 -0
- package/include/librsvg-2.0/librsvg/rsvg-version.h +13 -0
- package/include/librsvg-2.0/librsvg/rsvg.h +1456 -0
- package/include/libxml2/libxml/HTMLparser.h +320 -0
- package/include/libxml2/libxml/HTMLtree.h +147 -0
- package/include/libxml2/libxml/SAX.h +204 -0
- package/include/libxml2/libxml/SAX2.h +173 -0
- package/include/libxml2/libxml/c14n.h +128 -0
- package/include/libxml2/libxml/catalog.h +182 -0
- package/include/libxml2/libxml/chvalid.h +230 -0
- package/include/libxml2/libxml/debugXML.h +217 -0
- package/include/libxml2/libxml/dict.h +81 -0
- package/include/libxml2/libxml/encoding.h +233 -0
- package/include/libxml2/libxml/entities.h +151 -0
- package/include/libxml2/libxml/globals.h +529 -0
- package/include/libxml2/libxml/hash.h +236 -0
- package/include/libxml2/libxml/list.h +137 -0
- package/include/libxml2/libxml/nanoftp.h +186 -0
- package/include/libxml2/libxml/nanohttp.h +81 -0
- package/include/libxml2/libxml/parser.h +1265 -0
- package/include/libxml2/libxml/parserInternals.h +662 -0
- package/include/libxml2/libxml/pattern.h +100 -0
- package/include/libxml2/libxml/relaxng.h +218 -0
- package/include/libxml2/libxml/schemasInternals.h +958 -0
- package/include/libxml2/libxml/schematron.h +142 -0
- package/include/libxml2/libxml/threads.h +94 -0
- package/include/libxml2/libxml/tree.h +1314 -0
- package/include/libxml2/libxml/uri.h +94 -0
- package/include/libxml2/libxml/valid.h +448 -0
- package/include/libxml2/libxml/xinclude.h +129 -0
- package/include/libxml2/libxml/xlink.h +189 -0
- package/include/libxml2/libxml/xmlIO.h +369 -0
- package/include/libxml2/libxml/xmlautomata.h +146 -0
- package/include/libxml2/libxml/xmlerror.h +919 -0
- package/include/libxml2/libxml/xmlexports.h +50 -0
- package/include/libxml2/libxml/xmlmemory.h +228 -0
- package/include/libxml2/libxml/xmlmodule.h +57 -0
- package/include/libxml2/libxml/xmlreader.h +428 -0
- package/include/libxml2/libxml/xmlregexp.h +222 -0
- package/include/libxml2/libxml/xmlsave.h +88 -0
- package/include/libxml2/libxml/xmlschemas.h +246 -0
- package/include/libxml2/libxml/xmlschemastypes.h +152 -0
- package/include/libxml2/libxml/xmlstring.h +140 -0
- package/include/libxml2/libxml/xmlunicode.h +202 -0
- package/include/libxml2/libxml/xmlversion.h +526 -0
- package/include/libxml2/libxml/xmlwriter.h +488 -0
- package/include/libxml2/libxml/xpath.h +575 -0
- package/include/libxml2/libxml/xpathInternals.h +632 -0
- package/include/libxml2/libxml/xpointer.h +137 -0
- package/include/orc-0.4/orc/orc-stdint.h +1 -0
- package/include/orc-0.4/orc/orc.h +16 -0
- package/include/orc-0.4/orc/orcarm.h +879 -0
- package/include/orc-0.4/orc/orcbytecode.h +35 -0
- package/include/orc-0.4/orc/orcbytecodes.h +255 -0
- package/include/orc-0.4/orc/orccode.h +53 -0
- package/include/orc-0.4/orc/orccompiler.h +176 -0
- package/include/orc-0.4/orc/orcconstant.h +39 -0
- package/include/orc-0.4/orc/orccpu.h +21 -0
- package/include/orc-0.4/orc/orccpuinsn.h +40 -0
- package/include/orc-0.4/orc/orcdebug.h +158 -0
- package/include/orc-0.4/orc/orcemulateopcodes.h +203 -0
- package/include/orc-0.4/orc/orcexecutor.h +135 -0
- package/include/orc-0.4/orc/orcfunctions.h +93 -0
- package/include/orc-0.4/orc/orcinstruction.h +39 -0
- package/include/orc-0.4/orc/orcinternal.h +46 -0
- package/include/orc-0.4/orc/orclimits.h +94 -0
- package/include/orc-0.4/orc/orcmips.h +229 -0
- package/include/orc-0.4/orc/orcmmx.h +79 -0
- package/include/orc-0.4/orc/orcneon.h +43 -0
- package/include/orc-0.4/orc/orconce.h +166 -0
- package/include/orc-0.4/orc/orcopcode.h +63 -0
- package/include/orc-0.4/orc/orcparse.h +27 -0
- package/include/orc-0.4/orc/orcpowerpc.h +209 -0
- package/include/orc-0.4/orc/orcprogram.h +192 -0
- package/include/orc-0.4/orc/orcrule.h +52 -0
- package/include/orc-0.4/orc/orcsse.h +55 -0
- package/include/orc-0.4/orc/orctarget.h +115 -0
- package/include/orc-0.4/orc/orcutils.h +238 -0
- package/include/orc-0.4/orc/orcvariable.h +81 -0
- package/include/orc-0.4/orc/orcx86.h +199 -0
- package/include/orc-0.4/orc/orcx86insn.h +672 -0
- package/include/pango-1.0/pango/pango-attributes.h +748 -0
- package/include/pango-1.0/pango/pango-bidi-type.h +117 -0
- package/include/pango-1.0/pango/pango-break.h +144 -0
- package/include/pango-1.0/pango/pango-color.h +75 -0
- package/include/pango-1.0/pango/pango-context.h +116 -0
- package/include/pango-1.0/pango/pango-coverage.h +108 -0
- package/include/pango-1.0/pango/pango-direction.h +72 -0
- package/include/pango-1.0/pango/pango-engine.h +457 -0
- package/include/pango-1.0/pango/pango-enum-types.h +120 -0
- package/include/pango-1.0/pango/pango-features.h +10 -0
- package/include/pango-1.0/pango/pango-font.h +699 -0
- package/include/pango-1.0/pango/pango-fontmap.h +132 -0
- package/include/pango-1.0/pango/pango-fontset-simple.h +64 -0
- package/include/pango-1.0/pango/pango-fontset.h +134 -0
- package/include/pango-1.0/pango/pango-glyph-item.h +175 -0
- package/include/pango-1.0/pango/pango-glyph.h +270 -0
- package/include/pango-1.0/pango/pango-gravity.h +137 -0
- package/include/pango-1.0/pango/pango-item.h +165 -0
- package/include/pango-1.0/pango/pango-language.h +70 -0
- package/include/pango-1.0/pango/pango-layout.h +554 -0
- package/include/pango-1.0/pango/pango-markup.h +52 -0
- package/include/pango-1.0/pango/pango-matrix.h +130 -0
- package/include/pango-1.0/pango/pango-modules.h +84 -0
- package/include/pango-1.0/pango/pango-ot.h +427 -0
- package/include/pango-1.0/pango/pango-renderer.h +290 -0
- package/include/pango-1.0/pango/pango-script.h +335 -0
- package/include/pango-1.0/pango/pango-tabs.h +117 -0
- package/include/pango-1.0/pango/pango-types.h +244 -0
- package/include/pango-1.0/pango/pango-utils.h +187 -0
- package/include/pango-1.0/pango/pango-version-macros.h +756 -0
- package/include/pango-1.0/pango/pango.h +54 -0
- package/include/pango-1.0/pango/pangocairo.h +220 -0
- package/include/pango-1.0/pango/pangofc-decoder.h +122 -0
- package/include/pango-1.0/pango/pangofc-font.h +120 -0
- package/include/pango-1.0/pango/pangofc-fontmap.h +244 -0
- package/include/pango-1.0/pango/pangoft2.h +158 -0
- package/include/pixman-1/pixman-version.h +54 -0
- package/include/pixman-1/pixman.h +1419 -0
- package/include/png.h +3247 -0
- package/include/pngconf.h +623 -0
- package/include/pnglibconf.h +219 -0
- package/include/spng.h +537 -0
- package/include/tiff.h +899 -0
- package/include/tiffconf.h +145 -0
- package/include/tiffio.h +653 -0
- package/include/tiffvers.h +36 -0
- package/include/vips/VConnection8.h +150 -0
- package/include/vips/VError8.h +76 -0
- package/include/vips/VImage8.h +6065 -0
- package/include/vips/VInterpolate8.h +77 -0
- package/include/vips/VRegion8.h +155 -0
- package/include/vips/arithmetic.h +571 -0
- package/include/vips/basic.h +113 -0
- package/include/vips/buf.h +118 -0
- package/include/vips/colour.h +306 -0
- package/include/vips/connection.h +570 -0
- package/include/vips/conversion.h +357 -0
- package/include/vips/convolution.h +95 -0
- package/include/vips/create.h +161 -0
- package/include/vips/dbuf.h +103 -0
- package/include/vips/debug.h +74 -0
- package/include/vips/draw.h +113 -0
- package/include/vips/enumtypes.h +181 -0
- package/include/vips/error.h +142 -0
- package/include/vips/foreign.h +993 -0
- package/include/vips/format.h +135 -0
- package/include/vips/freqfilt.h +64 -0
- package/include/vips/gate.h +82 -0
- package/include/vips/generate.h +92 -0
- package/include/vips/header.h +312 -0
- package/include/vips/histogram.h +85 -0
- package/include/vips/image.h +605 -0
- package/include/vips/interpolate.h +141 -0
- package/include/vips/memory.h +96 -0
- package/include/vips/morphology.h +73 -0
- package/include/vips/mosaicing.h +80 -0
- package/include/vips/object.h +706 -0
- package/include/vips/operation.h +182 -0
- package/include/vips/private.h +227 -0
- package/include/vips/rect.h +80 -0
- package/include/vips/region.h +238 -0
- package/include/vips/resample.h +123 -0
- package/include/vips/sbuf.h +144 -0
- package/include/vips/semaphore.h +77 -0
- package/include/vips/thread.h +72 -0
- package/include/vips/threadpool.h +160 -0
- package/include/vips/transform.h +89 -0
- package/include/vips/type.h +305 -0
- package/include/vips/util.h +406 -0
- package/include/vips/vector.h +183 -0
- package/include/vips/version.h +26 -0
- package/include/vips/vips.h +194 -0
- package/include/vips/vips8 +60 -0
- package/include/webp/decode.h +504 -0
- package/include/webp/demux.h +363 -0
- package/include/webp/encode.h +552 -0
- package/include/webp/mux.h +530 -0
- package/include/webp/mux_types.h +98 -0
- package/include/webp/sharpyuv/sharpyuv.h +103 -0
- package/include/webp/sharpyuv/sharpyuv_csp.h +60 -0
- package/include/webp/types.h +72 -0
- package/include/zconf.h +203 -0
- package/include/zlib.h +1855 -0
- package/include/zlib_name_mangling.h +8 -0
- package/package.json +30 -0
- package/versions.json +31 -0
|
@@ -0,0 +1,1359 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* C++ interface to libheif
|
|
3
|
+
* Copyright (c) 2018 struktur AG, Dirk Farin <farin@struktur.de>
|
|
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_CXX_H
|
|
22
|
+
#define LIBHEIF_HEIF_CXX_H
|
|
23
|
+
|
|
24
|
+
#include <memory>
|
|
25
|
+
#include <string>
|
|
26
|
+
#include <vector>
|
|
27
|
+
|
|
28
|
+
extern "C" {
|
|
29
|
+
#include <libheif/heif.h>
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
namespace heif {
|
|
34
|
+
|
|
35
|
+
class Error
|
|
36
|
+
{
|
|
37
|
+
public:
|
|
38
|
+
Error()
|
|
39
|
+
{
|
|
40
|
+
m_code = heif_error_Ok;
|
|
41
|
+
m_subcode = heif_suberror_Unspecified;
|
|
42
|
+
m_message = "Ok";
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
Error(const heif_error& err)
|
|
46
|
+
{
|
|
47
|
+
m_code = err.code;
|
|
48
|
+
m_subcode = err.subcode;
|
|
49
|
+
m_message = err.message;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
Error(heif_error_code code, heif_suberror_code subcode, const std::string& msg)
|
|
53
|
+
{
|
|
54
|
+
m_code = code;
|
|
55
|
+
m_subcode = subcode;
|
|
56
|
+
m_message = msg;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const std::string& get_message() const
|
|
60
|
+
{ return m_message; }
|
|
61
|
+
|
|
62
|
+
heif_error_code get_code() const
|
|
63
|
+
{ return m_code; }
|
|
64
|
+
|
|
65
|
+
heif_suberror_code get_subcode() const
|
|
66
|
+
{ return m_subcode; }
|
|
67
|
+
|
|
68
|
+
operator bool() const
|
|
69
|
+
{ return m_code != heif_error_Ok; }
|
|
70
|
+
|
|
71
|
+
private:
|
|
72
|
+
heif_error_code m_code;
|
|
73
|
+
heif_suberror_code m_subcode;
|
|
74
|
+
std::string m_message;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
class ImageHandle;
|
|
79
|
+
|
|
80
|
+
class Image;
|
|
81
|
+
|
|
82
|
+
class Encoder;
|
|
83
|
+
|
|
84
|
+
class EncoderParameter;
|
|
85
|
+
|
|
86
|
+
class EncoderDescriptor;
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
class Context
|
|
90
|
+
{
|
|
91
|
+
public:
|
|
92
|
+
Context();
|
|
93
|
+
|
|
94
|
+
class ReadingOptions
|
|
95
|
+
{
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
// throws Error
|
|
99
|
+
void read_from_file(const std::string& filename, const ReadingOptions& opts = ReadingOptions());
|
|
100
|
+
|
|
101
|
+
// DEPRECATED. Use read_from_memory_without_copy() instead.
|
|
102
|
+
// throws Error
|
|
103
|
+
void read_from_memory(const void* mem, size_t size, const ReadingOptions& opts = ReadingOptions());
|
|
104
|
+
|
|
105
|
+
// throws Error
|
|
106
|
+
void read_from_memory_without_copy(const void* mem, size_t size, const ReadingOptions& opts = ReadingOptions());
|
|
107
|
+
|
|
108
|
+
class Reader
|
|
109
|
+
{
|
|
110
|
+
public:
|
|
111
|
+
virtual ~Reader() = default;
|
|
112
|
+
|
|
113
|
+
virtual int64_t get_position() const = 0;
|
|
114
|
+
|
|
115
|
+
virtual int read(void* data, size_t size) = 0;
|
|
116
|
+
|
|
117
|
+
virtual int seek(int64_t position) = 0;
|
|
118
|
+
|
|
119
|
+
virtual heif_reader_grow_status wait_for_file_size(int64_t target_size) = 0;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
// throws Error
|
|
123
|
+
void read_from_reader(Reader&, const ReadingOptions& opts = ReadingOptions());
|
|
124
|
+
|
|
125
|
+
int get_number_of_top_level_images() const noexcept;
|
|
126
|
+
|
|
127
|
+
bool is_top_level_image_ID(heif_item_id id) const noexcept;
|
|
128
|
+
|
|
129
|
+
std::vector<heif_item_id> get_list_of_top_level_image_IDs() const noexcept;
|
|
130
|
+
|
|
131
|
+
// throws Error
|
|
132
|
+
heif_item_id get_primary_image_ID() const;
|
|
133
|
+
|
|
134
|
+
// throws Error
|
|
135
|
+
ImageHandle get_primary_image_handle() const;
|
|
136
|
+
|
|
137
|
+
ImageHandle get_image_handle(heif_item_id id) const;
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
class EncodingOptions : public heif_encoding_options
|
|
141
|
+
{
|
|
142
|
+
public:
|
|
143
|
+
EncodingOptions();
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
// throws Error
|
|
147
|
+
ImageHandle encode_image(const Image& img, Encoder& encoder,
|
|
148
|
+
const EncodingOptions& options = EncodingOptions());
|
|
149
|
+
|
|
150
|
+
// throws Error
|
|
151
|
+
void set_primary_image(ImageHandle& new_primary_image_handle);
|
|
152
|
+
|
|
153
|
+
// throws Error
|
|
154
|
+
ImageHandle encode_thumbnail(const Image& image,
|
|
155
|
+
const ImageHandle& master_image,
|
|
156
|
+
Encoder& encoder,
|
|
157
|
+
const EncodingOptions&,
|
|
158
|
+
int bbox_size);
|
|
159
|
+
|
|
160
|
+
// throws Error
|
|
161
|
+
void assign_thumbnail(const ImageHandle& thumbnail_image,
|
|
162
|
+
const ImageHandle& master_image);
|
|
163
|
+
|
|
164
|
+
// throws Error
|
|
165
|
+
void add_exif_metadata(const ImageHandle& master_image,
|
|
166
|
+
const void* data, int size);
|
|
167
|
+
|
|
168
|
+
// throws Error
|
|
169
|
+
void add_XMP_metadata(const ImageHandle& master_image,
|
|
170
|
+
const void* data, int size);
|
|
171
|
+
|
|
172
|
+
class Writer
|
|
173
|
+
{
|
|
174
|
+
public:
|
|
175
|
+
virtual ~Writer() = default;
|
|
176
|
+
|
|
177
|
+
virtual heif_error write(const void* data, size_t size) = 0;
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
// throws Error
|
|
181
|
+
void write(Writer&);
|
|
182
|
+
|
|
183
|
+
// throws Error
|
|
184
|
+
void write_to_file(const std::string& filename) const;
|
|
185
|
+
|
|
186
|
+
private:
|
|
187
|
+
std::shared_ptr<heif_context> m_context;
|
|
188
|
+
|
|
189
|
+
friend struct ::heif_error heif_writer_trampoline_write(struct heif_context* ctx,
|
|
190
|
+
const void* data,
|
|
191
|
+
size_t size,
|
|
192
|
+
void* userdata);
|
|
193
|
+
|
|
194
|
+
//static Context wrap_without_releasing(heif_context*); // internal use in friend function only
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
class ImageHandle
|
|
199
|
+
{
|
|
200
|
+
public:
|
|
201
|
+
ImageHandle() = default;
|
|
202
|
+
|
|
203
|
+
ImageHandle(heif_image_handle* handle);
|
|
204
|
+
|
|
205
|
+
bool empty() const noexcept
|
|
206
|
+
{ return !m_image_handle; }
|
|
207
|
+
|
|
208
|
+
bool is_primary_image() const noexcept;
|
|
209
|
+
|
|
210
|
+
int get_width() const noexcept;
|
|
211
|
+
|
|
212
|
+
int get_height() const noexcept;
|
|
213
|
+
|
|
214
|
+
bool has_alpha_channel() const noexcept;
|
|
215
|
+
|
|
216
|
+
bool is_premultiplied_alpha() const noexcept;
|
|
217
|
+
|
|
218
|
+
int get_luma_bits_per_pixel() const noexcept;
|
|
219
|
+
|
|
220
|
+
int get_chroma_bits_per_pixel() const noexcept;
|
|
221
|
+
|
|
222
|
+
int get_ispe_width() const noexcept;
|
|
223
|
+
|
|
224
|
+
int get_ispe_height() const noexcept;
|
|
225
|
+
|
|
226
|
+
// ------------------------- depth images -------------------------
|
|
227
|
+
|
|
228
|
+
// TODO
|
|
229
|
+
|
|
230
|
+
// ------------------------- thumbnails -------------------------
|
|
231
|
+
|
|
232
|
+
int get_number_of_thumbnails() const noexcept;
|
|
233
|
+
|
|
234
|
+
std::vector<heif_item_id> get_list_of_thumbnail_IDs() const noexcept;
|
|
235
|
+
|
|
236
|
+
// throws Error
|
|
237
|
+
ImageHandle get_thumbnail(heif_item_id id);
|
|
238
|
+
|
|
239
|
+
// ------------------------- metadata (Exif / XMP) -------------------------
|
|
240
|
+
|
|
241
|
+
// Can optionally be filtered by type ("Exif" / "XMP")
|
|
242
|
+
std::vector<heif_item_id> get_list_of_metadata_block_IDs(const char* type_filter = nullptr) const noexcept;
|
|
243
|
+
|
|
244
|
+
std::string get_metadata_type(heif_item_id metadata_id) const noexcept;
|
|
245
|
+
|
|
246
|
+
std::string get_metadata_content_type(heif_item_id metadata_id) const noexcept;
|
|
247
|
+
|
|
248
|
+
// throws error
|
|
249
|
+
std::vector<uint8_t> get_metadata(heif_item_id) const;
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
class DecodingOptions
|
|
253
|
+
{
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
// throws Error
|
|
257
|
+
Image decode_image(heif_colorspace colorspace, heif_chroma chroma,
|
|
258
|
+
const DecodingOptions& options = DecodingOptions());
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
heif_image_handle* get_raw_image_handle() noexcept
|
|
262
|
+
{ return m_image_handle.get(); }
|
|
263
|
+
|
|
264
|
+
const heif_image_handle* get_raw_image_handle() const noexcept
|
|
265
|
+
{ return m_image_handle.get(); }
|
|
266
|
+
|
|
267
|
+
private:
|
|
268
|
+
std::shared_ptr<heif_image_handle> m_image_handle;
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
class ColorProfile_nclx
|
|
273
|
+
{
|
|
274
|
+
public:
|
|
275
|
+
ColorProfile_nclx();
|
|
276
|
+
|
|
277
|
+
~ColorProfile_nclx();
|
|
278
|
+
|
|
279
|
+
heif_color_primaries get_color_primaries() const;
|
|
280
|
+
|
|
281
|
+
heif_transfer_characteristics get_transfer_characteristics() const;
|
|
282
|
+
|
|
283
|
+
heif_matrix_coefficients get_matrix_coefficients() const;
|
|
284
|
+
|
|
285
|
+
bool is_full_range() const;
|
|
286
|
+
|
|
287
|
+
void set_color_primaries(heif_color_primaries cp);
|
|
288
|
+
|
|
289
|
+
// DEPRECATED: typo in function name. Use set_color_primaries() instead.
|
|
290
|
+
void set_color_primaties(heif_color_primaries cp);
|
|
291
|
+
|
|
292
|
+
void set_transfer_characteristics(heif_transfer_characteristics tc);
|
|
293
|
+
|
|
294
|
+
void set_matrix_coefficients(heif_matrix_coefficients mc);
|
|
295
|
+
|
|
296
|
+
void set_full_range_flag(bool is_full_range);
|
|
297
|
+
|
|
298
|
+
private:
|
|
299
|
+
ColorProfile_nclx(heif_color_profile_nclx* nclx)
|
|
300
|
+
{ mProfile = nclx; }
|
|
301
|
+
|
|
302
|
+
heif_color_profile_nclx* mProfile;
|
|
303
|
+
|
|
304
|
+
friend class Image;
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
class Image
|
|
309
|
+
{
|
|
310
|
+
public:
|
|
311
|
+
Image() = default;
|
|
312
|
+
|
|
313
|
+
Image(heif_image* image);
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
// throws Error
|
|
317
|
+
void create(int width, int height,
|
|
318
|
+
enum heif_colorspace colorspace,
|
|
319
|
+
enum heif_chroma chroma);
|
|
320
|
+
|
|
321
|
+
// throws Error
|
|
322
|
+
void add_plane(enum heif_channel channel,
|
|
323
|
+
int width, int height, int bit_depth);
|
|
324
|
+
|
|
325
|
+
heif_colorspace get_colorspace() const noexcept;
|
|
326
|
+
|
|
327
|
+
heif_chroma get_chroma_format() const noexcept;
|
|
328
|
+
|
|
329
|
+
int get_width(enum heif_channel channel) const noexcept;
|
|
330
|
+
|
|
331
|
+
int get_height(enum heif_channel channel) const noexcept;
|
|
332
|
+
|
|
333
|
+
int get_bits_per_pixel(enum heif_channel channel) const noexcept;
|
|
334
|
+
|
|
335
|
+
int get_bits_per_pixel_range(enum heif_channel channel) const noexcept;
|
|
336
|
+
|
|
337
|
+
bool has_channel(enum heif_channel channel) const noexcept;
|
|
338
|
+
|
|
339
|
+
const uint8_t* get_plane(enum heif_channel channel, int* out_stride) const noexcept;
|
|
340
|
+
|
|
341
|
+
uint8_t* get_plane(enum heif_channel channel, int* out_stride) noexcept;
|
|
342
|
+
|
|
343
|
+
// throws Error
|
|
344
|
+
void set_nclx_color_profile(const ColorProfile_nclx&);
|
|
345
|
+
|
|
346
|
+
// throws Error
|
|
347
|
+
ColorProfile_nclx get_nclx_color_profile() const;
|
|
348
|
+
|
|
349
|
+
heif_color_profile_type get_color_profile_type() const;
|
|
350
|
+
|
|
351
|
+
// throws Error
|
|
352
|
+
std::vector<uint8_t> get_raw_color_profile() const;
|
|
353
|
+
|
|
354
|
+
void set_raw_color_profile(heif_color_profile_type type,
|
|
355
|
+
const std::vector<uint8_t>& data);
|
|
356
|
+
|
|
357
|
+
bool is_premultiplied_alpha() const noexcept;
|
|
358
|
+
|
|
359
|
+
void set_premultiplied_alpha(bool is_premultiplied_alpha) noexcept;
|
|
360
|
+
|
|
361
|
+
class ScalingOptions
|
|
362
|
+
{
|
|
363
|
+
};
|
|
364
|
+
|
|
365
|
+
// throws Error
|
|
366
|
+
Image scale_image(int width, int height,
|
|
367
|
+
const ScalingOptions& options = ScalingOptions()) const;
|
|
368
|
+
|
|
369
|
+
private:
|
|
370
|
+
std::shared_ptr<heif_image> m_image;
|
|
371
|
+
|
|
372
|
+
friend class Context;
|
|
373
|
+
};
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
class EncoderDescriptor
|
|
377
|
+
{
|
|
378
|
+
public:
|
|
379
|
+
static std::vector<EncoderDescriptor>
|
|
380
|
+
get_encoder_descriptors(enum heif_compression_format format_filter,
|
|
381
|
+
const char* name_filter) noexcept;
|
|
382
|
+
|
|
383
|
+
std::string get_name() const noexcept;
|
|
384
|
+
|
|
385
|
+
std::string get_id_name() const noexcept;
|
|
386
|
+
|
|
387
|
+
enum heif_compression_format get_compression_format() const noexcept;
|
|
388
|
+
|
|
389
|
+
// DEPRECATED: typo in function name
|
|
390
|
+
bool supportes_lossy_compression() const noexcept;
|
|
391
|
+
|
|
392
|
+
// DEPRECATED: typo in function name
|
|
393
|
+
bool supportes_lossless_compression() const noexcept;
|
|
394
|
+
|
|
395
|
+
|
|
396
|
+
// throws Error
|
|
397
|
+
Encoder get_encoder() const;
|
|
398
|
+
|
|
399
|
+
bool supports_lossy_compression() const noexcept;
|
|
400
|
+
|
|
401
|
+
bool supports_lossless_compression() const noexcept;
|
|
402
|
+
|
|
403
|
+
private:
|
|
404
|
+
EncoderDescriptor(const struct heif_encoder_descriptor* descr) : m_descriptor(descr)
|
|
405
|
+
{}
|
|
406
|
+
|
|
407
|
+
const struct heif_encoder_descriptor* m_descriptor = nullptr;
|
|
408
|
+
};
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
class EncoderParameter
|
|
412
|
+
{
|
|
413
|
+
public:
|
|
414
|
+
std::string get_name() const noexcept;
|
|
415
|
+
|
|
416
|
+
enum heif_encoder_parameter_type get_type() const noexcept;
|
|
417
|
+
|
|
418
|
+
bool is_integer() const noexcept;
|
|
419
|
+
|
|
420
|
+
// Returns 'true' if the integer range is limited.
|
|
421
|
+
bool get_valid_integer_range(int& out_minimum, int& out_maximum);
|
|
422
|
+
|
|
423
|
+
bool is_boolean() const noexcept;
|
|
424
|
+
|
|
425
|
+
bool is_string() const noexcept;
|
|
426
|
+
|
|
427
|
+
std::vector<std::string> get_valid_string_values() const;
|
|
428
|
+
|
|
429
|
+
private:
|
|
430
|
+
EncoderParameter(const heif_encoder_parameter*);
|
|
431
|
+
|
|
432
|
+
const struct heif_encoder_parameter* m_parameter;
|
|
433
|
+
|
|
434
|
+
friend class Encoder;
|
|
435
|
+
};
|
|
436
|
+
|
|
437
|
+
|
|
438
|
+
class Encoder
|
|
439
|
+
{
|
|
440
|
+
public:
|
|
441
|
+
// throws Error
|
|
442
|
+
Encoder(enum heif_compression_format format);
|
|
443
|
+
|
|
444
|
+
// throws Error
|
|
445
|
+
void set_lossy_quality(int quality);
|
|
446
|
+
|
|
447
|
+
// throws Error
|
|
448
|
+
void set_lossless(bool enable_lossless);
|
|
449
|
+
|
|
450
|
+
std::vector<EncoderParameter> list_parameters() const noexcept;
|
|
451
|
+
|
|
452
|
+
void set_integer_parameter(const std::string& parameter_name, int value);
|
|
453
|
+
|
|
454
|
+
int get_integer_parameter(const std::string& parameter_name) const;
|
|
455
|
+
|
|
456
|
+
void set_boolean_parameter(const std::string& parameter_name, bool value);
|
|
457
|
+
|
|
458
|
+
bool get_boolean_parameter(const std::string& parameter_name) const;
|
|
459
|
+
|
|
460
|
+
void set_string_parameter(const std::string& parameter_name, const std::string& value);
|
|
461
|
+
|
|
462
|
+
std::string get_string_parameter(const std::string& parameter_name) const;
|
|
463
|
+
|
|
464
|
+
void set_parameter(const std::string& parameter_name, const std::string& parameter_value);
|
|
465
|
+
|
|
466
|
+
std::string get_parameter(const std::string& parameter_name) const;
|
|
467
|
+
|
|
468
|
+
private:
|
|
469
|
+
Encoder(struct heif_encoder*) noexcept;
|
|
470
|
+
|
|
471
|
+
std::shared_ptr<heif_encoder> m_encoder;
|
|
472
|
+
|
|
473
|
+
friend class EncoderDescriptor;
|
|
474
|
+
|
|
475
|
+
friend class Context;
|
|
476
|
+
};
|
|
477
|
+
|
|
478
|
+
|
|
479
|
+
// ==========================================================================================
|
|
480
|
+
// IMPLEMENTATION
|
|
481
|
+
// ==========================================================================================
|
|
482
|
+
|
|
483
|
+
inline Context::Context()
|
|
484
|
+
{
|
|
485
|
+
heif_context* ctx = heif_context_alloc();
|
|
486
|
+
m_context = std::shared_ptr<heif_context>(ctx,
|
|
487
|
+
[](heif_context* c) { heif_context_free(c); });
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
inline void Context::read_from_file(const std::string& filename, const ReadingOptions& /*opts*/)
|
|
491
|
+
{
|
|
492
|
+
Error err = Error(heif_context_read_from_file(m_context.get(), filename.c_str(), NULL));
|
|
493
|
+
if (err) {
|
|
494
|
+
throw err;
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
inline void Context::read_from_memory(const void* mem, size_t size, const ReadingOptions& /*opts*/)
|
|
499
|
+
{
|
|
500
|
+
Error err = Error(heif_context_read_from_memory(m_context.get(), mem, size, NULL));
|
|
501
|
+
if (err) {
|
|
502
|
+
throw err;
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
inline void Context::read_from_memory_without_copy(const void* mem, size_t size, const ReadingOptions& /*opts*/)
|
|
507
|
+
{
|
|
508
|
+
Error err = Error(heif_context_read_from_memory_without_copy(m_context.get(), mem, size, NULL));
|
|
509
|
+
if (err) {
|
|
510
|
+
throw err;
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
|
|
515
|
+
inline int64_t heif_reader_trampoline_get_position(void* userdata)
|
|
516
|
+
{
|
|
517
|
+
Context::Reader* reader = (Context::Reader*) userdata;
|
|
518
|
+
return reader->get_position();
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
inline int heif_reader_trampoline_read(void* data, size_t size, void* userdata)
|
|
522
|
+
{
|
|
523
|
+
Context::Reader* reader = (Context::Reader*) userdata;
|
|
524
|
+
return reader->read(data, size);
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
inline int heif_reader_trampoline_seek(int64_t position, void* userdata)
|
|
528
|
+
{
|
|
529
|
+
Context::Reader* reader = (Context::Reader*) userdata;
|
|
530
|
+
return reader->seek(position);
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
inline heif_reader_grow_status heif_reader_trampoline_wait_for_file_size(int64_t target_size, void* userdata)
|
|
534
|
+
{
|
|
535
|
+
Context::Reader* reader = (Context::Reader*) userdata;
|
|
536
|
+
return reader->wait_for_file_size(target_size);
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
|
|
540
|
+
static struct heif_reader heif_reader_trampoline =
|
|
541
|
+
{
|
|
542
|
+
1,
|
|
543
|
+
heif_reader_trampoline_get_position,
|
|
544
|
+
heif_reader_trampoline_read,
|
|
545
|
+
heif_reader_trampoline_seek,
|
|
546
|
+
heif_reader_trampoline_wait_for_file_size
|
|
547
|
+
};
|
|
548
|
+
|
|
549
|
+
inline void Context::read_from_reader(Reader& reader, const ReadingOptions& /*opts*/)
|
|
550
|
+
{
|
|
551
|
+
Error err = Error(heif_context_read_from_reader(m_context.get(), &heif_reader_trampoline,
|
|
552
|
+
&reader, NULL));
|
|
553
|
+
if (err) {
|
|
554
|
+
throw err;
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
|
|
559
|
+
inline int Context::get_number_of_top_level_images() const noexcept
|
|
560
|
+
{
|
|
561
|
+
return heif_context_get_number_of_top_level_images(m_context.get());
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
inline bool Context::is_top_level_image_ID(heif_item_id id) const noexcept
|
|
565
|
+
{
|
|
566
|
+
return heif_context_is_top_level_image_ID(m_context.get(), id);
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
inline std::vector<heif_item_id> Context::get_list_of_top_level_image_IDs() const noexcept
|
|
570
|
+
{
|
|
571
|
+
int num = get_number_of_top_level_images();
|
|
572
|
+
std::vector<heif_item_id> IDs(num);
|
|
573
|
+
heif_context_get_list_of_top_level_image_IDs(m_context.get(), IDs.data(), num);
|
|
574
|
+
return IDs;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
inline heif_item_id Context::get_primary_image_ID() const
|
|
578
|
+
{
|
|
579
|
+
heif_item_id id;
|
|
580
|
+
Error err = Error(heif_context_get_primary_image_ID(m_context.get(), &id));
|
|
581
|
+
if (err) {
|
|
582
|
+
throw err;
|
|
583
|
+
}
|
|
584
|
+
return id;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
inline ImageHandle Context::get_primary_image_handle() const
|
|
588
|
+
{
|
|
589
|
+
heif_image_handle* handle;
|
|
590
|
+
Error err = Error(heif_context_get_primary_image_handle(m_context.get(), &handle));
|
|
591
|
+
if (err) {
|
|
592
|
+
throw err;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
return ImageHandle(handle);
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
inline ImageHandle Context::get_image_handle(heif_item_id id) const
|
|
599
|
+
{
|
|
600
|
+
struct heif_image_handle* handle;
|
|
601
|
+
Error err = Error(heif_context_get_image_handle(m_context.get(), id, &handle));
|
|
602
|
+
if (err) {
|
|
603
|
+
throw err;
|
|
604
|
+
}
|
|
605
|
+
return ImageHandle(handle);
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
#if 0
|
|
609
|
+
inline Context Context::wrap_without_releasing(heif_context* ctx) {
|
|
610
|
+
Context context;
|
|
611
|
+
context.m_context = std::shared_ptr<heif_context>(ctx,
|
|
612
|
+
[] (heif_context*) { /* NOP */ });
|
|
613
|
+
return context;
|
|
614
|
+
}
|
|
615
|
+
#endif
|
|
616
|
+
|
|
617
|
+
inline struct ::heif_error heif_writer_trampoline_write(struct heif_context* ctx,
|
|
618
|
+
const void* data,
|
|
619
|
+
size_t size,
|
|
620
|
+
void* userdata)
|
|
621
|
+
{
|
|
622
|
+
Context::Writer* writer = (Context::Writer*) userdata;
|
|
623
|
+
|
|
624
|
+
(void) ctx;
|
|
625
|
+
|
|
626
|
+
//Context context = Context::wrap_without_releasing(ctx);
|
|
627
|
+
//return writer->write(context, data, size);
|
|
628
|
+
return writer->write(data, size);
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
static struct heif_writer heif_writer_trampoline =
|
|
632
|
+
{
|
|
633
|
+
1,
|
|
634
|
+
&heif_writer_trampoline_write
|
|
635
|
+
};
|
|
636
|
+
|
|
637
|
+
inline void Context::write(Writer& writer)
|
|
638
|
+
{
|
|
639
|
+
Error err = Error(heif_context_write(m_context.get(), &heif_writer_trampoline, &writer));
|
|
640
|
+
if (err) {
|
|
641
|
+
throw err;
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
inline void Context::write_to_file(const std::string& filename) const
|
|
646
|
+
{
|
|
647
|
+
Error err = Error(heif_context_write_to_file(m_context.get(), filename.c_str()));
|
|
648
|
+
if (err) {
|
|
649
|
+
throw err;
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
|
|
654
|
+
inline ImageHandle::ImageHandle(heif_image_handle* handle)
|
|
655
|
+
{
|
|
656
|
+
if (handle != nullptr) {
|
|
657
|
+
m_image_handle = std::shared_ptr<heif_image_handle>(handle,
|
|
658
|
+
[](heif_image_handle* h) { heif_image_handle_release(h); });
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
inline bool ImageHandle::is_primary_image() const noexcept
|
|
663
|
+
{
|
|
664
|
+
return heif_image_handle_is_primary_image(m_image_handle.get()) != 0;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
inline int ImageHandle::get_width() const noexcept
|
|
668
|
+
{
|
|
669
|
+
return heif_image_handle_get_width(m_image_handle.get());
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
inline int ImageHandle::get_height() const noexcept
|
|
673
|
+
{
|
|
674
|
+
return heif_image_handle_get_height(m_image_handle.get());
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
inline bool ImageHandle::has_alpha_channel() const noexcept
|
|
678
|
+
{
|
|
679
|
+
return heif_image_handle_has_alpha_channel(m_image_handle.get()) != 0;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
inline bool ImageHandle::is_premultiplied_alpha() const noexcept
|
|
683
|
+
{
|
|
684
|
+
return heif_image_handle_is_premultiplied_alpha(m_image_handle.get()) != 0;
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
inline int ImageHandle::get_luma_bits_per_pixel() const noexcept
|
|
688
|
+
{
|
|
689
|
+
return heif_image_handle_get_luma_bits_per_pixel(m_image_handle.get());
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
inline int ImageHandle::get_chroma_bits_per_pixel() const noexcept
|
|
693
|
+
{
|
|
694
|
+
return heif_image_handle_get_chroma_bits_per_pixel(m_image_handle.get());
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
inline int ImageHandle::get_ispe_width() const noexcept
|
|
698
|
+
{
|
|
699
|
+
return heif_image_handle_get_ispe_width(m_image_handle.get());
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
inline int ImageHandle::get_ispe_height() const noexcept
|
|
703
|
+
{
|
|
704
|
+
return heif_image_handle_get_ispe_height(m_image_handle.get());
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
// ------------------------- depth images -------------------------
|
|
708
|
+
|
|
709
|
+
// TODO
|
|
710
|
+
|
|
711
|
+
// ------------------------- thumbnails -------------------------
|
|
712
|
+
|
|
713
|
+
inline int ImageHandle::get_number_of_thumbnails() const noexcept
|
|
714
|
+
{
|
|
715
|
+
return heif_image_handle_get_number_of_thumbnails(m_image_handle.get());
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
inline std::vector<heif_item_id> ImageHandle::get_list_of_thumbnail_IDs() const noexcept
|
|
719
|
+
{
|
|
720
|
+
int num = get_number_of_thumbnails();
|
|
721
|
+
std::vector<heif_item_id> IDs(num);
|
|
722
|
+
heif_image_handle_get_list_of_thumbnail_IDs(m_image_handle.get(), IDs.data(), num);
|
|
723
|
+
return IDs;
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
inline ImageHandle ImageHandle::get_thumbnail(heif_item_id id)
|
|
727
|
+
{
|
|
728
|
+
heif_image_handle* handle;
|
|
729
|
+
Error err = Error(heif_image_handle_get_thumbnail(m_image_handle.get(), id, &handle));
|
|
730
|
+
if (err) {
|
|
731
|
+
throw err;
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
return ImageHandle(handle);
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
inline Image ImageHandle::decode_image(heif_colorspace colorspace, heif_chroma chroma,
|
|
738
|
+
const DecodingOptions& /*options*/)
|
|
739
|
+
{
|
|
740
|
+
heif_image* out_img;
|
|
741
|
+
Error err = Error(heif_decode_image(m_image_handle.get(),
|
|
742
|
+
&out_img,
|
|
743
|
+
colorspace,
|
|
744
|
+
chroma,
|
|
745
|
+
nullptr)); //const struct heif_decoding_options* options);
|
|
746
|
+
if (err) {
|
|
747
|
+
throw err;
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
return Image(out_img);
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
|
|
754
|
+
inline std::vector<heif_item_id> ImageHandle::get_list_of_metadata_block_IDs(const char* type_filter) const noexcept
|
|
755
|
+
{
|
|
756
|
+
int nBlocks = heif_image_handle_get_number_of_metadata_blocks(m_image_handle.get(),
|
|
757
|
+
type_filter);
|
|
758
|
+
std::vector<heif_item_id> ids(nBlocks);
|
|
759
|
+
int n = heif_image_handle_get_list_of_metadata_block_IDs(m_image_handle.get(),
|
|
760
|
+
type_filter,
|
|
761
|
+
ids.data(), nBlocks);
|
|
762
|
+
(void) n;
|
|
763
|
+
//assert(n==nBlocks);
|
|
764
|
+
return ids;
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
inline std::string ImageHandle::get_metadata_type(heif_item_id metadata_id) const noexcept
|
|
768
|
+
{
|
|
769
|
+
return heif_image_handle_get_metadata_type(m_image_handle.get(), metadata_id);
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
inline std::string ImageHandle::get_metadata_content_type(heif_item_id metadata_id) const noexcept
|
|
773
|
+
{
|
|
774
|
+
return heif_image_handle_get_metadata_content_type(m_image_handle.get(), metadata_id);
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
inline std::vector<uint8_t> ImageHandle::get_metadata(heif_item_id metadata_id) const
|
|
778
|
+
{
|
|
779
|
+
size_t data_size = heif_image_handle_get_metadata_size(m_image_handle.get(),
|
|
780
|
+
metadata_id);
|
|
781
|
+
|
|
782
|
+
std::vector<uint8_t> data(data_size);
|
|
783
|
+
|
|
784
|
+
Error err = Error(heif_image_handle_get_metadata(m_image_handle.get(),
|
|
785
|
+
metadata_id,
|
|
786
|
+
data.data()));
|
|
787
|
+
if (err) {
|
|
788
|
+
throw err;
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
return data;
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
|
|
795
|
+
inline ColorProfile_nclx::ColorProfile_nclx()
|
|
796
|
+
{
|
|
797
|
+
mProfile = heif_nclx_color_profile_alloc();
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
inline ColorProfile_nclx::~ColorProfile_nclx()
|
|
801
|
+
{
|
|
802
|
+
heif_nclx_color_profile_free(mProfile);
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
inline heif_color_primaries ColorProfile_nclx::get_color_primaries() const
|
|
806
|
+
{ return mProfile->color_primaries; }
|
|
807
|
+
|
|
808
|
+
inline heif_transfer_characteristics ColorProfile_nclx::get_transfer_characteristics() const
|
|
809
|
+
{ return mProfile->transfer_characteristics; }
|
|
810
|
+
|
|
811
|
+
inline heif_matrix_coefficients ColorProfile_nclx::get_matrix_coefficients() const
|
|
812
|
+
{ return mProfile->matrix_coefficients; }
|
|
813
|
+
|
|
814
|
+
inline bool ColorProfile_nclx::is_full_range() const
|
|
815
|
+
{ return mProfile->full_range_flag; }
|
|
816
|
+
|
|
817
|
+
inline void ColorProfile_nclx::set_color_primaries(heif_color_primaries cp)
|
|
818
|
+
{ mProfile->color_primaries = cp; }
|
|
819
|
+
|
|
820
|
+
inline void ColorProfile_nclx::set_color_primaties(heif_color_primaries cp)
|
|
821
|
+
{ set_color_primaries(cp); }
|
|
822
|
+
|
|
823
|
+
inline void ColorProfile_nclx::set_transfer_characteristics(heif_transfer_characteristics tc)
|
|
824
|
+
{ mProfile->transfer_characteristics = tc; }
|
|
825
|
+
|
|
826
|
+
inline void ColorProfile_nclx::set_matrix_coefficients(heif_matrix_coefficients mc)
|
|
827
|
+
{ mProfile->matrix_coefficients = mc; }
|
|
828
|
+
|
|
829
|
+
inline void ColorProfile_nclx::set_full_range_flag(bool is_full_range)
|
|
830
|
+
{ mProfile->full_range_flag = is_full_range; }
|
|
831
|
+
|
|
832
|
+
|
|
833
|
+
inline Image::Image(heif_image* image)
|
|
834
|
+
{
|
|
835
|
+
m_image = std::shared_ptr<heif_image>(image,
|
|
836
|
+
[](heif_image* h) { heif_image_release(h); });
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
|
|
840
|
+
inline void Image::create(int width, int height,
|
|
841
|
+
enum heif_colorspace colorspace,
|
|
842
|
+
enum heif_chroma chroma)
|
|
843
|
+
{
|
|
844
|
+
heif_image* image;
|
|
845
|
+
Error err = Error(heif_image_create(width, height, colorspace, chroma, &image));
|
|
846
|
+
if (err) {
|
|
847
|
+
m_image.reset();
|
|
848
|
+
throw err;
|
|
849
|
+
}
|
|
850
|
+
else {
|
|
851
|
+
m_image = std::shared_ptr<heif_image>(image,
|
|
852
|
+
[](heif_image* h) { heif_image_release(h); });
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
inline void Image::add_plane(enum heif_channel channel,
|
|
857
|
+
int width, int height, int bit_depth)
|
|
858
|
+
{
|
|
859
|
+
Error err = Error(heif_image_add_plane(m_image.get(), channel, width, height, bit_depth));
|
|
860
|
+
if (err) {
|
|
861
|
+
throw err;
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
inline heif_colorspace Image::get_colorspace() const noexcept
|
|
866
|
+
{
|
|
867
|
+
return heif_image_get_colorspace(m_image.get());
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
inline heif_chroma Image::get_chroma_format() const noexcept
|
|
871
|
+
{
|
|
872
|
+
return heif_image_get_chroma_format(m_image.get());
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
inline int Image::get_width(enum heif_channel channel) const noexcept
|
|
876
|
+
{
|
|
877
|
+
return heif_image_get_width(m_image.get(), channel);
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
inline int Image::get_height(enum heif_channel channel) const noexcept
|
|
881
|
+
{
|
|
882
|
+
return heif_image_get_height(m_image.get(), channel);
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
inline int Image::get_bits_per_pixel(enum heif_channel channel) const noexcept
|
|
886
|
+
{
|
|
887
|
+
return heif_image_get_bits_per_pixel(m_image.get(), channel);
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
inline int Image::get_bits_per_pixel_range(enum heif_channel channel) const noexcept
|
|
891
|
+
{
|
|
892
|
+
return heif_image_get_bits_per_pixel_range(m_image.get(), channel);
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
inline bool Image::has_channel(enum heif_channel channel) const noexcept
|
|
896
|
+
{
|
|
897
|
+
return heif_image_has_channel(m_image.get(), channel);
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
inline const uint8_t* Image::get_plane(enum heif_channel channel, int* out_stride) const noexcept
|
|
901
|
+
{
|
|
902
|
+
return heif_image_get_plane_readonly(m_image.get(), channel, out_stride);
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
inline uint8_t* Image::get_plane(enum heif_channel channel, int* out_stride) noexcept
|
|
906
|
+
{
|
|
907
|
+
return heif_image_get_plane(m_image.get(), channel, out_stride);
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
inline void Image::set_nclx_color_profile(const ColorProfile_nclx& nclx)
|
|
911
|
+
{
|
|
912
|
+
Error err = Error(heif_image_set_nclx_color_profile(m_image.get(), nclx.mProfile));
|
|
913
|
+
if (err) {
|
|
914
|
+
throw err;
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
// throws Error
|
|
919
|
+
inline ColorProfile_nclx Image::get_nclx_color_profile() const
|
|
920
|
+
{
|
|
921
|
+
heif_color_profile_nclx* nclx = nullptr;
|
|
922
|
+
Error err = Error(heif_image_get_nclx_color_profile(m_image.get(), &nclx));
|
|
923
|
+
if (err) {
|
|
924
|
+
throw err;
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
return ColorProfile_nclx(nclx);
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
|
|
931
|
+
inline heif_color_profile_type Image::get_color_profile_type() const
|
|
932
|
+
{
|
|
933
|
+
return heif_image_get_color_profile_type(m_image.get());
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
// throws Error
|
|
937
|
+
inline std::vector<uint8_t> Image::get_raw_color_profile() const
|
|
938
|
+
{
|
|
939
|
+
auto size = heif_image_get_raw_color_profile_size(m_image.get());
|
|
940
|
+
std::vector<uint8_t> profile(size);
|
|
941
|
+
heif_image_get_raw_color_profile(m_image.get(), profile.data());
|
|
942
|
+
return profile;
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
inline void Image::set_raw_color_profile(heif_color_profile_type type,
|
|
946
|
+
const std::vector<uint8_t>& data)
|
|
947
|
+
{
|
|
948
|
+
const char* profile_type = nullptr;
|
|
949
|
+
switch (type) {
|
|
950
|
+
case heif_color_profile_type_prof:
|
|
951
|
+
profile_type = "prof";
|
|
952
|
+
break;
|
|
953
|
+
case heif_color_profile_type_rICC:
|
|
954
|
+
profile_type = "rICC";
|
|
955
|
+
break;
|
|
956
|
+
default:
|
|
957
|
+
throw Error(heif_error_code::heif_error_Usage_error,
|
|
958
|
+
heif_suberror_Unspecified,
|
|
959
|
+
"invalid raw color profile type");
|
|
960
|
+
break;
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
Error err = Error(heif_image_set_raw_color_profile(m_image.get(), profile_type,
|
|
964
|
+
data.data(), data.size()));
|
|
965
|
+
if (err) {
|
|
966
|
+
throw err;
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
inline bool Image::is_premultiplied_alpha() const noexcept
|
|
971
|
+
{
|
|
972
|
+
return heif_image_is_premultiplied_alpha(m_image.get()) != 0;
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
inline void Image::set_premultiplied_alpha(bool is_premultiplied_alpha) noexcept
|
|
976
|
+
{
|
|
977
|
+
heif_image_set_premultiplied_alpha(m_image.get(), is_premultiplied_alpha);
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
inline Image Image::scale_image(int width, int height,
|
|
981
|
+
const ScalingOptions&) const
|
|
982
|
+
{
|
|
983
|
+
heif_image* img;
|
|
984
|
+
Error err = Error(heif_image_scale_image(m_image.get(), &img, width, height,
|
|
985
|
+
nullptr)); // TODO: scaling options not defined yet
|
|
986
|
+
if (err) {
|
|
987
|
+
throw err;
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
return Image(img);
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
|
|
994
|
+
inline std::vector<EncoderDescriptor>
|
|
995
|
+
EncoderDescriptor::get_encoder_descriptors(enum heif_compression_format format_filter,
|
|
996
|
+
const char* name_filter) noexcept
|
|
997
|
+
{
|
|
998
|
+
int maxDescriptors = 10;
|
|
999
|
+
int nDescriptors;
|
|
1000
|
+
for (;;) {
|
|
1001
|
+
const struct heif_encoder_descriptor** descriptors;
|
|
1002
|
+
descriptors = new const heif_encoder_descriptor* [maxDescriptors];
|
|
1003
|
+
|
|
1004
|
+
nDescriptors = heif_context_get_encoder_descriptors(nullptr,
|
|
1005
|
+
format_filter,
|
|
1006
|
+
name_filter,
|
|
1007
|
+
descriptors,
|
|
1008
|
+
maxDescriptors);
|
|
1009
|
+
if (nDescriptors < maxDescriptors) {
|
|
1010
|
+
std::vector<EncoderDescriptor> outDescriptors;
|
|
1011
|
+
outDescriptors.reserve(nDescriptors);
|
|
1012
|
+
for (int i = 0; i < nDescriptors; i++) {
|
|
1013
|
+
outDescriptors.push_back(EncoderDescriptor(descriptors[i]));
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
delete[] descriptors;
|
|
1017
|
+
|
|
1018
|
+
return outDescriptors;
|
|
1019
|
+
}
|
|
1020
|
+
else {
|
|
1021
|
+
delete[] descriptors;
|
|
1022
|
+
maxDescriptors *= 2;
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
|
|
1028
|
+
inline std::string EncoderDescriptor::get_name() const noexcept
|
|
1029
|
+
{
|
|
1030
|
+
return heif_encoder_descriptor_get_name(m_descriptor);
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
inline std::string EncoderDescriptor::get_id_name() const noexcept
|
|
1034
|
+
{
|
|
1035
|
+
return heif_encoder_descriptor_get_id_name(m_descriptor);
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
inline enum heif_compression_format EncoderDescriptor::get_compression_format() const noexcept
|
|
1039
|
+
{
|
|
1040
|
+
return heif_encoder_descriptor_get_compression_format(m_descriptor);
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
inline bool EncoderDescriptor::supportes_lossy_compression() const noexcept
|
|
1044
|
+
{
|
|
1045
|
+
return heif_encoder_descriptor_supports_lossy_compression(m_descriptor);
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
inline bool EncoderDescriptor::supports_lossy_compression() const noexcept
|
|
1049
|
+
{
|
|
1050
|
+
return heif_encoder_descriptor_supports_lossy_compression(m_descriptor);
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
inline bool EncoderDescriptor::supportes_lossless_compression() const noexcept
|
|
1054
|
+
{
|
|
1055
|
+
return heif_encoder_descriptor_supports_lossless_compression(m_descriptor);
|
|
1056
|
+
}
|
|
1057
|
+
|
|
1058
|
+
inline bool EncoderDescriptor::supports_lossless_compression() const noexcept
|
|
1059
|
+
{
|
|
1060
|
+
return heif_encoder_descriptor_supports_lossless_compression(m_descriptor);
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
inline Encoder EncoderDescriptor::get_encoder() const
|
|
1064
|
+
{
|
|
1065
|
+
heif_encoder* encoder;
|
|
1066
|
+
Error err = Error(heif_context_get_encoder(nullptr, m_descriptor, &encoder));
|
|
1067
|
+
if (err) {
|
|
1068
|
+
throw err;
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
return Encoder(encoder);
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
|
|
1075
|
+
inline Encoder::Encoder(enum heif_compression_format format)
|
|
1076
|
+
{
|
|
1077
|
+
heif_encoder* encoder;
|
|
1078
|
+
Error err = Error(heif_context_get_encoder_for_format(nullptr, format, &encoder));
|
|
1079
|
+
if (err) {
|
|
1080
|
+
throw err;
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
m_encoder = std::shared_ptr<heif_encoder>(encoder,
|
|
1084
|
+
[](heif_encoder* e) { heif_encoder_release(e); });
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
inline Encoder::Encoder(struct heif_encoder* encoder) noexcept
|
|
1088
|
+
{
|
|
1089
|
+
m_encoder = std::shared_ptr<heif_encoder>(encoder,
|
|
1090
|
+
[](heif_encoder* e) { heif_encoder_release(e); });
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
|
|
1094
|
+
inline EncoderParameter::EncoderParameter(const heif_encoder_parameter* param)
|
|
1095
|
+
: m_parameter(param)
|
|
1096
|
+
{
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
inline std::string EncoderParameter::get_name() const noexcept
|
|
1100
|
+
{
|
|
1101
|
+
return heif_encoder_parameter_get_name(m_parameter);
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1104
|
+
inline enum heif_encoder_parameter_type EncoderParameter::get_type() const noexcept
|
|
1105
|
+
{
|
|
1106
|
+
return heif_encoder_parameter_get_type(m_parameter);
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1109
|
+
inline bool EncoderParameter::is_integer() const noexcept
|
|
1110
|
+
{
|
|
1111
|
+
return get_type() == heif_encoder_parameter_type_integer;
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
inline bool EncoderParameter::get_valid_integer_range(int& out_minimum, int& out_maximum)
|
|
1115
|
+
{
|
|
1116
|
+
int have_minimum_maximum;
|
|
1117
|
+
Error err = Error(heif_encoder_parameter_get_valid_integer_range(m_parameter,
|
|
1118
|
+
&have_minimum_maximum,
|
|
1119
|
+
&out_minimum, &out_maximum));
|
|
1120
|
+
if (err) {
|
|
1121
|
+
throw err;
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1124
|
+
return have_minimum_maximum;
|
|
1125
|
+
}
|
|
1126
|
+
|
|
1127
|
+
inline bool EncoderParameter::is_boolean() const noexcept
|
|
1128
|
+
{
|
|
1129
|
+
return get_type() == heif_encoder_parameter_type_boolean;
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
inline bool EncoderParameter::is_string() const noexcept
|
|
1133
|
+
{
|
|
1134
|
+
return get_type() == heif_encoder_parameter_type_string;
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
inline std::vector<std::string> EncoderParameter::get_valid_string_values() const
|
|
1138
|
+
{
|
|
1139
|
+
const char* const* stringarray;
|
|
1140
|
+
Error err = Error(heif_encoder_parameter_get_valid_string_values(m_parameter,
|
|
1141
|
+
&stringarray));
|
|
1142
|
+
if (err) {
|
|
1143
|
+
throw err;
|
|
1144
|
+
}
|
|
1145
|
+
|
|
1146
|
+
std::vector<std::string> values;
|
|
1147
|
+
for (int i = 0; stringarray[i]; i++) {
|
|
1148
|
+
values.push_back(stringarray[i]);
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
return values;
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
inline std::vector<EncoderParameter> Encoder::list_parameters() const noexcept
|
|
1155
|
+
{
|
|
1156
|
+
std::vector<EncoderParameter> parameters;
|
|
1157
|
+
|
|
1158
|
+
for (const struct heif_encoder_parameter* const* params = heif_encoder_list_parameters(m_encoder.get());
|
|
1159
|
+
*params;
|
|
1160
|
+
params++) {
|
|
1161
|
+
parameters.push_back(EncoderParameter(*params));
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
return parameters;
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
|
|
1168
|
+
inline void Encoder::set_lossy_quality(int quality)
|
|
1169
|
+
{
|
|
1170
|
+
Error err = Error(heif_encoder_set_lossy_quality(m_encoder.get(), quality));
|
|
1171
|
+
if (err) {
|
|
1172
|
+
throw err;
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
inline void Encoder::set_lossless(bool enable_lossless)
|
|
1177
|
+
{
|
|
1178
|
+
Error err = Error(heif_encoder_set_lossless(m_encoder.get(), enable_lossless));
|
|
1179
|
+
if (err) {
|
|
1180
|
+
throw err;
|
|
1181
|
+
}
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
inline void Encoder::set_integer_parameter(const std::string& parameter_name, int value)
|
|
1185
|
+
{
|
|
1186
|
+
Error err = Error(heif_encoder_set_parameter_integer(m_encoder.get(), parameter_name.c_str(), value));
|
|
1187
|
+
if (err) {
|
|
1188
|
+
throw err;
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
inline int Encoder::get_integer_parameter(const std::string& parameter_name) const
|
|
1193
|
+
{
|
|
1194
|
+
int value;
|
|
1195
|
+
Error err = Error(heif_encoder_get_parameter_integer(m_encoder.get(), parameter_name.c_str(), &value));
|
|
1196
|
+
if (err) {
|
|
1197
|
+
throw err;
|
|
1198
|
+
}
|
|
1199
|
+
return value;
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
inline void Encoder::set_boolean_parameter(const std::string& parameter_name, bool value)
|
|
1203
|
+
{
|
|
1204
|
+
Error err = Error(heif_encoder_set_parameter_boolean(m_encoder.get(), parameter_name.c_str(), value));
|
|
1205
|
+
if (err) {
|
|
1206
|
+
throw err;
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
|
+
inline bool Encoder::get_boolean_parameter(const std::string& parameter_name) const
|
|
1211
|
+
{
|
|
1212
|
+
int value;
|
|
1213
|
+
Error err = Error(heif_encoder_get_parameter_boolean(m_encoder.get(), parameter_name.c_str(), &value));
|
|
1214
|
+
if (err) {
|
|
1215
|
+
throw err;
|
|
1216
|
+
}
|
|
1217
|
+
return value;
|
|
1218
|
+
}
|
|
1219
|
+
|
|
1220
|
+
inline void Encoder::set_string_parameter(const std::string& parameter_name, const std::string& value)
|
|
1221
|
+
{
|
|
1222
|
+
Error err = Error(heif_encoder_set_parameter_string(m_encoder.get(), parameter_name.c_str(), value.c_str()));
|
|
1223
|
+
if (err) {
|
|
1224
|
+
throw err;
|
|
1225
|
+
}
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1228
|
+
inline std::string Encoder::get_string_parameter(const std::string& parameter_name) const
|
|
1229
|
+
{
|
|
1230
|
+
const int max_size = 250;
|
|
1231
|
+
char value[max_size];
|
|
1232
|
+
Error err = Error(heif_encoder_get_parameter_string(m_encoder.get(), parameter_name.c_str(),
|
|
1233
|
+
value, max_size));
|
|
1234
|
+
if (err) {
|
|
1235
|
+
throw err;
|
|
1236
|
+
}
|
|
1237
|
+
return value;
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
inline void Encoder::set_parameter(const std::string& parameter_name, const std::string& parameter_value)
|
|
1241
|
+
{
|
|
1242
|
+
Error err = Error(heif_encoder_set_parameter(m_encoder.get(), parameter_name.c_str(),
|
|
1243
|
+
parameter_value.c_str()));
|
|
1244
|
+
if (err) {
|
|
1245
|
+
throw err;
|
|
1246
|
+
}
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1249
|
+
inline std::string Encoder::get_parameter(const std::string& parameter_name) const
|
|
1250
|
+
{
|
|
1251
|
+
const int max_size = 250;
|
|
1252
|
+
char value[max_size];
|
|
1253
|
+
Error err = Error(heif_encoder_get_parameter(m_encoder.get(), parameter_name.c_str(),
|
|
1254
|
+
value, max_size));
|
|
1255
|
+
if (err) {
|
|
1256
|
+
throw err;
|
|
1257
|
+
}
|
|
1258
|
+
return value;
|
|
1259
|
+
}
|
|
1260
|
+
|
|
1261
|
+
inline void Context::set_primary_image(ImageHandle& new_primary_image_handle)
|
|
1262
|
+
{
|
|
1263
|
+
Error err = Error(heif_context_set_primary_image(m_context.get(),
|
|
1264
|
+
new_primary_image_handle.get_raw_image_handle()));
|
|
1265
|
+
if (err) {
|
|
1266
|
+
throw err;
|
|
1267
|
+
}
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
|
|
1271
|
+
inline Context::EncodingOptions::EncodingOptions()
|
|
1272
|
+
{
|
|
1273
|
+
// TODO: this is a bit hacky. It would be better to have an API function to set
|
|
1274
|
+
// the options to default values. But I do not see any reason for that apart from
|
|
1275
|
+
// this use-case.
|
|
1276
|
+
|
|
1277
|
+
struct heif_encoding_options* default_options = heif_encoding_options_alloc();
|
|
1278
|
+
*static_cast<heif_encoding_options*>(this) = *default_options; // copy over all options
|
|
1279
|
+
heif_encoding_options_free(default_options);
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
|
|
1283
|
+
inline ImageHandle Context::encode_image(const Image& img, Encoder& encoder,
|
|
1284
|
+
const EncodingOptions& options)
|
|
1285
|
+
{
|
|
1286
|
+
struct heif_image_handle* image_handle;
|
|
1287
|
+
|
|
1288
|
+
Error err = Error(heif_context_encode_image(m_context.get(),
|
|
1289
|
+
img.m_image.get(),
|
|
1290
|
+
encoder.m_encoder.get(),
|
|
1291
|
+
&options,
|
|
1292
|
+
&image_handle));
|
|
1293
|
+
if (err) {
|
|
1294
|
+
throw err;
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
return ImageHandle(image_handle);
|
|
1298
|
+
}
|
|
1299
|
+
|
|
1300
|
+
|
|
1301
|
+
inline ImageHandle Context::encode_thumbnail(const Image& image,
|
|
1302
|
+
const ImageHandle& master_image_handle,
|
|
1303
|
+
Encoder& encoder,
|
|
1304
|
+
const EncodingOptions& options,
|
|
1305
|
+
int bbox_size)
|
|
1306
|
+
{
|
|
1307
|
+
struct heif_image_handle* thumb_image_handle;
|
|
1308
|
+
|
|
1309
|
+
Error err = Error(heif_context_encode_thumbnail(m_context.get(),
|
|
1310
|
+
image.m_image.get(),
|
|
1311
|
+
master_image_handle.get_raw_image_handle(),
|
|
1312
|
+
encoder.m_encoder.get(),
|
|
1313
|
+
&options,
|
|
1314
|
+
bbox_size,
|
|
1315
|
+
&thumb_image_handle));
|
|
1316
|
+
if (err) {
|
|
1317
|
+
throw err;
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1320
|
+
return ImageHandle(thumb_image_handle);
|
|
1321
|
+
}
|
|
1322
|
+
|
|
1323
|
+
|
|
1324
|
+
inline void Context::assign_thumbnail(const ImageHandle& thumbnail_image,
|
|
1325
|
+
const ImageHandle& master_image)
|
|
1326
|
+
{
|
|
1327
|
+
Error err = Error(heif_context_assign_thumbnail(m_context.get(),
|
|
1328
|
+
thumbnail_image.get_raw_image_handle(),
|
|
1329
|
+
master_image.get_raw_image_handle()));
|
|
1330
|
+
if (err) {
|
|
1331
|
+
throw err;
|
|
1332
|
+
}
|
|
1333
|
+
}
|
|
1334
|
+
|
|
1335
|
+
inline void Context::add_exif_metadata(const ImageHandle& master_image,
|
|
1336
|
+
const void* data, int size)
|
|
1337
|
+
{
|
|
1338
|
+
Error err = Error(heif_context_add_exif_metadata(m_context.get(),
|
|
1339
|
+
master_image.get_raw_image_handle(),
|
|
1340
|
+
data, size));
|
|
1341
|
+
if (err) {
|
|
1342
|
+
throw err;
|
|
1343
|
+
}
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
|
+
inline void Context::add_XMP_metadata(const ImageHandle& master_image,
|
|
1347
|
+
const void* data, int size)
|
|
1348
|
+
{
|
|
1349
|
+
Error err = Error(heif_context_add_XMP_metadata(m_context.get(),
|
|
1350
|
+
master_image.get_raw_image_handle(),
|
|
1351
|
+
data, size));
|
|
1352
|
+
if (err) {
|
|
1353
|
+
throw err;
|
|
1354
|
+
}
|
|
1355
|
+
}
|
|
1356
|
+
}
|
|
1357
|
+
|
|
1358
|
+
|
|
1359
|
+
#endif
|