Georg,
- PI only considers double values between 0 and 1. This is equivalent to the full range of unsigned(!) integers (0...2^bits-1). PI does not have a concept of negative values, neither for double sample nor for int samples.
If this statement was true, the whole PixInsight platform would not work in any way! Actually, pixel samples of a floating point real or complex image can take the whole range of IEEE 754 values in PCL, either in 32-bit (float) or 64-bit (double) format, including non-numeric entities such as NaN and infinities. There are absolutely no restrictions in this regard.
However, when a module submits a floating point image to the platform, it is expected to be represented it in the normalized [0,1] range, where 0 is black and 1 is white. So the [0,1] range is only required for images that are to be managed directly by the graphical interface, but not for internal image data or working images. In fact, although it is considered nonstandard practice (and in most cases, bad practice), a module can submit an out-of-range floating point image to the GUI. In this case the image won't be rendered correctly on the screen, color management and masking won't work, and some modules can have problems to work with it, but otherwise it will be tolerated.
In the case of integer images, PixInsight supports unsigned integer pixel data exclusively, where 0 is black and 2
n-1 is white, being n the number of bits used to store a pixel sample. This does not mean that an unsigned integer image cannot be used to perform any kind of image processing algorithms, such as convolutions, Fourier transforms, wavelet transforms, etc, where negative values happen naturally. Unsigned integer data are automatically converted to/from floating point working values as necessary, in a completely transparent way.
Finally, PCL supports signed integer images, although they have not been implemented as standard image types. For example, you can instantiate the GenericPixelTraits template as follows:
class PCL_CLASS Int16PixelTraits : public GenericPixelTraits<int16>
{
// ...
};which is straightforward, and then this should work without problems:
typedef Generic2DImage<Int16PixelTraits> Int16Image;However, no standard module would be able to work with instances of this class, and no View object could transport them either.