/[escript]/trunk-mpi-branch/doc/examples/pyvisi/logo.py
ViewVC logotype

Contents of /trunk-mpi-branch/doc/examples/pyvisi/logo.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1295 - (show annotations)
Mon Sep 10 06:07:09 2007 UTC (12 years ago) by ksteube
File MIME type: text/x-python
File size: 996 byte(s)
Have now merged latest trunk features into MPI branch in preparation for
ending the MPI branch.
Compiles but has run time problems in bandwith reduction.

1 """
2 Author: John Ngui, john.ngui@uq.edu.au
3 """
4
5 # Import the necessary modules.
6 from esys.pyvisi import Scene, ImageReader, Logo
7 from esys.pyvisi import LocalPosition
8 from esys.pyvisi.constant import *
9 import os
10
11 PYVISI_EXAMPLE_MESHES_PATH = "data_meshes"
12 PYVISI_EXAMPLE_IMAGES_PATH = "data_sample_images"
13 X_SIZE = 600
14 Y_SIZE = 300
15
16 LOAD_LOGO_NAME = "access_logo.jpg"
17 SAVE_IMAGE_NAME = "logo.jpg"
18 JPG_RENDERER = Renderer.ONLINE_JPG
19
20 # Create a Scene.
21 s = Scene(renderer = JPG_RENDERER, num_viewport = 1, x_size = X_SIZE,
22 y_size = Y_SIZE)
23
24 # Create an ImageReader (in place of DataCollector).
25 ir = ImageReader(ImageFormat.JPG)
26 ir.setImageName(image_name = os.path.join(PYVISI_EXAMPLE_MESHES_PATH, \
27 LOAD_LOGO_NAME))
28
29 # Create an Logo.
30 l = Logo(scene = s, image_reader = ir, viewport = Viewport.SOUTH_WEST)
31 l.setPosition(position = LocalPosition(10,10))
32 l.setSize(size = 0.7)
33
34 # Render the object.
35 s.render(image_name = os.path.join(PYVISI_EXAMPLE_IMAGES_PATH, SAVE_IMAGE_NAME))
36

  ViewVC Help
Powered by ViewVC 1.1.26