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'.DavidAaah .. my input image has to be resized to 720x280 (maybe the macro can do it ?)
//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.
the 720x280 was a typo.
Should be 720x240.
It would be usefull for a lot of applications to make it possible to display a full color image using your load_viewport function on a viewport when a designated button is clicked in either REC or PLAY mode. I tried to hook on the histogram code, but right now, on SD1000 I was able display the image only once in a PLAY mode after I turn the camera on or after I switch from REC to PLAY mode. When I click on MENU button, I can repeat it. Initially, I can load to buffer I get with vid_get_viewport_fb_d(), but I believe that viewport buffer location changes when you scroll through the saved images in PLAY mode. When you click on MENU button or switch from REC to PLAY the viewport buffer is restored to the initial buffer returned by vid_get_viewport_fb_d(). Anyone knows more about this?
Started by hiker_jon General Discussion and Assistance
Started by Bernd R General Discussion and Assistance
Started by Dave92F1 General Help and Assistance on using CHDK stable releases
Started by pigeonhill General Help and Assistance on using CHDK stable releases
Started by SandraEllis General Help and Assistance on using CHDK stable releases