source: cows/trunk/cows/service/imps/pywms/view.py @ 4808

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/cows/trunk/cows/service/imps/pywms/view.py@4808
Revision 4808, 1.4 KB checked in by domlowe, 11 years ago (diff)

adding contents of pywms

Line 
1"""
2View classes.
3
4@author: Stephen Pascoe
5"""
6
7class GridRenderer(object):
8    """A class which converts a Grid object into an image.
9
10    @ivar mimeType: The MIME type of images created by this renderer.
11    @ivar varmin: The minimum value on the grid for colourmap calculation.
12    @ivar varmax: The maximum value of the grid for colourmap calculation.
13    """
14
15    mimeType = NotImplemented
16    varmin = NotImplemented
17    varmax = NotImplemented
18
19    def renderGrid(self, grid, bbox, width, height):
20        """Draw the grid into an image.
21
22        @param grid: The grid to draw
23        @param bbox: The bounding box to map grid onto.  This may extend
24            beyond the grid's bounds.
25        @param width: The image width in pixels.
26        @param height: The image height in pixels.
27        @return: A PIL.Image object.
28
29        @note: grid is expected to cover the entire longitude range of bbox but may
30            not cover all of the latitude range if bbox extends beyond the CRS:84 range.
31            In this case the returned image must be padded to enforce the correct
32            image size and bbox.
33        """
34        raise NotImplementedError
35
36    def renderColourbar(self, width, height, isVertical=True):
37        """
38        @param width: The image width in pixels.
39        @param height: The image height in pixels.
40        @param isVertical: Boolean selecting orientation.
41        @return: A PIL.Image object
42        """
43        pass
Note: See TracBrowser for help on using the repository browser.