示例#1
0
void BWSepiaFilter::applyInfraredFilter(DImg& img, int sensibility)
{
    InfraredContainer settings;
    settings.sensibility = sensibility;
    settings.redGain     = d->redMult   + d->redMult * d->redAttn;
    settings.greenGain   = d->greenMult + d->greenMult * d->greenAttn;
    settings.blueGain    = d->blueMult  + d->blueMult * d->blueAttn;
    InfraredFilter infra(&img, 0L, settings);
    infra.startFilterDirectly();
    img.putImageData(infra.getTargetImage().bits());
}
示例#2
0
void BWSepiaFilter::applyToneFilter(DImg& img, TonalityContainer& settings)
{
    // Value to multiply RGB 8 bits component of mask used by TonalityFilter.
    int mul            = img.sixteenBit() ? 255 : 1;
    settings.redMask   = settings.redMask   * mul;
    settings.greenMask = settings.greenMask * mul;
    settings.blueMask  = settings.blueMask  * mul;
    TonalityFilter tone(&img, 0L, settings);
    tone.startFilterDirectly();
    img.putImageData(tone.getTargetImage().bits());
}
示例#3
0
void BWSepiaFilter::applyChannelMixer(DImg& img)
{
    MixerContainer settings;
    settings.bMonochrome    = true;
    settings.blackRedGain   = d->redMult   + d->redMult * d->redAttn;
    settings.blackGreenGain = d->greenMult + d->greenMult * d->greenAttn;
    settings.blackBlueGain  = d->blueMult  + d->blueMult * d->blueAttn;
    MixerFilter mixer(&img, 0L, settings);
    mixer.startFilterDirectly();
    img.putImageData(mixer.getTargetImage().bits());
}