mirror of https://github.com/SixLabors/ImageSharp
5 changed files with 68 additions and 26 deletions
@ -0,0 +1,16 @@ |
|||
// Copyright (c) Six Labors and contributors.
|
|||
// Licensed under the Apache License, Version 2.0.
|
|||
|
|||
using System; |
|||
|
|||
namespace SixLabors.ImageSharp.PixelFormats |
|||
{ |
|||
[Flags] |
|||
internal enum PixelConversionModifiers |
|||
{ |
|||
None = 0, |
|||
Scale = 1 << 0, |
|||
Premultiply = 1 << 1, |
|||
SRgbCompand = 1 << 2, |
|||
} |
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
// Copyright (c) Six Labors and contributors.
|
|||
// Licensed under the Apache License, Version 2.0.
|
|||
|
|||
using System.Runtime.CompilerServices; |
|||
|
|||
namespace SixLabors.ImageSharp.PixelFormats |
|||
{ |
|||
internal static class PixelConversionModifiersExtensions |
|||
{ |
|||
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|||
public static bool IsDefined(this PixelConversionModifiers modifiers, PixelConversionModifiers expected) => |
|||
(modifiers & expected) == expected; |
|||
|
|||
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|||
public static PixelConversionModifiers Remove( |
|||
this PixelConversionModifiers modifiers, |
|||
PixelConversionModifiers removeThis) => |
|||
modifiers & ~removeThis; |
|||
} |
|||
} |
|||
Loading…
Reference in new issue