heif  3.7.0
About: HEIF (High Efficiency Image File Format) is a visual media container format for images and image sequences (MPEG-standard). This HEIF engine demonstrates its powerful features and capabilities (under Nokia HEIF license).
  Fossies Dox: heif-3.7.0.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

HEIF::Writer Class Referenceabstract

#include <heifwriter.h>

Inheritance diagram for HEIF::Writer:
Collaboration diagram for HEIF::Writer:

Public Member Functions

virtual ErrorCode initialize (const OutputConfig &outputConfig)=0
 
virtual ErrorCode setMajorBrand (const FourCC &brand)=0
 
virtual ErrorCode addCompatibleBrand (const FourCC &brand)=0
 
virtual ErrorCode addCompatibleBrandCombination (const Array< FourCC > &compatibleBrandCombination)=0
 
virtual ErrorCode finalize ()=0
 
virtual ErrorCode feedDecoderConfig (const Array< DecoderSpecificInfo > &decoderConfig, DecoderConfigId &decoderConfigId)=0
 
virtual ErrorCode feedMediaData (const Data &data, MediaDataId &mediaDataId)=0
 
virtual ErrorCode addImage (const MediaDataId &mediaDataId, ImageId &imageId)=0
 
virtual ErrorCode addImage (const MediaDataId &mediaDataId, const Array< ImageId > &referenceImageIds, ImageId &imageId)=0
 
virtual ErrorCode setPrimaryItem (const ImageId &imageId)=0
 
virtual ErrorCode setItemDescription (const ImageId &imageId, const ItemDescription &itemDescription)=0
 
virtual ErrorCode addMetadata (const MediaDataId &mediaDataId, MetadataItemId &metadataItemId)=0
 
virtual ErrorCode addThumbnail (const ImageId &thumbImageId, const ImageId &masterImageId)=0
 
virtual ErrorCode addProperty (const CleanAperture &clap, PropertyId &propertyId)=0
 
virtual ErrorCode addProperty (const Mirror &imir, PropertyId &propertyId)=0
 
virtual ErrorCode addProperty (const Rotate &irot, PropertyId &propertyId)=0
 
virtual ErrorCode addProperty (const RelativeLocation &rloc, PropertyId &propertyId)=0
 
virtual ErrorCode addProperty (const PixelInformation &pixi, PropertyId &propertyId)=0
 
virtual ErrorCode addProperty (const ColourInformation &colr, PropertyId &propertyId)=0
 
virtual ErrorCode addProperty (const PixelAspectRatio &pasp, PropertyId &propertyId)=0
 
virtual ErrorCode addProperty (const AuxiliaryType &auxC, PropertyId &propertyId)=0
 
virtual ErrorCode addProperty (const RequiredReferenceTypes &rref, PropertyId &propertyId)=0
 
virtual ErrorCode addProperty (const UserDescription &udes, PropertyId &propertyId)=0
 
virtual ErrorCode addProperty (const Scale &iscl, PropertyId &propertyId)=0
 
virtual ErrorCode addProperty (const AccessibilityText &altt, PropertyId &propertyId)=0
 
virtual ErrorCode addProperty (const CreationTimeInformation &crtt, PropertyId &propertyId)=0
 
virtual ErrorCode addProperty (const ModificationTimeInformation &mdft, PropertyId &propertyId)=0
 
virtual ErrorCode addProperty (const RawProperty &property, const bool isTransformative, PropertyId &propertyId)=0
 
virtual ErrorCode associateProperty (const ImageId &imageId, const PropertyId &propertyId, const bool isEssential=false)=0
 
virtual ErrorCode associateProperty (const GroupId &groupId, const PropertyId &propertyId, const bool isEssential=false)=0
 
virtual ErrorCode addDerivedImage (const ImageId &imageId, ImageId &derivedImageId)=0
 
virtual ErrorCode addDerivedImageItem (const Grid &grid, ImageId &gridId)=0
 
virtual ErrorCode addDerivedImageItem (const Overlay &iovl, ImageId &overlayId)=0
 
virtual ErrorCode addMetadataItemReference (const MetadataItemId &fromMetadata, const ImageId &toImageId)=0
 
virtual ErrorCode addTbasItemReference (const ImageId &fromImageId, const ImageId &toImageId)=0
 
virtual ErrorCode addBaseItemReference (const ImageId &fromImageId, const Array< ImageId > &toImageIds)=0
 
virtual ErrorCode addAuxiliaryReference (const ImageId &fromImageId, const ImageId &toImageId)=0
 
virtual ErrorCode setImageHidden (const ImageId &imageId, const bool hidden)=0
 
virtual ErrorCode addImageSequence (const Rational &timeBase, const CodingConstraints &constraints, SequenceId &id)=0
 
virtual ErrorCode addImage (const SequenceId &sequenceId, const MediaDataId &mediaDataId, const SampleInfo &sampleInfo, SequenceImageId &imageId)=0
 
virtual ErrorCode addMetadataItemReference (const MetadataItemId &metadataItemId, const SequenceId &sequenceId, const SequenceImageId &imageId)=0
 
virtual ErrorCode addThumbnails (const SequenceId &thumbSequenceId, const SequenceId &sequenceId)=0
 
virtual ErrorCode setImageHidden (const SequenceImageId &sequenceImageId, const bool hidden)=0
 
virtual ErrorCode addProperty (const CleanAperture &clap, const SequenceId &sequenceId)=0
 
virtual ErrorCode addAuxiliaryReference (const AuxiliaryType &auxC, const SequenceId &auxiliarySequenceId, const SequenceId &sequenceId)=0
 
virtual ErrorCode setEditList (const SequenceId &sequenceId, const EditList &editList)=0
 
virtual ErrorCode setMatrix (const Array< int32_t > &matrix)=0
 
virtual ErrorCode setMatrix (const SequenceId &sequenceId, const Array< int32_t > &matrix)=0
 
virtual ErrorCode setAlternateGrouping (const SequenceId &sequenceId1, const SequenceId &sequenceId2)=0
 
virtual ErrorCode createEntityGroup (const FourCC &type, GroupId &id)=0
 
virtual ErrorCode createAlternativesGroup (GroupId &id)=0
 
virtual ErrorCode createEquivalenceGroup (GroupId &id)=0
 
