// // Copyright (c) James Jackson-South and contributors. // Licensed under the Apache License, Version 2.0. // namespace ImageProcessorCore { using System; /// /// Encapsulates the basic properties and methods required to manipulate images. /// public interface IImageBase { /// /// Gets the image pixels as byte array. /// /// /// The returned array has a length of Width * Height * 4 bytes /// and stores the blue, the green, the red and the alpha value for /// each pixel in this order. /// float[] Pixels { get; } /// /// Gets the width in pixels. /// int Width { get; } /// /// Gets the height in pixels. /// int Height { get; } /// /// Gets the pixel ratio made up of the width and height. /// double PixelRatio { get; } /// /// Gets the representing the bounds of the image. /// Rectangle Bounds { get; } /// /// Gets or sets th quality of the image. This affects the output quality of lossy image formats. /// int Quality { get; set; } /// /// Gets or sets the frame delay for animated images. /// If not 0, this field specifies the number of hundredths (1/100) of a second to /// wait before continuing with the processing of the Data Stream. /// The clock starts ticking immediately after the graphic is rendered. /// int FrameDelay { get; set; } /// /// Gets or sets the color of a pixel at the specified position. /// /// /// The x-coordinate of the pixel. Must be greater /// than zero and smaller than the width of the pixel. /// /// /// The y-coordinate of the pixel. Must be greater /// than zero and smaller than the width of the pixel. /// /// The at the specified position. Color this[int x, int y] { get; set; } /// /// Sets the pixel array of the image to the given value. /// /// The new width of the image. Must be greater than zero. /// The new height of the image. Must be greater than zero. /// /// The array with colors. Must be a multiple of four times the width and height. /// /// /// Thrown if either or are less than or equal to 0. /// /// /// Thrown if the length is not equal to Width * Height * 4. /// void SetPixels(int width, int height, float[] pixels); /// /// Sets the pixel array of the image to the given value, creating a copy of /// the original pixels. /// /// The new width of the image. Must be greater than zero. /// The new height of the image. Must be greater than zero. /// /// The array with colors. Must be a multiple of four times the width and height. /// /// /// Thrown if either or are less than or equal to 0. /// /// /// Thrown if the length is not equal to Width * Height * 4. /// void ClonePixels(int width, int height, float[] pixels); } }