Re: [casetta] New img_to_basic function (produce smaller programs for simple pictures) |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/casetta Archives
]
Fabien ANDRE a écrit :
Hello,
_*
*_Thank you for proposing me an svn account but I think that's not a
good idea. I mean, I am a not-experienced programmer and can add bad
code and I don't really know how to use svn (I think I could delete
all the svn in 10s :-). However, If you are bored with adding my code
to the svn, I can accept._*
*_
As you want!
_*
New img_to_basic function*_
I'm now in holidays and I took advantage of my free time to rewrite
this function.
It is now much longer (~200 lines) and constituted of 2 main blocks
(separated by big comments) :
- The first main block tries to break down (fr: décomposer) the
picture into HORIZONTAL F-lines
- The second main block tries to break down the picture into VERTICAL
F-lines.
Each main block contains 3 sub-blocks to detect begin, end of F-lines
and one another to continue them.
For each main block, rather than drawing an orphan Plot-on, I store
its coords in a plot_table.
There is, at the end of each main block a sub-block which analyses
this table and tries to detect VERTICAL F-lines for the first block
(contrary to the direction of all the F-lines created by this first
main block) and HORIZONTAL F-lines ofr the second (contrary to the
direction of all the F-lines created by the second main block).
If what I say is not clear and if you want to understand, read the
code ;-). No, seriously, I can re-explain what I did if you don't see
what I mean (I suppose that's not very clear).
This new function produces smaller Casio Basic programs for pictures
containing lots of Vertical F-lines and simple pictures (not coloured)
but the benefit is invisible for coloured pictures like the tux I sent
you.
However this function is not perfect : the best would be to break
down the function in less lines (both Vertical and Horizontal F-lines)
possible, but I said it before I don't know how to do that.
I'll read and try it when I have more time, but the idea seems to be
interesting.
_*
Casetta Internal transfert tool
*_It works great :
I have no more fickering for the progress bar (sys.stdout.flush()
helped, I think ;-)) no more problems to receive screencaptures.
I can receive pictures,screencaptures, pictures, programs and backups
without any issues. Perfectly good :-).
Good news!
I CAN'T send pictures (in png format, good format because they were
previously received by casetta_cli). Here is what I get :
fabien@PCXion345:~/src/casetta/casetta_cli$ ./casetta_cli.py img.png casio
Wait until the calculator is ready...
Header [==================================================] (100%) 49/49
Picture1 [==================================================] (100%)
1028/1028 (Only 1028 octets transfered ?)
The transfer abort because of a checksum error. Please check your link.
I've change recently the checksum calculation. A picture is divided into
4 sheets (one by color) or 1028 bytes, and a checksum must be send at
the end of each sheet. I'll test it and correct it.
(small msitake here : the transfert has just aborted or aborted or
abort*s)
*
Ok, thanks.
*
*Nothing is displayed before the progress bar while receiving a
screencapture (I think that's intentionnal, so it's OK).
I've made the same choice as other unix command line tools: nothing is
displayed until all is good, except during a transfer because it
requires some user interactions. So nothing is displayed during the
format conversion.
Previously, I had also a bug when using the keyword casio if the
default tool was not set, It seems to be corrected.
So...
_*Image extractor from backups
*_Could you write the raw/cafix picture specifications or explain me
how they are stored (by mail) ?
I *must* do it for the website, it's my main future job. I understand
that you need specifications, because the format is very strange...
Because it seems that *not* all the metadata stored in cafix/raw
picture files can be found in raw backups.
And I can't understand that pictures take 4111o and screencaptures
3075o, while same data is stored : the metadata must be different.
Quick explication: pictures have 4 sheet (one by each color - yes, the
with sheet is not very useful for the calculator...) and color
screencaptures have only 3 (the white sheet is removed).
_*Casetta_gtk and syntax hilighting
*_Is Choplar still working on casetta_gtk ?
Can I solve this problem of syntax coloration whitout stealing his job ?
I don't know PyGTK becuase usually, I use PyQt but I will try to look
inside Gedit source code and give ideas about improving syntax
coloration in casetta
(I'll answer after the one of Choplair.)
Thank you for reading this loooooooooooong e-mail !
Thank you for writing the looooooooooong e-mail :-p
--
Thesa ~ Florian Birée
e-mail : florian.biree@xxxxxxxxxxx
Messagerie Instantanée Jabber/XMPP/Google Talk : florian.biree@xxxxxxxxx
Site web et blog : http://filyb.info/