Commit Graph

8620 Commits

Author SHA1 Message Date
Kartik K. Agaram
a97a7cb8c4 . 2021-07-10 20:10:30 -07:00
Kartik K. Agaram
80023c3e54 . 2021-07-10 20:03:16 -07:00
Kartik K. Agaram
b28a31315e increase precision for dithering computations
Now we get a perfect checkerboard pattern.
2021-07-10 19:56:32 -07:00
Kartik K. Agaram
3420f10f18 .
https://merveilles.town/@akkartik/106559551043772522
2021-07-10 19:47:32 -07:00
Kartik K. Agaram
e377991a9e .
https://merveilles.town/@akkartik/106557664535993377
2021-07-10 11:18:47 -07:00
Kartik K. Agaram
5f8a8c11a2 dithering greyscale using black/white
Starting to look right.
2021-07-10 10:51:39 -07:00
Kartik K. Agaram
2a0f6cbb6f reorder a few functions 2021-07-08 17:08:34 -07:00
Kartik K. Agaram
76f1fdc83e . 2021-07-08 16:57:07 -07:00
Kartik K. Agaram
0539b961a0 scaling ppm images 2021-07-08 16:53:06 -07:00
Kartik K. Agaram
b8488c5223 scaling pgm images 2021-07-08 16:43:34 -07:00
Kartik K. Agaram
f07ebb9e5e . 2021-07-08 16:33:49 -07:00
Kartik K. Agaram
b049cc1320 . 2021-07-08 16:23:48 -07:00
Kartik K. Agaram
13ef6b6202 . 2021-07-08 16:20:17 -07:00
Kartik K. Agaram
3ee70401e3 . 2021-07-08 16:12:27 -07:00
Kartik K. Agaram
019fb0babc scaling pbm images 2021-07-08 11:00:51 -07:00
Kartik K. Agaram
b628bbd686 . 2021-07-08 09:26:55 -07:00
Kartik K. Agaram
afda7d59c0 better ppm colors
I had some logic to make hue distance cylindrical, but it wasn't right.
2021-07-08 01:13:38 -07:00
Kartik K. Agaram
0f29e61238 better greyscale 2021-07-08 00:26:58 -07:00
Kartik K. Agaram
9c70f7c643 . 2021-07-08 00:21:01 -07:00
Kartik K. Agaram
359f55d893 . 2021-07-08 00:13:12 -07:00
Kartik K. Agaram
d1482a9e89 ppm colors are weird, though 2021-07-08 00:12:31 -07:00
Kartik K. Agaram
91af9ccf2c ppm support
Typo in commit fe3cbcd77: it only rendered pbm/pgm.
2021-07-07 19:43:56 -07:00
Kartik K. Agaram
d73c84e299 instructions for Universal Ctags
Thanks Sumeet Agarwal for raising this issue.
2021-07-07 19:34:54 -07:00
Kartik K. Agaram
d78a45340c . 2021-07-07 19:24:12 -07:00
Kartik K. Agaram
fe3cbcd778 render ppm/pgm
Looks pretty bad compressing 256 shades of grey to 8.
2021-07-07 09:57:18 -07:00
Kartik K. Agaram
a9353ea327 load ppm/pgm/ppm on demand 2021-07-07 08:35:17 -07:00
Kartik K. Agaram
ef73cb78f1 initial image rendering
Supports just some ASCII formats: https://en.wikipedia.org/wiki/Netpbm

Colors are messed up. That's next.
2021-07-07 07:13:16 -07:00
Kartik K. Agaram
2d3fe4e940 . 2021-07-06 21:35:22 -07:00
Kartik K. Agaram
c31c02f0d1 . 2021-07-06 08:39:46 -07:00
Kartik K. Agaram
d84d17d6f5 nearest h/s/l color by a euclidean metric 2021-07-06 07:01:14 -07:00
Kartik K. Agaram
cbf22e7ab2 primitives for double-buffering
I thought I needed these for this bouncing-ball demo:

  def (bounce screen)
    with (w (width screen)
          h (height screen)
          cx 16
          cy 16
          dx 12
          dy 19)
      while 1
        clear screen
        ring screen cx cy 16 3 5
        cx += dx
        cy += dy
        when (or (cx > w) (cx < 0))
          set dx 0-dx
        when (or (cy > h) (cy < 0))
          set dy 0-dy
        for _ 0 (< _ 100) ++_         # delay

