dlemstra / Magick.NET

The .NET library for ImageMagick
Apache License 2.0
3.49k stars 415 forks source link

Create an image with a specific pixel format and getting an IntPtr to the pixel data #399

Closed osre77 closed 5 years ago

osre77 commented 5 years ago

Is there a way to create an Image with an specific Pixel Format and get an IntPtr to the data? I want to use ImageMagick to grab and process imeages from an GigE Camera. For that the data needs to be stored in the correct Pixel Format (like BGR24) and I need an IntPtr so I can tell the Camera API where to store the Image data. Using PixelSource and doing it pixel by pixel would be a performance nightmare. Also all our own Image processing algorithms use unsafe code where I need the IntPtr. I'm using Windows with C# (Q8_AnyCpu) So is this already possible, or can I add this functionality?

dlemstra commented 5 years ago

I don't want to add an Intptr to the public API of Magick.NET. And even if this would be added it would conflict with the API of ImageMagick for accessing the pixels. You can copy an area instead of just an individual pixel. But I don't know if that would be possible with the API of your camera.

osre77 commented 5 years ago

Thank you for the Response. Have to look for a different library then.