Add examples
This commit is contained in:
parent
4173ad64a1
commit
5d5fbb3d06
13 changed files with 27 additions and 0 deletions
12
examples/Makefile
Normal file
12
examples/Makefile
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
.PHONY: all
|
||||||
|
all: checkers.png random_pbm.png random_pgm.png random_ppm.png gradient.png hsv.png
|
||||||
|
|
||||||
|
%.pnm: %.bqn
|
||||||
|
bqn $< > $@
|
||||||
|
|
||||||
|
%.png: %.pnm
|
||||||
|
pnmtopng $< | convert - -scale 300x300 - > $@
|
||||||
|
|
||||||
|
.PHONY: clean
|
||||||
|
clean:
|
||||||
|
rm -f *.png *.pnm
|
2
examples/checkers.bqn
Normal file
2
examples/checkers.bqn
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
⟨PBM⟩←•Import"../pnm.bqn"
|
||||||
|
•Out PBM 39‿39⥊0‿1
|
BIN
examples/checkers.png
Normal file
BIN
examples/checkers.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.2 KiB |
3
examples/gradient.bqn
Normal file
3
examples/gradient.bqn
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
⟨PPM⟩←•Import"../pnm.bqn"
|
||||||
|
⟨Inferno,Viridis⟩←•Import"../colormaps.bqn"
|
||||||
|
•Out PPM ⌊255×>Inferno¨40÷˜+⌜˜↕20
|
BIN
examples/gradient.png
Normal file
BIN
examples/gradient.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 929 B |
3
examples/hsv.bqn
Normal file
3
examples/hsv.bqn
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
⟨PPM⟩←•Import"../pnm.bqn"
|
||||||
|
⟨HSVtoRGB⟩←•Import"../colors.bqn"
|
||||||
|
•Out PPM ⌊255×>HSVtoRGB¨{(𝕨×360)‿𝕩‿1}⌜˜↕⊸÷˜50
|
BIN
examples/hsv.png
Normal file
BIN
examples/hsv.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.1 KiB |
2
examples/random_pbm.bqn
Normal file
2
examples/random_pbm.bqn
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
⟨PBM⟩←•Import"../pnm.bqn"
|
||||||
|
•Out PBM •rand.Range¨100‿100⥊2
|
BIN
examples/random_pbm.png
Normal file
BIN
examples/random_pbm.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.6 KiB |
2
examples/random_pgm.bqn
Normal file
2
examples/random_pgm.bqn
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
⟨PGM⟩←•Import"../pnm.bqn"
|
||||||
|
•Out PGM •rand.Range¨100‿100⥊100
|
BIN
examples/random_pgm.png
Normal file
BIN
examples/random_pgm.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
3
examples/random_ppm.bqn
Normal file
3
examples/random_ppm.bqn
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
⟨PPM⟩←•Import"../pnm.bqn"
|
||||||
|
⟨Inferno,Viridis⟩←•Import"../colormaps.bqn"
|
||||||
|
•Out PPM ⌊255×>Viridis¨100÷˜•rand.Range¨100‿100⥊100
|
BIN
examples/random_ppm.png
Normal file
BIN
examples/random_ppm.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
Loading…
Add table
Add a link
Reference in a new issue