[Digikam-devel] extragear/graphics/digikamimageplugins/infrared
Gilles Caulier
caulier.gilles at free.fr
Wed Mar 8 11:54:13 GMT 2006
SVN commit 516724 by cgilles:
digikam from trunk : Infrared film sensitivity escursion can be set from 200 to 2600 :
- 200..800 : we trying to reproduce Ilford SFX200 infrared film.
- Over 800 : we trying to reproduce Kodak HIE hight speed infrared film.
You can see IR film comparison at this URL :
http://www.pauck.de/marco/photo/infrared/comparison_of_films/comparison_of_films.html
CCMAIL: digikam-devel at kde.org
M +8 -7 imageeffect_infrared.cpp
M +15 -12 infrared.cpp
--- trunk/extragear/graphics/digikamimageplugins/infrared/imageeffect_infrared.cpp #516723:516724
@@ -85,18 +85,19 @@
QGridLayout* gridSettings = new QGridLayout( gboxSettings, 2, 1, marginHint(), spacingHint());
QLabel *label1 = new QLabel(i18n("Sensibility (ISO):"), gboxSettings);
- m_sensibilitySlider = new QSlider(1, 7, 1, 1, Qt::Horizontal, gboxSettings);
+ m_sensibilitySlider = new QSlider(1, 25, 1, 1, Qt::Horizontal, gboxSettings);
m_sensibilitySlider->setTracking ( false );
m_sensibilitySlider->setTickInterval(1);
m_sensibilitySlider->setTickmarks(QSlider::Below);
- m_sensibilityLCDValue = new QLCDNumber (3, gboxSettings);
+ m_sensibilityLCDValue = new QLCDNumber (4, gboxSettings);
m_sensibilityLCDValue->setSegmentStyle ( QLCDNumber::Flat );
m_sensibilityLCDValue->display( QString::number(200) );
whatsThis = i18n("<p>Set here the ISO-sensitivity of the simulated infrared film. "
"Increasing this value will increase the portion of green color in the mix. "
"It will also increase the halo effect on the hightlights, and the film "
- "graininess (if the box is checked).");
+ "graininess (if the box is checked).</p>"
+ "<p>Note: to simulate an <b>Ilford SFX200</b> infrared film, use a sensibility excursion of 200 to 800. A sensibility over 800 simulate <b>Kodak HIE</b> hight speed infrared film. This last one give more dramastic photograph style.</p>");
QWhatsThis::add( m_sensibilityLCDValue, whatsThis);
QWhatsThis::add( m_sensibilitySlider, whatsThis);
@@ -160,8 +161,8 @@
m_sensibilitySlider->setEnabled(false);
Digikam::DImg image = m_imagePreviewWidget->getOriginalRegionImage();
- int s = 100 + 100 * m_sensibilitySlider->value();
- bool g = m_addFilmGrain->isChecked();
+ int s = 100 + 100 * m_sensibilitySlider->value();
+ bool g = m_addFilmGrain->isChecked();
m_threadedFilter = dynamic_cast<Digikam::DImgThreadedFilter *>(new Infrared(&image, this, s, g));
}
@@ -171,8 +172,8 @@
m_addFilmGrain->setEnabled(false);
m_sensibilitySlider->setEnabled(false);
- int s = 100 + 100 * m_sensibilitySlider->value();
- bool g = m_addFilmGrain->isChecked();
+ int s = 100 + 100 * m_sensibilitySlider->value();
+ bool g = m_addFilmGrain->isChecked();
Digikam::ImageIface iface(0, 0);
--- trunk/extragear/graphics/digikamimageplugins/infrared/infrared.cpp #516723:516724
@@ -21,8 +21,6 @@
*
* ============================================================ */
-#define INT_MULT(a,b,t) ((t) = (a) * (b) + 0x80, ((((t) >> 8) + (t)) >> 8))
-
// C++ includes.
#include <cmath>
@@ -56,8 +54,6 @@
// This method is based on the Simulate Infrared Film tutorial from GimpGuru.org web site
// available at this url : http://www.gimpguru.org/Tutorials/SimulatedInfrared/
-//#define INT_MULT(a,b,t) ((t) = (a) * (b) + 0x80, ( ( (t >> 8) + t ) >> 8))
-
inline static int intMult8(uint a, uint b)
{
uint t = a * b + 0x80;
@@ -70,28 +66,35 @@
return ((t >> 16) + t) >> 16;
}
+/* More info about IR film can be seen at this url :
+
+http://www.pauck.de/marco/photo/infrared/comparison_of_films/comparison_of_films.html
+*/
+
void Infrared::infraredImage(Digikam::DImg *orgImage, int Sensibility, bool Grain)
{
- // Sensibility: 200..800
+ // Sensibility: 200..2600
if (Sensibility <= 0) return;
- int Width = orgImage->width();
- int Height = orgImage->height();
- int bytesDepth = orgImage->bytesDepth();
- uint numBytes = orgImage->numBytes();
+ int Width = orgImage->width();
+ int Height = orgImage->height();
+ int bytesDepth = orgImage->bytesDepth();
+ uint numBytes = orgImage->numBytes();
bool sixteenBit = orgImage->sixteenBit();
- uchar* data = orgImage->bits();
+ uchar* data = orgImage->bits();
// Infrared film variables depending on Sensibility.
- // This way try to reproduce famous Ilford SFX200 infrared film
+ // We can reproduce famous Ilford SFX200 infrared film
// http://www.ilford.com/html/us_english/prod_html/sfx200/sfx200.html
- // Note : this film have a sensibility escursion from 200 to 800 ISO.
+ // This film have a sensibility escursion from 200 to 800 ISO.
+ // Over 800 ISO, we reproduce The Kodak HIE hight speed infrared film.
// Infrared film grain.
int Noise = (Sensibility + 3000) / 10;
if (sixteenBit)
Noise = (Noise + 1) * 256 - 1;
+
int blurRadius = (int)((Sensibility / 200.0) + 1.0); // Gaussian blur infrared hightlight effect
// [2 to 5].
float greenBoost = 2.1 - (Sensibility / 2000.0); // Infrared green color boost [1.7 to 2.0].
More information about the Digikam-devel
mailing list