mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-08-20 06:38:07 +08:00
Rename TryGetMemory -> TryGetBytesAsMemory
This commit is contained in:
parent
fc1a41ffbb
commit
c3a2e8c08f
@ -70,7 +70,7 @@
|
||||
var page = document.GetPage(1);
|
||||
foreach (var image in page.GetImages())
|
||||
{
|
||||
if (image.TryGetMemory(out var bytes))
|
||||
if (image.TryGetBytesAsMemory(out var bytes))
|
||||
{
|
||||
Assert.False(bytes.IsEmpty);
|
||||
}
|
||||
|
@ -99,7 +99,7 @@
|
||||
{
|
||||
foreach (var image in page.GetImages())
|
||||
{
|
||||
if (!image.TryGetMemory(out _))
|
||||
if (!image.TryGetBytesAsMemory(out _))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -37,7 +37,7 @@
|
||||
|
||||
public ReadOnlyMemory<byte> DecodedBytes { get; set; }
|
||||
|
||||
public bool TryGetMemory(out ReadOnlyMemory<byte> bytes)
|
||||
public bool TryGetBytesAsMemory(out ReadOnlyMemory<byte> bytes)
|
||||
{
|
||||
bytes = DecodedBytes;
|
||||
return !bytes.IsEmpty;
|
||||
|
@ -98,7 +98,7 @@
|
||||
/// Get the decoded memory of the image if applicable. For JPEG images and some other types the
|
||||
/// <see cref="RawMemory"/> should be used directly.
|
||||
/// </summary>
|
||||
bool TryGetMemory(out ReadOnlyMemory<byte> memory);
|
||||
bool TryGetBytesAsMemory(out ReadOnlyMemory<byte> memory);
|
||||
|
||||
/// <summary>
|
||||
/// Try to convert the image to PNG. Doesn't support conversion of JPG to PNG.
|
||||
|
@ -105,7 +105,7 @@
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool TryGetMemory(out ReadOnlyMemory<byte> bytes)
|
||||
public bool TryGetBytesAsMemory(out ReadOnlyMemory<byte> bytes)
|
||||
{
|
||||
bytes = null;
|
||||
if (memoryFactory is null)
|
||||
|
@ -11,7 +11,7 @@
|
||||
public static class ColorSpaceDetailsByteConverter
|
||||
{
|
||||
/// <summary>
|
||||
/// Converts the output bytes (if available) of <see cref="IPdfImage.TryGetMemory"/>
|
||||
/// Converts the output bytes (if available) of <see cref="IPdfImage.TryGetBytesAsMemory"/>
|
||||
/// to actual pixel values using the <see cref="IPdfImage.ColorSpaceDetails"/>. For most images this doesn't
|
||||
/// change the data but for <see cref="ColorSpace.Indexed"/> it will convert the bytes which are indexes into the
|
||||
/// real pixel data into the real pixel data.
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
var isColorSpaceSupported = hasValidDetails && image.ColorSpaceDetails!.BaseType != ColorSpace.Pattern;
|
||||
|
||||
if (!isColorSpaceSupported || !image.TryGetMemory(out var imageMemory))
|
||||
if (!isColorSpaceSupported || !image.TryGetBytesAsMemory(out var imageMemory))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -97,7 +97,7 @@
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool TryGetMemory(out ReadOnlyMemory<byte> bytes)
|
||||
public bool TryGetBytesAsMemory(out ReadOnlyMemory<byte> bytes)
|
||||
{
|
||||
bytes = null;
|
||||
if (memoryFactory is null)
|
||||
|
Loading…
Reference in New Issue
Block a user