Exemple #1
0
from renmas3.base import GraphicsPRGBA, RGBSpectrum, ImagePRGBA, ImageBGRA
from renmas3.utils import blt_prgba_to_bgra
from renmas3.win32 import show_image_in_window

img = ImagePRGBA(400, 400)
gr = GraphicsPRGBA()
gr.draw_rect(img, 20, 20, 80, 50, RGBSpectrum(0.6, 0.0, 0.0))

width, height = img.size()
img2 = ImageBGRA(width, height)
blt_prgba_to_bgra(img, img2)

show_image_in_window(img2)
Exemple #2
0
    contents = tmo_loader.load(tmo_shader, 'tmo.py')
    tmo = Tmo(contents, props)
    return tmo


hdr_image = load_image('Desk_oBA2.hdr')
#hdr_image = load_image('AtriumNight_oA9D.hdr')
width, height = hdr_image.size()
ldr_image = ImagePRGBA(width, height)

output_image = ImageBGRA(width, height)
reinhard = ReinhardOperator()
tmo = create_tmo('log_tmo')

start = time.clock()

#tmo shader
tmo.tone_map(hdr_image, ldr_image)
blt_prgba_to_bgra(ldr_image, output_image)

#old asm implementation
#reinhard.tone_map(hdr_image, output_image)

#without tone mapping
#blt_prgba_to_bgra(hdr_image, output_image)

end = time.clock()
print(end - start)

show_image_in_window(output_image)
Exemple #3
0
    contents = tmo_loader.load(tmo_shader, 'tmo.py')
    tmo = Tmo(contents, props)
    return tmo

hdr_image = load_image('Desk_oBA2.hdr')
#hdr_image = load_image('AtriumNight_oA9D.hdr')
width, height = hdr_image.size()
ldr_image = ImagePRGBA(width, height)

output_image = ImageBGRA(width, height)
reinhard = ReinhardOperator()
tmo = create_tmo('log_tmo')

start = time.clock()

#tmo shader
tmo.tone_map(hdr_image, ldr_image)
blt_prgba_to_bgra(ldr_image, output_image)

#old asm implementation
#reinhard.tone_map(hdr_image, output_image)

#without tone mapping
#blt_prgba_to_bgra(hdr_image, output_image)

end = time.clock()
print(end-start)

show_image_in_window(output_image)