.EDG file format - General Help and Assistance on using CHDK stable releases - CHDK Forum supplierdeeply

.EDG file format

  • 5 Replies
  • 3901 Views
.EDG file format
« on: 28 / March / 2012, 11:59:11 »
Advertisements
I was wondering whether someone could help with the definition (structure) of the .EDG files that are produced when using the Edge Overlay mode for saving the edge data.

Re: .EDG file format
« Reply #1 on: 28 / March / 2012, 12:29:03 »
I was wondering whether someone could help with the definition (structure) of the .EDG files that are produced when using the Edge Overlay mode for saving the edge data.
I don't have access to the source at the moment,  but I'd be surprised if its not just a raw dump of xy data the size of the LCD display buffer ?

UPDATE :  gotta love having wifi on an airplane.  From core/edgeoverlay.c, here you go :

Code: [Select]
    // open the right file
    sprintf(fn, EDGE_SAVE_DIR "/" EDGE_FILE_FORMAT, fnum );
    fd = fopen(fn, "wb");
    if(fd !=NULL)
    {
        // write the data
        fwrite(edgebuf->ptr,edgebuf->ptrLen,1,fd);
        fwrite(&zoom,sizeof(zoom),1,fd);
        fclose(fd);
        t.actime = t.modtime = time(NULL);
        utime(fn, &t);
        sprintf(msg, "Saved as %s",fn);
        draw_string(0, 0, msg, conf.osd_color);
    }
    safe_closedir(d);

« Last Edit: 28 / March / 2012, 12:35:29 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

Re: .EDG file format
« Reply #2 on: 28 / March / 2012, 15:58:12 »
Thanks, waterwingz, for your helpful information. Now for the interpretation of the bitwise dump.

I start reading the .EDG file from bit 0. If the bit is 0, I colour pixel (0, 0) white, otherwise black. Bit 1 then determines the colour of pixel (1, 0), bit 2: pixel (2, 0) ... bit 360 determines the colour of the first pixel of the next row (0, 1), bit 361: pixel (1, 1), bit 362: pixel (2, 1), etc. (Am using a camera with a display resolution of 360*240.) The result is:



Still a number of problems, notably the "sawedges" (should be straight lines) on the lower right; the vertical, white stripe near the left border.

Next question is: How to better interpret the bits of the bitdump?

Best

Lee
« Last Edit: 28 / March / 2012, 16:06:39 by ltraynor »

*

Offline srsa_4c

  • ******
  • 4451
Re: .EDG file format
« Reply #3 on: 28 / March / 2012, 18:05:26 »

Just read the bits of a byte "backwards".
If you create a picture, don't forget the additional bytes (in my case, 5 bytes) after the image data. Those are zeros (again, in my case) when no zoom was used.


Re: .EDG file format
« Reply #4 on: 28 / March / 2012, 21:40:54 »
Actually,  I kind of like that image.  Might be a new form of photographic "art" starting here.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: .EDG file format
« Reply #5 on: 29 / March / 2012, 03:36:40 »
@srsa_4c: brilliant, thanks so much.

It is now only a minor step to implement the following: Take any picture that you've taken in the past, make a graphics program do the outlining, save it as .EDG on the card and then load it as a screen overlay. This thread http://chdk.setepontos.com/index.php?topic=6450 discussed such a feature but didn't seem to get that far.

Thanks again,

Lee

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal