Author Topic: Postprocessing with PicoC  (Read 5016 times)

desmovalvo

  • New to the forum
  • *
  • Posts: 4
Postprocessing with PicoC
« on: February 13, 2013, 01:43:51 PM »
Hi, I'm looking for a way to edit photos on the camera with picoC scripts, but reading the API I could not find anything useful. Can you help me? I would like to open one or more images and elaborate them... Forgive me if my question is too silly :)

Fabio
EOS 1000d and EOS 1100d. standard 18-55  and 55-250mm f/4-5.6.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: Postprocessing with PicoC
« Reply #1 on: February 13, 2013, 03:38:35 PM »
It's very slow for this. Here's an example (it takes around 1 minute for a 720x480 image):

Code: [Select]
// image processing test

console_hide();
click(PLAY);
sleep(1);

// 5D Mark II only
// for others, look in platform/YOUR.CAMERA/consts.h for YUV422_LV_BUFFER_DISPLAY_ADDR
short * buf = *(short**)0x2900;

for (int i = 0; i < 480; i++)
{
    for (int j = 0; j < 720; j++)
    {
        // for each pixel, keep chroma, set luma to 0x80
        buf[i*720+j] = (buf[i*720+j] & 0x00FF) | 0x8000;
    }
}

So... consider using plain C. It's useful only for previewing, like fisheye correction, or averaging two images, or brightening/darkening.


desmovalvo

  • New to the forum
  • *
  • Posts: 4
Re: Postprocessing with PicoC
« Reply #2 on: February 13, 2013, 03:59:58 PM »
Thank you for the quick reply a1ex! ;) I'll give it a try! I only need to do some minor editing but if it's really too slow I'll switch to plain C!
Many thanks! I'll share with you my achievements :)

Fabio
EOS 1000d and EOS 1100d. standard 18-55  and 55-250mm f/4-5.6.