Microfunguy
Creating the RAW file seemed to be OK but when reading it gave strange results (just a pattern, no image).
Maybe I did it wrong, will check tomorrow.
A number of brackets also missing from that macro, some caused by the 'smiley'.
David
Aaah .. my input image has to be resized to 720x280 (maybe the macro can do it ?)
Hi, the 720x280 was a typo. Should be 720x240.
I added a line to resize the image. Here is the correct beginning to the macro:
//RGBtoViewport.txt
//This macro can convert an RGB image to Canon viewport data.
//For my camera, the A720IS, the viewport data is 360x240 x 3bytes.
//Every 6 bytes in the data is encoded as U,Y1,V,Y2,Y3,Y4 in the YUV color system.
//This routine takes 4 RGB pixels and converts them to 6 bytes in the output data
//The input RGB image is resized to 720x240.
//The output is a 360x240 RGB image saved in raw format.
open();
setBatchMode(true);
run("Scale...", "x=[] y=[] width=720 height=240 interpolate create title=VPinput");
By the way... I just noticed that the first macro ViewportToRGB has a bug. The output colors aren't perfect. I will have to look into this. My Java code works fine, but macros are a little tricky when doing integer operations.