virtual ErrorCode addToGroup (const GroupId &groupId, const ImageId &id)=0
 
virtual ErrorCode addToGroup (const GroupId &groupId, const SequenceId &id)=0
 
virtual ErrorCode addToEquivalenceGroup (const GroupId &equivalenceGroupId, const SequenceId &sequenceId, const SequenceImageId &sequenceImageId, const EquivalenceTimeOffset &offset={0, 1<< 8})=0
 
virtual ErrorCode createTrackGroup (const FourCC &type, TrackGroupId &id)=0
 createTrackGroup Create a new grouping done within a Track group box 'trgr'. More...
 
virtual ErrorCode addToGroup (const TrackGroupId &trackGroupId, const SequenceId &sequenceId)=0
 addToGroup Add a Image Sequence (track) to a track group. More...
 
virtual ErrorCode addVideoTrack (const Rational &timeBase, SequenceId &id)=0
 
virtual ErrorCode addVideo (const SequenceId &id, const MediaDataId &mediaDataId, const SampleInfo &sampleInfo, SequenceImageId &sampleid)=0
 
virtual ErrorCode addAudioTrack (const Rational &timeBase, const AudioParams &config, SequenceId &id)=0
 
virtual ErrorCode addAudio (const SequenceId &id, const MediaDataId &mediaDataId, const SampleInfo &sampleInfo, SequenceImageId &sampleid)=0
 

Static Public Member Functions

static WriterCreate ()
 
static void Destroy (Writer *instance)
 
static ErrorCode SetCustomAllocator (CustomAllocator *customAllocator)
 
static const char * GetVersion ()
 

Protected Member Functions

virtual ~Writer ()=default
 

Detailed Description

HEIF (High Efficiency Image File Format) writer. Standard specification: http://standards.iso.org/ittf/PubliclyAvailableStandards/c066067_ISO_IEC_23008-12_2017.zip

Definition at line 28 of file heifwriter.h.

Constructor & Destructor Documentation

◆ ~Writer()

virtual HEIF::Writer::~Writer ( )
protectedvirtualdefault

Member Function Documentation

◆ addAudio()

virtual ErrorCode HEIF::Writer::addAudio ( const SequenceId id,
const MediaDataId mediaDataId,
const SampleInfo sampleInfo,
SequenceImageId sampleid 
)
pure virtual

Add an audio sample to a audio track. Audio bitstream must have been already fed by using feedMediaData(). Note: Audio must be fed in media data / decoding order!

Parameters
id[in] Id of the audio track, generated by addAudioTrack().
mediaDataId[in] Id of the data from feedMediaData().
sampleInfo[in] Information of given mediaDataId to generate playable sequence.
sampleid[out] Id for the sample that was added to the track
Returns
ErrorCode: OK, UNINITIALIZED, INVALID_SEQUENCE_ID, INVALID_MEDIADATA_ID, INVALID_FUNCTION_PARAMETER or INVALID_MEDIA_FORMAT

Implemented in HEIF::WriterImpl.

Referenced by HEIFPP::Sample::save().

Here is the caller graph for this function:

◆ addAudioTrack()

virtual ErrorCode HEIF::Writer::addAudioTrack ( const Rational timeBase,
const AudioParams config,
SequenceId id 
)
pure virtual

Add a new audio (track with 'soun' handler type) to the file.

Parameters
timeBase[in] Rational value of number of time units per second used for this audio track (usually 1 / samplerate)
config[in] AudioParams for this audio track. See AudioParams struct definition for more info.
id[out] SequenceId identifier of the added track. This is not necessary same the corresponding track ID in the file.
Returns
ErrorCode: OK, UNINITIALIZED

Implemented in HEIF::WriterImpl.

Referenced by HEIFPP::AudioTrack::save().

Here is the caller graph for this function:

◆ addAuxiliaryReference() [1/2]

virtual ErrorCode HEIF::Writer::addAuxiliaryReference ( const AuxiliaryType auxC,
const SequenceId auxiliarySequenceId,
const SequenceId sequenceId 
)
pure virtual

Set an Image Sequence as an auxiliary Image Sequence for another Image Sequence.

  • Changes auxiliary Image Sequence track handler type to 'auxv'.
  • Adds 'auxl' track reference from auxiliary Image Sequence to master Image Sequence.
    Parameters
    auxC[in] Type of the auxiliary image as AuxiliaryType struct: auxType : "urn:mpeg:mpegB:cicp:systems:auxiliary:alpha" for alpha plane "urn:mpeg:mpegB:cicp:systems:auxiliary:depth" for depth map
    auxiliarySequenceId[in] SequenceId of the Image Sequence that is marked as auxiliary.
    sequenceId[in] SequenceId of the Image Sequence for which the auxiliary Image Sequence is added.
    Returns
    ErrorCode: OK, UNINITIALIZED or INVALID_SEQUENCE_ID

Implemented in HEIF::WriterImpl.

◆ addAuxiliaryReference() [2/2]

virtual ErrorCode HEIF::Writer::addAuxiliaryReference ( const ImageId fromImageId,
const ImageId toImageId 
)
pure virtual

Set an image as an auxiliary image of another image. Adds item reference of type 'auxl' from the auxiliary image to the master image.

Parameters
fromImageIdImageId of the auxiliary image.
toImageIdImageId of the image for which the auxiliary image is added.
Returns
ErrorCode: OK, UNINITIALIZED or INVALID_ITEM_ID

Implemented in HEIF::WriterImpl.

Referenced by HEIFPP::ImageItem::save(), and HEIFPP::ImageSequence::save().

Here is the caller graph for this function:

◆ addBaseItemReference()

virtual ErrorCode HEIF::Writer::addBaseItemReference ( const ImageId fromImageId,
const Array< ImageId > &  toImageIds 
)
pure virtual

Set 'base' item references for a pre-derived coded image.

Parameters
fromImageIdImageId of the pre-derived coded image.
toImageIdsImageId's of images the pre-derived coded image derives from.
Returns
ErrorCode: OK, UNINITIALIZED or INVALID_ITEM_ID

Implemented in HEIF::WriterImpl.

Referenced by HEIFPP::CodedImageItem::save().

Here is the caller graph for this function:

◆ addCompatibleBrand()

virtual ErrorCode HEIF::Writer::addCompatibleBrand ( const FourCC brand)
pure virtual

