Originally Posted by: Alex.M Can you decide on input format for and RGB? Matrix, system, etc...
I vote for system.
Matrix of 3(4)-element vectors should be easiest to implement, but creating it takes considerably longer, and managing it is less convenient.
Actually, system looks more natural in SMath
If you would implement matrix of vectors, then please just in addition to system.
Mathcad seems to have another option - packed matrix that has its height equal to image height, and its width 3x image width, its first 1/3 cols being R, after that go 1/3 cols of G, and last are B. But I dislike that route, because then it's unclear when it's gray bitmap of triple width, and when it's RGB packed matrix.
Using matrix of 24-bit numbers isn't good, too, because it won't be easy and robust to tell 24(32)-bit from 8-bit. It's possible for an image to have only one color, so that it would be falsely treated as 8-bit.
Another option is 3(4)-element vector of matrices. I don't see much advantage in this compared to system.
Generalizing, one can think of more complex schemas: system of separate images where each image has own dimensions and position, thus creating patchwork.
But you know, my imagination is inflamed from sleepless night. Please scrap all this and do what you feel like.
Quote:RGB should not be too hard to implement, just a matter of finding some 4 hours of my time... Alpha is not as straightforward. Do we need alpha?
Personally I don't really need Alpha, and only wanted it for completeness.
But I don't see why it's not straightforward. At the link above that discusses it, I see that the only requirement for it is creating not PixelFormat.Format32bppRgb, but PixelFormat.Format32bppArgb, and then each pixel is defined with not 3, but 4 bytes (B,G,R,Alpha). So, I think, that if you simply detect that input is system, then check if it contains exactly 3 or 4 matrices, that all of them are same size, and then if 3, then create PixelFormat.Format32bppRgb and do 3-byte processing (like it is now for ordinary matrices), and if 4, then create PixelFormat.Format32bppArgb and do 4-byte.
Anyway, if you feel like it's overkill, then please skip it!