Author Topic: Cropped zebra or zebra specific OSD  (Read 12479 times)

Offline fudgey

  • Global Moderator
  • Guru Member
  • *****
  • Posts: 1690
  • a570is
Re: Cropped zebra or zebra specific OSD
« Reply #15 on: 13 / July / 2008, 12:39:36 »
Ah, now I get it.

First, yes, I don't seem to be getting "wrong-OSD" any more either.

Second, there's still that ghostly appearance in Canon OSD. I tried masking all 9 surrounding pixels (in addition to those two horizontally adjacent ones) but it had no effect either. But then I disabled RGB mode from zebra options (yep, I've had that enabled all this time) and everything including the OSD works flawlessly even without that two adjacent pixels mask (which I believe reads outside the buffer twice unless there's a limit to the loop somewhere I didn't look at?).  :D

Btw, the zebra options "restore osd" and "restore original screen" don't seem to have an effect (any more? I think I previously had to set them both for zebra+histogram+osd all to be shown)

Offline LjL

  • Sr. Member
  • ****
  • Posts: 266
  • A720IS
Re: Cropped zebra or zebra specific OSD
« Reply #16 on: 13 / July / 2008, 16:45:29 »
Uhm, I had never tried RGB mode to be honest, my bad.
The problem you mentioned does happen in that mode, but that good news is that I know why: RGB mode involves skipping every odd pixel (s+=step_x). And there is no bad news.

You're right that "Restore OSD" and "Restore original screen" don't behave as intended anymore... but I think those should be removed completely. If you don't want the CHDK OSD to show up during zebra, you can just select that behavior in "Draw over zebra", and as for the "original screen" (i.e. the Canon OSD), I see no reason to make it disappear at any time, now that it can be made to stay all the time.

P.S.: ah, and yes, the previous workaround wrote out of bounds twice. I hoped nobody would notice :P Anyway, it's gone now.
« Last Edit: 13 / July / 2008, 16:48:52 by LjL »

Offline fudgey

  • Global Moderator
  • Guru Member
  • *****
  • Posts: 1690
  • a570is
Re: Cropped zebra or zebra specific OSD
« Reply #17 on: 13 / July / 2008, 17:28:28 »
Uhm, I had never tried RGB mode to be honest, my bad.
The problem you mentioned does happen in that mode, but that good news is that I know why: RGB mode involves skipping every odd pixel (s+=step_x). And there is no bad news.

Yup, now it works in RGB mode too. Perfect! We need to get this thing to trunk, or can anyone think of a reason not to? This is a major improvement.

You're right that "Restore OSD" and "Restore original screen" don't behave as intended anymore... but I think those should be removed completely. If you don't want the CHDK OSD to show up during zebra, you can just select that behavior in "Draw over zebra", and as for the "original screen" (i.e. the Canon OSD), I see no reason to make it disappear at any time, now that it can be made to stay all the time.

I agree. There isn't a way to disable the half-shoot exposure OSD witout CHDK either, is there? If someone wants it gone for some reason, that's a separate feature which needs more work I guess. And it shouldn't be zebra related. I find it unlikely that anyone has used zebra for that particular purpose...someone speak out if you did ;)

P.S.: ah, and yes, the previous workaround wrote out of bounds twice. I hoped nobody would notice :P Anyway, it's gone now.

Yea I figured it was just a quick test to see if it helped. My diagonal mask test went past the buffer an entire line, which made me think twice...didn't crash the camera though...  :haha


As for what could be further improved in zebra: I think those slowest blink zebra modes are now unnecessary (Blink 3 and 2), but faster blink rates could now be useful instead. A quick change to make each blink mode one step faster seems like a good idea to me (from gui_osd.c):

Code: [Select]
            case ZEBRA_MODE_BLINKED_1:
                f = timer&1;
                break;
            case ZEBRA_MODE_BLINKED_3:
                f = timer&4;
                break;
            case ZEBRA_MODE_BLINKED_2:
            default:
                f = timer&2;
                break;


Also, it would be nice if zebra could be also drawn under CHDK OSD gray transparent areas (I keep a 6-line misc osd on display, the rectangle takes up quite a bit of space while most of it is just background, not text) and histogram transparent areas (one thing that especially catches my attention is the histogram multiplier field on top-left corner of the histogram... it's empty when the histogram isn't scaled, but zebra never draws there).

Offline LjL

  • Sr. Member
  • ****
  • Posts: 266
  • A720IS
Re: Cropped zebra or zebra specific OSD
« Reply #18 on: 13 / July / 2008, 18:45:18 »
Yup, now it works in RGB mode too. Perfect! We need to get this thing to trunk, or can anyone think of a reason not to? This is a major improvement.

Well, as PhyrePhoX said, I might be confusing trunk a little with all these patches. Now that a couple of them are in apparently good shape, I should put them together in a single, clean patch for trunk to look at, I think.

For instance, the draw_guard_pixel() function that I used both here and in the face detection patch should really be exported from gui_draw.c instead of duplicated.

Quote
I agree. There isn't a way to disable the half-shoot exposure OSD witout CHDK either, is there? If someone wants it gone for some reason, that's a separate feature which needs more work I guess. And it shouldn't be zebra related. I find it unlikely that anyone has used zebra for that particular purpose...someone speak out if you did ;)

Honestly, I'm not sure why anyone would disable half-shoot OSD at all :o)
Maybe in manual mode, but in the automatic modes it contains pretty much essential information...

Quote
As for what could be further improved in zebra: I think those slowest blink zebra modes are now unnecessary (Blink 3 and 2), but faster blink rates could now be useful instead.

Yeah, that works and makes sense.

Quote
Also, it would be nice if zebra could be also drawn under CHDK OSD gray transparent areas (I keep a 6-line misc osd on display, the rectangle takes up quite a bit of space while most of it is just background, not text) and histogram transparent areas (one thing that especially catches my attention is the histogram multiplier field on top-left corner of the histogram... it's empty when the histogram isn't scaled, but zebra never draws there).

Hm, this makes a lot of sense (consider that the Canon OSD itself disables all elements that have a background, in half-shoot mode), but it's harder to implement than it sounds.

I can ask the OSD to use COLOR_TRANSPARENT for the background during half-shoot/zebra mode, but that will just make the background transparent, it won't let zebra draw over it.

That's because the buffer I'm keeping to check for whether or not I should draw zebra on pixels only contains the Canon OSD at the time just after pressing the half-shoot button. It's not updated, and it doesn't contain the CHDK OSD. It could be made to contain the CHDK OSD, but then it wouldn't get updated. And if it were updated, the problem of zebra "leaving trails" would surface back.

I could keep yet another separate buffer just for the CHDK OSD, but I feel I'm starting to allocate a tad too much precious memory.


But don't despair! If it can't be done in gui_osd.c, it can be done further up the hill in gui_draw.c.
I modified draw_char() so that, then the background color is transparent, nothing at all is drawn there.
That made the text unreadable on white backgrounds, so I also did something to give text a black border (much like Canon's own font; I like it).

The only problem is that, erm... I wouldn't suggest using color 0x00 as the standard background color anymore. Perhaps a new "fake" color should be defined, like COLOR_NEVER_DRAW. Except all 255 of them are already taken.

I also had to modify the histogram drawing code, because it wouldn't use the standard OSD colors. There are a couple of other things in the OSD that don't use OSD colors, so they'll still not be transparent, but I couldn't modify those now as they're scattered in several files.

Offline fudgey

  • Global Moderator
  • Guru Member
  • *****
  • Posts: 1690
  • a570is
Re: Cropped zebra or zebra specific OSD
« Reply #19 on: 13 / July / 2008, 20:52:10 »
Misc values OSD looks pretty nice now... but things like the file browser look quite awful; that black border should only appear when the text is on transparent background I suppose. Also, the grey background of misc values OSD doesn't always disappear when half shooting, and sometimes it disappears only partly.

I didn't try modifying my OSD settings, but I keep SD card free space in MB and battery voltage on screen (quite important even during half shoot since that's where fast MD runs). Curiously the free space indication always has it's gray background, battery voltage doesn't.

Btw. you broke zebra mode Blink 1, it doesn't actually ever draw zebra with f=timer&0.  ::)


Offline LjL

  • Sr. Member
  • ****
  • Posts: 266
  • A720IS
Re: Cropped zebra or zebra specific OSD
« Reply #20 on: 13 / July / 2008, 21:01:18 »
Bah, yes, I knew about timer&0. I thought I had changed that to &1 before uploading, but obviously I didn't.

You're probably right about making the black border only show up with transparent backgrounds (which is easy to do)... I liked it, but it's true, in things like the file browser it's just plain broken.

I noticed about the free space indication, too... *shrug*, I won't say anything, since the guy or girl who wrote that part might be lurking around :P

Offline fudgey

  • Global Moderator
  • Guru Member
  • *****
  • Posts: 1690
  • a570is
Re: Cropped zebra or zebra specific OSD
« Reply #21 on: 13 / July / 2008, 23:16:18 »
I noticed about the free space indication, too... *shrug*, I won't say anything, since the guy or girl who wrote that part might be lurking around :P

Heh well... try to remember that CHDK doesn't have strict management and that a lot of great features have been let in trunk because they work and don't seem to break things. At the same time there is likely much room for improvement in optimizing and documenting things and having some sort of structural discipline. The parasitic nature of CHDK probably adds to the complexity of keeping things neat quite a bit as well... 

Many people who have contributed aren't all that experienced coders, me included. I'll make a wild guess that you're among the most skilled ones around here, you seem to find your way through the code pretty smoothly.

In any case, whenever you find something that's broken, ugly or incomprehensible, I'm sure nobody will object someone fixing it... The thing is, I'm really happy I have a free space indicator and when shooting, I could care less about what makes it tick. ::)