Add a new compatible brand. Calling this is possible only if the file type box was not already written (OutputConfig.progressiveFile = true).

Parameters
brandFourCC of new compatible brand to append.
Returns
ErrorCode: OK, UNINITIALIZED or FTYP_ALREADY_WRITTEN

Implemented in HEIF::WriterImpl.

◆ addCompatibleBrandCombination()

virtual ErrorCode HEIF::Writer::addCompatibleBrandCombination ( const Array< FourCC > &  compatibleBrandCombination)
pure virtual

Add a new compatible brand combination. A new type combination box will be added to the extended type box, after the file type box. Calling this is possible only if the file type box was not already written (OutputConfig.progressiveFile = true).

Parameters
compatibleBrandCombinationFourCCs of a new compatible brand combination. Empty array returns error INVALID_FUNCTION_PARAMETER.
Returns
ErrorCode: OK, INVALID_FUNCTION_PARAMETER, UNINITIALIZED or FTYP_ALREADY_WRITTEN

Implemented in HEIF::WriterImpl.

◆ addDerivedImage()

virtual ErrorCode HEIF::Writer::addDerivedImage ( const ImageId imageId,
ImageId derivedImageId 
)
pure virtual

Create a new identity-derived image from an existing image. This implies creation of an item of type 'iden' (identity transformation) and 'dimg' item reference from the 'iden' image to the existing source item.

Parameters
imageId[in] ImageId of the existing image item.
derivedImageId[out] ImageId of the created 'iden' image item.
Returns
ErrorCode: OK, UNINITIALIZED or INVALID_ITEM_ID

Implemented in HEIF::WriterImpl.

Referenced by HEIFPP::IdentityImageItem::save().

Here is the caller graph for this function:

◆ addDerivedImageItem() [1/2]

virtual ErrorCode HEIF::Writer::addDerivedImageItem ( const Grid grid,
ImageId gridId 
)
pure virtual

Create an image grid derived item.

Parameters
grid[in] Parameters for the image grid item.
gridId[out] Id of the created image grid.
Returns
ErrorCode: OK, UNINITIALIZED, INVALID_REFERENCE_COUNT, INVALID_FUNCTION_PARAMETER or INVALID_ITEM_ID

Implemented in HEIF::WriterImpl.

Referenced by HEIFPP::GridImageItem::save(), and HEIFPP::OverlayImageItem::save().

Here is the caller graph for this function:

◆ addDerivedImageItem() [2/2]

virtual ErrorCode HEIF::Writer::addDerivedImageItem ( const Overlay iovl,
ImageId overlayId 
)
pure virtual

Create an image overlay derived item.

Parameters
iovl[in] Parameters for the image overlay item.
overlayId[out] Id of the created image overlay.
Returns
ErrorCode: OK, UNINITIALIZED, INVALID_REFERENCE_COUNT, INVALID_FUNCTION_PARAMETER or INVALID_ITEM_ID

Implemented in HEIF::WriterImpl.

◆ addImage() [1/3]

virtual ErrorCode HEIF::Writer::addImage ( const MediaDataId mediaDataId,
const Array< ImageId > &  referenceImageIds,
ImageId imageId 
)
pure virtual

Add an image with decoding dependencies to a HEIF Image Collection. The image bitstream and decoding dependencies must have been already fed by using feedMediaData() and addImage().

Parameters
mediaDataId[in] MediaDataId of the data from feedMediaData().
referenceImageIds[in] Ids of reference images.
imageId[out] ImageId of the added image.
Returns
ErrorCode: OK, UNINITIALIZED, INVALID_ITEM_ID or INVALID_MEDIADATA_ID

Implemented in HEIF::WriterImpl.

◆ addImage() [2/3]

virtual ErrorCode HEIF::Writer::addImage ( const MediaDataId mediaDataId,
ImageId imageId 
)
pure virtual

Add an image to a HEIF Image Collection. Image bitstream must have been already fed by using feedMediaData().

Parameters
mediaDataId[in] MediaDataId of the data from feedMediaData().
imageId[out] ImageId of the added image.
Returns
ErrorCode: OK, UNINITIALIZED or INVALID_MEDIADATA_ID

Implemented in HEIF::WriterImpl.

Referenced by HEIFPP::Sample::save(), and HEIFPP::CodedImageItem::save().

Here is the caller graph for this function:

◆ addImage() [3/3]

virtual ErrorCode HEIF::Writer::addImage ( const SequenceId sequenceId,
const MediaDataId mediaDataId,
const SampleInfo sampleInfo,
SequenceImageId imageId 
)
pure virtual

Add an image to a image sequence. Image bitstream must have been already fed by using feedMediaData(). Note: Images must be fed in media data / decoding order!

Parameters
sequenceId[in] SequenceId of the image sequence, returned by addImageSequence().
mediaDataId[in] MediaDataId of the data from feedMediaData().
sampleInfo[in] SampleInfo struct information of given mediaDataId to generate playable sequence.
imageId[out] Identifier of the added image.
Returns
ErrorCode: OK, UNINITIALIZED, INVALID_SEQUENCE_ID, INVALID_MEDIADATA_ID, INVALID_FUNCTION_PARAMETER or INVALID_MEDIA_FORMAT

Implemented in HEIF::WriterImpl.

◆ addImageSequence()

virtual ErrorCode HEIF::Writer::addImageSequence ( const Rational timeBase,
const CodingConstraints constraints,
SequenceId id 
)
pure virtual

Add a new HEIF Image Sequence (track with 'pict' handler type) to the file.

Parameters
timeBase[in] Rational value of number of time units per second used for this image sequence (usually 1 / timescale)
constraints[in] CodingConstraints for this image sequence. See CodingConstraints struct definition for more info.
id[out] SequenceId identifier of the added sequence. This is not necessarily the same as the corresponding track ID in the file.
Returns
ErrorCode: OK or UNINITIALIZED

Implemented in HEIF::WriterImpl.

Referenced by HEIFPP::ImageSequence::save().

Here is the caller graph for this function:

◆ addMetadata()

virtual ErrorCode HEIF::Writer::addMetadata ( const MediaDataId mediaDataId,
MetadataItemId metadataItemId 
)
pure virtual

Add external metadata (EXIF, XMP or MPEG-7) for an image in Image Collection

