Table of contents Index

class GvRasterLayer

Declared in module gview

Inheritance hierarchy:

gview.GvRasterLayer
  gview.GvLayer
    gview.GvData
      gtk.GtkData

Synopsis

class GvRasterLayer(GvLayer):
    def gview.GvRasterLayer.__init__(self, raster=None, creation_properties=None, _obj=None, rl_mode=0) # Create a raster layer.
    def gview.GvRasterLayer.add_height(self, height_raster) #  Adds height to raster layer for 3D effect.
    def gview.GvRasterLayer.alpha_get(self)
    def gview.GvRasterLayer.alpha_set(self, alpha_mode, alpha_check_val)
    def gview.GvRasterLayer.blend_mode_get(self)
    def gview.GvRasterLayer.blend_mode_set(self, mode, sfactor=0, dfactor=0) # Set blend mode
    def gview.GvRasterLayer.equalize(self) # Compute a histogram equalized source LUT, and apply.
    def gview.GvRasterLayer.get_const_value(self, isource) # Fetch source constant value
    def gview.GvRasterLayer.get_data(self, isource=0) # Fetch the GvRaster for a source.
    def gview.GvRasterLayer.get_mode(self) # Fetch the GvRasterLayer display mode.
    def gview.GvRasterLayer.launch_properties(self)
    def gview.GvRasterLayer.lut_color_wheel_1d_new(self, s=1.0, v=1.0, offset=0.0)
    def gview.GvRasterLayer.lut_color_wheel_new(self, h_mode, h_param, s_mode, s_param, v_mode, v_param) # Generate 2D LUT
    def gview.GvRasterLayer.lut_get(self) # Fetch the lut.
    def gview.GvRasterLayer.lut_put(self, lut=None) # Set the lut.
    def gview.GvRasterLayer.lut_type_get(self) # Fetch the LUT type.
    def gview.GvRasterLayer.max_get(self, isource) # Fetch the scaling maximum.
    def gview.GvRasterLayer.max_set(self, isource, max) # Set the scaling maximum.
    def gview.GvRasterLayer.min_get(self, isource) # Fetch the scaling minimum.
    def gview.GvRasterLayer.min_set(self, isource, min) # Set the scaling minimum.
    def gview.GvRasterLayer.set_source(self, isource, data, min=0, max=0, const_value=0, lut=None) # Set a data source
    def gview.GvRasterLayer.source_get_lut(self, isource=0) # Fetch the lut for a source
    def gview.GvRasterLayer.texture_clamp_set(self, s_mode, t_mode)
    def gview.GvRasterLayer.texture_mode_get(self)
    def gview.GvRasterLayer.texture_mode_set(self, texture_mode, color) # Set the texture mode.
    def gview.GvRasterLayer.zoom_get(self) # Fetch zoom mode
    def gview.GvRasterLayer.zoom_set(self, mag_mode, min_mode) # Set interpolation method

    # Inherited from gtk.GtkData
    def gtk.GtkData.__init__(self, _obj=None)

    # Inherited from gview.GvData
    def gview.GvData.__init__(self, _obj=None)
    def gview.GvData.changed(self) # Emit GvData changed signal.
    def gview.GvData.get_name(self) # Fetch the name of this GvData.
    def gview.GvData.get_parent(self) # Fetch parent GvData object.
    def gview.GvData.get_projection(self) # Fetch projection, if any.
    def gview.GvData.get_properties(self) # Get GvData properties (attributes) as a dictionary.
    def gview.GvData.get_property(self, name) # Get a GvData property.
    def gview.GvData.set_name(self, name) # Set the name of this GvData.
    def gview.GvData.set_projection(self, projection) # Set the projection.
    def gview.GvData.set_property(self, name, value) # Set a GvData property.

    # Inherited from gtk.GtkObject
    def gtk.GtkObject.__cmp__(self, other)
    def gtk.GtkObject.__getattr__(self, attr)
    def gtk.GtkObject.__getitem__(self, key)
    def gtk.GtkObject.__hash__(self)
    def gtk.GtkObject.__init__(self, _obj=None)
    def gtk.GtkObject.__setitem__(self, key, v)
    def gtk.GtkObject.connect(self, name, f, *extra)
    def gtk.GtkObject.connect(self, name, f, *extra)
    def gtk.GtkObject.connect_after(self, name, f, *extra)
    def gtk.GtkObject.connect_after(self, name, f, *extra)
    def gtk.GtkObject.connect_object(self, name, f, obj, *extra)
    def gtk.GtkObject.connect_object(self, name, f, obj, *extra)
    def gtk.GtkObject.connect_object_after(self, name, f, obj, *extra)
    def gtk.GtkObject.destroy(self, _obj=None)
    def gtk.GtkObject.disconnect(self, id)
    def gtk.GtkObject.emit(self, signal, *args)
    def gtk.GtkObject.emit_stop_by_name(self, sig)
    def gtk.GtkObject.flags(self, mask=None)
    def gtk.GtkObject.get_data(self, key)
    def gtk.GtkObject.remove_data(self, key)
    def gtk.GtkObject.set(self, dict)
    def gtk.GtkObject.set_data(self, key, value)
    def gtk.GtkObject.set_flags(self, flags)
    def gtk.GtkObject.signal_handler_block(self, id)
    def gtk.GtkObject.signal_handler_unblock(self, id)
    def gtk.GtkObject.signal_handlers_destroy(self)
    def gtk.GtkObject.unset_flags(self, flags)

    # Inherited from gview.GvLayer
    def gview.GvLayer.__init__(self, _obj=None)
    def gview.GvLayer.display_change(self) # Send a display property notification.
    def gview.GvLayer.extents(self) # Return extents of layer.
    def gview.GvLayer.is_visible(self) # Check if layer is visible.
    def gview.GvLayer.launch_properties(self) # Launch a properties panel for this layer.
    def gview.GvLayer.reproject(self, projection) # Attempt to change view projection.
    def gview.GvLayer.set_visible(self, visible) # Set layer visibility.