Offline LjL

  • Sr. Member
  • ****
  • Posts: 266
  • A720IS
Re: Cropped zebra or zebra specific OSD
« Reply #22 on: 14 / July / 2008, 05:27:14 »
Sure, I wasn't really being serious with the free space OSD implementor bashing... :)
Things like CHDK work because everything is hacked into just as long as it works, although it's probably reaching the level of complexity where some more structure will eventually be needed.

It's not like things were thought without any structure at all, either... if it had been me, I wouldn't have bothered with a MAKE_COLOR macro and just sticked hex numbers all around the place ;)

Offline PhyrePhoX

  • Global Moderator
  • Guru Member
  • *****
  • Posts: 2254
  • make RAW not WAR
    • PhyreWorX
Re: Cropped zebra or zebra specific OSD
« Reply #23 on: 14 / July / 2008, 05:31:54 »
Quote
I noticed about the free space indication, too... *shrug*, I won't say anything, since the guy or girl who wrote that part might be lurking around Tongue
hm, i am an animal, right? ;)
anyhoo, what exactly is the problem with the freespace indication? are you talking about the SD card symbol or the "space bar"? you can define it's colors in the visuals menu. am i missing something?

CHDK Forum

Re: Cropped zebra or zebra specific OSD
« Reply #23 on: 14 / July / 2008, 05:31:54 »

Offline fudgey

  • Global Moderator
  • Guru Member
  • *****
  • Posts: 1690
  • a570is
Re: Cropped zebra or zebra specific OSD
« Reply #24 on: 14 / July / 2008, 11:08:40 »
Things like CHDK work because everything is hacked into just as long as it works, although it's probably reaching the level of complexity where some more structure will eventually be needed.


Now that you mention it, this is something others are worried about as well:
http://chdk.setepontos.com/index.php/topic,847.0.html

Offline dzsemx

  • Sr. Member
  • ****
  • Posts: 299
  • [A650][A630]
Re: Cropped zebra or zebra specific OSD
« Reply #25 on: 19 / August / 2008, 14:21:45 »
something caused that if i'm using transparent background label, it does not erase the previous output and this looks very bad :P
first i thought that this patch is responsable, but no....
« Last Edit: 19 / August / 2008, 14:24:51 by dzsemx »

Offline PhyrePhoX

  • Global Moderator
  • Guru Member
  • *****
  • Posts: 2254
  • make RAW not WAR
    • PhyreWorX
Re: Cropped zebra or zebra specific OSD
« Reply #26 on: 20 / August / 2008, 01:18:00 »
transparent background label? sorry i dont get what you mean?

Offline dzsemx

  • Sr. Member
  • ****
  • Posts: 299
  • [A650][A630]
Re: Cropped zebra or zebra specific OSD
« Reply #27 on: 20 / August / 2008, 23:57:08 »
i mean osd output fields :D
sorry, i use many times delphi style names
but i corrected it :P

Offline fudgey

  • Global Moderator
  • Guru Member
  • *****
  • Posts: 1690
  • a570is
Re: Cropped zebra or zebra specific OSD
« Reply #28 on: 21 / August / 2008, 00:07:09 »
Even though it wasn't this patch causing your problems, I'd advice to use the "draw over zebra: OSD" option. Otherwise zebra will draw over OSD in whatever way it chooses and OSD will seem corrupt even though that's quite what is requested...

Offline dzsemx

  • Sr. Member
  • ****
  • Posts: 299
  • [A650][A630]
Re: Cropped zebra or zebra specific OSD
« Reply #29 on: 21 / August / 2008, 00:46:21 »
ok i'll tell it more detailated
so
i noticed that osd text has outline(some black pixels around the characters) :)
great!
so i set osd text backround to COLOR_TRANSPARENT to have more space on the screen
fine
but i noticed that previous osd text is not erased(=overwritten by transparent pixels) so everything got overlapped, overwritten...whatever... it looks ugly
problem here:
Code: [Select]
void draw_char(coord x, coord y, const char ch, color cl) {

............blablabla............

                else if(inside_box && cl>>8!=COLOR_TRANSPARENT) draw_pixel(x+ii ,y+i, cl>>8);
            }
}
    }
}


so i introduced a  !kbd_is_key_pressed(KEY_SHOOT_HALF) condition too...

else if((cl>>8!=COLOR_TRANSPARENT && inside_box) || !kbd_is_key_pressed(KEY_SHOOT_HALF))draw_pixel(x+ii ,y+i, cl>>8);

i should use a global variable, i know :P... it would be faster
and i requested a few times to remove from comment this line from platform/650/kbd.c
   
/*if(!kbd_is_key_pressed(KEY_SHOOT_HALF)) */ physw_status[alt_mode_key_reg] |= alt_mode_key_mask;............
i have to modify the sources every time when i'm downloading it...
without this isoshift on print button doesn't work

EDIT: STILL BUGGY :(
« Last Edit: 21 / August / 2008, 10:32:29 by dzsemx »

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal