41 light[i].
RGBvalue << guiLight[i].value<QColor>().redF();
42 light[i].
RGBvalue << guiLight[i].value<QColor>().greenF();
43 light[i].
RGBvalue << guiLight[i].value<QColor>().blueF();
50 m = cos( inclination *
M_PI / 180);
91 lightVector.normalize();
119 const quint8 totalChannels = 3;
120 qreal computation[] = {0, 0, 0};
128 for (
int i = 0; i <
size; i++) {
131 for (channel = 0; channel < totalChannels; channel++) {
133 computation[channel] +=
Ia;
137 for (channel = 0; channel < totalChannels; channel++) {
141 computation[channel] +=
Id;
148 for (channel = 0; channel < totalChannels; channel++) {
152 computation[channel] +=
Is;
157 for (channel = 0; channel < totalChannels; channel++) {
158 if (computation[channel] > 1)
159 computation[channel] = 1;
160 if (computation[channel] < 0)
161 computation[channel] = 0;
165 finalPixel[2] = quint16(computation[0] * 0xFFFF);
166 finalPixel[1] = quint16(computation[1] * 0xFFFF);
167 finalPixel[0] = quint16(computation[2] * 0xFFFF);
qreal Kd
Diffuse light coefficient.
void setLightVector(QVector3D light_vector)
qreal Ks
Specular light coefficient.
qreal shiny_exp
Shinyness exponent.
qreal Is
Total specular light.
QVector< quint16 > IlluminatePixelFromHeightmap(quint32 posup, quint32 posdown, quint32 posleft, quint32 posright)
bool diffuseLightIsEnabled
QVector3D reflection_vector
qreal Ia
Total ambient light.
qreal Id
Total diffuse light.
qreal Ka
Ambient light coefficient.
QVector< quint16 > IlluminatePixel()
PhongPixelProcessor(quint32 pixelArea, const KisPropertiesConfigurationSP config)
QVector< double > realheightmap
void initialize(const KisPropertiesConfigurationSP config)
quint8 size
Size of this stuff.
bool specularLightIsEnabled
QVector< quint16 > IlluminatePixelFromNormalmap(qreal r, qreal g, qreal b)
QList< Illuminant > lightSources
Light sources to use (those disabled in the GUI are not present here)
const QString PHONG_SPECULAR_REFLECTIVITY_IS_ENABLED
const QString PHONG_DIFFUSE_REFLECTIVITY_IS_ENABLED
const QString PHONG_ILLUMINANT_AZIMUTH[]
const QString PHONG_ILLUMINANT_INCLINATION[]
const QString PHONG_ILLUMINANT_COLOR[]
const quint8 PHONG_TOTAL_ILLUMINANTS
const QString PHONG_SHINYNESS_EXPONENT
const QString PHONG_DIFFUSE_REFLECTIVITY
const QString PHONG_ILLUMINANT_IS_ENABLED[]
const QString PHONG_SPECULAR_REFLECTIVITY
const QString PHONG_AMBIENT_REFLECTIVITY