/[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 1306 - (show annotations)
Tue Sep 18 05:51:09 2007 UTC (11 years, 11 months ago) by ksteube
File MIME type: text/x-python
File size: 1424 byte(s)
New Copyright in each .c .h .cpp and .py file

1 #
2 # $Id$
3 #
4 #######################################################
5 #
6 # Copyright 2003-2007 by ACceSS MNRF
7 # Copyright 2007 by University of Queensland
8 #
9 # http://esscc.uq.edu.au
10 # Primary Business: Queensland, Australia
11 # Licensed under the Open Software License version 3.0
12 # http://www.opensource.org/licenses/osl-3.0.php
13 #
14 #######################################################
15 #
16
17 """
18 Author: John Ngui, john.ngui@uq.edu.au
19 """
20
21 # Import the necessary modules.
22 from esys.pyvisi import Scene, ImageReader, Logo
23 from esys.pyvisi import LocalPosition
24 from esys.pyvisi.constant import *
25 import os
26
27 PYVISI_EXAMPLE_MESHES_PATH = "data_meshes"
28 PYVISI_EXAMPLE_IMAGES_PATH = "data_sample_images"
29 X_SIZE = 600
30 Y_SIZE = 300
31
32 LOAD_LOGO_NAME = "access_logo.jpg"
33 SAVE_IMAGE_NAME = "logo.jpg"
34 JPG_RENDERER = Renderer.ONLINE_JPG
35
36 # Create a Scene.
37 s = Scene(renderer = JPG_RENDERER, num_viewport = 1, x_size = X_SIZE,
38 y_size = Y_SIZE)
39
40 # Create an ImageReader (in place of DataCollector).
41 ir = ImageReader(ImageFormat.JPG)
42 ir.setImageName(image_name = os.path.join(PYVISI_EXAMPLE_MESHES_PATH, \
43 LOAD_LOGO_NAME))
44
45 # Create an Logo.
46 l = Logo(scene = s, image_reader = ir, viewport = Viewport.SOUTH_WEST)
47 l.setPosition(position = LocalPosition(10,10))
48 l.setSize(size = 0.7)
49
50 # Render the object.
51 s.render(image_name = os.path.join(PYVISI_EXAMPLE_IMAGES_PATH, SAVE_IMAGE_NAME))
52

  ViewVC Help
Powered by ViewVC 1.1.26