Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
13
Task/Bitmap-Write-a-PPM-file/AWK/bitmap-write-a-ppm-file.awk
Normal file
13
Task/Bitmap-Write-a-PPM-file/AWK/bitmap-write-a-ppm-file.awk
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#!/usr/bin/awk -f
|
||||
BEGIN {
|
||||
split("255,0,0,255,255,0",R,",");
|
||||
split("0,255,0,255,255,0",G,",");
|
||||
split("0,0,255,0,0,0",B,",");
|
||||
|
||||
outfile = "P3.ppm";
|
||||
printf("P3\n2 3\n255\n") >outfile;
|
||||
for (k=1; k<=length(R); k++) {
|
||||
printf("%3i %3i %3i\n",R[k],G[k],B[k])>outfile
|
||||
}
|
||||
close(outfile);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue