Skip to content

Implement discontiguous buffer handling - #1109

Merged
JimBobSquarePants merged 66 commits into
masterfrom
af/disco-buffers
Feb 21, 2020
Merged

JimBobSquarePants merged 66 commits into
masterfrom
af/disco-buffers

Conversation

@antonfirsov

@antonfirsov antonfirsov commented Feb 8, 2020 •

Copy link
Copy Markdown
Member

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following matches the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules 👮.
  • I have provided test coverage for my change (where applicable)

Description

Marked as WIP because processors and codecs need adaption, but the core logic is ready to review!

  • MemorySource<T> has been replaced with MemoryGroup<T>, which is a list of uniformly sized buffers (IMemoryOwner<T> and Memory<T>)
  • Several helpers intend to provide span-like functionalities in MemoryGroupExtensions eg. .CopyTo()
  • MemoryGroupView<T> is an indirection to expose these memory buffers in a safe way, see docs and comments for more info
  • The methods exposed over AdvancedMemoryExtensions have been changed to reflect the new memory model, .GetPixelSpan<T>() has been made obsolete
  • buffer2d.GetSpan<T>() ---> buffer2d.GetSingleSpan<T>(), temporarily marked [Obsolete] to guide refactor

TODO

We should no longer process Buffer2D as a single span (except of a few special cases like resize KernelMap). Guidance: go through all [Obsolote] warnings.

  • Add tests for each codec and processor in a similar manner like it has been added to Jpeg tests. (Artifically limit buffer capacity of allocator to emulate the discontiguous case.)
  • Fix remaining codecs
  • Fix remaining processors

Resolves #898, Fixes #805

@antonfirsov
antonfirsov requested a review from a team February 8, 2020 02:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable images of arbitrary size System.ArgumentOutOfRangeException (Parameter name: minimumLength) when loading moderate size jpg image

5 participants