Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 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