Author Topic: 3 level greyscale image  (Read 4664 times)

0 Members and 1 Guest are viewing this topic.

Offline Raylin

  • Godslayer
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1392
  • Rating: +83/-25
  • I am a certifiable squirrel ninja.
    • View Profile
    • Ray M. Perry
3 level greyscale image
« on: September 04, 2010, 10:20:49 pm »
How would one display a fullscreen 3 level grey image on the screen in Axe?
Bug me about my book.

Sarah: TI-83 Plus Silver Edition [OS 1.19]
Cassie: TI-86 [OS 1.XX]
Elizabeth: TI-81 [OS 1.XX]
Jehuty: TI-83 Plus Silver Edition [OS 1.19]
Tesla: CASIO Prizm







Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: 3 level greyscale image
« Reply #1 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).
« Last Edit: September 04, 2010, 10:28:12 pm by Deep Thought »




Offline Raylin

  • Godslayer
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1392
  • Rating: +83/-25
  • I am a certifiable squirrel ninja.
    • View Profile
    • Ray M. Perry
Re: 3 level greyscale image
« Reply #2 on: September 04, 2010, 10:28:16 pm »
Nonono. I have fullscreen hex images. How do I display them on the screen?
« Last Edit: September 04, 2010, 10:28:33 pm by Raylin »
Bug me about my book.

Sarah: TI-83 Plus Silver Edition [OS 1.19]
Cassie: TI-86 [OS 1.XX]
Elizabeth: TI-81 [OS 1.XX]
Jehuty: TI-83 Plus Silver Edition [OS 1.19]
Tesla: CASIO Prizm







Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: 3 level greyscale image
« Reply #3 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)
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: 3 level greyscale image
« Reply #4 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.
« Last Edit: September 04, 2010, 10:32:16 pm by Quigibo »
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: 3 level greyscale image
« Reply #5 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 :)
« Last Edit: September 04, 2010, 10:32:24 pm by Deep Thought »




Offline Raylin

  • Godslayer
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1392
  • Rating: +83/-25
  • I am a certifiable squirrel ninja.
    • View Profile
    • Ray M. Perry
Re: 3 level greyscale image
« Reply #6 on: September 04, 2010, 10:31:54 pm »
You. Are. A. Lifesaver.
Bug me about my book.

Sarah: TI-83 Plus Silver Edition [OS 1.19]
Cassie: TI-86 [OS 1.XX]
Elizabeth: TI-81 [OS 1.XX]
Jehuty: TI-83 Plus Silver Edition [OS 1.19]
Tesla: CASIO Prizm







Offline KermMartian

  • Editor
  • LV7 Elite (Next: 700)
  • *******
  • Posts: 500
  • Rating: +233/-20
    • View Profile
    • Cemetech
Re: 3 level greyscale image
« Reply #7 on: September 04, 2010, 10:32:20 pm »
Hello.



Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: 3 level greyscale image
« Reply #8 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.
« Last Edit: September 04, 2010, 10:40:18 pm by DJ Omnimaga »