Parameters
mediaDataId[in] MediaDataId of metadata that was previously fed to writer using feedMediaData().
metadataItemId[out] MetadataItemId of the created metadata item.
Returns
ErrorCode: OK, UNINITIALIZED, INVALID_ITEM_ID or INVALID_MEDIADATA_ID

Implemented in HEIF::WriterImpl.

Referenced by HEIFPP::ExifItem::save(), and HEIFPP::MimeItem::save().

Here is the caller graph for this function:

◆ addMetadataItemReference() [1/2]

virtual ErrorCode HEIF::Writer::addMetadataItemReference ( const MetadataItemId fromMetadata,
const ImageId toImageId 
)
pure virtual

Add metadata reference from metadata item to Image that metadata describes.

Parameters
fromMetadata[in] MetadataItemId of linked metadata
toImageId[in] ImageId of image that the metadata is linked to

Implemented in HEIF::WriterImpl.

Referenced by HEIFPP::Sample::save(), and HEIFPP::ImageItem::save().

Here is the caller graph for this function:

◆ addMetadataItemReference() [2/2]

virtual ErrorCode HEIF::Writer::addMetadataItemReference ( const MetadataItemId metadataItemId,
const SequenceId sequenceId,
const SequenceImageId imageId 
)
pure virtual

Add external metadata for an image in Image Sequence

Parameters
metadataItemId[in] MetadataItemId of metadata.
sequenceId[in] SequenceId of the image sequence.
imageId[in] SequenceImageId of the image to link metadata to.
Returns
ErrorCode: OK, UNINITIALIZED, INVALID_SEQUENCE_ID or INVALID_SEQUENCE_IMAGE_ID

Implemented in HEIF::WriterImpl.

◆ addProperty() [1/16]

virtual ErrorCode HEIF::Writer::addProperty ( const AccessibilityText altt,
PropertyId propertyId 
)
pure virtual

Add a Accessibility text 'altt' descriptive property. It can be then associated to one or several images by using method associateProperty().

Parameters
altt[in] Parameters for the Accessibility text property.
propertyId[out] PropertyId of the added property, to be used as a parameter of associateProperty().
Returns
ErrorCode: OK or UNINITIALIZED

Implemented in HEIF::WriterImpl.

◆ addProperty() [2/16]

virtual ErrorCode HEIF::Writer::addProperty ( const AuxiliaryType auxC,
PropertyId propertyId 
)
pure virtual

Add a auxiliary type 'auxC' descriptive property. It can be then associated to one or several images by using method associateProperty(). If an image has an associated auxiliary property, a 'auxl' reference from from the auxiliary image to the master image must be also present. The reference is created by using method addAuxiliaryReference().

Parameters
auxC[in] Parameters for the image properties for auxiliary images.
propertyId[out] PropertyId of the added property, to be used as a parameter of associateProperty().
Returns
ErrorCode: OK or UNINITIALIZED

Implemented in HEIF::WriterImpl.

◆ addProperty() [3/16]

virtual ErrorCode HEIF::Writer::addProperty ( const CleanAperture clap,
const SequenceId sequenceId 
)
pure virtual

Add a clean aperture 'clap' (cropping) property to an image sequence.

Parameters
clap[in] Parameters for the CleanApertureBox.
sequenceId[in] Id of the image sequence for which the CleanApertureBox is added.
Returns
ErrorCode: OK, UNINITIALIZED or INVALID_SEQUENCE_ID

Implemented in HEIF::WriterImpl.

◆ addProperty() [4/16]

virtual ErrorCode HEIF::Writer::addProperty ( const CleanAperture clap,
PropertyId propertyId 
)
pure virtual

Add a clean aperture 'clap' transformative property (cropping). It can be then associated to one or several images by using method associateProperty().

Parameters
clap[in] Parameters for the clean aperture property.
propertyId[out] PropertyId of the added property, to be used as a parameter of associateProperty().
Returns
ErrorCode: OK or UNINITIALIZED

Implemented in HEIF::WriterImpl.

Referenced by HEIFPP::PixelAspectRatioProperty::save(), HEIFPP::ColourInformationProperty::save(), HEIFPP::PixelInformationProperty::save(), HEIFPP::RelativeLocationProperty::save(), HEIFPP::AuxiliaryProperty::save(), HEIFPP::ImageSequence::save(), HEIFPP::RawProperty::save(), HEIFPP::CleanApertureProperty::save(), HEIFPP::RotateProperty::save(), and HEIFPP::MirrorProperty::save().

Here is the caller graph for this function:

◆ addProperty() [5/16]

virtual ErrorCode HEIF::Writer::addProperty ( const ColourInformation colr,
PropertyId propertyId 
)
pure virtual

Add a colour information 'colr' descriptive property. It can be then associated to one or several images by using method associateProperty().

Parameters
colr[in] Parameters for the colour information property.
propertyId[out] PropertyId of the added property, to be used as a parameter of associateProperty().
Returns
ErrorCode: OK, UNINITIALIZED or INVALID_FUNCTION_PARAMETER

Implemented in HEIF::WriterImpl.

◆ addProperty() [6/16]

virtual ErrorCode HEIF::Writer::addProperty ( const CreationTimeInformation crtt,
PropertyId propertyId 
)
pure virtual

Add a Creation time information 'crtt' descriptive property. It can be then associated to one or several images by using method associateProperty().

Parameters
crtt[in] Parameters for the Creation time information property.
propertyId[out] PropertyId of the added property, to be used as a parameter of associateProperty().
Returns
ErrorCode: OK or UNINITIALIZED

Implemented in HEIF::WriterImpl.

◆ addProperty() [7/16]

virtual ErrorCode HEIF::Writer::addProperty ( const Mirror imir,
PropertyId propertyId 
)
pure virtual

Add an image mirroring 'imir' transformative property. It can be then associated to one or several images by using method associateProperty().

Parameters
imir[in] Parameters for the the image mirroring property.
propertyId[out] PropertyId of the added property, to be used as a parameter of associateProperty().
Returns
ErrorCode: OK or UNINITIALIZED

Implemented in HEIF::WriterImpl.

◆ addProperty() [8/16]

virtual ErrorCode HEIF::Writer::addProperty ( const ModificationTimeInformation mdft,
PropertyId propertyId 
)
pure virtual

Add a Modification time information 'mdft' descriptive property. It can be then associated to one or several images by using method associateProperty().

