~vorlon/ubuntu/oneiric/lcms/multiarch

« back to all changes in this revision

Viewing changes to src/cmspack.c

  • Committer: Bazaar Package Importer
  • Author(s): Oleksandr Moskalenko
  • Date: 2007-04-12 16:48:49 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070412164849-a5h7vxb1bzjdqg1t
Tags: 1.16-3
Revert liblcms1-dev file location from /usr/include/liblcms1 to
/usr/include before people start complaining about FTBFS bugs in other
packages. Temporarily remove python-liblcms to avoid NEW queue.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
//  Little cms
2
 
//  Copyright (C) 1998-2005 Marti Maria
 
2
//  Copyright (C) 1998-2006 Marti Maria
3
3
//
4
4
// Permission is hereby granted, free of charge, to any person obtaining 
5
5
// a copy of this software and associated documentation files (the "Software"), 
610
610
 
611
611
 
612
612
 
 
613
static
 
614
LPBYTE UnrollDouble1Chan(register _LPcmsTRANSFORM info, register WORD wIn[], register LPBYTE accum)
 
615
{
 
616
    double* Inks = (double*) accum;
 
617
    double v;
 
618
        
 
619
        
 
620
        v = floor(Inks[0] * 65535.0 + 0.5);
 
621
        
 
622
        if (v > 65535.0) v = 65535.0;
 
623
        if (v < 0) v = 0;
 
624
        
 
625
        
 
626
        wIn[0] = wIn[1] = wIn[2] = (WORD) v;
 
627
    
 
628
    return accum + sizeof(double);    
 
629
}
 
630
 
 
631
 
613
632
// ----------------------------------------------------------- Packing routines
614
633
 
615
634
 
1318
1337
       else
1319
1338
           cmsLabEncoded2Float((LPcmsCIELab) output, wOut);
1320
1339
 
1321
 
        output += sizeof(cmsCIELab);
1322
 
    
1323
 
        return output;
 
1340
        return output + (sizeof(cmsCIELab) + T_EXTRA(Info ->OutputFormat) * sizeof(double));            
1324
1341
    }
1325
1342
 
1326
1343
}
1344
1361
    }
1345
1362
    else {
1346
1363
 
1347
 
    cmsXYZEncoded2Float((LPcmsCIEXYZ) output, wOut);
1348
 
    output += sizeof(cmsCIEXYZ);
1349
 
 
1350
 
    return output;
 
1364
        cmsXYZEncoded2Float((LPcmsCIEXYZ) output, wOut);
 
1365
        
 
1366
        return output + (sizeof(cmsCIEXYZ) + T_EXTRA(Info ->OutputFormat) * sizeof(double));
1351
1367
    }
1352
1368
}
1353
1369
 
1460
1476
           case PT_HSV:
1461
1477
           case PT_HLS:
1462
1478
           case PT_Yxy: 
1463
 
                    FromInput = UnrollDouble;
 
1479
                                if (T_CHANNELS(dwInput) == 1)
 
1480
                                                FromInput = UnrollDouble1Chan;
 
1481
                                        else
 
1482
                                                FromInput = UnrollDouble;
1464
1483
                    break;
1465
1484
 
1466
1485
            // Inks (%) 0.0 .. 100.0
2026
2045
{
2027
2046
    _LPcmsTRANSFORM xform = (_LPcmsTRANSFORM) (LPSTR) hTransform;
2028
2047
    
2029
 
    *Input =  (cmsFORMATTER) xform ->FromInput;
2030
 
    *InputFormat = xform -> InputFormat;
2031
 
    *Output = (cmsFORMATTER) xform ->ToOutput;
2032
 
    *OutputFormat = xform -> OutputFormat;
 
2048
    if (Input)        *Input =  (cmsFORMATTER) xform ->FromInput;
 
2049
    if (InputFormat)  *InputFormat = xform -> InputFormat;
 
2050
    if (Output)       *Output = (cmsFORMATTER) xform ->ToOutput;
 
2051
    if (OutputFormat) *OutputFormat = xform -> OutputFormat;
2033
2052
}
2034
2053
 
2035
2054
 
2042
2061
 
2043
2062
    cmsSetUserFormatters(hTransform, 
2044
2063
                        dwInputFormat,
2045
 
                        (cmsFORMATTER) _cmsIdentifyInputFormat((_LPcmsTRANSFORM ) hTransform, dwInputFormat),
 
2064
                        (cmsFORMATTER) _cmsIdentifyInputFormat((_LPcmsTRANSFORM) hTransform, dwInputFormat),
2046
2065
                        dwOutputFormat,
2047
 
                        (cmsFORMATTER) _cmsIdentifyOutputFormat((_LPcmsTRANSFORM ) hTransform, dwOutputFormat));
 
2066
                        (cmsFORMATTER) _cmsIdentifyOutputFormat((_LPcmsTRANSFORM) hTransform, dwOutputFormat));
2048
2067
}