mirror of https://github.com/SixLabors/ImageSharp
Browse Source
Former-commit-id: 63481b92335c358cfeb10da5df3c4fb79abf7786 Former-commit-id: 2e9a02d7896340fbd9610c358ba4cd472ac124a1 Former-commit-id: bb5030a386fb749f779e5acddd462832d6412ee2af/merge-core
5 changed files with 119 additions and 4 deletions
@ -0,0 +1,33 @@ |
|||||
|
// <copyright file="ComponentOrder.cs" company="James Jackson-South">
|
||||
|
// Copyright (c) James Jackson-South and contributors.
|
||||
|
// Licensed under the Apache License, Version 2.0.
|
||||
|
// </copyright>
|
||||
|
|
||||
|
namespace ImageProcessorCore |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// Enumerates the various component orders.
|
||||
|
/// </summary>
|
||||
|
public enum ComponentOrder |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// Blue-> Green-> Red order.
|
||||
|
/// </summary>
|
||||
|
BGR, |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Blue-> Green-> Red-> Alpha order.
|
||||
|
/// </summary>
|
||||
|
BGRA, |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Red-> Green-> Blue order.
|
||||
|
/// </summary>
|
||||
|
RGB, |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Red-> Green-> Blue-> Alpha order.
|
||||
|
/// </summary>
|
||||
|
RGBA, |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,31 @@ |
|||||
|
// <copyright file="IPackedBytes.cs" company="James Jackson-South">
|
||||
|
// Copyright (c) James Jackson-South and contributors.
|
||||
|
// Licensed under the Apache License, Version 2.0.
|
||||
|
// </copyright>
|
||||
|
|
||||
|
namespace ImageProcessorCore |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// An interface that converts packed vector types to and from <see cref="byte[]"/> values,
|
||||
|
/// allowing multiple encodings to be manipulated in a generic manner.
|
||||
|
/// </summary>
|
||||
|
public interface IPackedBytes |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// Gets the packed representation from the gives bytes.
|
||||
|
/// </summary>
|
||||
|
/// <param name="x">The x-component.</param>
|
||||
|
/// <param name="y">The y-component.</param>
|
||||
|
/// <param name="z">The z-omponent.</param>
|
||||
|
/// <param name="w">The w-component.</param>
|
||||
|
void PackFromBytes(byte x, byte y, byte z, byte w); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Sets the packed representation into the gives bytes.
|
||||
|
/// </summary>
|
||||
|
/// <param name="bytes">The bytes to set the color in.</param>
|
||||
|
/// <param name="startIndex">The starting index of the <paramref name="bytes"/>.</param>
|
||||
|
/// <param name="componentOrder">The order of the components.</param>
|
||||
|
void ToBytes(byte[] bytes, int startIndex, ComponentOrder componentOrder); |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue