Cropped zebra or zebra specific OSD - Feature Requests - CHDK Forum supplierdeeply

Cropped zebra or zebra specific OSD

  • 90 Replies
  • 30158 Views
*

Offline fudgey

  • *****
  • 1705
  • a570is
Cropped zebra or zebra specific OSD
« on: 05 / July / 2008, 07:39:34 »
Advertisements
As we know, zebra draws over the camera's built-in OSD. What I miss are the camera's metered values (ISO on top left corner and Tv and Av along with Ev offset on bottom). They only blink very shortly when first half pressing and then releasing the shutter.

The blink modes are there to overcome this, but I sort of hate everything that blinks. So I'm left with leaving zebra off and enabling it (thankfully we have a shortcut key) when I need it. But for most of the time I just don't bother, which is a shame since it's a great feature.

Could zebra be drawn in "cropped mode" i.e. just in a (preferably user defined) rectangle in the middle of the screen? Since zebra is updated while one moves the camera, the border areas can be quickly checked if necessary (just like we need to check below histogram and OSD if they are enabled in current builds).

Or if zebra is drawn over some buffer that doesn't have the Canon OSD on it, could at least the upper and lower parts be copied from another buffer where Canon OSD does exist?

Or, if that's just not possible, could we have some OSD options in the zebra menu to display these values when zebra is enabled?

*

Offline LjL

  • ****
  • 266
  • A720IS
Re: Cropped zebra or zebra specific OSD
« Reply #1 on: 05 / July / 2008, 09:04:37 »
I second this.

I'll just note that there is a build (which? I'm losing count) that only draws zebra when there's actually something overexposed, and does without it otherwise - so when your exposure is fine, nothing will blink and the OSD will stay.

*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: Cropped zebra or zebra specific OSD
« Reply #2 on: 05 / July / 2008, 09:29:43 »
I second this.

I'll just note that there is a build (which? I'm losing count) that only draws zebra when there's actually something overexposed, and does without it otherwise - so when your exposure is fine, nothing will blink and the OSD will stay.

Yes, it's one of cyril42e's improvements http://chdk.setepontos.com/index.php/topic,1687.0.html
and it's been added to the juciphox/collaborative build: http://chdk.setepontos.com/index.php/topic,688.msg5556.html#msg5556 which is actually what I've been running for a couple of days now.


*

Offline LjL

  • ****
  • 266
  • A720IS
Re: Cropped zebra or zebra specific OSD
« Reply #3 on: 08 / July / 2008, 10:51:23 »
Well, I've modified core/gui_osd.c so that areas of the screen that aren't transparent aren't touched by zebra.
This, as far as I can see, means you'll have all the OSD elements always visible - which should satisfy the feature request.

There is also two commented-out lines in my files that do the cropping as requested by the OP, but I don't see the purpose of that, since it appears that I can just draw zebra "under" the OSD.

The attached file is a modified version of the one from DataGhost's build. I don't know if it works with other builds, as the trunk site seems to be down.

