Example #1
0
    def __init__(self):
        ImageBase.__init__(self)

        self.prof = None
        if runProfile:
            self.prof = cProfile.Profile()
            self.prof.enable()

        self.glutWindow = None

        # The aspect ratio of a pixel on a computer is different
        # from what it is on an NTSC standard def television.  We
        # could display each pixel from the simulation as a single
        # pixel on your screen, but this would display a tall skinny
        # image.  To do that, use these commented-out lines:
        #self.windowWidth = params.scanlineNumPixels
        #self.windowHeight = params.frameHeightPixels * 2
        # Instead, we stretch each pixel horizontally.  Each pixel
        # of the simulation covers three pixels in the vertical 
        # direction.
        self.windowWidth = int(params.scanlineNumPixels * 4)
        self.windowHeight = int(params.frameHeightPixels * 3)

        self.textureId = None
        self.startedNewImage = True
        self.renderToTopHalf = True

        self.initOpenGL()

        glClearColor(1, 1, 1, 0.0)
        glDisable(GL_DEPTH_TEST)
        glDisable(GL_CULL_FACE)
        glEnable(GL_TEXTURE_2D)
        glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE)
        glClear(GL_COLOR_BUFFER_BIT)
Example #2
0
    def __init__(self):
        ImageBase.__init__(self)

        self.prof = None
        if runProfile:
            self.prof = cProfile.Profile()
            self.prof.enable()

        self.glutWindow = None

        # The aspect ratio of a pixel on a computer is different
        # from what it is on an NTSC standard def television.  We
        # could display each pixel from the simulation as a single
        # pixel on your screen, but this would display a tall skinny
        # image.  To do that, use these commented-out lines:
        #self.windowWidth = params.scanlineNumPixels
        #self.windowHeight = params.frameHeightPixels * 2
        # Instead, we stretch each pixel horizontally.  Each pixel
        # of the simulation covers three pixels in the vertical
        # direction.
        self.windowWidth = int(params.scanlineNumPixels * 4)
        self.windowHeight = int(params.frameHeightPixels * 3)

        self.textureId = None
        self.startedNewImage = True
        self.renderToTopHalf = True

        self.initOpenGL()

        glClearColor(1, 1, 1, 0.0)
        glDisable(GL_DEPTH_TEST)
        glDisable(GL_CULL_FACE)
        glEnable(GL_TEXTURE_2D)
        glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE)
        glClear(GL_COLOR_BUFFER_BIT)
Example #3
0
 def __init__(self):
     print('Creating ImagePIL class to save frame images')
     ImageBase.__init__(self)
     self.image = Image.new("RGBA", (params.scanlineNumPixels,
                                     params.frameHeightPixels), "white")
     self.outputDir = params.imageOutputDir
     self.frameCount = 0
     self.dateTimeStr = time.strftime('%y_%m%d_%H%M%S')
Example #4
0
 def __init__(self):
     print('Creating ImagePIL class to save frame images')
     ImageBase.__init__(self)
     self.image = Image.new(
         "RGBA", (params.scanlineNumPixels, params.frameHeightPixels),
         "white")
     self.outputDir = params.imageOutputDir
     self.frameCount = 0
     self.dateTimeStr = time.strftime('%y_%m%d_%H%M%S')