Skip to content

Image<TPixel>.TryGetSinglePixelSpan(out Span<TPixel>) doesn't hint towards when it will work. When will it work? #1307

Discussion options

You must be logged in to vote
  1. Does it always work? Is it unpredictable? Does it always work on Images loaded from a file?

Currently the limit is int.MaxValue / 4 bytes which is around 134 Rgba32 megapixels. We may decide to lower this value, but it we won't go below 16 Megapixels, to not break people working with images that need to fit on screen.

  1. What is the backup plan, constructing contiguous memory myself with all of the values from GetPixelRowSpan(Int32)?
foreach (Memory<Rgba32> memory in image.GetPixelMemoryGroup())
{
    // Take pixel data from memory.Span
}

PS:
These questions made me to consider exposing methods likeimage.CopyPixelDataTo(Span<TPixel>) and maybe even image.CopyPixelDataTo(Stream). Is t…

Replies: 2 comments 8 replies

Comment options

You must be logged in to vote
6 replies
@JimBobSquarePants
Comment options

@antonfirsov
Comment options

@alistaircarscadden
Comment options

@antonfirsov
Comment options

@alistaircarscadden
Comment options

Answer selected by alistaircarscadden
Comment options

You must be logged in to vote
2 replies
@ThomasMiz
Comment options

@antonfirsov
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants