// // Copyright (c) James Jackson-South and contributors. // Licensed under the Apache License, Version 2.0. // namespace ImageProcessor { using System; using System.Collections.Generic; using System.IO; using ImageProcessor.Formats; /// /// Encapsulates an image, which consists of the pixel data for a graphics image and its attributes. /// public interface IImage : IImageBase { /// /// Gets or sets the resolution of the image in x- direction. It is defined as /// number of dots per inch and should be an positive value. /// /// The density of the image in x- direction. double HorizontalResolution { get; set; } /// /// Gets or sets the resolution of the image in y- direction. It is defined as /// number of dots per inch and should be an positive value. /// /// The density of the image in y- direction. double VerticalResolution { get; set; } /// /// Gets the width of the image in inches. It is calculated as the width of the image /// in pixels multiplied with the density. When the density is equals or less than zero /// the default value is used. /// /// The width of the image in inches. double InchWidth { get; } /// /// Gets the height of the image in inches. It is calculated as the height of the image /// in pixels multiplied with the density. When the density is equals or less than zero /// the default value is used. /// /// The height of the image in inches. double InchHeight { get; } /// /// Gets a value indicating whether this image is animated. /// /// /// True if this image is animated; otherwise, false. /// bool IsAnimated { get; } /// /// Gets or sets the number of times any animation is repeated. /// 0 means to repeat indefinitely. /// ushort RepeatCount { get; set; } /// /// Gets the currently loaded image format. /// IImageFormat CurrentImageFormat { get; } /// /// Gets the other frames for the animation. /// /// The list of frame images. IList Frames { get; } /// /// Gets the list of properties for storing meta information about this image. /// /// A list of image properties. IList Properties { get; } /// /// Saves the image to the given stream using the currently loaded image format. /// /// The stream to save the image to. /// Thrown if the stream is null. void Save(Stream stream); /// /// Saves the image to the given stream using the given image format. /// /// The stream to save the image to. /// The format to save the image as. /// Thrown if the stream is null. void Save(Stream stream, IImageFormat format); } }