Parameters
mdft[in] Parameters for the Modification time information property.
propertyId[out] PropertyId of the added property, to be used as a parameter of associateProperty().
Returns
ErrorCode: OK or UNINITIALIZED

Implemented in HEIF::WriterImpl.

◆ addProperty() [9/16]

virtual ErrorCode HEIF::Writer::addProperty ( const PixelAspectRatio pasp,
PropertyId propertyId 
)
pure virtual

Add a pixel aspect ratio 'pasp' descriptive property. It can be then associated to one or several images by using method associateProperty().

Parameters
pasp[in] Parameters for the pixel aspect ratio property.
propertyId[out] PropertyId of the added property, to be used as a parameter of associateProperty().
Returns
ErrorCode: OK or UNINITIALIZED

Implemented in HEIF::WriterImpl.

◆ addProperty() [10/16]

virtual ErrorCode HEIF::Writer::addProperty ( const PixelInformation pixi,
PropertyId propertyId 
)
pure virtual

Add a pixel information 'pixi' descriptive property. It can be then associated to one or several images by using method associateProperty().

Parameters
pixi[in] Parameters for the pixel information property.
propertyId[out] PropertyId of the added property, to be used as a parameter of associateProperty().
Returns
ErrorCode: OK or UNINITIALIZED

Implemented in HEIF::WriterImpl.

◆ addProperty() [11/16]

virtual ErrorCode HEIF::Writer::addProperty ( const RawProperty property,
const bool  isTransformative,
PropertyId propertyId 
)
pure virtual

Add a new property from binary data. Note that complete property data including box or full box header must be supplied. This can be used to add properties which are not supported by the writer, or for other purposes when full control of property data is wanted. The added property can then be associated to one or several images by using method associateProperty().

Parameters
property[in] Full data of the property.
isTransformative[in] True if this is a transformative property, false if it is a descriptive property.
propertyId[out] PropertyId of the added property, to be used as a parameter of associateProperty().
Returns
ErrorCode: OK or UNINITIALIZED

Implemented in HEIF::WriterImpl.

◆ addProperty() [12/16]

virtual ErrorCode HEIF::Writer::addProperty ( const RelativeLocation rloc,
PropertyId propertyId 
)
pure virtual

Add a relative location 'rloc' descriptive property. It can be then associated to one or several images by using method associateProperty(). If an image has an associated Relative location property, a 'tbas' reference from it must be also present. The reference is created by using method addTbasItemReference().

Parameters
rloc[in] Parameters for the relative location property.
propertyId[out] PropertyId of the added property, to be used as a parameter of associateProperty().
Returns
ErrorCode: OK or UNINITIALIZED

Implemented in HEIF::WriterImpl.

◆ addProperty() [13/16]

virtual ErrorCode HEIF::Writer::addProperty ( const RequiredReferenceTypes rref,
PropertyId propertyId 
)
pure virtual

Add a Required reference types 'rref' descriptive property. It can be then associated to one or several images by using method associateProperty().

Parameters
rref[in] Parameters for the Required reference types property.
propertyId[out] PropertyId of the added property, to be used as a parameter of associateProperty().
Returns
ErrorCode: OK or UNINITIALIZED

Implemented in HEIF::WriterImpl.

◆ addProperty() [14/16]

virtual ErrorCode HEIF::Writer::addProperty ( const Rotate irot,
PropertyId propertyId 
)
pure virtual

Add an image rotation 'irot' transformative property. It can be then associated to one or several images by using method associateProperty().

Parameters
irot[in] Parameters for the image rotation property.
propertyId[out] PropertyId of the added property, to be used as a parameter of associateProperty().
Returns
ErrorCode: OK or UNINITIALIZED

Implemented in HEIF::WriterImpl.

◆ addProperty() [15/16]

virtual ErrorCode HEIF::Writer::addProperty ( const Scale iscl,
PropertyId propertyId 
)
pure virtual

Add a Image scaling 'iscl' transformative property. It can be then associated to one or several images by using method associateProperty().

Parameters
iscl[in] Parameters for the Image scaling property.
propertyId[out] PropertyId of the added property, to be used as a parameter of associateProperty().
Returns
ErrorCode: OK or UNINITIALIZED

Implemented in HEIF::WriterImpl.

◆ addProperty() [16/16]

virtual ErrorCode HEIF::Writer::addProperty ( const UserDescription udes,
PropertyId propertyId 
)
pure virtual

Add a User description 'udes' descriptive property. It can be then associated to one or several images by using method associateProperty().

Parameters
udes[in] Parameters for the User description property.
propertyId[out] PropertyId of the added property, to be used as a parameter of associateProperty().
Returns
ErrorCode: OK or UNINITIALIZED

Implemented in HEIF::WriterImpl.

◆ addTbasItemReference()

virtual ErrorCode HEIF::Writer::addTbasItemReference ( const ImageId fromImageId,
const ImageId toImageId 
)
pure virtual

Set 'tbas' item reference from an image associated with a Relative location ('rloc') property to a reconstructed image. If an image has an associated Relative location property, a 'tbas' reference from it must be also present.

Parameters
fromImageIdId of the item associated with Relative location ('rloc') property.
toImageIdId of the reconstructed image, a part of which fromImageId is.
Returns
ErrorCode: OK, UNINITIALIZED or INVALID_ITEM_ID

Implemented in HEIF::WriterImpl.

◆ addThumbnail()

virtual ErrorCode HEIF::Writer::addThumbnail ( const ImageId thumbImageId,
const ImageId masterImageId 
)
pure virtual

Add a thumbnail image for an image. This creates a 'thmb' reference from the thumbnail image to the master image. A thumbnail can not be marked as a thumbnail of another thumbnail.

Parameters
thumbImageId[in] ImageId of the thumbnail image.
masterImageId[in] ImageId of the master image for which the thumbnail is added.
Returns
ErrorCode: OK, UNINITIALIZED or INVALID_ITEM_ID

Implemented in HEIF::WriterImpl.

Referenced by HEIFPP::ImageItem::save().

Here is the caller graph for this function:

◆ addThumbnails()

virtual ErrorCode HEIF::Writer::addThumbnails ( const SequenceId thumbSequenceId,
const SequenceId sequenceId 
)
pure virtual

