~ubuntu-branches/ubuntu/precise/koffice/precise

« back to all changes in this revision

Viewing changes to krita/plugins/colorspaces/ctlcs/tests/KoCtlChannelTest.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2010-10-27 17:52:57 UTC
  • mfrom: (0.12.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20101027175257-s04zqqk5bs8ckm9o
Tags: 1:2.2.83-0ubuntu1
* Merge with Debian git remaining changes:
 - Add build-deps on librcps-dev, opengtl-dev, libqtgtl-dev, freetds-dev,
   create-resources, libspnav-dev
 - Remove needless build-dep on libwv2-dev
 - koffice-libs recommends create-resources
 - krita recommends pstoedit
 - Keep our patches
* New upstream release 2.3 beta 3
  - Remove debian/patches fixed by upstream
  - Update install files

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
    quint8 rgbu81[3];
36
36
    c8.singleChannelPixel(rgbu81, rgbu8);
37
37
    QCOMPARE(rgbu81[1], rgbu8[1]);
38
 
    c8.scaleFromF32(rgbu8, 0.5);
 
38
    c8.scaleFromF32(rgbu8, 127.0/255.0);
39
39
    QCOMPARE(rgbu8[0], quint8(100));
40
40
    QCOMPARE(rgbu8[1], quint8(127));
41
41
    QCOMPARE(rgbu8[2], quint8(200));
46
46
 
47
47
    float rgbf32[] = { 1.0, 0.12, -1.0 };
48
48
    quint8* rgbf32_ptr = reinterpret_cast<quint8*>(rgbf32);
49
 
    KoCtlChannelImpl<float> c32(4, 3 * sizeof(quint8));
 
49
    KoCtlChannelImpl<float> c32(4, 3 * sizeof(float));
50
50
    QCOMPARE(c32.channelValueText(rgbf32_ptr), QString("0.12"));
51
51
    QCOMPARE(c32.normalisedChannelValueText(rgbf32_ptr), QString("0.12"));
52
 
    QCOMPARE(c32.scaleToU8(rgbf32_ptr), quint8(0.12 * 0xFF));
 
52
    QCOMPARE(c32.scaleToU8(rgbf32_ptr), quint8(float2int(0.12 * 255)));
53
53
    QCOMPARE(c32.scaleToU16(rgbf32_ptr), quint16(0.12 * 0xFFFF));
54
54
    QCOMPARE(c32.scaleToF32(rgbf32_ptr), 0.12f);
55
55
    float rgbf321[3];