Skip to content

Support decoding into an existing Memory<T> #1487

Discussion options

You must be logged in to vote

I was actually just about to open this same exact discussion, then I saw this 😄
@JimBobSquarePants I think we absolutely should expose APIs for this, and the solution found by @DaZombieKiller doesn't actually solvee the issue at all. The code in the last comment is still performing an unnecessary copy, which can (and should) be avoided.

The way I see it, there are two main reasons why such an API should be public:

  • It's conceptually the symmetric equivalent for Image.WrapMemory. We exposed that, so it just seems logical to expose this too.
  • It allows users to directly decode an image into a 3rd party buffer, with no extra copy.

I have this issue in ComputeSharp, but really the same applie…

Replies: 5 comments 40 replies

Comment options

You must be logged in to vote
0 replies
Comment options

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

@DaZombieKiller
Comment options

@DaZombieKiller
Comment options

@JimBobSquarePants
Comment options

Comment options

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

@Sergio0694
Comment options

@JimBobSquarePants
Comment options

@antonfirsov
Comment options

@JimBobSquarePants
Comment options

Answer selected by JimBobSquarePants
Comment options

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

@DaZombieKiller
Comment options

@Sergio0694
Comment options

@JimBobSquarePants
Comment options

@antonfirsov
Comment options

Comment options

You must be logged in to vote
15 replies
@DaZombieKiller
Comment options

@antonfirsov
Comment options

@DaZombieKiller
Comment options

@sunkin351
Comment options

@JimBobSquarePants
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
5 participants