Chapter 8 Reference Manual
Ranger E/D
104 ©SICK AG • Advanced Industrial Sensors • www.sick.com • All rights reserved
iCon API
// Create a buffer to store the resulting color image in
icon::IconBuffer resultImage;
// Prepare the rgb filter to not let initiation and allocation slow
// down processing of the first buffer
rgbFilter.prepareResult(resultImage);
[…]
// Apply the color generation filter
rgbFilter.apply(*input, resultImage);
// Save image to disk
// If the input buffer has scan layout, apply an extractionFilter to get sub-
component layout before saving
IconBuffer imageToSave;
ExtractionFilter extractionFilter("Color 1");
extractionFilter.setInput(*(resultImage.getDataFormat()),
resultImage.getNoScans());
extractionFilter.prepareResult(imageToSave);
extractionFilter.apply(resultImage, imageToSave);
std::stringstream fileName;
fileName << "registrationResult.bmp";
imageToSave.saveImageRGB(fileName.str(), "BMP");
The color generation filter adds a new sub-component to the RGB component.
The RGB color data is formatted with 24-bit color stored in 32-bit containers. The last byte
is unused. The data is stored in the order B-G-R-x.