Skip to content

Commit

Permalink
Update qgsrasterlayer.sip.in
Browse files Browse the repository at this point in the history
  • Loading branch information
DelazJ authored and nyalldawson committed Jan 21, 2020
1 parent 899feee commit 27da26b
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions python/core/auto_generated/raster/qgsrasterlayer.sip.in
Expand Up @@ -21,20 +21,20 @@ onto the mapcanvas.
The qgsrasterlayer class makes use of gdal for data io, and thus supports
any gdal supported format. The constructor attempts to infer what type of
file (LayerType) is being opened - not in terms of the file format (tif, ascii grid etc.)
but rather in terms of whether the image is a GRAYSCALE, PaletteD or Multiband,
but rather in terms of whether the image is a GRAYSCALE, PaletteD or Multiband.

Within the three allowable raster layer types, there are 8 permutations of
how a layer can actually be rendered. These are defined in the DrawingStyle enum
and consist of:

SingleBandGray -> a GRAYSCALE layer drawn as a range of gray colors (0-255)
SingleBandPseudoColor -> a GRAYSCALE layer drawn using a pseudocolor algorithm
PalettedSingleBandGray -> a PaletteD layer drawn in gray scale (using only one of the color components)
PalettedSingleBandPseudoColor -> a PaletteD layer having only one of its color components rendered as pseudo color
PalettedMultiBandColor -> a PaletteD image where the bands contains 24bit color info and 8 bits is pulled out per color
MultiBandSingleBandGray -> a layer containing 2 or more bands, but using only one band to produce a grayscale image
MultiBandSingleBandPseudoColor -> a layer containing 2 or more bands, but using only one band to produce a pseudocolor image
MultiBandColor -> a layer containing 2 or more bands, mapped to the three RGBcolors. In the case of a multiband with only two bands, one band will have to be mapped to more than one color
- SingleBandGray -> a GRAYSCALE layer drawn as a range of gray colors (0-255)
- SingleBandPseudoColor -> a GRAYSCALE layer drawn using a pseudocolor algorithm
- PalettedSingleBandGray -> a PaletteD layer drawn in gray scale (using only one of the color components)
- PalettedSingleBandPseudoColor -> a PaletteD layer having only one of its color components rendered as pseudo color
- PalettedMultiBandColor -> a PaletteD image where the bands contains 24bit color info and 8 bits is pulled out per color
- MultiBandSingleBandGray -> a layer containing 2 or more bands, but using only one band to produce a grayscale image
- MultiBandSingleBandPseudoColor -> a layer containing 2 or more bands, but using only one band to produce a pseudocolor image
- MultiBandColor -> a layer containing 2 or more bands, mapped to the three RGBcolors. In the case of a multiband with only two bands, one band will have to be mapped to more than one color

Each of the above mentioned drawing styles is implemented in its own draw* function.
Some of the drawing styles listed above require statistics about the layer such
Expand All @@ -55,7 +55,7 @@ so the rasterlayer class appends the band number in brackets behind each band na

Sample usage of the QgsRasterLayer class:

In order to automate redrawing of a raster layer, you should link it to a map canvas like this :
In order to automate redrawing of a raster layer, you should link it to a map canvas like this:

Once a layer has been created you can find out what type of layer it is (GrayOrUndefined, Palette or Multiband):

Expand Down Expand Up @@ -127,15 +127,15 @@ This is the constructor for the RasterLayer class.

The main tasks carried out by the constructor are:

-Load the rasters default style (.qml) file if it exists
- Load the rasters default style (.qml) file if it exists

-Populate the RasterStatsVector with initial values for each band.
- Populate the RasterStatsVector with initial values for each band.

-Calculate the layer extents
- Calculate the layer extents

-Determine whether the layer is gray, paletted or multiband.
- Determine whether the layer is gray, paletted or multiband.

-Assign sensible defaults for the red, green, blue and gray bands.
- Assign sensible defaults for the red, green, blue and gray bands.
%End

~QgsRasterLayer();
Expand Down

0 comments on commit 27da26b

Please sign in to comment.