Add a thumbnail sequence for a track. This results in:

  • Creating 'thmb' track reference from thumbnail track to master image track.
  • Enabling track_in_preview flag of the TrackHeaderBox 'tkhd' of the thumbnail track
  • Setting the same integer value for alternate_group in both track headers.
    Parameters
    thumbSequenceId[in] Id of the thumbnail image sequence.
    sequenceId[in] Id of the image sequence for which the thumbnail sequence is added.
    Returns
    ErrorCode: OK, UNINITIALIZED or INVALID_SEQUENCE_ID

Implemented in HEIF::WriterImpl.

◆ addToEquivalenceGroup()

virtual ErrorCode HEIF::Writer::addToEquivalenceGroup ( const GroupId equivalenceGroupId,
const SequenceId sequenceId,
const SequenceImageId sequenceImageId,
const EquivalenceTimeOffset offset = {0, 1<< 8} 
)
pure virtual

Add a Image Seqeunce image to an equivalence ('eqiv') entity group. Image Collection images can use generic addToGroup() instead.

Parameters
equivalenceGroupId[in] GroupId of the Equivalence entity group.
sequenceId[in] SequenceId of the image sequence which is added to the group.
sequenceImageId[in] SequenceImageId of the image sequence image which is added to the group.
offset[in] Optional: In case equivalence image item doesn't match give SequenceImageId timing on image sequence timeline this offset value can be added (see HEIF specification "6.8 Relating an untimed item to a timed sequence" for details) to indicate this.
Returns
ErrorCode: OK, UNINITIALIZED, INVALID_SEQUENCE_IMAGE_ID or INVALID_GROUP_ID

Implemented in HEIF::WriterImpl.

Referenced by HEIFPP::Heif::save().

Here is the caller graph for this function:

◆ addToGroup() [1/3]

virtual ErrorCode HEIF::Writer::addToGroup ( const GroupId groupId,
const ImageId id 
)
pure virtual

Add a image item to an entity group.

Parameters
groupId[in] GroupId of the entity group.
id[in] ImageId of the image item to add.
Returns
ErrorCode: OK, UNINITIALIZED, INVALID_ITEM_ID or INVALID_GROUP_ID

Implemented in HEIF::WriterImpl.

Referenced by HEIFPP::Heif::save().

Here is the caller graph for this function:

◆ addToGroup() [2/3]

virtual ErrorCode HEIF::Writer::addToGroup ( const GroupId groupId,
const SequenceId id 
)
pure virtual

Add a seqeunce image to an existing entity group.

Parameters
groupId[in] GroupId of the entity group.
id[in] SequenceId of the image sequence added to the group.
Returns
ErrorCode: OK, UNINITIALIZED, INVALID_SEQUENCE_ID or INVALID_GROUP_ID

Implemented in HEIF::WriterImpl.

◆ addToGroup() [3/3]

virtual ErrorCode HEIF::Writer::addToGroup ( const TrackGroupId trackGroupId,
const SequenceId sequenceId 
)
pure virtual

addToGroup Add a Image Sequence (track) to a track group.

Parameters
trackGroupId[in] Id of a track grouping.
sequenceId[in] SequenceId of the image sequence which is added to the group.
Returns
ErrorCode: OK, UNINITIALIZED, INVALID_SEQUENCE_ID or INVALID_GROUP_ID

Implemented in HEIF::WriterImpl.

◆ addVideo()

virtual ErrorCode HEIF::Writer::addVideo ( const SequenceId id,
const MediaDataId mediaDataId,
const SampleInfo sampleInfo,
SequenceImageId sampleid 
)
pure virtual

Add an video sample to a video track. Video bitstream must have been already fed by using feedMediaData(). Note: Video must be fed in media data / decoding order! For HEIF Image Sequences use addImage() instead.

Parameters
id[in] SequenceId of the video track, generated by addVideoTrack().
mediaDataId[in] MediaDataId of the data from feedMediaData().
sampleInfo[in] Information of given mediaDataId to generate playable sequence.
sampleid[out] Id for the sample that was added to the track
Returns
ErrorCode: OK, UNINITIALIZED, INVALID_SEQUENCE_ID, INVALID_MEDIADATA_ID, INVALID_FUNCTION_PARAMETER or INVALID_MEDIA_FORMAT

Implemented in HEIF::WriterImpl.

Referenced by HEIFPP::Sample::save().

Here is the caller graph for this function:

◆ addVideoTrack()

virtual ErrorCode HEIF::Writer::addVideoTrack ( const Rational timeBase,
SequenceId id 
)
pure virtual

Add a new video (track with 'vide' handler type) to the file. For HEIF Image sequences use addImageSequence() instead.

Parameters
timeBase[in] Rational value of number of time units per second used for this video track (usually 1 / timescale)
id[out] Identifier of the added track. This is not necessary same the corresponding track ID in the file.
Returns
ErrorCode: OK, UNINITIALIZED

Implemented in HEIF::WriterImpl.

Referenced by HEIFPP::VideoTrack::save().

Here is the caller graph for this function:

◆ associateProperty() [1/2]

virtual ErrorCode HEIF::Writer::associateProperty ( const GroupId groupId,
const PropertyId propertyId,
const bool  isEssential = false 
)
pure virtual

Associate a property to an entity group. The writer will arrange all descriptive property associations before transformative property associations. Otherwise association order will be same as fed by using this method. Note that it is possible to associate same property to several images and/or entity groups.

Parameters
groupId[in] GroupId of the existing entity group.
propertyId[in] PropertyId of the existing property.
isEssential[out] True if this property is defined 'essential' for this entity group.
Returns
ErrorCode: OK, UNINITIALIZED, INVALID_GROUP_ID or INVALID_PROPERTY_INDEX

Implemented in HEIF::WriterImpl.

◆ associateProperty() [2/2]

virtual ErrorCode HEIF::Writer::associateProperty ( const ImageId imageId,
const PropertyId propertyId,
const bool  isEssential = false 
)
pure virtual

Associate a property to an image. The writer will arrange all descriptive property associations before transformative property associations. Otherwise association order will be same as fed by using this method. Note that it is possible to associate same property to several images and/or entity groups.

Parameters
imageId[in] ImageId of the existing image item.
propertyId[in] PropertyId of the existing property.
isEssential[out] True if this property is defined 'essential' for this image. A reader should not present an image if it is not capable of processing an essential property.
Returns
ErrorCode: OK, UNINITIALIZED, INVALID_ITEM_ID or INVALID_PROPERTY_INDEX

