Library: ImageSource

Contents:

The ImageSource Utils

karabo::utils namespace contains functions which are of common use for image source devices. This is the list of the currently provided ones:

void karabo::util::unpackMono12Packed(const uint8_t *data, const uint32_t width, const uint32_t height, uint16_t *unpackedData)

Unpack the input MONO12PACKED data to MONO12.

In MONO12PACKED pixel data format, every 3 bytes contain data for 2 pixels, according to the following table:

Byte Pixel - Data bits
B0 P0 11…4
B1 P1 3…0 | P0 3…0
B2 P1 11…4
Bm Pn 11…4

Parameters
  • data: The pointer to the input packed data
  • width: The image width
  • height: The image height
  • unpackedData: The pointer to the output unpacked data

The ImageSource class

The ImageSource class provides a base class to be used for all kind of image providing devices, for example image processors.

For the cameras a more specific class is provided, see here.

The advantage of using this class, is that it can take care of creating the necessary output channels in the schema, and it provides functions to output images and End-of-Stream signals to them.

class karabo::ImageSource

Inherits from karabo::core::Device<>

Subclassed by karabo::CameraImageSource

Protected Functions

void updateOutputSchema(const std::vector<unsigned long long> &shape, const karabo::xms::EncodingType &encoding, const karabo::util::Types::ReferenceType &kType)
void writeChannels(const karabo::util::NDArray &data, const karabo::util::Dims &binning, const unsigned short bpp, const karabo::xms::EncodingType &encoding, const karabo::util::Dims &roiOffsets, const karabo::util::Timestamp &timestamp, bool safeNDArray = false)
void signalEOS()

The CameraImageSource class

The CameraImageSource class provides a base class to be used for all camera devices. In addition to the functionalities provided by its base class, this class provides a default scene for cameras.

class karabo::CameraImageSource

Inherits from karabo::ImageSource

Indices and tables