Family Day update
This commit is contained in:
parent
aac6731f2c
commit
9ad63ea473
2442 changed files with 39761 additions and 8255 deletions
|
|
@ -0,0 +1,20 @@
|
|||
mata
|
||||
void writeppm(name, r, g, b) {
|
||||
n = rows(r)
|
||||
p = cols(r)
|
||||
f = fopen(name, "w")
|
||||
fput(f, "P3")
|
||||
fput(f, strofreal(p) + " " + strofreal(n) + " 255")
|
||||
for (i = 1; i <= n; i++) {
|
||||
for (j = 1; j <= p; j++) {
|
||||
fput(f, strofreal(r[i,j]) + " " + strofreal(g[i,j]) + " " + strofreal(b[i,j]))
|
||||
}
|
||||
}
|
||||
fclose(f)
|
||||
}
|
||||
|
||||
r = J(1, 6, (0::5) * 51)
|
||||
g = J(6, 1, (0..5) * 51)
|
||||
b = J(6, 6, 255)
|
||||
writeppm("image.ppm", r, g, b)
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue