xVir / aforge

Automatically exported from code.google.com/p/aforge
Other
1 stars 0 forks source link

UnmanagedImage.Create could have option not to zero unmanaged memory #373

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
UnmanagedImage.Create allocates fresh unmanaged memory for the image, and sets 
it to zero before returning to the caller.

This is good default behavior, but optionally, it's a step that can be avoided 
in many algorithms (in particular, those that immediately fill up the new image 
with fresh data before ever reading from it).

The patch I've attached simply adds an overload with a zeroMemory boolean 
parameter. A more thorough patch would go through the whole library to check 
for cases where UnmanagedImage.Create can be safely called with 
zeroMemory=false.

Original issue reported on code.google.com by ncruces on 25 Nov 2013 at 4:25

Attachments: