ICameraV3ImageArrayVariant Property |
Namespace: ASCOM.DeviceInterface
Exception | Condition |
---|---|
InvalidOperationException | If no image data is available. |
NotConnectedException | If the device is not connected |
DriverException | An error occurred that is not described by one of the more specific ASCOM exceptions. Include sufficient detail in the message text to enable the issue to be accurately diagnosed by someone other than yourself. |
For colour or multispectral cameras, will produce an array of NumX * NumY * NumPlanes. If the application cannot handle multispectral images, it should use just the first plane.
Clarification December 2021.
The two dimensional array that supports monochrome and Bayer matrix colour sensors is specified with width as its first dimension and height as its second, rightmost, dimension. From an infrastructure perspective, the .NET CLR and C like languages store arrays in memory using row major order, which means that the rightmost array index changes most rapidly. For an array Array[X, Y] it is the Y index that changes most rapidly, leading to a memory layout that looks like this:
Array[0, 0], Array[0, 1] ... Array[0, Y - 1], Array[1, 0], Array[1, 1] ... Array[1, Y - 1] ... Array[X - 1, 0], Array[X - 1, 1] ... Array[X - 1, Y - 1]
The ImageArrayVariant property is specified to return Array[NumX, NumY] where X represents width (horizontal lines) and Y represents height (vertical columns). For the ImageArrayVariant array, the rightmost dimension is defined as the image height, hence, when stored in memory, the height index will change most rapidly.This means that, from an application perspective, values are held in memory in column major order despite being stored in row major order from an infrastructure perspective.
We consider the application view to have primacy and thus consider the returned array to be column major in structure, regardless of the form in which it is stored in memory.
Furthermore, for the avoidence of doubt, the pixel at coordinate 0,0 is the top left image pixel.