code stringlengths 1 1.72M | language stringclasses 1
value |
|---|---|
#!/usr/bin/env python
'''Test that mouse cursor can be made visible and hidden.
Expected behaviour:
One window will be opened. Press 'v' to hide mouse cursor and 'V' to
show mouse cursor. It should only affect the mouse when within the
client area of the window.
Close the window or press ESC to end... | Python |
#!/usr/bin/python
# $Id:$
import unittest
import time
class BaseEventSequence(unittest.TestCase):
next_sequence = 0
last_sequence = 0
finished = False
timeout = 2
start_time = time.time()
def check_sequence(self, sequence, name):
if self.next_sequence == 0 and sequence != 0:
... | Python |
#!/usr/bin/env python
'''Test that window size can be set.
Expected behaviour:
One window will be opened. The window's dimensions will be printed
to the terminal.
- press "x" to increase the width
- press "X" to decrease the width
- press "y" to increase the height
- press "Y" to decre... | Python |
#!/usr/bin/env python
'''Test that mouse cursor can be set to a platform-dependent image.
Expected behaviour:
One window will be opened. Press the left and right arrow keys to cycle
through the system mouse cursors. The current cursor selected will
be printed to the terminal.
Note that not all curs... | Python |
#!/usr/bin/env python
'''Test that mouse motion event works correctly.
Expected behaviour:
One window will be opened. Move the mouse in and out of this window
and ensure the absolute and relative coordinates are correct.
- Absolute coordinates should have (0,0) at bottom-left of client area
of wi... | Python |
#!/usr/bin/env python
'''Test that mouse drag event works correctly.
Expected behaviour:
One window will be opened. Click and drag with the mouse and ensure
that buttons, coordinates and modifiers are reported correctly. Events
should be generated even when the drag leaves the window.
Close the win... | Python |
#!/usr/bin/env python
'''Test that window can be minimized and maximized.
Expected behaviour:
One window will be opened.
- press "x" to maximize the window.
- press "n" to minimize the window.
Close the window or press ESC to end the test.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id... | Python |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
from pyglet import window
from pyglet.window.event import WindowEventLogger
from pyglet.window import key
from pyglet.gl import *
import window_util
class WINDOW_SET_FULLSCREEN(unittest.TestCase):
def on_te... | Python |
#!/usr/bin/env python
'''Test that window can be resized.
Expected behaviour:
One window will be opened. It should be resizable by the user.
Close the window or press ESC to end the test.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: WINDOW_SET_MOUSE_CURSOR.py 717 2007-03-03 07:04:10Z Alex.Hol... | Python |
#!/usr/bin/env python
'''Test that multiple windows share objects by default.
This test is non-interactive.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
from ctypes import *
from pyglet import window
from pyglet.gl import *
__noninteractive = True
class CONTEXT_SHARE(unittest.Tes... | Python |
#!/usr/bin/env python
'''Test that exclusive mouse mode can be set.
Expected behaviour:
One window will be opened. Press 'e' to enable exclusive mode and 'E'
to disable exclusive mode.
In exclusive mode:
- the mouse cursor should be invisible
- moving the mouse should generate events with bogu... | Python |
#!/usr/bin/env python
'''Test that window can be set to and from various fullscreen sizes.
Expected behaviour:
One window will be opened. Press a number to switch to the corresponding
fullscreen size; hold control and press a number to switch back
to the corresponding window size:
0 - Default si... | Python |
#!/usr/bin/env python
'''Test that window expose event works correctly.
Expected behaviour:
One window will be opened. Uncovering the window from other windows
or the edge of the screen should produce the expose event.
Note that on OS X and other compositing window managers this event
is equivalent ... | Python |
#!/usr/bin/env python
'''Test that window can be set fullscreen and back again.
Expected behaviour:
One window will be opened.
- press "f" to enter fullscreen mode.
- press "g" to leave fullscreen mode.
All events will be printed to the terminal.
Close the window or press ESC to end the tes... | Python |
#!/usr/bin/env python
'''Test that activate and deactivate events work correctly.
Expected behaviour:
One window will be opened. Clicking on the window should activate it,
clicking on another window should deactivate it. Messages will be
printed to the console for both events.
On OS X you can also ... | Python |
#!/usr/bin/env python
# $Id: $
import unittest
from pyglet import window
import base_event_sequence
__noninteractive = True
class TEST_CLASS(base_event_sequence.BaseEventSequence):
last_sequence = 3
def on_resize(self, width, height):
self.check_sequence(1, 'on_resize')
def on_show(self):
... | Python |
#!/usr/bin/env python
'''Test that a non-resizable window's size can be set.
Expected behaviour:
One window will be opened. The window's dimensions will be printed
to the terminal.
- press "x" to increase the width
- press "X" to decrease the width
- press "y" to increase the height
- ... | Python |
#!/usr/bin/python
# $Id:$
import unittest
from pyglet import window
import base_event_sequence
__noninteractive = True
class TEST_CLASS(base_event_sequence.BaseEventSequence):
last_sequence = 3
def on_resize(self, width, height):
self.check_sequence(1, 'on_resize')
def on_show(self):
... | Python |
#!/usr/bin/env python
# $Id: $
import unittest
from pyglet import window
import base_event_sequence
__noninteractive = True
class TEST_CLASS(base_event_sequence.BaseEventSequence):
last_sequence = 3
def on_resize(self, width, height):
self.check_sequence(1, 'on_resize')
def on_show(self):
... | Python |
#!/usr/bin/env python
'''Test that mouse cursor can be made visible and hidden.
Expected behaviour:
One window will be opened. Press 'v' to hide mouse cursor and 'V' to
show mouse cursor. It should only affect the mouse when within the
client area of the window.
Close the window or press ESC to end... | Python |
#!/usr/bin/env python
'''Test that window icon can be set.
Expected behaviour:
One window will be opened. It will have an icon depicting a yellow
"A".
Close the window or press ESC to end the test.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: WINDOW_SET_MOUSE_CURSOR.py 717 2007-03-03 07:... | Python |
#!/usr/bin/env python
'''Test that show and hide events work correctly.
Expected behaviour:
One window will be opened. There should be one shown event printed
initially. Minimizing and restoring the window should produce hidden
and shown events, respectively.
On OS X the events should also be fired... | Python |
#!/usr/bin/env python
'''Test that activate and deactivate events work correctly.
Expected behaviour:
One window will be opened. Clicking on the window should activate it,
clicking on another window should deactivate it. Messages will be
printed to the console for both events.
On OS X you can also ... | Python |
#!/usr/bin/env python
'''Test that window style can be tool.
Expected behaviour:
One tool-styled window will be opened.
Close the window to end the test.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: WINDOW_SET_MOUSE_CURSOR.py 717 2007-03-03 07:04:10Z Alex.Holkner $'
import unittest
from pygl... | Python |
#!/usr/bin/env python
'''Test that key press and release events work correctly.
Expected behaviour:
One window will be opened. Type into this window and check the console
output for key press and release events. Check that the correct
key symbol and modifiers are reported.
Close the window or press... | Python |
#!/usr/bin/env python
'''Test that image mouse cursor can be set.
Expected behaviour:
One window will be opened. The mouse cursor in the window will be
a custom cursor.
Close the window or press ESC to end the test.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
from pygl... | Python |
#!/usr/bin/env python
'''Test that exclusive keyboard mode can be set.
Expected behaviour:
One window will be opened. Press 'e' to enable exclusive mode and 'E'
to disable exclusive mode.
In exclusive mode:
- Pressing system keys, the Expose keys, etc., should have no effect
besides displayi... | Python |
#!/usr/bin/env python
'''Test that a window can have multisample.
A window will be opened containing two rotating squares. Initially,
there will be no multisampling (the edges will look "jaggy"). Press:
* M to toggle multisampling on/off
* S to increase samples (2, 4, 6, 8, 10, ...)
* Shift+S to... | Python |
#!/usr/bin/env python
'''Test that vsync can be set.
Expected behaviour:
A window will alternate between red and green fill.
- Press "v" to toggle vsync on/off. "Tearing" should only be visible
when vsync is off (as indicated at the terminal).
Not all video drivers support vsync. On Linux,... | Python |
#!/usr/bin/env python
'''Test that window can be set to and from various fullscreen sizes.
Expected behaviour:
One window will be opened. Press a number to switch to the corresponding
fullscreen size; hold control and press a number to switch back
to the corresponding window size:
0 - Default si... | Python |
#!/usr/bin/env python
'''Test that window move event works correctly.
Expected behaviour:
One window will be opened. Move the window and ensure that the
location printed to the terminal is correct.
Close the window or press ESC to end the test.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id:... | Python |
#!/usr/bin/env python
'''Test that window can be minimized and maximized.
Expected behaviour:
One window will be opened.
- press "x" to maximize the window.
- press "n" to minimize the window.
Close the window or press ESC to end the test.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id... | Python |
#!/usr/bin/env python
'''Test that mouse motion event works correctly.
Expected behaviour:
One window will be opened. Move the mouse in and out of this window
and ensure the absolute and relative coordinates are correct.
- Absolute coordinates should have (0,0) at bottom-left of client area
of wi... | Python |
#!/usr/bin/env python
'''Test that multiple windows share objects by default.
This test is non-interactive.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
from ctypes import *
from pyglet import window
from pyglet.gl import *
__noninteractive = True
class CONTEXT_SHARE(unittest.Tes... | Python |
#!/usr/bin/env python
# $Id: $
import unittest
from pyglet import window
import base_event_sequence
__noninteractive = True
class TEST_CLASS(base_event_sequence.BaseEventSequence):
last_sequence = 2
def on_resize(self, width, height):
self.check_sequence(1, 'on_resize')
def on_expose(self):
... | Python |
#!/usr/bin/env python
'''Test that the window can be activated (focus set).
Expected behaviour:
One window will be opened. Every 5 seconds it will be activated;
it should be come to the front and accept keyboard input (this will
be shown on the terminal).
On Windows XP, the taskbar icon may flash (i... | Python |
#!/usr/bin/env python
'''Test that text events work correctly.
Expected behaviour:
One window will be opened. Type into this window and check the console
output for text events.
- Repeated when keys are held down
- Motion events (e.g., arrow keys, HOME/END, etc) are reported
- Select events ... | Python |
#!/usr/bin/env python
'''Test that a non-resizable window's size can be set.
Expected behaviour:
One window will be opened. The window's dimensions will be printed
to the terminal.
- press "x" to increase the width
- press "X" to decrease the width
- press "y" to increase the height
- ... | Python |
#!/usr/bin/env python
'''Test that mouse enter and leave events work correctly.
Expected behaviour:
One window will be opened. Move the mouse in and out of this window
and ensure the events displayed are correct.
Close the window or press ESC to end the test.
'''
__docformat__ = 'restructuredtext'
__ve... | Python |
#!/usr/bin/python
# $Id:$
from pyglet.gl import *
def draw_client_border(window):
glClearColor(0, 0, 0, 1)
glClear(GL_COLOR_BUFFER_BIT)
glMatrixMode(GL_PROJECTION)
glLoadIdentity()
glOrtho(0, window.width, 0, window.height, -1, 1)
glMatrixMode(GL_MODELVIEW)
glLoadIdentity()... | Python |
#!/usr/bin/env python
'''Test that a window can be opened fullscreen.
Expected behaviour:
A fullscreen window will be created, with a flat purple colour.
- Press 'g' to leave fullscreen mode and create a window.
- Press 'f' to re-enter fullscreen mode.
- All events will be printed to the console. ... | Python |
#!/usr/bin/env python
'''Test that resize event works correctly.
Expected behaviour:
One window will be opened. Resize the window and ensure that the
dimensions printed to the terminal are correct. You should see
a green border inside the window but no red.
Close the window or press ESC to end the ... | Python |
#!/usr/bin/env python
'''Test that window can be resized.
Expected behaviour:
One window will be opened. It should be resizable by the user.
Close the window or press ESC to end the test.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: WINDOW_SET_MOUSE_CURSOR.py 717 2007-03-03 07:04:10Z Alex.Ho... | Python |
#!/usr/bin/env python
'''Test that window can be resized.
Expected behaviour:
One window will be opened. It should be resizable by the user.
Close the window or press ESC to end the test.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: WINDOW_SET_MOUSE_CURSOR.py 717 2007-03-03 07:04:10Z Alex.Hol... | Python |
#!/usr/bin/env python
'''Test that mouse cursor can be set to a platform-dependent image.
Expected behaviour:
One window will be opened. Press the left and right arrow keys to cycle
through the system mouse cursors. The current cursor selected will
be printed to the terminal.
Note that not all curs... | Python |
#!/usr/bin/env python
'''Test that multiple windows can be opened.
Expected behaviour:
Two small windows will be opened, one coloured yellow and the other
purple.
Close either window or press ESC to end the test.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
from pyglet... | Python |
#!/usr/bin/python
# $Id:$
import unittest
import time
class BaseEventSequence(unittest.TestCase):
next_sequence = 0
last_sequence = 0
finished = False
timeout = 2
start_time = time.time()
def check_sequence(self, sequence, name):
if self.next_sequence == 0 and sequence != 0:
... | Python |
#!/usr/bin/env python
'''Test that window can be set fullscreen and back again.
Expected behaviour:
One window will be opened.
- press "f" to enter fullscreen mode.
- press "g" to leave fullscreen mode.
All events will be printed to the terminal.
Close the window or press ESC to end the tes... | Python |
#!/usr/bin/env python
'''Test that the window caption can be set.
Expected behaviour:
Two windows will be opened, one with the caption "Window caption 1"
counting up every second; the other with a Unicode string including
some non-ASCII characters.
Press escape or close either window to finished the ... | Python |
#!/usr/bin/env python
'''Test framework for pyglet. Reads details of components and capabilities
from a requirements document, runs the appropriate unit tests.
How to Run the Tests
--------------------
::
python tests/test.py top app graphics clock resource # these all run automatically
python tests/test.py... | Python |
#!/usr/bin/env python
'''Test framework for pyglet. Reads details of components and capabilities
from a requirements document, runs the appropriate unit tests.
Overview
--------
First, some definitions:
Test case:
A single test, implemented by a Python module in the tests/ directory.
Tests can be interacti... | Python |
#!/usr/bin/env python
'''Test that all public modules are accessible after importing just 'pyglet'.
This _must_ be the first test run.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: TICK.py 310 2006-12-23 15:56:35Z Alex.Holkner $'
import unittest
import pyglet
__noninteractive = True
modules = [
... | Python |
#!/usr/bin/env python
'''Test that all public modules are accessible after importing just 'pyglet'.
This _must_ be the first test run.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: TICK.py 310 2006-12-23 15:56:35Z Alex.Holkner $'
import unittest
import pyglet
__noninteractive = True
modules = [
... | Python |
#!/usr/bin/env python
'''Test load using the Python BMP loader. You should see the rgb_24bpp.bmp
image on a checkboard background.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
import base_load
from pyglet.image.codecs.bmp import BMPImageDecoder
class TEST_SUITE(base_lo... | Python |
#!/usr/bin/env python
'''Test DXT1 compressed RGBA load from a DDS file. You should see the
rgba_dxt1.dds image on a checkboard background.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
import base_load
from pyglet.image.codecs.dds import DDSImageDecoder
class TEST_DDS_... | Python |
#!/usr/bin/env python
'''Test RGBA save using PyPNG. You should see rgba.png reference image
on the left, and saved (and reloaded) image on the right. The saved image
may have larger dimensions due to texture size restrictions.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest... | Python |
#!/usr/bin/env python
'''Test LA load using PyPNG. You should see the la.png image on
a checkboard background.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
import base_load
from pyglet.image.codecs.png import PNGImageDecoder
class TEST_PNG_LA_LOAD(base_load.TestLoad):... | Python |
#!/usr/bin/env python
'''Test LA load using PIL. You should see the la.png image on
a checkboard background.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
import base_load
from pyglet.image.codecs.pil import *
class TEST_PNG_LA(base_load.TestLoad):
texture_file = ... | Python |
#!/usr/bin/env python
'''Test rearrangement of color components using the OpenGL color matrix.
The test will be skipped if the GL_ARB_imaging extension is not present.
You should see the RGBA test image correctly rendered. Press ESC to
end the test.
'''
__docformat__ = 'restructuredtext'
__version__ = '$I... | Python |
#!/usr/bin/env python
'''Test LA load using the platform decoder (QuickTime, Quartz, GDI+ or Gdk).
You should see the la.png image on a checkboard background.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
import base_load
import sys
if sys.platform.startswith('linux'):
... | Python |
#!/usr/bin/env python
'''Test RGB load using PyPNG. You should see the rgb.png image on
a checkboard background.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
import base_load
from pyglet.image.codecs.png import PNGImageDecoder
class TEST_PNG_RGB_LOAD(base_load.TestL... | Python |
#!/usr/bin/env python
'''Test DXT3 compressed RGBA load from a DDS file. You should see the
rgba_dxt3.dds image on a checkboard background.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
import base_load
from pyglet.image.codecs.dds import DDSImageDecoder
class TEST_DDS_... | Python |
#!/usr/bin/env python
'''Test rearrangement of color components using the OpenGL color matrix.
The test will be skipped if the GL_ARB_imaging extension is not present.
You should see the RGB test image correctly rendered. Press ESC to
end the test.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id... | Python |
#!/usr/bin/env python
'''Test load using the Python BMP loader. You should see the rgb_32bpp.bmp
image on a checkboard background.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
import base_load
from pyglet.image.codecs.bmp import BMPImageDecoder
class TEST_SUITE(base_lo... | Python |
#!/usr/bin/python
# $Id:$
import unittest
from pyglet.image import atlas
__noninteractive = True
class Rect(object):
def __init__(self, x1, y1, x2, y2):
self.x1 = x1
self.y1 = y1
self.x2 = x2
self.y2 = y2
def __repr__(self):
return 'Rect(%d, %d to %d, %d)' % (
... | Python |
#!/usr/bin/env python
'''Test RGB load using the platform decoder (QuickTime, Quartz, GDI+ or Gdk).
You should see the rgb.png image on a checkboard background.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
import base_load
import sys
if sys.platform.startswith('linux'):... | Python |
#!/usr/bin/env python
'''Test load using the Python BMP loader. You should see the rgba_32bpp.bmp
image on a checkboard background.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
import base_load
from pyglet.image.codecs.bmp import BMPImageDecoder
class TEST_SUITE(base_l... | Python |
#!/usr/bin/env python
'''Test L load using the platform decoder (QuickTime, Quartz, GDI+ or Gdk).
You should see the l.png image on a checkboard background.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
import base_load
import sys
if sys.platform.startswith('linux'):
... | Python |
#!/usr/bin/env python
'''Test RGB load using the platform decoder (QuickTime, Quartz, GDI+ or Gdk).
You should see the rgb.png image on a checkboard background.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
import base_load
import sys
if sys.platform.startswith('linux'):... | Python |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
from pyglet.gl import *
from pyglet.image import *
from pyglet.window import *
__noninteractive = True
class TestTexture3D(unittest.TestCase):
def create_image(self, width, height, color):
data = ('... | Python |
#!/usr/bin/env python
'''Test L load using PIL. You should see the la.png image on
a checkboard background.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
import base_load
from pyglet.image.codecs.pil import *
class TEST_PIL_L(base_load.TestLoad):
texture_file = 'l... | Python |
#!/usr/bin/env python
'''Test RGBA save using PyPNG. You should see rgba.png reference image
on the left, and saved (and reloaded) image on the right. The saved image
may have larger dimensions due to texture size restrictions.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest... | Python |
#!/usr/bin/env python
'''Test L load using PyPNG. You should see the l.png image on
a checkboard background.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
import base_load
from pyglet.image.codecs.png import PNGImageDecoder
class TEST_PNG_L_LOAD(base_load.TestLoad):
... | Python |
#!/usr/bin/env python
'''Test rearrangement of color components using the OpenGL color matrix.
The test will be skipped if the GL_ARB_imaging extension is not present.
You should see the RGBA test image correctly rendered. Press ESC to
end the test.
'''
__docformat__ = 'restructuredtext'
__version__ = '$I... | Python |
#!/usr/bin/env python
'''Base class for image tests.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
from StringIO import StringIO
from os.path import dirname, join
from pyglet.gl import *
from pyglet import image
from pyglet.image import codecs
from pyglet.window import *
from pyglet.... | Python |
#!/usr/bin/env python
'''Test L save using PIL. You should see l.png reference image
on the left, and saved (and reloaded) image on the right. The saved image
may have larger dimensions due to texture size restrictions.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
import b... | Python |
#!/usr/bin/env python
'''Test LA load using PIL. You should see the la.png image on
a checkboard background.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
import base_load
from pyglet.image.codecs.pil import *
class TEST_PNG_LA(base_load.TestLoad):
texture_file = ... | Python |
#!/usr/bin/env python
'''Test load using the Python BMP loader. You should see the rgb_32bpp.bmp
image on a checkboard background.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
import base_load
from pyglet.image.codecs.bmp import BMPImageDecoder
class TEST_SUITE(base_lo... | Python |
#!/usr/bin/env python
'''Test RGBA load using PIL. You should see the rgba.png image on
a checkboard background.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
import base_load
from pyglet.image.codecs.pil import *
class TEST_PIL_RGBA_LOAD(base_load.TestLoad):
te... | Python |
#!/usr/bin/env python
'''Test DXT3 compressed RGBA load from a DDS file. You should see the
rgba_dxt3.dds image on a checkboard background.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
import base_load
from pyglet.image.codecs.dds import DDSImageDecoder
class TEST_DDS_... | Python |
#!/usr/bin/env python
'''Test LA save using PyPNG. You should see la.png reference image
on the left, and saved (and reloaded) image on the right. The saved image
may have larger dimensions due to texture size restrictions.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
impo... | Python |
#!/usr/bin/env python
'''Test RGB save using PyPNG. You should see rgb.png reference image
on the left, and saved (and reloaded) image on the right. The saved image
may have larger dimensions due to texture size restrictions.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
... | Python |
#!/usr/bin/env python
'''Test LA save using PIL. You should see la.png reference image
on the left, and saved (and reloaded) image on the right. The saved image
may have larger dimensions due to texture size restrictions.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
import... | Python |
#!/usr/bin/env python
'''Test load using the Python BMP loader. You should see the rgb_16bpp.bmp
image on a checkboard background.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
import base_load
from pyglet.image.codecs.bmp import BMPImageDecoder
class TEST_SUITE(base_lo... | Python |
#!/usr/bin/env python
'''Test DXT1 compressed RGBA load from a DDS file. You should see the
rgba_dxt1.dds image on a checkboard background.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
import base_load
from pyglet.image.codecs.dds import DDSImageDecoder
class TEST_DDS_... | Python |
#!/usr/bin/env python
'''Test depth buffer save.
A scene consisting of a single coloured triangle will be rendered. The
depth buffer will then be saved to a stream and loaded as a texture.
You will see the original scene first for up to several seconds before the
depth buffer image appears (because retrie... | Python |
#!/usr/bin/env python
'''Test load using the Python BMP loader. You should see the rgb_4bpp.bmp
image on a checkboard background.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
import base_load
from pyglet.image.codecs.bmp import BMPImageDecoder
class TEST_SUITE(base_loa... | Python |
#!/usr/bin/env python
'''Test LA load using PyPNG. You should see the la.png image on
a checkboard background.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
import base_load
from pyglet.image.codecs.png import PNGImageDecoder
class TEST_PNG_LA_LOAD(base_load.TestLoad):... | Python |
#!/usr/bin/env python
'''Test RGB load using PyPNG. You should see the rgb.png image on
a checkboard background.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
import base_load
from pyglet.image.codecs.png import PNGImageDecoder
class TEST_PNG_RGB_LOAD(base_load.TestL... | Python |
#!/usr/bin/env python
'''Base class for image tests.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
from os.path import dirname, join
from pyglet.gl import *
from pyglet import image
from pyglet.image import codecs
from pyglet.window import *
from pyglet.window.event import *
from te... | Python |
#!/usr/bin/env python
'''Test colour buffer copy to texture.
A scene consisting of a single coloured triangle will be rendered. The
colour buffer will then be saved to a stream and loaded as a texture.
You will see the original scene first for up to several seconds before the
buffer image appears (because r... | Python |
#!/usr/bin/env python
'''Test load using the Python BMP loader. You should see the rgba_32bpp.bmp
image on a checkboard background.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
import base_load
from pyglet.image.codecs.bmp import BMPImageDecoder
class TEST_SUITE(base_l... | Python |
#!/usr/bin/env python
'''Test that the checkerboard pattern looks correct.
One window will open, it should show one instance of the checkerboard
pattern in two levels of grey.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
from pyglet.gl import *
from pyglet import image
from pyglet.... | Python |
#!/usr/bin/env python
'''Test L save using PyPNG. You should see l.png reference image
on the left, and saved (and reloaded) image on the right. The saved image
may have larger dimensions due to texture size restrictions.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
import... | Python |
#!/usr/bin/env python
'''Test RGBA load using PyPNG. You should see the rgba.png image on
a checkboard background.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
import base_load
from pyglet.image.codecs.png import PNGImageDecoder
class TEST_PNG_RGBA_LOAD(base_load.Te... | Python |
#!/usr/bin/env python
'''Test DXT5 compressed RGBA load from a DDS file. You should see the
rgba_dxt5.dds image on a checkboard background.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
import base_load
from pyglet.image.codecs.dds import DDSImageDecoder
class TEST_DDS_... | Python |
#!/usr/bin/env python
'''Test RGB load using PIL. You should see the rgb.png image on
a checkboard background.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
import base_load
from pyglet.image.codecs.pil import *
class TEST_PIL_RGB_LOAD(base_load.TestLoad):
textu... | Python |
#!/usr/bin/env python
'''Test DXT1 compressed RGB load from a DDS file. You should see the
rgb_dxt1.dds image.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
import base_load
from pyglet.image.codecs.dds import DDSImageDecoder
class TEST_DDS_RGB_DXT1(base_load.TestLoad):... | Python |
#!/usr/bin/env python
'''Test load using the Python BMP loader. You should see the rgb_24bpp.bmp
image on a checkboard background.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
import base_load
from pyglet.image.codecs.bmp import BMPImageDecoder
class TEST_SUITE(base_lo... | Python |
#!/usr/bin/env python
'''Test RGBA load using the platform decoder (QuickTime, Quartz, GDI+ or Gdk).
You should see the rgba.png image on a checkboard background.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
import base_load
import sys
if sys.platform.startswith('linux'... | Python |
Subsets and Splits
SQL Console for ajibawa-2023/Python-Code-Large
Provides a useful breakdown of language distribution in the training data, showing which languages have the most samples and helping identify potential imbalances across different language groups.