From: Michael R. <mi...@re...> - 2009-05-19 10:57:50
|
Hi Scott, > I decided to work on this. Great! Histograms have been on my todo list for years, but as I'm that busy all the time... > I think I'm understanding the bars code. The > one thing that confuses me is pack_segments. I found that it cleaned up > a lot of garbage however, so I'm assuming that's all it's for. Well, as I said, the bar code is quite complex. I'll try to explain it a bit: A bar (especially the split bars) are made of custom chars (except the "empty" and the "full" cell, empty is always a blank, full is used only if a solid block is avaliable. So if you have several bars (with mixed directions) and split bars alltogether at the same time, you'll need a very lot of these custom chars. Unfortunately, the number of custom chars is limited (usually only eight). So the bar code tries to add little "errors" to the bars to combine two chars into one (think of two bar cells, one with three pixel rows set, one with two. The bar code would either expand one bar to use three columns or reduce the other cell to use only two rows. This "compaction" is quite complicated, because there are several constrains you have to deal with: a bar line shall never be "interrupted" (it should not contain "holes", this is especially tricky with split bars), you should not redefine a custom char that is currently visible (otherwise you'll get some flickering) and so on. > I only > dealt with direction east in the character creation because only east > works for me. Outside of west maybe, It might be a limitation with my > CFA635. No, there shouldn't be a limitation. bars should work in all directions, otherwise there may be a bug. > I'm ordering a picoLCD here soon so I'll have a graphics display > to play with and I can work on a graphics version of the histogram, > unless someone else picks it up. Anyhow, there's a diff attached. graphic histograms would be great, too! > Why don't westbound bars work? see above I don't really understand your patch. You tried to reuse the bar code, but: - a histogram should not deal with "val1" and "val2", this is for split bars only (at least there shouldn't be a seperate expression) - you can specify the length of a histogram (as with bars), but shouldn't there be something like a "width"? Looks like you're always using the whole size of the display..... bye, Michael -- Michael Reinelt <mi...@re...> http://home.pages.at/reinelt GPG-Key 0xDF13BA50 ICQ #288386781 |