diff --git a/examples/Makefile b/examples/Makefile new file mode 100644 index 0000000..1523ca0 --- /dev/null +++ b/examples/Makefile @@ -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 diff --git a/examples/checkers.bqn b/examples/checkers.bqn new file mode 100644 index 0000000..343187a --- /dev/null +++ b/examples/checkers.bqn @@ -0,0 +1,2 @@ +⟨PBM⟩←•Import"../pnm.bqn" +•Out PBM 39‿39⥊0‿1 diff --git a/examples/checkers.png b/examples/checkers.png new file mode 100644 index 0000000..9867c90 Binary files /dev/null and b/examples/checkers.png differ diff --git a/examples/gradient.bqn b/examples/gradient.bqn new file mode 100644 index 0000000..1b73e5d --- /dev/null +++ b/examples/gradient.bqn @@ -0,0 +1,3 @@ +⟨PPM⟩←•Import"../pnm.bqn" +⟨Inferno,Viridis⟩←•Import"../colormaps.bqn" +•Out PPM ⌊255×>Inferno¨40÷˜+⌜˜↕20 diff --git a/examples/gradient.png b/examples/gradient.png new file mode 100644 index 0000000..96e7726 Binary files /dev/null and b/examples/gradient.png differ diff --git a/examples/hsv.bqn b/examples/hsv.bqn new file mode 100644 index 0000000..1cc8f6c --- /dev/null +++ b/examples/hsv.bqn @@ -0,0 +1,3 @@ +⟨PPM⟩←•Import"../pnm.bqn" +⟨HSVtoRGB⟩←•Import"../colors.bqn" +•Out PPM ⌊255×>HSVtoRGB¨{(𝕨×360)‿𝕩‿1}⌜˜↕⊸÷˜50 diff --git a/examples/hsv.png b/examples/hsv.png new file mode 100644 index 0000000..3a0f675 Binary files /dev/null and b/examples/hsv.png differ diff --git a/examples/random_pbm.bqn b/examples/random_pbm.bqn new file mode 100644 index 0000000..5b4b7e9 --- /dev/null +++ b/examples/random_pbm.bqn @@ -0,0 +1,2 @@ +⟨PBM⟩←•Import"../pnm.bqn" +•Out PBM •rand.Range¨100‿100⥊2 diff --git a/examples/random_pbm.png b/examples/random_pbm.png new file mode 100644 index 0000000..48a78be Binary files /dev/null and b/examples/random_pbm.png differ diff --git a/examples/random_pgm.bqn b/examples/random_pgm.bqn new file mode 100644 index 0000000..41f467e --- /dev/null +++ b/examples/random_pgm.bqn @@ -0,0 +1,2 @@ +⟨PGM⟩←•Import"../pnm.bqn" +•Out PGM •rand.Range¨100‿100⥊100 diff --git a/examples/random_pgm.png b/examples/random_pgm.png new file mode 100644 index 0000000..b03b296 Binary files /dev/null and b/examples/random_pgm.png differ diff --git a/examples/random_ppm.bqn b/examples/random_ppm.bqn new file mode 100644 index 0000000..10f2f2d --- /dev/null +++ b/examples/random_ppm.bqn @@ -0,0 +1,3 @@ +⟨PPM⟩←•Import"../pnm.bqn" +⟨Inferno,Viridis⟩←•Import"../colormaps.bqn" +•Out PPM ⌊255×>Viridis¨100÷˜•rand.Range¨100‿100⥊100 diff --git a/examples/random_ppm.png b/examples/random_ppm.png new file mode 100644 index 0000000..f7bb5da Binary files /dev/null and b/examples/random_ppm.png differ