Expose ImageDictionary through IPdfImage to make available when working with InlineImage(s).

This commit is contained in:
Kasper Frank
2021-05-10 17:28:59 +02:00
parent 6fa223c0db
commit 449f16edd7
4 changed files with 19 additions and 7 deletions

View File

@@ -6,6 +6,7 @@
using UglyToad.PdfPig.Graphics.Colors;
using UglyToad.PdfPig.Graphics.Core;
using UglyToad.PdfPig.Images.Png;
using UglyToad.PdfPig.Tokens;
public class TestPdfImage : IPdfImage
{
@@ -31,6 +32,8 @@
public bool IsInlineImage { get; set; }
public DictionaryToken ImageDictionary { get; set; }
public ColorSpaceDetails ColorSpaceDetails { get; set; }
public IReadOnlyList<byte> DecodedBytes { get; set; }

View File

@@ -3,7 +3,8 @@
using System.Collections.Generic;
using Core;
using Graphics.Colors;
using Graphics.Core;
using Graphics.Core;
using UglyToad.PdfPig.Tokens;
using XObjects;
/// <summary>
@@ -84,6 +85,11 @@
/// </summary>
bool IsInlineImage { get; }
/// <summary>
/// The full dictionary for this image object.
/// </summary>
public DictionaryToken ImageDictionary { get; }
/// <summary>
/// Full details for the <see cref="ColorSpace"/> with any associated data.
/// </summary>

View File

@@ -8,8 +8,9 @@
using Graphics.Colors;
using Graphics.Core;
using Tokens;
using Images.Png;
using Images.Png;
using UglyToad.PdfPig.Util.JetBrains.Annotations;
/// <inheritdoc />
/// <summary>
/// A small image that is completely defined directly inline within a <see cref="T:UglyToad.PdfPig.Content.Page" />'s content stream.
@@ -42,6 +43,10 @@
/// <inheritdoc />
public bool IsInlineImage { get; } = true;
/// <inheritdoc />
[NotNull]
public DictionaryToken ImageDictionary { get; }
/// <inheritdoc />
public RenderingIntent RenderingIntent { get; }
@@ -76,6 +81,7 @@
IsImageMask = isImageMask;
RenderingIntent = renderingIntent;
Interpolate = interpolate;
ImageDictionary = streamDictionary;
RawBytes = bytes;
ColorSpaceDetails = colorSpaceDetails;

View File

@@ -6,7 +6,6 @@
using Core;
using Graphics.Colors;
using Graphics.Core;
using Images;
using Images.Png;
using Tokens;
using Util.JetBrains.Annotations;
@@ -57,9 +56,7 @@
/// <inheritdoc />
public bool IsInlineImage { get; } = false;
/// <summary>
/// The full dictionary for this Image XObject.
/// </summary>
/// <inheritdoc />
[NotNull]
public DictionaryToken ImageDictionary { get; }