*magick_restrict k;
register const Quantum
- *magick_restrict pixels;
+ *magick_restrict pixels,
+ *magick_restrict quantum_pixels;
register ssize_t
u;
continue;
}
pixels=p;
+ quantum_pixels=(const Quantum *) NULL;
maximum=0.0;
minimum=(double) QuantumRange;
switch (method)
intensity=(double) GetPixelIntensity(image,pixels);
if (intensity < minimum)
{
+ quantum_pixels=pixels;
pixel=(double) pixels[i];
minimum=intensity;
}
if (intensity > maximum)
{
pixel=(double) pixels[i];
+ quantum_pixels=pixels;
maximum=intensity;
}
count++;
gamma=PerceptibleReciprocal(gamma);
if (count != 0)
gamma*=(double) kernel->height*kernel->width/count;
- SetPixelChannel(morphology_image,channel,ClampToQuantum(gamma*pixel),q);
+ if (quantum_pixels != (const Quantum *) NULL)
+ SetPixelChannel(morphology_image,channel,quantum_pixels[i],q);
+ else
+ SetPixelChannel(morphology_image,channel,ClampToQuantum(gamma*pixel),
+ q);
}
p+=GetPixelChannels(image);
q+=GetPixelChannels(morphology_image);