1515 /// </summary>
1616 public abstract class ColorSpaceDetails
1717 {
18- /// <summary>
19- /// Is the color space a stencil indexed color space.
20- /// <para>Stencil color spaces take care of inverting colors based on the Decode array.</para>
21- /// </summary>
22- public bool IsStencil { get ; }
23-
2418 /// <summary>
2519 /// The type of the ColorSpace.
2620 /// </summary>
@@ -45,11 +39,10 @@ public abstract class ColorSpaceDetails
4539 /// <summary>
4640 /// Create a new <see cref="ColorSpaceDetails"/>.
4741 /// </summary>
48- protected internal ColorSpaceDetails ( ColorSpace type , bool isStencil = false )
42+ protected internal ColorSpaceDetails ( ColorSpace type )
4943 {
5044 Type = type ;
5145 BaseType = type ;
52- IsStencil = isStencil ;
5346 }
5447
5548 /// <summary>
@@ -278,15 +271,12 @@ public sealed class IndexedColorSpaceDetails : ColorSpaceDetails
278271 private readonly ConcurrentDictionary < double , IColor > cache = new ConcurrentDictionary < double , IColor > ( ) ;
279272
280273 /// <summary>
281- /// Creates a indexed color space useful for extracting stencil masks as black-and-white images,
282- /// i.e. with a color palette of two colors (black and white). If the decode parameter array is
283- /// [0, 1] it indicates that black is at index 0 in the color palette, whereas [1, 0] indicates
284- /// that the black color is at index 1.
274+ /// Creates an indexed color space useful for extracting stencil masks as black-and-white images,
275+ /// i.e. with a color palette of two colors (black and white).
285276 /// </summary>
286- internal static ColorSpaceDetails Stencil ( ColorSpaceDetails colorSpaceDetails , double [ ] decode )
277+ internal static ColorSpaceDetails Stencil ( ColorSpaceDetails colorSpaceDetails )
287278 {
288- var blackIsOne = decode . Length >= 2 && decode [ 0 ] == 1 && decode [ 1 ] == 0 ;
289- return new IndexedColorSpaceDetails ( colorSpaceDetails , 1 , blackIsOne ? [ 255 , 0 ] : [ 0 , 255 ] , true ) ;
279+ return new IndexedColorSpaceDetails ( colorSpaceDetails , 1 , [ 0 , 255 ] ) ;
290280 }
291281
292282 /// <inheritdoc/>
@@ -321,14 +311,7 @@ internal static ColorSpaceDetails Stencil(ColorSpaceDetails colorSpaceDetails, d
321311 /// Create a new <see cref="IndexedColorSpaceDetails"/>.
322312 /// </summary>
323313 public IndexedColorSpaceDetails ( ColorSpaceDetails baseColorSpaceDetails , byte hiVal , byte [ ] colorTable )
324- : this ( baseColorSpaceDetails , hiVal , colorTable , false )
325- { }
326-
327- /// <summary>
328- /// Create a new <see cref="IndexedColorSpaceDetails"/>.
329- /// </summary>
330- private IndexedColorSpaceDetails ( ColorSpaceDetails baseColorSpaceDetails , byte hiVal , byte [ ] colorTable , bool isStencil )
331- : base ( ColorSpace . Indexed , isStencil )
314+ : base ( ColorSpace . Indexed )
332315 {
333316 BaseColorSpace = baseColorSpaceDetails ?? throw new ArgumentNullException ( nameof ( baseColorSpaceDetails ) ) ;
334317 HiVal = hiVal ;
0 commit comments