ImageLoader: convert images always to 8-bit depth as expected by Shark.cpp (i.e. 16-bit images can be loaded now)
--- a/ImageLoader.cpp Sun Dec 03 00:17:48 2023 +0100
+++ b/ImageLoader.cpp Sun Dec 03 00:57:54 2023 +0100
@@ -25,12 +25,18 @@
ImageLoader::ImageBuffer* ImageLoader::loadImage(const Buffer& input) {
Magick::Blob inputBlob(input.getData(), input.getSize());
Magick::Image image(inputBlob);
+ // Magick::Image image("magick:LOGO");
+ // Magick::Image image("magick:WIZARD");
+ // Magick::Image image("https://.../remote-image.png");
+ // Magick::Image image("x:root"); // whole desktop
+ // Magick::Image image("x:0x6a0001c"); // single window, use e.g. xwininfo
// Magick::PixelPacket* parsedPixels = parsedImage.getPixels(
// 0, 0, parsedImage.size().width(), parsedImage.size().height());
Magick::Blob outputBlob;
image.magick("RGBA");
+ image.depth(8); // TODO: pass more bits to OpenGL?
image.write(&outputBlob);
ImageBuffer* outputBuffer = new ImageBuffer(