Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: kindermoumoute on March 10, 2012, 07:21:27 pm

Title: Bitmap compression
Post by: kindermoumoute on March 10, 2012, 07:21:27 pm
Plop,
I want to compress my bitmap (monochrom) 256*256 pixels (8192 bytes). I tried to make my own rle compression in this way : the first bit to determinate state (1 = pixel on, 0 = pixel off) then 7 bits are used to indicate number of pixels to fill with this value.
eg. this code :
Code: [Select]
[FFFFFFFFFFFFFFFF0000]Should be :
Code: [Select]
[C010]
Here my code, it leave program without reason. That's probably due to a corrupted RAM (each time it display ARC>7500Ko :w00t:).
Spoiler For Spoiler:
Quote from: Axe
.LMBD
"|vMAPTEMP"→Str1
L3+768→^^oEND
ClrDrawr
Return!If GetCalc(Str1)
+2→A
{A}[e]0*128→{L3}
L3→C
1→I
While I
While OPT1()
OPT2()
End
C++
0→{C}
Repeat OPT1()
OPT2()
End
C++
128→{C}
End
Disp length(L3)>Dec
Repeat getKey(9)
End
Return

Lbl OPT2
!If C-^^oEND
Disp "L3 DEPASSE
Pause 2000
Returnr
End
{C}+1^128?{C}++,C++
I++
Return

Lbl OPT1
/8+A[e]I
Return

Generated by the BBify'r (http://clrhome.org/resources/bbify/ (http://clrhome.org/resources/bbify/))