HeifDecoder Class |
Namespace: Atalasoft.Imaging.Codec
The HeifDecoder type exposes the following members.
Name | Description | |
---|---|---|
HeifDecoder |
Initializes a new instance of HeifDecoder class.
|
Name | Description | |
---|---|---|
SupportedImageType | Obsolete. Returns the ImageType that the implemented decoder class supports. (Inherited from ImageDecoder.) |
Name | Description | |
---|---|---|
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetFrameCount | Returns the number of frames in the image (Overrides MultiFramedImageDecoderGetFrameCount(Stream).) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetHeifDocument |
Provides an access to HEIF files data.
| |
GetImageInfo(Stream) | Retrieves information from an image stored in a file without decoding the image data. (Overrides ImageDecoderGetImageInfo(Stream).) | |
GetImageInfo(Stream, Int32) | (Overrides MultiFramedImageDecoderGetImageInfo(Stream, Int32).) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
IsValidFormat | Checks the stream to determine if the image can be read by the decoder that derives this class. (Overrides ImageDecoderIsValidFormat(Stream).) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
Read(Stream, ProgressEventHandler) | Decode an image in a specified image Stream. (Overrides ImageDecoderRead(Stream, ProgressEventHandler).) | |
Read(Stream, Int32, ProgressEventHandler) | Read a given frame in an encoded image using this decoder. (Overrides MultiFramedImageDecoderRead(Stream, Int32, ProgressEventHandler).) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
var imagesCount = heifDecoder.GetFrameCount(stream); for (int i = 0; i < imagesCount; i++) { using (var atalaImage = heifDecoder.Read(stream, i, null)) { // .. process image here } }
RegisteredDecoders.Decoders.Add(heifDecoder); using (var atalaImage = new AtalaImage(stream)) { // .. process image here }
var heifDocument = heifDecoder.GetHeifDocument(stream, null); foreach (var heifImage in heifDocument.HeifImages) { // reading auxiliary images foreach (var auxiliaryImage in heifImage.AuxiliaryImages) { // process auxiliary image } // retrieve AtalaImage var atalaImage = heifImage.GetImage(); }
using (var document = heifDecoder.GetHeifDocument(stream, null)) { foreach (var heifImage in document.HeifImages) { foreach (var metadata in heifImage.Metadata) { if (metadata.Type.Equals("exif", StringComparison.CurrentCultureIgnoreCase)) { var exifCollection = metadata.AsExifCollection(); foreach (ExifTag exifTag in exifCollection) { Console.WriteLine(exifTag.ToString()); } } else if (metadata.Type.Equals("mime", StringComparison.CurrentCultureIgnoreCase) && metadata.ContentType.Equals("application/rdf+xml", StringComparison.CurrentCultureIgnoreCase)) { var doc = new XmlDocument(); doc.LoadXml(System.Text.Encoding.UTF8.GetString(metadata.Data)); StringWriter sw = new StringWriter(); doc.Save(sw); Console.WriteLine(sw.ToString()); } } } }