gview.GvRasterLayer.__init__(self, raster=None, creation_properties=None, _obj=None, rl_mode=0)

Create a raster layer.

raster
the primary GvRaster to which this layer is tied. It will be the GvData parent of this layer, and will be used to establish georeferencing, and other information. Internally this is known as the ``prototype-data''.
creation-properties
A list of (name, value) tuples with special creation options. Currently the only supported one is ('raw','yes') to avoid using affine or gcp based georeferencing information from the GvRaster.
rl_mode
One of the RLM modes (documented in get_mode()), or gview.RLM_AUTO meaning the layer type should be deduced from the passed GvRaster (the default).

gview.GvRasterLayer.add_height(self, height_raster)

Adds height to raster layer for 3D effect.

Georeferrencing information will be used to place height_raster with respect to layer.

height_raster
a GvRaster containing elevation information in a compatible georeferencing system with this raster layer.

gview.GvRasterLayer.blend_mode_set(self, mode, sfactor=0, dfactor=0)

Set blend mode

mode
0=off, non-0=on
sfactor
...
dfactor
...

gview.GvRasterLayer.equalize(self)

Compute a histogram equalized source LUT, and apply.

This method is not meaningful for RLM_COMPLEX layers, and will be ignored.

gview.GvRasterLayer.get_data(self, isource=0)

Fetch the GvRaster for a source.

Note that gview.RLM_SINGLE mode has one source (isource=0), gview.RLM_COMPLEX has one source, and gview.RLM_RGBA has four (red, green, blue and alpha). Any source may be None indicating that that source will use the constant value (see get_const_value()).

isource
the source index (from 0 to 3).

gview.GvRasterLayer.get_mode(self)

Fetch the GvRasterLayer display mode.

It will be one of gview.RLM_SINGLE (greyscale or pseudocolored raster band), gview.RLM_RGBA (RGBA composite from individual GvRaster bands), or gview.RLM_COMPLEX (complex GvRaster pseudocolored with 2D lookup table).

gview.GvRasterLayer.lut_color_wheel_new(self, h_mode, h_param, s_mode, s_param, v_mode, v_param)

Generate 2D LUT

Returns a lut suitable for applying to a RLM_COMPLEX layer with the lut_put() method. See gvrasterpropdlg.py for an example of use of this method.

h_mode
one of the RL_LUT_* values indicating the source of the hue component of the HLS color.
h_param
if h_mode is RL_LUT_SCALAR this should be the constant hue value between 0.0 and 1.0.
s_mode
one of the RL_LUT_* values indicating the source of the saturation component of the HLS color.
s_param
if s_mode is RL_LUT_SCALAR this should be the constant saturation value between 0.0 and 1.0.
v_mode
one of the RL_LUT_* values indicating the source of the value component of the HLS color.
v_param
if v_mode is RL_LUT_SCALAR this should be the constant value value between 0.0 and 1.0.

gview.GvRasterLayer.lut_get(self)

Fetch the lut.

The returned lut will be a string of 1024 bytes if 1D, or 262144 bytes if the lut is 2D. The data is stored in "RGBARGBA..." format.

gview.GvRasterLayer.lut_put(self, lut=None)

Set the lut.

This method will reset the compositing lut on a rasterlayer. The lut should be a string of 1024 bytes for a 1D LUT and 262144 bytes (as a String) for a 2D LUT. The array should be stored in "RGBARGBA..." format.

