/[escript]/trunk/pyvisi/py_src/renderers/gnuplot/image.py
ViewVC logotype

Contents of /trunk/pyvisi/py_src/renderers/gnuplot/image.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 605 - (show annotations)
Mon Mar 20 07:16:27 2006 UTC (13 years, 7 months ago) by gross
File MIME type: text/x-python
File size: 10419 byte(s)
pyvisi with vtk runs noe on the altix
1 # Copyright (C) 2004-2005 Paul Cochrane
2 #
3 # This program is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU General Public License
5 # as published by the Free Software Foundation; either version 2
6 # of the License, or (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16
17 # $Id: image.py,v 1.19 2005/02/24 01:03:31 paultcochrane Exp $
18
19 ## @file image.py
20
21 """
22 Class and functions associated with a pyvisi Image objects
23 """
24
25 # generic imports
26 from common import debugMsg, unsupportedError
27
28 from esys.pyvisi.common import fileCheck
29
30 # module specific imports
31 from pyvisi.renderers.gnuplot.item import Item
32
33 __revision__ = '$Revision: 1.19 $'
34
35 class Image(Item):
36 """
37 Image class. Generic class to handle image data.
38 """
39 def __init__(self, scene=None):
40 """
41 Initialises the Image class object
42
43 @param scene: The Scene object to add to
44 @type scene: Scene object
45 """
46 debugMsg("Called Image.__init__()")
47 Item.__init__(self)
48
49 if scene is not None:
50 self.renderer = scene.renderer
51
52 def load(self, fname):
53 """
54 Loads image data from file.
55
56 @param fname: The filename from which to load image data
57 @type fname: string
58 """
59 debugMsg("Called Image.load()")
60 fileCheck(fname)
61 return
62
63 class JpegImage(Image):
64 """
65 Subclass of Image class to explicitly handle jpeg images
66 """
67 def __init__(self, scene=None):
68 """
69 Initialises the JpegImage class object
70
71 @param scene: The Scene object to add to
72 @type scene: Scene object
73 """
74 debugMsg("Called JpegImage.__init__()")
75 Image.__init__(self)
76
77 if scene is not None:
78 self.renderer = scene.renderer
79
80 self.format = "jpeg"
81
82 def load(self, fname):
83 """
84 Loads jpeg image data from file.
85
86 NOT supported by this renderer module
87
88 @param fname: The filename from which to load jpeg image data
89 @type fname: string
90 """
91 debugMsg("Called JpegImage.load()")
92
93 fileCheck(fname)
94
95 # this ability not handled by this renderer module
96 unsupportedError()
97
98 return
99
100 def render(self):
101 """
102 Does JpegImage object specific (pre)rendering stuff
103 """
104 debugMsg("Called JpegImage.render()")
105
106 return
107
108 class PngImage(Image):
109 """
110 Subclass of Image class to explicitly handle png images
111 """
112 def __init__(self, scene=None):
113 """
114 Initialises the PngImage class object
115
116 @param scene: The Scene object to add to
117 @type scene: Scene object
118 """
119 debugMsg("Called PngImage.__init__()")
120 Image.__init__(self)
121
122 if scene is not None:
123 self.renderer = scene.renderer
124
125 self.format = "png"
126
127 def load(self, fname):
128 """
129 Loads png image data from file.
130
131 NOT supported by this renderer module
132
133 @param fname: The filename from which to load png image data
134 @type fname: string
135 """
136 debugMsg("Called PngImage.load()")
137
138 fileCheck(fname)
139
140 # this ability not handled by this renderer module
141 unsupportedError()
142
143 return
144
145 def render(self):
146 """
147 Does PngImage object specific (pre)rendering stuff
148 """
149 debugMsg("Called PngImage.render()")
150
151 return
152
153 class BmpImage(Image):
154 """
155 Subclass of Image class to explicitly handle bmp images
156 """
157 def __init__(self, scene=None):
158 """
159 Initialises the BmpImage class object
160
161 @param scene: The Scene object to add to
162 @type scene: Scene object
163 """
164 debugMsg("Called BmpImage.__init__()")
165 Image.__init__(self)
166
167 if scene is not None:
168 self.renderer = scene.renderer
169
170 self.format = "bmp"
171
172 def load(self, fname):
173 """
174 Loads bmp image data from file.
175
176 NOT supported by this renderer module
177
178 @param fname: The filename from which to load bmp image data
179 @type fname: string
180 """
181 debugMsg("Called BmpImage.load()")
182
183 fileCheck(fname)
184
185 # this ability not handled by this renderer module
186 unsupportedError()
187
188 return
189
190 def render(self):
191 """
192 Does BmpImage object specific (pre)rendering stuff
193 """
194 debugMsg("Called BmpImage.render()")
195
196 return
197
198 class TiffImage(Image):
199 """
200 Subclass of Image class to explicitly handle tiff images
201 """
202 def __init__(self, scene=None):
203 """
204 Initialises the TiffImage class object
205
206 @param scene: The Scene object to add to
207 @type scene: Scene object
208 """
209 debugMsg("Called TiffImage.__init__()")
210 Image.__init__(self)
211
212 if scene is not None:
213 self.renderer = scene.renderer
214
215 self.format = "tiff"
216
217 def load(self, fname):
218 """
219 Loads tiff image data from file.
220
221 NOT supported by this renderer module
222
223 @param fname: The filename from which to load tiff image data
224 @type fname: string
225 """
226 debugMsg("Called TiffImage.load()")
227
228 fileCheck(fname)
229
230 # this ability not handled by this renderer module
231 unsupportedError()
232
233 return
234
235 def render(self):
236 """
237 Does TiffImage object specific (pre)rendering stuff
238 """
239 debugMsg("Called TiffImage.render()")
240
241 return
242
243 class PnmImage(Image):
244 """
245 Subclass of Image class to explicitly handle pnm images
246 """
247 def __init__(self, scene=None):
248 """
249 Initialises the PnmImage class object
250
251 @param scene: The Scene object to add to
252 @type scene: Scene object
253 """
254 debugMsg("Called PnmImage.__init__()")
255 Image.__init__(self)
256
257 if scene is not None:
258 self.renderer = scene.renderer
259
260 self.format = "pnm"
261
262 def load(self, fname):
263 """
264 Loads pnm image data from file.
265
266 NOT supported by this renderer module
267
268 @param fname: The filename from which to load pnm image data
269 @type fname: string
270 """
271 debugMsg("Called PnmImage.load()")
272
273 fileCheck(fname)
274
275 # this ability not handled by this renderer module
276 unsupportedError()
277
278 return
279
280 def render(self):
281 """
282 Does PnmImage object specific (pre)rendering stuff
283 """
284 debugMsg("Called PnmImage.render()")
285
286 return
287
288 class PbmImage(Image):
289 """
290 Subclass of Image class to explicitly handle pbm images
291 """
292 def __init__(self, scene=None):
293 """
294 Initialises the PbmImage class object
295
296 @param scene: The Scene object to add to
297 @type scene: Scene object
298 """
299 debugMsg("Called PbmImage.__init__()")
300 Image.__init__(self)
301
302 if scene is not None:
303 self.renderer = scene.renderer
304
305 self.format = "pbm"
306
307 def load(self, fname):
308 """
309 Loads pnm image data from file.
310
311 NOT supported by this renderer module
312
313 @param fname: The filename from which to load pbm image data
314 @type fname: string
315 """
316 debugMsg("Called PnmImage.load()")
317
318 fileCheck(fname)
319
320 # this ability not handled by this renderer module
321 unsupportedError()
322
323 return
324
325 def render(self):
326 """
327 Does PbmImage object specific (pre)rendering stuff
328 """
329 debugMsg("Called PbmImage.render()")
330
331 return
332
333 class PsImage(Image):
334 """
335 Subclass of Image class to explicitly handle ps images
336 """
337 def __init__(self, scene=None):
338 """
339 Initialises the PsImage class object
340
341 This object is B{only} used for generating postscript output
342
343 @param scene: The Scene object to add to
344 @type scene: Scene object
345 """
346 debugMsg("Called PsImage.__init__()")
347 Image.__init__(self)
348
349 if scene is not None:
350 self.renderer = scene.renderer
351
352 self.format = "ps"
353
354 def load(self, fname):
355 """
356 Loads ps image data from file.
357
358 B{NOT} supported by this renderer module
359
360 @param fname: The filename from which to load ps image data
361 @type fname: string
362 """
363 debugMsg("Called PsImage.load()")
364
365 fileCheck(fname)
366
367 # this ability not handled by this renderer module
368 unsupportedError()
369
370 return
371
372 def render(self):
373 """
374 Does PsImage object specific (pre)rendering stuff
375 """
376 debugMsg("Called PsImage.render()")
377
378 return
379
380 class PdfImage(Image):
381 """
382 Subclass of Image class to explicitly handle pdf images
383 """
384 def __init__(self, scene=None):
385 """
386 Initialises the PdfImage class object
387
388 This object is B{only} used for generating pdf output
389
390 @param scene: The Scene object to add to
391 @type scene: Scene object
392 """
393 debugMsg("Called PdfImage.__init__()")
394 Image.__init__(self)
395
396 if scene is not None:
397 self.renderer = scene.renderer
398
399 self.format = "pdf"
400
401 def load(self, fname):
402 """
403 Loads pdf image data from file.
404
405 B{NOT} supported by this renderer module
406
407 @param fname: The filename from which to load pdf image data
408 @type fname: string
409 """
410 debugMsg("Called PdfImage.load()")
411
412 fileCheck(fname)
413
414 # this ability not handled by this renderer module
415 unsupportedError()
416
417 return
418
419 def render(self):
420 """
421 Does PdfImage object specific (pre)rendering stuff
422 """
423 debugMsg("Called PdfImage.render()")
424
425 return
426
427 # vim: expandtab shiftwidth=4:

  ViewVC Help
Powered by ViewVC 1.1.26