//
// Copyright (c) James Jackson-South and contributors.
// Licensed under the Apache License, Version 2.0.
//
namespace ImageProcessorCore
{
///
/// Encapsulates the basic properties and methods required to manipulate images in varying formats.
///
/// The pixel format.
/// The packed format. uint, long, float.
public interface IImageBase : IImageBase
where TColor : IPackedVector
where TPacked : struct
{
///
/// Gets the pixels as an array of the given packed pixel format.
///
TColor[] Pixels { get; }
///
/// 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 pixels. Must be a multiple of 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.
///
void SetPixels(int width, int height, TColor[] 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 pixels. 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.
///
void ClonePixels(int width, int height, TColor[] pixels);
///
/// Locks the image providing access to the pixels.
///
/// It is imperative that the accessor is correctly disposed off after use.
///
///
/// The
PixelAccessor Lock();
}
///
/// Encapsulates the basic properties and methods required to manipulate images.
///
public interface IImageBase
{
///
/// Gets the representing the bounds of the image.
///
Rectangle Bounds { get; }
///
/// Gets or sets the 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 maximum allowable width in pixels.
///
int MaxWidth { get; set; }
///
/// Gets or sets the maximum allowable height in pixels.
///
int MaxHeight { get; set; }
///
/// 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; }
}
}