No matter how I adjusted the delay I couldn't get rid of the jitter. So
I built a double-buffered version:

    (bounce2 . [def (bounce2 screen)
  with (w (width screen)
        h (height screen)
        cx 16
        cy 16
        dx 12
        dy 19
        screen2 (new_screen (columns screen)
                            (lines screen)))
      while 1
        clear screen2
        ring screen2 cx cy 16 3 5
        cx += dx
        cy += dy
        when (or (cx > w) (cx < 0))
          set dx 0-dx
        when (or (cy > h) (cy < 0))
          set dy 0-dy
        blit screen2 screen
        for _ 0 (< _ 100) ++_])       # delay

But it didn't make a difference! Turns out nothing will help you when
successive frames are too far apart. This is the correct tweak to
`bounce`:

  -       dx 12
  -       dy 19)
  +       dx 1
  +       dy (/ 19 12))

Still, we'll keep double-buffering around for the future.
2021-07-05 23:18:30 -07:00
Kartik K. Agaram
468b0d979f shell: fix clear on screens
Broken since commit c95648c96 on Jul 3.

Unclear what test to write for this. Should clear-stream check for NULL?
Should apply-clear?
2021-07-05 22:06:37 -07:00
Kartik K. Agaram
5d614af955 expose Mu implementation of 'bezier'
Still no support for acute-angled control points.
2021-07-05 18:31:07 -07:00
Kartik K. Agaram
493aabf79a replace 'circle' with Mu implementation 2021-07-05 18:21:02 -07:00
Kartik K. Agaram
c7bedaf49b replace 'vline' with Mu implementation 2021-07-05 18:12:07 -07:00
Kartik K. Agaram
5d8a858a6f replace 'hline' with Mu implementation 2021-07-05 18:08:40 -07:00
Kartik K. Agaram
0b07a43367 replace 'line' with Mu implementation 2021-07-05 18:08:33 -07:00
Kartik K. Agaram
f32caac6df grow code region yet again
We need a cleaner way to do this.
2021-07-05 17:53:57 -07:00
Kartik K. Agaram
ac1d702cdc . 2021-07-05 17:36:25 -07:00
Kartik K. Agaram
1ac1fe1fff . 2021-07-05 17:35:38 -07:00
Kartik K. Agaram
c95648c960 reading from streams
The Mu shell has no string literals, only streams. No random access,
only sequential access. But I've been playing fast and loose with its
read pointer until now. Hopefully things are cleaned up now.
2021-07-03 18:27:01 -07:00
Kartik K. Agaram
7ced4e44dd alists 2021-07-03 16:28:15 -07:00
Kartik K. Agaram
d986404ff0 new primitive: cons? 2021-07-03 16:16:03 -07:00
Kartik K. Agaram
810d9a26f5 . 2021-07-03 10:57:36 -07:00
Kartik K. Agaram
a745749382 . 2021-07-03 10:44:05 -07:00
Kartik K. Agaram
bd538804db reorg primitives on screen 2021-07-02 19:31:15 -07:00
Kartik K. Agaram
c8fb6d6aca clean up final abort in macroexpand 2021-06-30 20:43:34 -07:00
Kartik Agaram
49d60aa575 delete a known issue
I can't reproduce the issue with the keyboard handler anymore :/
2021-06-30 09:44:20 -07:00
Kartik K. Agaram
c76679dbff more general timer interface 2021-06-29 22:46:26 -07:00
Kartik K. Agaram
1083f2a400 . 2021-06-29 22:37:00 -07:00