First try with Magick Core 7
Posted: 2013-02-06T07:06:00-07:00
I have started converting the Windows Interface for Image Magick that I am developing so that it will be compatible with IM7. Is this the correct place to discuss this?
I am only at the start of the convertion but I can already load and display images with one to 3 colour channels and with or without an alpha channel. I have also got my painting routine working, this needs an alpha channel on source, destination and background images which I add with SetImageAlphaChannel(). Displaying images on Windows is made a little tricky as it is best to premultiply by alpha, and convert to 8 bit channel data. So I use IM to sample an image down to the dfisplay size (I should convert to RGB if necessary too), and then AcquireVirtualCacheView() and GetCacheViewVirtualPixels() so that I can process the raw data premultiplying and converting to 8-bit channels in a single step.
So far it seems that there is no noticeable slow down when drawing IM7 (floating point) images compared with IM6 (16 bits per channel) images. I can still move a magnifying glass over an image and get smoothe movement in the magnified image, I have a Quad core Win7 64 bit PC.
I am using the alpha version of IM, ImageMagick-7.0.0-0-Q16-windows-x64-dll.exe, I can not compile the source code as I am using an Express edition of C++ which does not allow certain windows components to be used.
I have a few questions about the new Pixel format of the raw data etc. if anyone can answer them.
1. I have a need to get the value of a single pixel, I am using GetOneAuthenticPixel(), which works fine the channel values are returned in an array. I first tried allocating the array big enough to hold one pixels worth of data, but it overflowed, it seems that this array needs to be 32 floats long. Does this imply that there will be a hard limit on pixel size?
2. Am I correct in calculating pixel size in bytes as (number_channels+number_meta_channels)*sizeof(float)?
3. Presumably the order of the channels is important when deciding which one is red, green, blue and black and these channels will be followed by the primary alpha channel if there is one will the next channel be the mask if there is one? Or do I always need to check for the appropriate channel_map entry?
4. Will all of the above channels be included in number_channels?
5. Which number_* will other alpha blending, and modifyable channels be included with? I am guessing the number_channels, so that IM knows which channels to ignore when processing.
6. Is ChannelMask still necessary?
I realize that this is only an Alpha version but I would like to be 'on the ball' when Beta testing comes along.
Alan Hadley
I am only at the start of the convertion but I can already load and display images with one to 3 colour channels and with or without an alpha channel. I have also got my painting routine working, this needs an alpha channel on source, destination and background images which I add with SetImageAlphaChannel(). Displaying images on Windows is made a little tricky as it is best to premultiply by alpha, and convert to 8 bit channel data. So I use IM to sample an image down to the dfisplay size (I should convert to RGB if necessary too), and then AcquireVirtualCacheView() and GetCacheViewVirtualPixels() so that I can process the raw data premultiplying and converting to 8-bit channels in a single step.
So far it seems that there is no noticeable slow down when drawing IM7 (floating point) images compared with IM6 (16 bits per channel) images. I can still move a magnifying glass over an image and get smoothe movement in the magnified image, I have a Quad core Win7 64 bit PC.
I am using the alpha version of IM, ImageMagick-7.0.0-0-Q16-windows-x64-dll.exe, I can not compile the source code as I am using an Express edition of C++ which does not allow certain windows components to be used.
I have a few questions about the new Pixel format of the raw data etc. if anyone can answer them.
1. I have a need to get the value of a single pixel, I am using GetOneAuthenticPixel(), which works fine the channel values are returned in an array. I first tried allocating the array big enough to hold one pixels worth of data, but it overflowed, it seems that this array needs to be 32 floats long. Does this imply that there will be a hard limit on pixel size?
2. Am I correct in calculating pixel size in bytes as (number_channels+number_meta_channels)*sizeof(float)?
3. Presumably the order of the channels is important when deciding which one is red, green, blue and black and these channels will be followed by the primary alpha channel if there is one will the next channel be the mask if there is one? Or do I always need to check for the appropriate channel_map entry?
4. Will all of the above channels be included in number_channels?
5. Which number_* will other alpha blending, and modifyable channels be included with? I am guessing the number_channels, so that IM knows which channels to ignore when processing.
6. Is ChannelMask still necessary?
I realize that this is only an Alpha version but I would like to be 'on the ball' when Beta testing comes along.
Alan Hadley