Desired behavior
Add a function that allows users to set a specific channel of an image, e.g. set the red channel of an RGB image from either another grayscale image or an array of data
Implementation suggestion
One is to add the function:
bool SetChannelData(Channel _channel,
const std::vector<unsigned char> &_data) const;
In the implementation, we make use of the FreeImage_SetChannel API call:
DLL_API BOOL DLL_CALLCONV FreeImage_SetChannel(FIBITMAP *dst, FIBITMAP *src, FREE_IMAGE_COLOR_CHANNEL channel);
Note we'll need to convert the raw std::vector data array to a FIBITMAP first. So need to profile and make sure it is efficient.
Additional context
See https://github.com/gazebosim/gz-common/pull/706/files#r2331699575
Desired behavior
Add a function that allows users to set a specific channel of an image, e.g. set the red channel of an RGB image from either another grayscale image or an array of data
Implementation suggestion
One is to add the function:
In the implementation, we make use of the
FreeImage_SetChannelAPI call:Note we'll need to convert the raw std::vector data array to a FIBITMAP first. So need to profile and make sure it is efficient.
Additional context
See https://github.com/gazebosim/gz-common/pull/706/files#r2331699575