mirror of
https://github.com/stevenrobertson/cuburn.git
synced 2025-02-05 11:40:04 -05:00
Add image writing, and revert the buffer flip
This commit is contained in:
parent
1dad09fc03
commit
972cd9f9ea
@ -109,7 +109,7 @@ void iter(mwc_st *msts, const iter_info *infos, float *accbuf, float *denbuf) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO: dither?
|
// TODO: dither?
|
||||||
int i = ((int)((1.0f - y) * 255.0f) * 512)
|
int i = ((int)((y + 1.0f) * 255.0f) * 512)
|
||||||
+ (int)((x + 1.0f) * 255.0f);
|
+ (int)((x + 1.0f) * 255.0f);
|
||||||
|
|
||||||
// since info was declared const, C++ barfs unless it's loaded first
|
// since info was declared const, C++ barfs unless it's loaded first
|
||||||
|
7
main.py
7
main.py
@ -16,6 +16,7 @@ from ctypes import *
|
|||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
np.set_printoptions(precision=5, edgeitems=20)
|
np.set_printoptions(precision=5, edgeitems=20)
|
||||||
|
import scipy
|
||||||
|
|
||||||
from fr0stlib.pyflam3 import *
|
from fr0stlib.pyflam3 import *
|
||||||
from fr0stlib.pyflam3._flam3 import *
|
from fr0stlib.pyflam3._flam3 import *
|
||||||
@ -37,11 +38,13 @@ def main(args):
|
|||||||
if '-g' not in args:
|
if '-g' not in args:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
noalpha = np.delete(accum, 3, axis=2)
|
||||||
|
scipy.misc.imsave('rendered.png', noalpha)
|
||||||
|
|
||||||
imgbuf = (np.minimum(accum * 255, 255)).astype(np.uint8)
|
imgbuf = (np.minimum(accum * 255, 255)).astype(np.uint8)
|
||||||
|
|
||||||
window = pyglet.window.Window(1600, 900)
|
window = pyglet.window.Window(1600, 900)
|
||||||
image = pyglet.image.ImageData(512, 512, 'RGBA', imgbuf.tostring())
|
image = pyglet.image.ImageData(512, 512, 'RGBA', imgbuf.tostring(), -2048)
|
||||||
#-anim.features.hist_stride*4)
|
|
||||||
tex = image.texture
|
tex = image.texture
|
||||||
|
|
||||||
#pal = (anim.ctx.ptx.instances[PaletteLookup].pal * 255.).astype(np.uint8)
|
#pal = (anim.ctx.ptx.instances[PaletteLookup].pal * 255.).astype(np.uint8)
|
||||||
|
Loading…
Reference in New Issue
Block a user