Rename TryGetMemory -> TryGetBytesAsMemory

This commit is contained in:
Jason Nelson 2024-04-08 13:48:26 -07:00 committed by BobLd
parent fc1a41ffbb
commit c3a2e8c08f
8 changed files with 8 additions and 8 deletions

View File

@ -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);
}

View File

@ -99,7 +99,7 @@
{
foreach (var image in page.GetImages())
{
if (!image.TryGetMemory(out _))
if (!image.TryGetBytesAsMemory(out _))
{
continue;
}

View File

@ -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;

View File

@ -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.

View File

@ -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)

View File

@ -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.

View File

@ -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;
}

View File

@ -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)