CodeWalrus

CodeWalrus Website => Game, Software and Music Downloads => Programs and Utilities => Topic started by: Snektron on February 14, 2015, 04:25:53 PM

Title: [TI-83+/84+] Draw (Axe)
Post by: Snektron on February 14, 2015, 04:25:53 PM
One of my friends asked if i could make a draw program, so i did :D.

Features:
  Menu's:
- Mode menu
    - Select actions/drawing modes
    - Open with [mode]
    - Navigate with [up]/[down]
    - select with [2nd], [mode] or [enter]

  - Size menu
    - Set pen size
    - Open with [alpha]
    - change size with [up]/[down]
    - Select with [alpha]

  - Pattern menu
    - Set drawing pattern
    - Open with [X,T,θ, n]
    -  Navigate with [up]/[down]
    - Select with [2nd], [X,T,θ, n] or [enter]

  Actions/Drawmode's
    - (http://clrhome.org/pix/2-F0C8848241221408-4.png) Pen:
      - Draws with the selected pattern and size
      - draw by holding [2nd]
      - Set size with [alpha]
    - (http://clrhome.org/pix/2-1028448E5F3E1C08-4.png) Eraser:
      - Clears with the selected size
      - erase by holding [2nd]
      - Set size with [alpha]
    - (http://clrhome.org/pix/2-0042241818244200-4.png) Quit:
      - Exits the program
    - (http://clrhome.org/pix/2-FC868781818181FF-4.png) Clear:
      - Clears the image
      - Activates immediately and selects pen after activating
    - (http://clrhome.org/pix/2-0080601008060100-4.png) Line:
      - Draw a line
      - Press [2nd] for point 1 and a second time for point 2
      - Press [Del] to cancel
    - (http://clrhome.org/pix/2-F0F0E8CCCCE8F0F0-4.png) Invert:
      - Inverts the image
      - Activates immediately and selects pen after activating
    - (http://clrhome.org/pix/2-1866428181426618-4.png) Circle:
      - Draws a circle
      - Press [2nd] to set the origin and a second time for a point to specify the radius
      - Press [del] to cancel
    - (http://clrhome.org/pix/2-202814325161520C-4.png) Flood:
      - Floods an area with the selected pattern
      - Activates when [2nd] is pressed
    - (http://clrhome.org/pix/2-A486FFFFFF81BD81-4.png) Save:
      - Save current image to a pic var
      - Displays an error message when there is too little free ram
    - (http://clrhome.org/pix/2-00609E829FA1C2FC-4.png) Open:
      - Open pic var and copy to image, overwriting everything
      - Diplays an error message when the pic var is undefined

  Misc
    - Hold [Y=] to speed up the cursor
    - When quitting, the current image is saved to an appvar and loaded when the program is reopened

Credits to DarkestEx for the pic pixel test algoritm and to MGOS for the flood fill
Download zip contains:
  - Draw.8xk -- the main app
  - Draw.8xp -- the axe source
  - readme.txt -- the readme

This was intended as App but will probably work when compiled as Program, though you will have to change the name
as it contains lower case characters.
If you find any bugs or have any ideas i should add let me know.
Have fun with it :P
Title: Re: [Axe] Draw
Post by: Dream of Omnimaga on February 14, 2015, 04:33:50 PM
I don't have much time to test it now, but do you have a screenshot? I know there are many paint programs for the 84+ series so I am curious about what this one has to offer that others lack :) The flood filling feature seems like a great addition, though.

Is there grayscale support?

One issue that many paint programs had in the past was the very large amount of RAM they took during runtime.
Title: Re: [Axe] Draw
Post by: Snektron on February 14, 2015, 04:38:39 PM
Quote from: DJ Omnimaga on February 14, 2015, 04:33:50 PM
I don't have much time to test it now, but do you have a screenshot?

Oh right. i knew i forgot something :3=

Quote from: DJ Omnimaga on February 14, 2015, 04:33:50 PM
Is there grayscale support?

Sadly, no. I already had to use all the freeram areas for the rest, especially the floodfill tool
uses a lot.

Quote from: DJ Omnimaga on February 14, 2015, 04:33:50 PM
One issue that many paint programs had in the past was the very large amount of RAM they took during runtime.

While i use allmost all the freeram areas, it only uses the appvar to save the current image as temporary
ram.
Title: Re: [Axe] Draw
Post by: Dream of Omnimaga on February 14, 2015, 04:44:40 PM
Aah ok that seems good about the RAM. Back then I never really used on-calc image editors because to run them I needed like 8 KB of RAM, so I hated to have to archive my entire game then unarchive the drawing utility and vice-versa, especially when I used a regular 83+ with lots of garbage collects (and the resulting battery bill). Free RAM areas helps a lot at least. How much free RAM does flood fill use to fill a 24x24 area by the way? What if the image is very complex like if you try to flood fill a maze?


EDIT: Also my 2000th post *.* (this was twice faster than on Omnimaga)
Title: Re: [Axe] Draw
Post by: Snektron on February 14, 2015, 04:59:13 PM
It uses a fixed size algoritm i found on omnimaga.org :3=. So it doesn't matter how
complex the area is, it will always use 3x768 bytes (2x768 for the algorithm and another 768 to mark
the changed pixels for the pattern)
Title: Re: [Axe] Draw
Post by: Dream of Omnimaga on February 14, 2015, 05:08:13 PM
Erm, Omnimaga.net doesn't exist. :P But I see. I wasn't sure if smaller areas used less RAM. I assume more complex areas must be slow though, but it's understandable on a 6 MHz calc. Even on a 100 MHz computer flood filling simple areas was rather laggy.


EDIT: Woah I just saw the screenshots. Looks good so far, especially the sliding menu :D
Title: Re: [Axe] Draw
Post by: Snektron on February 14, 2015, 05:11:20 PM
Thanks :D
I've made a few gifs of filling complex areas.
Indeed it takes a few sec, but not too too long :)
Title: Re: [Axe] Draw
Post by: Dream of Omnimaga on February 14, 2015, 05:14:44 PM
That isn't particularly complex. By complex I meant something like this starting from the middle in the white areas :P

(https://img.ourl.ca/illusiat7finaldungeonmaze.png)
Title: Re: [Axe] Draw
Post by: Snektron on February 14, 2015, 05:22:59 PM
i'd fill it up... if i knew how to convert png's to 8xi's :3=
EDIT: Well i can just send them to my calc and get them back, only it doesnt convert properly >.<
EDIT2: A finaly got it :D
Title: Re: [Axe] Draw
Post by: Dream of Omnimaga on February 15, 2015, 04:47:27 AM
Wow that seems pretty fast actually! O.O

Also I think SourceCoder can convert images to hexadecimal that can be used in Axe.TokenIDE can probably do it too. Otherwise I'm sure there are 8xi to hexadecimal converters on ticalc as well.
Title: Re: [Axe] Draw
Post by: Keoni29 on February 15, 2015, 06:14:32 PM
Wow this is a really nice paint program. I like the animation of the tool menu :D
Title: Re: [Axe] Draw
Post by: matrefeytontias on February 15, 2015, 06:31:12 PM
I especially like the flooding feature. How do you achieve it ? Do you use a flood-filling algorithm, or is there some trick you use ?
Title: Re: [Axe] Draw
Post by: Snektron on February 15, 2015, 08:16:16 PM
As i said earlier, i didn't make the algorithm myself :P
here (https://www.omnimaga.org/computer-projects-and-ideas/fixed-memory-flood-fill-pseudocode/30/) is a link to the topic.
I did modify it a bit to allow for the patterns :)
Title: Re: [Axe] Draw
Post by: matrefeytontias on February 15, 2015, 08:37:53 PM
Ah okay. Thanks for the precision.
Title: Re: Draw
Post by: Dream of Omnimaga on March 05, 2015, 07:19:33 PM
By the way, in the last screenshot, I was wondering what causes the screen to go blank while it's flood-filling? Also should I move this topic to the Downloads section?
Title: Re: [Axe] Draw
Post by: Snektron on March 05, 2015, 07:32:07 PM
well it uses L6 (the display buffer) as temporary storage, and as kind of "debug" feature it updates the screen a few times, so you can see it's not dying.
And it's okay to move it to the download section :)
Title: Re: Draw
Post by: Dream of Omnimaga on March 06, 2015, 06:47:18 AM
Ah right I see now. I tend to be used to be able to see what I am flood filling, but I guess if it's impossible to work around this limitation then it's fine. I like how fast it is and the texture drawing. 

I renamed the topic to respect the downloads section topic naming standards btw.
Title: Re: [TI-83+/84+] Draw (Axe)
Post by: Snektron on March 06, 2015, 09:05:23 AM
Quote from: DJ Omnimaga on March 06, 2015, 06:47:18 AM
I renamed the topic to respect the downloads section topic naming standards btw.

Okay, thanks :3

Quote from: DJ Omnimaga on March 06, 2015, 06:47:18 AM
Ah right I see now. I tend to be used to be able to see what I am flood filling, but I guess if it's impossible to work around this limitation then it's fine. I like how fast it is and the texture drawing. 

Thanks! Though i was thinking of writing my own flood fill algorithm to see how i'd do :)
Title: Re: Draw (Axe)
Post by: Dream of Omnimaga on March 06, 2015, 03:19:34 PM
Ooh that would be a fun challenge actually :D