BUGS:
- If you move the camera with the shutter half-pressed, the zebra pattern for the previous frame won't go away (it will be treated like a part of the OSD that must not be drawn upon; the "cropping" version shouldn't have this poblem)
- Sometimes the "half-shutter" OSD will be shown as expected, but other times you will see the "no button pressed" OSD (I guess it's because the screen buffer is read very early in the zebra routine)
« Last Edit: 08 / July / 2008, 10:59:16 by LjL »


*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: Cropped zebra or zebra specific OSD
« Reply #4 on: 08 / July / 2008, 12:51:25 »
Hmm... I built it in trunk 436 I had on my computer (can't get in assembla either) and it definitely does something... but it's the wrong Canon OSD that's sticking on the screen.

The metered Tv, Av and ISO values still only flash on my screen instead of staying there (actually they did stay a few times in a ghostly raster, but almost always they disappeared)

Instead, what's not disappearing is all the settings icons and top-right corner mode indicatiors of the Canon "full OSD" mode -- these are actually normally disabled from the screen by Canon while half-pressing. They are transformed into a ghostly raster.

This was with the gui_osd.c you postes without modifications. Also, the "old zebra lines not being removed" problem happens for me too.


I'm assuming the cropped mode is enabled by uncommenting lines 244 and 326, so I tried that as well. It's different but not much better. It doesn't remove old zebra lines either (expect on the border area outside the crop... it draws zebra there too and it's cleared correctly there). It transforms Canon OSD to that semitransparent raster also. It sometimes leaves the "full Canon OSD" enabled, but unlike the non-cropped version, it sometimes removes it fully or partially. When it does (maybe 1/3 of the time), the Av/Tv/ISO OSD sticks. So, this works better than the non-cropped one, but still not quite usable.

This varying behavior and it's 1/3 nature makes me think that the problem is that we're not fully aware which display buffer (from the MD speedup I remember we have three) is active and being drawn to, or something like that?

And for what it's worth, that ghostly semi-transparent raster is harder to read than the original Canon OSD, but it's readable and way better than not having the OSD there at all.

*

Offline LjL

  • ****
  • 266
  • A720IS
Re: Cropped zebra or zebra specific OSD
« Reply #5 on: 08 / July / 2008, 14:26:12 »
To enable "cropped mode", you should uncomment those line as you said, but also comment out the lines that are relevant to "draw-under mode", if you don't want the problems you mentioned.

But on my camera, the problem of the "wrong" OSD showing up doesn't appear all the times... most/some of the times, the "right" OSD shows up and stays.

I've tried several things now to get rid of the problem, from waiting some ticks and then grabbing the OSD screen, to forcing draw_restore()... none was successful.

I think I should only start doing the zebra drawing after the camera is in "ready to shoot" mode (i.e. has finished focusing and metering), because that appears to be when the "shooting" OSD is drawn.
However, the only function i've found that seems to give that information is _GetShutterReadyStateVar(), but that's weird, because it doesn't seem to be defined for all camera models... although it's used in main.c and I can't see an #ifdef...

*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: Cropped zebra or zebra specific OSD
« Reply #6 on: 08 / July / 2008, 15:02:52 »
To enable "cropped mode", you should uncomment those line as you said, but also comment out the lines that are relevant to "draw-under mode", if you don't want the problems you mentioned.

Ah...will have to try that one too.

Quote
I think I should only start doing the zebra drawing after the camera is in "ready to shoot" mode (i.e. has finished focusing and metering), because that appears to be when the "shooting" OSD is drawn.

Yes that's probably a good idea. After all, how could zebra even be accurate before exposure has been decided?

Quote
However, the only function i've found that seems to give that information is _GetShutterReadyStateVar(), but that's weird, because it doesn't seem to be defined for all camera models... although it's used in main.c and I can't see an #ifdef...

Wouldn't prop 205 (digic II propset) / prop 206 (digic III propset) somewhat help? Or even better, did you see this thread?:
http://chdk.setepontos.com/index.php/topic,1770.msg16115.html#msg16115


Keep up the good work :)

*

Offline LjL

  • ****
  • 266
  • A720IS
Re: Cropped zebra or zebra specific OSD
« Reply #7 on: 08 / July / 2008, 15:52:18 »
Ah, I've come across PROPCASE_SHOOTING a dozen of minutes ago, but no, I wasn't aware that it returned anything more than 0 or 1.

I will have to try with 7... but the weird thing is that even if I start zebra after a long timer wait, it still sometimes shows the wrong OSD. It's like the system forgets to update the bitmap framebuffer when it draws the OSD... which sounds a bit paradoxical, but.

EDIT: Ok, it's just double-buffered, it probably isn't during half-shoot, and half the times, I end with the wrong buffer... The problem now is, how do I tell which buffer is being used for the half-shoot OSD  :blink:
« Last Edit: 08 / July / 2008, 16:22:40 by LjL »


*

Offline cyril42e

  • ***
  • 111
  • SD1000/Ixus70 1.02a
    • CR-TEKnologies
Re: Cropped zebra or zebra specific OSD
« Reply #8 on: 08 / July / 2008, 17:02:52 »
Ah, I've come across PROPCASE_SHOOTING a dozen of minutes ago, but no, I wasn't aware that it returned anything more than 0 or 1.

I will have to try with 7...
PROPCASE_SHOOTING returns only 0 or 1, it's an experimental memory variable that returns more information (0xAB38 for A720IS).

EDIT: Ok, it's just double-buffered, it probably isn't during half-shoot, and half the times, I end with the wrong buffer... The problem now is, how do I tell which buffer is being used for the half-shoot OSD  :blink:

Which buffer are you using that contains Canon's OSD? I think the buffers used by motion detection does not contain Canon's OSD, right? There is a way to know which buffer is used for motion detection (Motion Detection too slow?), so there is probably a way for your buffer too.

*

Offline LjL

  • ****
  • 266
  • A720IS
Re: Cropped zebra or zebra specific OSD
« Reply #9 on: 08 / July / 2008, 17:25:35 »
I'm using vid_get_bitmap_fb(). The secondary buffer appears to be at vid_get_bitmap_fb()+screen_buffer_size (it's in gui_draw).

The first buffer is at 0x10361000 in apparently every model or almost (which, as is explained in the stubs, is 0x10360000 + 0x1000... oh really? ;) I tried looking at the 0x1000 thingies that preceed it, but could find no hint of a variable telling me which buffer is active).

 

Related Topics