Implemented in HEIF::WriterImpl.

Referenced by HEIFPP::Item::save().

Here is the caller graph for this function:

◆ Create()

Writer * HEIF::Writer::Create ( )
static

Make an instance of Writer

If a custom memory allocator has not been set with SetCustomAllocator prior to calling this, the default allocator will be set into use.

Definition at line 66 of file writerimpl.cpp.

References CUSTOM_NEW.

Referenced by HEIFPP::Heif::save().

Here is the caller graph for this function:

◆ createAlternativesGroup()

virtual ErrorCode HEIF::Writer::createAlternativesGroup ( GroupId id)
pure virtual

Create a new Alternative ('altr') entity grouping. Helper method that internally wraps createEntityGroup().

Parameters
id[out] Id of the created 'altr' entity grouping.
Returns
ErrorCode: OK or UNINITIALIZED

Implemented in HEIF::WriterImpl.

◆ createEntityGroup()

virtual ErrorCode HEIF::Writer::createEntityGroup ( const FourCC type,
GroupId id 
)
pure virtual

Create a new entity grouping. Generic grouping for any FourCC identifier.

Parameters
type[in] Type of the entity grouping to add.
id[out] Id of the created entity grouping.
Returns
ErrorCode: OK or UNINITIALIZED

Implemented in HEIF::WriterImpl.

Referenced by HEIFPP::Heif::save().

Here is the caller graph for this function:

◆ createEquivalenceGroup()

virtual ErrorCode HEIF::Writer::createEquivalenceGroup ( GroupId id)
pure virtual

Create a new Equivalence ('eqiv') entity grouping. Helper method that internally wraps createEntityGroup(). Note: If any SequenceId are added to the group then further calls to addToEquivalenceGroup() are needed as image (=sample) specific information is needed (else none of the samples of sequece will be marked as equivalence).

Parameters
id[out] Id of the created 'eqiv' entity grouping.
Returns
ErrorCode: OK or UNINITIALIZED

Implemented in HEIF::WriterImpl.

◆ createTrackGroup()

virtual ErrorCode HEIF::Writer::createTrackGroup ( const FourCC type,
TrackGroupId id 
)
pure virtual

createTrackGroup Create a new grouping done within a Track group box 'trgr'.

Parameters
type[in] Track group type to add.
id[out] Id of the created track grouping.
Returns
ErrorCode: OK, UNINITIALIZED

Implemented in HEIF::WriterImpl.

◆ Destroy()

void HEIF::Writer::Destroy ( Writer instance)
static

Destroy the instance returned by Create

Definition at line 71 of file writerimpl.cpp.

References CUSTOM_DELETE.

Referenced by HEIFPP::Heif::save().

Here is the caller graph for this function:

◆ feedDecoderConfig()

virtual ErrorCode HEIF::Writer::feedDecoderConfig ( const Array< DecoderSpecificInfo > &  decoderConfig,
DecoderConfigId decoderConfigId 
)
pure virtual

Add a new decoder configuration for file content. Needed only for encoded image MediaFormats (AVC/H.264, HEVC/H.265) and encoded AAC-LC audio.

Parameters
decoderConfig[in] Decoder configuration data.
decoderConfigId[out] DecoderConfigId of the added decoder configuration. The Id must be provided along media data Data when feeding encoded data to inform what decoder configuration should be used to decode that media data.
Returns
ErrorCode: OK or UNINITIALIZED

Implemented in HEIF::WriterImpl.

Referenced by HEIFPP::DecoderConfig::save().

Here is the caller graph for this function:

◆ feedMediaData()

virtual ErrorCode HEIF::Writer::feedMediaData ( const Data data,
MediaDataId mediaDataId 
)
pure virtual

Add new encoded image/video/audio data or external metadata (EXIF, XMP, MPEG-7) bytearray to MediaDataBox ('mdat') of the file.

Parameters
data[in] Data struct. Ownership of the data will not be transferred. It must be freed by the caller. This can be done immediately after the call.
mediaDataId[out] MediaDataId for the added data. This can then be for example referred by addImage() when creating images from the added data.
Returns
ErrorCode: OK, UNINITIALIZED, INVALID_DECODER_CONFIG_ID or INVALID_MEDIA_FORMAT

Implemented in HEIF::WriterImpl.

Referenced by HEIFPP::Sample::save(), HEIFPP::CodedImageItem::save(), HEIFPP::ExifItem::save(), and HEIFPP::MimeItem::save().

Here is the caller graph for this function:

◆ finalize()

virtual ErrorCode HEIF::Writer::finalize ( )
pure virtual

Finalize the file writing.

Returns
ErrorCode: OK, UNINITIALIZED or BRANDS_NOT_SET

Implemented in HEIF::WriterImpl.

Referenced by HEIFPP::Heif::save().

Here is the caller graph for this function:

◆ GetVersion()

const char * HEIF::Writer::GetVersion ( )
static

Get library version string.

Returns
Version string.

Definition at line 76 of file writerimpl.cpp.

◆ initialize()

virtual ErrorCode HEIF::Writer::initialize ( const OutputConfig outputConfig)
pure virtual

Open file for writing.

Parameters
outputConfigOutputConfig struct containing file name, brands and other output config information.
Returns
ErrorCode: OK, ALREADY_INITIALIZED, BRANDS_NOT_SET or FILE_OPEN_ERROR

Implemented in HEIF::WriterImpl.

Referenced by HEIFPP::Heif::save().

Here is the caller graph for this function:

◆ setAlternateGrouping()

virtual ErrorCode HEIF::Writer::setAlternateGrouping ( const SequenceId sequenceId1,
const SequenceId sequenceId2 
)
pure virtual

Set image sequences (or video tracks) to the same alternate group. This signals that these sequences contain alternate data for one another.

This alternate group is specified in ISOBMFF TrackHeaderBox ('thkd') by field alternate_group. A single image sequence can be a member of only one alternate group. When a thumbnail image sequence is associated to a master image sequence, both sequences will get assigned to the same alternate group automatically.

