Add examples

This commit is contained in:
Dimitri Lozeve 2023-03-16 22:11:50 +01:00
parent 4173ad64a1
commit 5d5fbb3d06
13 changed files with 27 additions and 0 deletions

12
examples/Makefile Normal file
View 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
View file

@ -0,0 +1,2 @@
PBM•Import"../pnm.bqn"
•Out PBM 393901

BIN
examples/checkers.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

3
examples/gradient.bqn Normal file
View 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

Binary file not shown.

After

Width:  |  Height:  |  Size: 929 B

3
examples/hsv.bqn Normal file
View 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

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

2
examples/random_pbm.bqn Normal file
View file

@ -0,0 +1,2 @@
PBM•Import"../pnm.bqn"
•Out PBM •rand.Range¨1001002

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
View file

@ -0,0 +1,2 @@
PGM•Import"../pnm.bqn"
•Out PGM •rand.Range¨100100100

BIN
examples/random_pgm.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

3
examples/random_ppm.bqn Normal file
View file

@ -0,0 +1,3 @@
PPM•Import"../pnm.bqn"
Inferno,Viridis•Import"../colormaps.bqn"
•Out PPM 255×>Viridis¨100÷˜•rand.Range¨100100100

BIN
examples/random_ppm.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB