I am translating the following command in C++:
exiftool -RawThermalImage -b imagename.jpg | convert - -compress none tester.pgm
This is what I have written for the Exiftool part:
ExifTool* et = new ExifTool();
TagInfo* info = et->ImageInfo(imagename.jpg, "-RawThermalImage -b");
For the ImageMagick part I have written the following:
Image inputImage;
inputImage.read(); //to complete
//compress
inputImage.compressType(NoCompression);
//write
inputImage.write("tester.pgm");
The problem is that I do not know how to translate the pipe in the script to join these 2 sections of code. As you can see the read function of the ImageMagick object is empty, as I don't know what to put into it. I am not sure if I can directly put 'info' there. Kindly guide. Thanx in advance.
I don't know c programming at all, but I think what you want is imagemagick BLOB (https://imagemagick.org/api/Image++.php#BLOBs). The TagInfo should contain the extracted image. You then create and copy that data to a BLOB and then inputImage.read(blob).
Could you be a bit more clear what you are trying to do.
Are you trying to call exiftool.exe from your program and write / read to std in and out via pipes?