2D LUTs should only be applied to layers in RLM_COMPLEX mode, and 1D LUTs should only be applied to layers in RLM_SINGLE mode. It is an error to apply luts in any other case.

lut
the lut to set, stored as a string. None may be used to clear the lut.

gview.GvRasterLayer.lut_type_get(self)

Fetch the LUT type.

Returns one of RL_LUT_NONE, RL_LUT_1D, or RL_LUT_2D (defined in gvconst.py).

gview.GvRasterLayer.max_set(self, isource, max)

Set the scaling maximum.

This will trigger a redraw via the display-change signal if it changes the scaling value.

isource
the source index (from 0 to 3)
max
new maximum value for scaling.

gview.GvRasterLayer.min_set(self, isource, min)

Set the scaling minimum.

This will trigger a redraw via the display-change signal if it changes the scaling value.

isource
the source index (from 0 to 3)
min
new minimum value for scaling.

gview.GvRasterLayer.set_source(self, isource, data, min=0, max=0, const_value=0, lut=None)

Set a data source

Sets all the configuration information for one of the data sources of a layer. This method will trigger a display-change signal if any values are altered.

isource
the source index (from 0 to 3)
data
a GvRaster, or None if the source should be constant valued.
min
the minimum value to use for scaling this raster to the range 0-255. If min and max are defaulted they will be extracted from the raster.
max
the maximum value to use for scaling this raster to the range 0-255. If min and max are defaulted they will be extracted from the raster.
const_value
Constant value to use in place of data if data is None.
lut
Pre-compositing lookup table or None. If passed it must be a string of exactly 256 characters mapping input values to output values in the range 0-255.

gview.GvRasterLayer.source_get_lut(self, isource=0)

Fetch the lut for a source

This fetches the pre-compositing lut applied to a source. It will be None (if there isn't any in effect), or a String of 256 values between 0 and 255. Source lut's can only be set with GvRasterLayer.set_source().

isource
the source to fetch from.

gview.GvRasterLayer.texture_mode_set(self, texture_mode, color)

Set the texture mode.

The default mode is replace in which case the fragment color is ignored. In modulate mode the raster is modulated with the provided fragment color.

texture_mode
gview.RL_TEXTURE_REPLACE or gview.GL_TEXTURE_MODULATE
color
fragment color as an RGBA tuple.

gview.GvRasterLayer.zoom_get(self)

Fetch zoom mode

Returns the mag_mode, and min_mode interploation modes as a tuple. See also: zoom_set()

gview.GvRasterLayer.zoom_set(self, mag_mode, min_mode)

Set interpolation method

I believe mag_mode sets the interpolation mode when zooming in past 1:1 on a texture, and min_mode is the interpolation mode used for downsampling from the texture, but I am not sure. Both default to bilinear, and are normally changed together.

mag_mode
One of gview.RL_FILTER_BILINEAR or gview.RL_FILTER_NEAREST.
min_mode
One of gview.RL_FILTER_BILINEAR or gview.RL_FILTER_NEAREST.

gview.GvData.changed(self)

Emit GvData changed signal.

Send a notification that this data has changed, with a NULL change_info value.

gview.GvData.get_parent(self)

Fetch parent GvData object.

This is typically used to get the underlying GvData on which a GvLayer (which is also a GvData) depends.

gview.GvData.get_projection(self)

Fetch projection, if any.

The projection is normally expressed in OpenGIS Well Known Text format or an empty string if no value is available.

gview.GvData.get_properties(self)

Get GvData properties (attributes) as a dictionary.

The properties are returned as a Python dictionary. Note that changes to this dictionary are not applied back to the GvData.

gview.GvData.get_property(self, name)

Get a GvData property.

name
the key or name of the property being set. Should be a well behaved token (no spaces, equal signs, or colons).

NOTE: Returns None if property does not exist.

gview.GvData.set_projection(self, projection)

Set the projection.

This method won't actually modify the data geometry, only the interpretation of the geometry.

gview.GvData.set_property(self, name, value)

Set a GvData property.

name
the key or name of the property being set. Should be a well behaved token (no spaces, equal signs, or colons).
value
the value to be assigned. Any text is acceptable.

gview.GvLayer.extents(self)

Return extents of layer.

The extents are returned as a tuple (xmin,ymin,xmax,ymax).

gview.GvLayer.launch_properties(self)

Launch a properties panel for this layer.

Returns the dialog object, or None if none can be created.

gview.GvLayer.reproject(self, projection)

Attempt to change view projection.

Currently this only works for rasters, but eventually it will modify the display projection of any kind of GvLayer.

Returns 0 on failure, or non-zero on success.


Valid HTML 4.0! Made with CSS