mirror of https://github.com/SixLabors/ImageSharp
9 changed files with 162 additions and 36 deletions
@ -0,0 +1,27 @@ |
|||||
|
// Copyright (c) Six Labors.
|
||||
|
// Licensed under the Six Labors Split License.
|
||||
|
|
||||
|
namespace SixLabors.ImageSharp.Formats.Jxl.Processing; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Describes the interpretation of the input and output
|
||||
|
/// buffers.
|
||||
|
/// </summary>
|
||||
|
internal struct JxlBitDepth |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// Gets or sets the kind of bit depth.
|
||||
|
/// </summary>
|
||||
|
public JxlBitDepthType Type { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Gets or sets the number of bits per sample when the
|
||||
|
/// bit depth type is custom.
|
||||
|
/// </summary>
|
||||
|
public uint BitsPerSample { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Gets or sets the custom exponent bits per sample.
|
||||
|
/// </summary>
|
||||
|
public uint ExponentBitsPerSample { get; set; } |
||||
|
} |
||||
@ -0,0 +1,35 @@ |
|||||
|
// Copyright (c) Six Labors.
|
||||
|
// Licensed under the Six Labors Split License.
|
||||
|
|
||||
|
namespace SixLabors.ImageSharp.Formats.Jxl.Processing; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Specifies the kind of bit depth.
|
||||
|
/// </summary>
|
||||
|
internal enum JxlBitDepthType : byte |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// Default setting, where the encoder expects the
|
||||
|
/// input pixels to use the full range of the pixel format
|
||||
|
/// data type (e.g. for ushort, the input range is 0..65535
|
||||
|
/// and the value 65535 is mapped to 1.0 when converting
|
||||
|
/// to float), and the decoder uses the full range to output
|
||||
|
/// pixels.
|
||||
|
/// </summary>
|
||||
|
FromPixelFormat, |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// When selected, the encoder expects the input pixels
|
||||
|
/// to be in the range defined by the bits per sample value of the
|
||||
|
/// basic info (e.g., for 12-bit images using ushort data types
|
||||
|
/// the range is 0..4095 and the 4095 value is mapped to 1.0 when
|
||||
|
/// converting to float), and the decoder outputs pixels in
|
||||
|
/// this range.
|
||||
|
/// </summary>
|
||||
|
FromCodeStream, |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Specifies custom ranges for pixel outputs.
|
||||
|
/// </summary>
|
||||
|
Custom = 2, |
||||
|
} |
||||
@ -0,0 +1,31 @@ |
|||||
|
// Copyright (c) Six Labors.
|
||||
|
// Licensed under the Six Labors Split License.
|
||||
|
|
||||
|
namespace SixLabors.ImageSharp.Formats.Jxl.Processing; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Specifies which data type to use for sample values
|
||||
|
/// per channel per pixel.
|
||||
|
/// </summary>
|
||||
|
internal enum JxlDataType : byte |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// Use float
|
||||
|
/// </summary>
|
||||
|
Single = 0, |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Use byte. May clip wide color gamut data.
|
||||
|
/// </summary>
|
||||
|
Byte = 2, |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Use ushort. May clip wide color gamut data.
|
||||
|
/// </summary>
|
||||
|
UInt16 = 3, |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Use 16-bit IEEE 754 half-precision floating-point values.
|
||||
|
/// </summary>
|
||||
|
Half = 5 |
||||
|
} |
||||
@ -0,0 +1,25 @@ |
|||||
|
// Copyright (c) Six Labors.
|
||||
|
// Licensed under the Six Labors Split License.
|
||||
|
|
||||
|
namespace SixLabors.ImageSharp.Formats.Jxl.Processing; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Specifies the ordering of multi-byte data.
|
||||
|
/// </summary>
|
||||
|
internal enum JxlEndianness : byte |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// Use endianness of the CPU/system.
|
||||
|
/// </summary>
|
||||
|
Native, |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Force little endian.
|
||||
|
/// </summary>
|
||||
|
Little, |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Force big endian.
|
||||
|
/// </summary>
|
||||
|
Big |
||||
|
} |
||||
@ -0,0 +1,34 @@ |
|||||
|
// Copyright (c) Six Labors.
|
||||
|
// Licensed under the Six Labors Split License.
|
||||
|
|
||||
|
namespace SixLabors.ImageSharp.Formats.Jxl.Processing; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Data type for the sample values per channel per pixel
|
||||
|
/// for the output buffer for pixels.
|
||||
|
/// </summary>
|
||||
|
internal struct JxlPixelFormat |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// Gets or sets the amount of channels available in a pixel buffer.
|
||||
|
/// </summary>
|
||||
|
public int Channels { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Gets or sets the data type of each channel.
|
||||
|
/// </summary>
|
||||
|
public JxlDataType DataType { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Gets or sets a value that denotes whether multi-byte data types are represented in
|
||||
|
/// big-endian or little-endian format. Applies to ushort
|
||||
|
/// and float data types.
|
||||
|
/// </summary>
|
||||
|
public JxlEndianness Endianness { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Gets or sets the alignment of scanlines to a multiple of
|
||||
|
/// align bytes.
|
||||
|
/// </summary>
|
||||
|
public int Align { get; set; } |
||||
|
} |
||||
Loading…
Reference in new issue