Changeset - 61164aaadbaa
[Not reviewed]
default
0 1 0
drewp@bigasterisk.com - 14 years ago 2011-06-18 21:18:06
drewp@bigasterisk.com
change lightsim to numpy
Ignore-this: 96e2710b0afa0afec9e76c73d68f984d
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
lightsim/openglsim.py
Show inline comments
 
#!/usr/bin/python2.4
 
# see http://www.sgi.com/software/opengl/advanced97/notes/node57.html for accum notes
 

	
 
from __future__ import division
 
import sys, time
 
import numarray as num
 
import numpy as num
 
import Tkinter as tk
 
import Image
 
from louie import dispatcher
 

	
 
from PyQt4.QtCore import QSize
 
from PyQt4.QtOpenGL import QGLWidget
 
from OpenGL.GL import *
 

	
 
def xxxdrawWithAlpha(imgString, w, h, alpha):
 
    # this one should be faster because GL does the alpha adjust, but
 
    # i don't think it works yet
 
    
 
    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
 
    
 
    glClear(GL_COLOR_BUFFER_BIT)
 
    #glBlendColor(1, 1, 1, mag) # needs ARB_imaging
 
    glDrawPixels(w, h, GL_RGBA, GL_UNSIGNED_BYTE, imgString)
 

	
 
class Surface(QGLWidget):
 
    """widget that adds multiple image files together with adjustable scales"""
 
    def __init__(self, parent, filenames, imgRescaleTo=None):
 
        """
 
        imgRescaleTo can be a length of pixels to reduce all the input
 
        images into. Try 64 for a low res drawing.
0 comments (0 inline, 0 general)