Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: Raylin on September 04, 2010, 10:20:49 pm

Title: 3 level greyscale image
Post by: Raylin on September 04, 2010, 10:20:49 pm
How would one display a fullscreen 3 level grey image on the screen in Axe?
Title: Re: 3 level greyscale image
Post by: Deep Toaster on September 04, 2010, 10:27:21 pm
Not sure what you mean ... do you just want black, white, and gray? In that case:

You have to keep displaying it, since grays in Axe (and ASM) is basically just really fast-flipping pixels, so put DispGraphrr in a loop. To get a black pixel, just make sure that pixel's turned on in the buffer (basically, all drawing commands do this). To get a gray, you have to leave the buffer off but turn on the pixel in the back-buffer (usually, it's the drawing command followed by a r. To get white, leave them both white (duh).
Title: Re: 3 level greyscale image
Post by: Raylin on September 04, 2010, 10:28:16 pm
Nonono. I have fullscreen hex images. How do I display them on the screen?
Title: Re: 3 level greyscale image
Post by: calc84maniac on September 04, 2010, 10:29:24 pm
What format are the 3-level gray images in? (other than hex, that's already been established)
Title: Re: 3 level greyscale image
Post by: Quigibo on September 04, 2010, 10:30:02 pm
Try this:

Code: [Select]
Copy(A,L6,768)
Copy(B,L3,768)
Repeat getkey(15)
DispGraphr
End

Replace "A" with a pointer to the picture in the front layer, and "B" with a pointer to the picture in the back layer.  They can either be in the program code itself (pic absorption or hex code) or they can be pointing to an OS pic in ram or even archive if you use a file variable instead of the pointer.
Title: Re: 3 level greyscale image
Post by: Deep Toaster on September 04, 2010, 10:31:46 pm
Oh, to move a static picture to the back-buffer, it's Copy([pointer to your picture],L3. To move it to the buffer, it's L6 instead of L3.

EDIT: Ninja'd by Quigibo, read his :)
Title: Re: 3 level greyscale image
Post by: Raylin on September 04, 2010, 10:31:54 pm
You. Are. A. Lifesaver.
Title: Re: 3 level greyscale image
Post by: KermMartian on September 04, 2010, 10:32:20 pm
Hello.
Title: Re: 3 level greyscale image
Post by: DJ Omnimaga on September 04, 2010, 10:37:51 pm
What format are the 3-level gray images in? (other than hex, that's already been established)
In two separate image (or sprite/tile). First layer is transparent (using the white) and black and second layer is white and gray, appearing behind. Everytime DispGraphr is used, the checkered pattern (Reuben Quest-like) for the gray alternates. If it alternates at the right speed, it creates grayscale that is nearly flickerless.

For 4-lv grayscale, you just use DispGraphrr instead, but the rest of the code is similar. In 4-lv, one of the pic is dark gray and white while the other is light gray and white. Combining light gray with dark gray gives black.