예제 #1
0
파일: regular.py 프로젝트: mario007/renmas
    def test1(self):
        mgr = ColorManager()

        sampler = RegularSampler(2, 2, pixel=1.0)
        tile = Tile(5, 5, 20, 20)
        tile.split(1)
        runtime = Runtime()

        sampler.get_sample_asm([runtime], "get_sample", mgr.assembler)
        mc = mgr.assembler.assemble(self.asm_code())
        ds = runtime.load('test', mc)

        sampler.set_tile(tile)

        while True:
            sample = sampler.get_sample()
            if sample is None:
                break

            runtime.run('test')
            self.sample_test(sample, ds)

        runtime.run('test')
        ret = ds['kraj']
        self.assertFalse(ret)
예제 #2
0
파일: regular.py 프로젝트: mario007/renmas
    def test1(self):
        mgr = ColorManager()
        
        sampler = RegularSampler(2, 2, pixel=1.0)
        tile = Tile(5, 5, 20, 20)
        tile.split(1)
        runtime = Runtime()

        sampler.get_sample_asm([runtime], "get_sample", mgr.assembler)
        mc = mgr.assembler.assemble(self.asm_code())
        ds = runtime.load('test', mc)

        sampler.set_tile(tile)

        while True:
            sample = sampler.get_sample()
            if sample is None:
                break

            runtime.run('test')
            self.sample_test(sample, ds)
        
        runtime.run('test')
        ret = ds['kraj']
        self.assertFalse(ret)
예제 #3
0
    mov dword [kraj], eax
    macro mov eax, sample1
    macro mov ebx, ray1
    call get_ray
    #END
"""

cam = Pinhole((2,3,4), (5,9,1))
mgr = ColorManager()

width = 2
height = 2
sampler = RegularSampler(width, height)

runtime = Runtime()
sampler.get_sample_asm([runtime], "get_sample", mgr.assembler)
cam.ray_asm([runtime], 'get_ray', mgr.assembler)
mc = mgr.assembler.assemble(ASM_CODE)
ds = runtime.load('test', mc)

tile = Tile(0,0, width, height)
tile.split(1)
sampler.set_tile(tile)

start = time.clock()
while True:
    sample = sampler.get_sample()
    if sample is None: break
    ray = cam.ray(sample)
    print(ray)
    runtime.run('test')