From 63af3a5682e344c811ba48d1f3f96c6fe356319b Mon Sep 17 00:00:00 2001 From: BobLd <38405645+BobLd@users.noreply.github.com> Date: Sun, 15 Mar 2026 18:52:11 +0000 Subject: [PATCH] For shading types 4 to 7, add Data property containing descriptive data characterizing the shading's gradient fill --- .../Graphics/Colors/Shading.cs | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/UglyToad.PdfPig/Graphics/Colors/Shading.cs b/src/UglyToad.PdfPig/Graphics/Colors/Shading.cs index 90e5335d2..f8ea206ed 100644 --- a/src/UglyToad.PdfPig/Graphics/Colors/Shading.cs +++ b/src/UglyToad.PdfPig/Graphics/Colors/Shading.cs @@ -1,5 +1,6 @@ namespace UglyToad.PdfPig.Graphics.Colors { + using System; using UglyToad.PdfPig.Core; using UglyToad.PdfPig.Functions; using UglyToad.PdfPig.Tokens; @@ -329,6 +330,11 @@ public sealed class FreeFormGouraudShading : Shading /// public override PdfFunction[]? Functions { get; } + /// + /// The decoded stream data containing descriptive data characterizing the shading's gradient fill. + /// + public Memory Data { get; } + /// /// Create a new . /// @@ -342,6 +348,7 @@ public FreeFormGouraudShading(bool antiAlias, StreamToken shadingStream, BitsPerFlag = bitsPerFlag; Decode = decode; Functions = functions; + Data = shadingStream.Data; } } @@ -392,6 +399,11 @@ public sealed class LatticeFormGouraudShading : Shading /// public override PdfFunction[]? Functions { get; } + /// + /// The decoded stream data containing descriptive data characterizing the shading's gradient fill. + /// + public Memory Data { get; } + /// /// Create a new . /// @@ -405,6 +417,7 @@ public LatticeFormGouraudShading(bool antiAlias, StreamToken shadingStream, VerticesPerRow = verticesPerRow; Decode = decode; Functions = functions; + Data = shadingStream.Data; } } @@ -457,6 +470,11 @@ public class CoonsPatchMeshesShading : Shading /// public override PdfFunction[]? Functions { get; } + /// + /// The decoded stream data containing descriptive data characterizing the shading's gradient fill. + /// + public Memory Data { get; } + /// /// Create a new . /// @@ -470,6 +488,7 @@ public CoonsPatchMeshesShading(bool antiAlias, StreamToken shadingStream, BitsPerFlag = bitsPerFlag; Decode = decode; Functions = functions; + Data = shadingStream.Data; } } @@ -522,6 +541,11 @@ public sealed class TensorProductPatchMeshesShading : Shading /// public override PdfFunction[]? Functions { get; } + /// + /// The decoded stream data containing descriptive data characterizing the shading's gradient fill. + /// + public Memory Data { get; } + /// /// Create a new . /// @@ -535,6 +559,7 @@ public TensorProductPatchMeshesShading(bool antiAlias, StreamToken shadingStream BitsPerFlag = bitsPerFlag; Decode = decode; Functions = functions; + Data = shadingStream.Data; } }