If neither of given sequences has an alternate group already assigned, a new alternate group will be created and both sequences are assigned to it. If either of sequences given as parameter already has an alternate group assigned, the other sequence will be assigned to the same alternate group. If both sequences have an alternate group already set, the alternate group of sequenceId2 will be overridden by the alternate group of the sequenceId1.

Note that this grouping is different from 'altr' type entity grouping which is handled by using methods createAlternativesGroup and addToGroup. Those methods can not to be used to handle this TrackHeaderBox alternate grouping. However, both groupings can co-exist as needed.

Parameters
sequenceId1[in] Image or video sequence ID.
sequenceId2[in] Image or video sequence ID.
Returns
ErrorCode: OK, UNITIALIZED, INVALID_SEQUENCE_ID

Implemented in HEIF::WriterImpl.

◆ SetCustomAllocator()

ErrorCode HEIF::Writer::SetCustomAllocator ( CustomAllocator customAllocator)
static

Set an optional custom memory allocator. Call this before calling Create for the first time, unless your new allocator is able to release blocks allocated with the previous allocator. The allocator is shared by all instances of HeifWriterInterface.

If you wish to change the allocator after once setting it, you must first set it to nullptr, which succeeds always. After this you can change it to the desired value.

Parameters
[in]customAllocatorthe allocator to use
Returns
ErrorCode: OK or ALLOCATOR_ALREADY_SET if the custom allocator has already been set (possibly automatically upon use); in this case the allocator remains the same as before this call.

Definition at line 54 of file writerimpl.cpp.

References HEIF::ALLOCATOR_ALREADY_SET, customAllocator, HEIF::OK, and setCustomAllocator().

Here is the call graph for this function:

◆ setEditList()

virtual ErrorCode HEIF::Writer::setEditList ( const SequenceId sequenceId,
const EditList editList 
)
pure virtual

Set edit list for an image sequence.

Parameters
sequenceId[in] SequenceId of the image sequence.
editList[in] EditList struct containing edit entries.
Returns
ErrorCode: OK, UNINITIALIZED, INVALID_SEQUENCE_ID or INVALID_FUNCTION_PARAMETER

Implemented in HEIF::WriterImpl.

◆ setImageHidden() [1/2]

virtual ErrorCode HEIF::Writer::setImageHidden ( const ImageId imageId,
const bool  hidden 
)
pure virtual

Set an image hidden.

Parameters
imageIdId of the image to hide or set visible.
hiddenTrue if image is hidden, false if not.
Returns
ErrorCode: OK, UNINITIALIZED or INVALID_ITEM_ID

Implemented in HEIF::WriterImpl.

Referenced by HEIFPP::ImageItem::save().

Here is the caller graph for this function:

◆ setImageHidden() [2/2]

virtual ErrorCode HEIF::Writer::setImageHidden ( const SequenceImageId sequenceImageId,
const bool  hidden 
)
pure virtual

Set an image from Image Sequence to be hidden.

Parameters
sequenceImageId[in] Id of the image to hide or set visible.
hidden[in] True if image is hidden, false if not.
Returns
ErrorCode: OK, UNINITIALIZED or INVALID_SEQUENCE_IMAGE_ID

Implemented in HEIF::WriterImpl.

◆ setItemDescription()

virtual ErrorCode HEIF::Writer::setItemDescription ( const ImageId imageId,
const ItemDescription itemDescription 
)
pure virtual

Set item description.

Parameters
imageId[in] ImageId of the image item.
itemDescription[in] ItemDescription of the item.
Returns
ErrorCode: OK, UNINITIALIZED or INVALID_ITEM_ID

Implemented in HEIF::WriterImpl.

Referenced by HEIFPP::Item::save().

Here is the caller graph for this function:

◆ setMajorBrand()

virtual ErrorCode HEIF::Writer::setMajorBrand ( const FourCC brand)
pure virtual

Set the major brand. Calling this is possible only if the file type box was not already written (OutputConfig.progressiveFile = true).

Parameters
brandFourCC of the new major brand to be set.
Returns
ErrorCode: OK, UNINITIALIZED or FTYP_ALREADY_WRITTEN

Implemented in HEIF::WriterImpl.

◆ setMatrix() [1/2]

virtual ErrorCode HEIF::Writer::setMatrix ( const Array< int32_t > &  matrix)
pure virtual

Set global transformation matrix (in MovieHeaderBox). Matrix values as defined in 6.2.2 of ISO/IEC 14496-12:2015(E) and 7.2.1 of ISO/IEC 23008-12:2017(E) Default values {0x00010000,0,0,0,0x00010000,0,0,0,0x40000000} used if not set.

Parameters
matrix[in] 3x3 matrix as 9 values in Array of integers {a,b,u, c,d,v, x,y,w}.
Returns
ErrorCode: OK, UNINITIALIZED or INVALID_FUNCTION_PARAMETER

Implemented in HEIF::WriterImpl.

Referenced by HEIFPP::Heif::save(), and HEIFPP::VideoTrack::save().

Here is the caller graph for this function:

◆ setMatrix() [2/2]

virtual ErrorCode HEIF::Writer::setMatrix ( const SequenceId sequenceId,
const Array< int32_t > &  matrix 
)
pure virtual

Set track level transformation matrix (in TrackHeaderBox). Matrix values as defined in 6.2.2 of ISO/IEC 14496-12:2015(E) and 7.2.1 of ISO/IEC 23008-12:2017(E) Default values {0x00010000,0,0,0,0x00010000,0,0,0,0x40000000} used if not set.

Parameters
matrix[in] 3x3 matrix as 9 values in Array of integers {a,b,u, c,d,v, x,y,w}.
sequenceId[in] Id of the image sequence.
Returns
ErrorCode: OK, UNINITIALIZED or INVALID_FUNCTION_PARAMETER

Implemented in HEIF::WriterImpl.

◆ setPrimaryItem()

virtual ErrorCode HEIF::Writer::setPrimaryItem ( const ImageId imageId)
pure virtual

Set primary item of the file. Typically cover image / main thumbnail for the file. The primary item of the file can not be hidden.

Parameters
imageId[in] ImageId of the image item.
Returns
ErrorCode: OK, UNINITIALIZED, INVALID_ITEM_ID or HIDDEN_PRIMARY_ITEM

Implemented in HEIF::WriterImpl.

Referenced by HEIFPP::Heif::save().

Here is the caller graph for this function:

The documentation for this class was generated from the following files: