29 name( theName ), visibleName( theVisibleName ), rendererCreateFunction( rendererFunction ),
30 widgetCreateFunction( widgetFunction )
75 if ( !
mEntries.contains( rendererName ) )
79 mEntries[rendererName].widgetCreateFunction = func;
84 QHash< QString, QgsRasterRendererRegistryEntry >::const_iterator it =
mEntries.find( rendererName );
100 QList< QgsRasterRendererRegistryEntry > result;
102 QHash< QString, QgsRasterRendererRegistryEntry >::const_iterator it =
mEntries.constBegin();
103 for ( ; it !=
mEntries.constEnd(); ++it )
105 result.push_back( it.value() );
112 if ( !provider || provider->
bandCount() < 1 )
119 switch ( theDrawingStyle )
124 QList<QgsColorRampShader::ColorRampItem> colorEntries = provider->
colorTable( grayBand );
127 int colorArraySize = 0;
128 QList<QgsColorRampShader::ColorRampItem>::const_iterator colorIt = colorEntries.constBegin();
129 for ( ; colorIt != colorEntries.constEnd(); ++colorIt )
131 if ( colorIt->value > colorArraySize )
133 colorArraySize = ( int )( colorIt->value );
138 QColor* colorArray =
new QColor[ colorArraySize ];
139 colorIt = colorEntries.constBegin();
140 for ( ; colorIt != colorEntries.constEnd(); ++colorIt )
142 colorArray[( int )( colorIt->value )] = colorIt->color;
179 int redBand = s.value(
"/Raster/defaultRedBand", 1 ).toInt();
180 if ( redBand < 0 || redBand > provider->
bandCount() )
184 int greenBand = s.value(
"/Raster/defaultGreenBand", 2 ).toInt();
185 if ( greenBand < 0 || greenBand > provider->
bandCount() )
189 int blueBand = s.value(
"/Raster/defaultBlueBand", 3 ).toInt();
190 if ( blueBand < 0 || blueBand > provider->
bandCount() )
208 int bandCount = renderer->
usesBands().size();
209 if ( bandCount == 1 )
211 QList<QgsRasterTransparency::TransparentSingleValuePixel> transparentSingleList;
214 else if ( bandCount == 3 )
216 QList<QgsRasterTransparency::TransparentThreeValuePixel> transparentThreeValueList;
234 if ( s.value(
"/Raster/useStandardDeviation",
false ).toBool() )
238 double stdDevFactor = s.value(
"/Raster/defaultStandardDeviation", 2.0 ).toDouble();
239 double diff = stdDevFactor * stats.
stdDev;
240 minValue = stats.
mean - diff;
241 maxValue = stats.
mean + diff;