Faster image copy to other buffers #1422
-
DescriptionI need to interoperate between ImageSharp and other libraries like UAP or WPF WriteableBitmap for reasons outside my control and so I would love a fast memcpy solution for whole image frame contiguous buffer copies. Seems to me you could just expose the ImageFrame.PixelBuffer and then expose GetSingleMemory, so System.Memory can do the CopyTo and we're good. Steps to ReproduceTry create the quickest way to copy Image to WriteableBitmap, currently have to iterate 1 row at a time? System Configuration
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
If the backing buffer is contiguous (which is often the case unless dealing with multi-megapixel images) we've got See #1375 (comment) |
Beta Was this translation helpful? Give feedback.
-
Thanks for the quick response, Image.TryGetSinglePixelSpan(out Span) works great. |
Beta Was this translation helpful? Give feedback.
If the backing buffer is contiguous (which is often the case unless dealing with multi-megapixel images) we've got
Image<TPixel>.TryGetSinglePixelSpan(out Span<TPixel>)
See #1375 (comment)