Skip to content

Commit

Permalink
Make ColorSpaceDetails.BaseNumberOfColorComponents public to allow fo…
Browse files Browse the repository at this point in the history
…r external image factories
  • Loading branch information
BobLd committed Jan 4, 2025
1 parent 2b14ae0 commit d1779cc
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/UglyToad.PdfPig/Graphics/Colors/ColorSpaceDetails.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public abstract class ColorSpaceDetails
/// <summary>
/// The number of components for the underlying color space.
/// </summary>
internal abstract int BaseNumberOfColorComponents { get; }
public abstract int BaseNumberOfColorComponents { get; }

/// <summary>
/// Create a new <see cref="ColorSpaceDetails"/>.
Expand Down Expand Up @@ -90,7 +90,7 @@ public sealed class DeviceGrayColorSpaceDetails : ColorSpaceDetails
public override int NumberOfColorComponents => 1;

/// <inheritdoc/>
internal override int BaseNumberOfColorComponents => NumberOfColorComponents;
public override int BaseNumberOfColorComponents => NumberOfColorComponents;

private DeviceGrayColorSpaceDetails() : base(ColorSpace.DeviceGray)
{ }
Expand Down Expand Up @@ -152,7 +152,7 @@ public sealed class DeviceRgbColorSpaceDetails : ColorSpaceDetails
public override int NumberOfColorComponents => 3;

/// <inheritdoc/>
internal override int BaseNumberOfColorComponents => NumberOfColorComponents;
public override int BaseNumberOfColorComponents => NumberOfColorComponents;

private DeviceRgbColorSpaceDetails() : base(ColorSpace.DeviceRGB)
{ }
Expand Down Expand Up @@ -213,7 +213,7 @@ public sealed class DeviceCmykColorSpaceDetails : ColorSpaceDetails
public override int NumberOfColorComponents => 4;

/// <inheritdoc/>
internal override int BaseNumberOfColorComponents => NumberOfColorComponents;
public override int BaseNumberOfColorComponents => NumberOfColorComponents;

private DeviceCmykColorSpaceDetails() : base(ColorSpace.DeviceCMYK)
{
Expand Down Expand Up @@ -289,7 +289,7 @@ internal static ColorSpaceDetails Stencil(ColorSpaceDetails colorSpaceDetails, d
/// <inheritdoc/>
/// <para>In the case of <see cref="IndexedColorSpaceDetails"/>, gets the <see cref="BaseColorSpace"/>' <c>BaseNumberOfColorComponents</c>.</para>
/// </summary>
internal override int BaseNumberOfColorComponents => BaseColorSpace.BaseNumberOfColorComponents;
public override int BaseNumberOfColorComponents => BaseColorSpace.BaseNumberOfColorComponents;

/// <summary>
/// The base color space in which the values in the color table are to be interpreted.
Expand Down Expand Up @@ -475,7 +475,7 @@ public sealed class DeviceNColorSpaceDetails : ColorSpaceDetails
public override int NumberOfColorComponents { get; }

/// <inheritdoc/>
internal override int BaseNumberOfColorComponents => AlternateColorSpace.NumberOfColorComponents;
public override int BaseNumberOfColorComponents => AlternateColorSpace.NumberOfColorComponents;

/// <summary>
/// Specifies name objects specifying the individual colour components. The length of the array shall
Expand Down Expand Up @@ -657,7 +657,7 @@ public sealed class SeparationColorSpaceDetails : ColorSpaceDetails
public override int NumberOfColorComponents => 1;

/// <inheritdoc/>
internal override int BaseNumberOfColorComponents => AlternateColorSpace.NumberOfColorComponents;
public override int BaseNumberOfColorComponents => AlternateColorSpace.NumberOfColorComponents;

/// <summary>
/// Specifies the name of the colorant that this Separation color space is intended to represent.
Expand Down Expand Up @@ -775,7 +775,7 @@ public sealed class CalGrayColorSpaceDetails : ColorSpaceDetails
public override int NumberOfColorComponents => 1;

/// <inheritdoc/>
internal override int BaseNumberOfColorComponents => NumberOfColorComponents;
public override int BaseNumberOfColorComponents => NumberOfColorComponents;

private readonly CIEBasedColorSpaceTransformer colorSpaceTransformer;

Expand Down Expand Up @@ -900,7 +900,7 @@ public sealed class CalRGBColorSpaceDetails : ColorSpaceDetails
public override int NumberOfColorComponents => 3;

/// <inheritdoc/>
internal override int BaseNumberOfColorComponents => NumberOfColorComponents;
public override int BaseNumberOfColorComponents => NumberOfColorComponents;

private readonly CIEBasedColorSpaceTransformer colorSpaceTransformer;

Expand Down Expand Up @@ -1045,7 +1045,7 @@ public sealed class LabColorSpaceDetails : ColorSpaceDetails
public override int NumberOfColorComponents => 3;

/// <inheritdoc/>
internal override int BaseNumberOfColorComponents => NumberOfColorComponents;
public override int BaseNumberOfColorComponents => NumberOfColorComponents;

/// <summary>
/// An array of three numbers [XW YW ZW] specifying the tristimulus value, in the CIE 1931 XYZ space of the
Expand Down Expand Up @@ -1196,7 +1196,7 @@ public sealed class ICCBasedColorSpaceDetails : ColorSpaceDetails
public override int NumberOfColorComponents { get; }

/// <inheritdoc/>
internal override int BaseNumberOfColorComponents => NumberOfColorComponents;
public override int BaseNumberOfColorComponents => NumberOfColorComponents;

/// <summary>
/// An alternate color space that can be used in case the one specified in the stream data is not
Expand Down Expand Up @@ -1327,7 +1327,7 @@ public sealed class PatternColorSpaceDetails : ColorSpaceDetails
/// Valid for Uncoloured Tiling Patterns. Will throw a <see cref="InvalidOperationException"/> otherwise.
/// </para>
/// </summary>
internal override int BaseNumberOfColorComponents => UnderlyingColourSpace!.NumberOfColorComponents;
public override int BaseNumberOfColorComponents => UnderlyingColourSpace!.NumberOfColorComponents;

/// <summary>
/// The underlying color space for Uncoloured Tiling Patterns.
Expand Down Expand Up @@ -1423,7 +1423,7 @@ public sealed class UnsupportedColorSpaceDetails : ColorSpaceDetails
/// Cannot be called for <see cref="UnsupportedColorSpaceDetails"/>, will throw a <see cref="InvalidOperationException"/>.
/// </para>
/// </summary>
internal override int BaseNumberOfColorComponents => NumberOfColorComponents;
public override int BaseNumberOfColorComponents => NumberOfColorComponents;

private UnsupportedColorSpaceDetails() : base(ColorSpace.DeviceGray)
{
Expand Down

0 comments on commit d1779cc

Please sign in to comment.