Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,16 @@
:- module(bitmapIO, [
write_ppm_p6/2]).
:- use_module(library(lists)).
%write_ppm_p6(File,Bitmap)
write_ppm_p6(Filename,[[X,Y],Pixels]):-
open(Filename,write,Output,[encoding(octet)]),
%write p6 header
writeln(Output, 'P6'),
atomic_list_concat([X, Y], ' ', Dimensions),
writeln(Output, Dimensions),
writeln(Output, '255'),
%write bytes
maplist(maplist(maplist(put_byte(Output))),Pixels),
close(Output).

View file

@ -0,0 +1,7 @@
:- use_module(bitmap).
:- use_module(bitmapIO).
write :-
new_bitmap(AllBlack,[50,50],[0,0,0]),
set_pixel0(AlmostAllBlack,AllBlack,[25,25],[255,255,255]),
write_ppm_p6('AlmostAllBlack.ppm',AlmostAllBlack).