From: Malitsky, N. D <mal...@bn...> - 2011-11-29 23:00:10
|
Hello, For the image types, I would suggest to start with the RGBA model. There are two primary reasons. First, it allows to deal with the explicit concepts without proprietary enumeration schemes. Second, one can consider RGBA as a common denominator which is supported by all C++ and Java client applications. Below please find the corresponding structure. In the context of NDArray, it addresses the Mono and RGB color modes. Any comments are welcome. The next important topic is a compression. -Nikolay struct RgbaImage { byte[2] byteOrder; // "II" or "MM" - TIFF // Basic fields int width; // number of columns int height; // number of rows int x; // start of readout region (left) int y; // start of readout region (top) int bytesPerPixel; // TINE also uses effectiveBitsPerPixel int samplesPerPixel; // 1 -> for grayscale and palette-color images; 3 -> for RGB; 4 -> for RGBA // NDArray variant-specific features defined via the Java BufferedImage concepts int pixelStride; // number of elements between two samples for the same band (e.g. red) // 0 -> RGB1 [3, NX, NY]; // width - 1 -> RGB2 [NX, 3, NY]; // samplesPerPixel - 1 -> RGB3 [NY, NY, 3] int dataType; // PvType id, but NDArray also uses unsigned integers // Data byte[size] data; // size = width*height* bytesPerPixel }; |