Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: kindermoumoute on November 07, 2010, 12:41:35 pm

Title: transform an image displayed in hexadecimal String
Post by: kindermoumoute on November 07, 2010, 12:41:35 pm
hello,
I would like to include a subroutine in my drawing program that transforms screen displayed (96*64 pixels) in hexadecimal text then I record in a string.
But I do not know where to start, can anyone help me? ???
Title: Re: transform an image displayed in hexadecimal String
Post by: squidgetx on November 07, 2010, 01:13:01 pm
transforms an image displayed in hexadecimal text then I record in a string.

Sorry, I don't quite know what you mean. Do you mean like converting a picture into hexadecimal text that is stored into a string? Something like this (http://ourl.ca/4832/94254) or this (http://ourl.ca/7776)?

Maybe you can write it in french and someone can translate
Title: Re: transform an image displayed in hexadecimal String
Post by: nemo on November 07, 2010, 01:20:43 pm
are you talking about transformations like scale changes and rotations? (affine transformations, for those in geometry).
Title: Re: transform an image displayed in hexadecimal String
Post by: kindermoumoute on November 07, 2010, 01:28:31 pm
I ask not for a tile image, but all screen. After i'll look yours source.
Title: Re: transform an image displayed in hexadecimal String
Post by: FloppusMaximus on November 07, 2010, 01:57:42 pm
Are you saying that you want to take the image that is currently displayed on the screen, and dump it out as a hex string?  It would be pretty straightforward to do that in assembly language; I don't know if there's a simple way to do that with Axe.
Title: Re: transform an image displayed in hexadecimal String
Post by: kindermoumoute on November 07, 2010, 02:13:42 pm
With pxl-test(X,Y) command, this isn't possible ?
Title: Re: transform an image displayed in hexadecimal String
Post by: Runer112 on November 07, 2010, 02:16:46 pm
With the help of my handy dandy hex display library (http://ourl.ca/4129/124589), this would be fairly simple. For example, this would dump the current contents of L6 into a 1536-byte string pointed to by P:

Code: [Select]
P-2?B
For(A,L?,L?+767)
{sub(B2H,{A})}??{B+2?B}?
End

If you're not dumping this into an OS string, remember that your string will need to be null-terminated.
Title: Re: transform an image displayed in hexadecimal String
Post by: DJ Omnimaga on November 07, 2010, 03:21:26 pm
You want to store the hex of the screen to a TI-BASIC string, right?
Title: Re: transform an image displayed in hexadecimal String
Post by: kindermoumoute on November 07, 2010, 04:00:36 pm
You want to store the hex of the screen to a TI-BASIC string, right?
Yes.

@runer : :o I don't understand your subroutine.
Title: Re: transform an image displayed in hexadecimal String
Post by: Runer112 on November 07, 2010, 05:37:05 pm
You want to store the hex of the screen to a TI-BASIC string, right?
Yes.

@runer : :o I don't understand your subroutine.

That's the point of libraries, the code is written and is known to work already ;) It's fairly simple though. One subroutine (N2H) converts nibbles into an ASCII character by returning the nth character in the string "0123456789ABCDEF" and another subroutine (B2H) just calls this subroutine for both nibbles in a byte and combines the two.
Title: Re: transform an image displayed in hexadecimal String
Post by: DJ Omnimaga on November 07, 2010, 07:33:50 pm
To clarify, since Nibbles were new when SIlver wrote his french version of the Axe command list, 1 nibble is half a byte. It goes from 0 to 15 instead of 0 to 255.
Title: Re: transform an image displayed in hexadecimal String
Post by: kindermoumoute on November 08, 2010, 02:59:56 pm
:o it work, pretty routine !