~ubuntu-branches/ubuntu/saucy/digikam/saucy

« back to all changes in this revision

Viewing changes to libs/dimg/dcolorcomposer.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2010-12-21 23:19:11 UTC
  • mfrom: (1.2.33 upstream) (3.1.7 experimental)
  • Revision ID: james.westby@ubuntu.com-20101221231911-z9jip7s5aht1jqn9
Tags: 2:1.7.0-1ubuntu1
* Merge from Debian Experimental. Remaining Ubuntu changes:
  - Export .pot name and copy to plugins in debian/rules
  - Version build-depends on kipi-plugins-dev to ensure build is against the
    same version on all archs
* Drop debian/patches/kubuntu_01_linker.diff, incoporated upstream
* Remove patches directory and unused patches

Show diffs side-by-side

added added

removed removed

Lines of Context:
136
136
    // preserve src alpha value for dest blending,
137
137
    // src.alpha() will be changed after blending src
138
138
    int sa = src.alpha();
 
139
 
139
140
    if (dest.sixteenBit())
140
141
    {
141
142
        src.blendAlpha16(sa);
284
285
void DColorComposerPorterDuffDstIn::compose(DColor& dest, DColor src)
285
286
{
286
287
    int sa = src.alpha();
 
288
 
287
289
    if (dest.sixteenBit())
288
290
    {
289
291
        src.blendZero();
341
343
void DColorComposerPorterDuffDstOut::compose(DColor& dest, DColor src)
342
344
{
343
345
    int sa = src.alpha();
 
346
 
344
347
    if (dest.sixteenBit())
345
348
    {
346
349
        src.blendZero();
370
373
void DColorComposerPorterDuffSrcAtop::compose(DColor& dest, DColor src)
371
374
{
372
375
    int sa = src.alpha();
 
376
 
373
377
    if (dest.sixteenBit())
374
378
    {
375
379
        src.blendAlpha16(dest.alpha());
399
403
void DColorComposerPorterDuffDstAtop::compose(DColor& dest, DColor src)
400
404
{
401
405
    int sa = src.alpha();
 
406
 
402
407
    if (dest.sixteenBit())
403
408
    {
404
409
        src.blendInvAlpha16(dest.alpha());
428
433
void DColorComposerPorterDuffXor::compose(DColor& dest, DColor src)
429
434
{
430
435
    int sa = src.alpha();
 
436
 
431
437
    if (dest.sixteenBit())
432
438
    {
433
439
        src.blendInvAlpha16(dest.alpha());
455
461
void DColorComposer::compose(DColor& dest, DColor src, DColorComposer::MultiplicationFlags multiplicationFlags)
456
462
{
457
463
    if (multiplicationFlags & PremultiplySrc)
 
464
    {
458
465
        src.premultiply();
 
466
    }
 
467
 
459
468
    if (multiplicationFlags & PremultiplyDst)
 
469
    {
460
470
        dest.premultiply();
 
471
    }
461
472
 
462
473
    compose(dest, src);
463
474
 
464
475
    if (multiplicationFlags & DemultiplyDst)
 
476
    {
465
477
        dest.demultiply();
 
478
    }
466
479
}
467
480
 
468
 
DColorComposer *DColorComposer::getComposer(DColorComposer::CompositingOperation rule)
 
481
DColorComposer* DColorComposer::getComposer(DColorComposer::CompositingOperation rule)
469
482
{
470
 
    switch(rule)
 
483
    switch (rule)
471
484
    {
472
485
        case PorterDuffNone:
473
486
            return new DColorComposerPorterDuffNone;
494
507
        case PorterDuffXor:
495
508
            return new DColorComposerPorterDuffDstOut;
496
509
    }
 
510
 
497
511
    return 0;
498
512
}
499
513