Commit 290c81bf authored by Wolthera van Hövell's avatar Wolthera van Hövell 🛍

Merge in Krita-testing-wolthera

Make a clean build for best results!

Squashed commit of the following:

commit fdc03dbfd47d8071303bd4c58394d70b58ab1f4e
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Sun Jan 31 15:16:37 2016 +0100

    Cleanup

    This introduces a little bug in the trc again, but I suposse this works for now.

commit c42e5c93cd9f33dc92927100c5aa47c5d8814b8b
Merge: 4b5806d c2706b36
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Sun Jan 31 12:45:40 2016 +0100

    Merge branch 'master' into krita-testing-wolthera

commit 4b5806d06ce7c7ad06245489355f4e0f5573f0b7
Merge: 5f4ae5e 97a2851e
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Sat Jan 30 17:25:57 2016 +0100

    Merge branch 'master' into krita-testing-wolthera

commit 5f4ae5e01ec4596172908502fff048ff10ff41a2
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Sat Jan 30 16:04:59 2016 +0100

    Make the trc curve widget work for cmyk

commit 95ba47ebe0b1a5394621ef82c7e280746b9c42d4
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Sat Jan 30 16:04:16 2016 +0100

    Fix build

commit a814301c23ff75b88808038729455805ce1d7005
Merge: 2089d33 1a0554c9
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Fri Jan 29 08:41:00 2016 +0100

    Merge branch 'master' into krita-testing-wolthera

commit 2089d335a7f5b928edf5d3245268bf2e49d2ac46
Merge: 597780c 96d2211
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Fri Jan 29 08:37:28 2016 +0100

    Merge branch 'krita-testing-wolthera' of git://anongit.kde.org/krita into krita-testing-wolthera

commit 96d22115b4006cf0be51d9525c9c4bd43c879bcd
Merge: 952bbc6 7d1d542f
Author: Wolthera van Hovell tot Westerflier <griffinvalley@gmail.com>
Date:   Sat Jan 23 12:05:09 2016 +0100

    Merge branch 'master' into krita-testing-wolthera

commit 597780c56793abb5d7e140aae1708bb37226b9f3
Merge: 952bbc6 7167c6be
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Thu Jan 14 20:08:23 2016 +0100

    Merge branch 'master' into krita-testing-wolthera

commit 952bbc6e41eff0cb726ac92d2c9ac22b3e632487
Merge: 35fe231 d592d520
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Thu Jan 14 16:49:15 2016 +0100

    Merge branch 'master' into krita-testing-wolthera

commit 35fe23104a7f41c823eb22bcdd43791ad9f12001
Merge: 36b940c 30c07ba8
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Thu Jan 14 14:30:57 2016 +0100

    Merge branch 'master' into krita-testing-wolthera

commit 36b940ca0dc4c334ecf8ed65422e0e6f9c48622a
Merge: 028a00f 8089c94e
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Tue Jan 12 18:55:54 2016 +0100

    Merge branch 'master' into krita-testing-wolthera

commit 028a00f84c7431f9a31c08e3f1545d3d47d155b8
Merge: c31a412 fe9c554a
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Tue Jan 12 14:21:42 2016 +0100

    Merge branch 'master' into krita-testing-wolthera

commit c31a412d2baf4dba97760e44c03895f89fe0cedb
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Sun Jan 10 19:16:37 2016 +0100

    Make some small changes to get cmyk/lab f32 to show up somewhat sensibly.

    ref T210

commit 9a466509d349a7077468bc6b30a899bb3df66bde
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Sun Jan 10 16:40:32 2016 +0100

    Draw semi-transparent triangle for the matrix-shapers.

    Still not sure if we should keep the gamut dots on there or not...

commit d1614f470e094b278d2c34eca66d448523b81e38
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Sun Jan 10 15:04:42 2016 +0100

    Display embedded copyright string.

    This is not translator friendly, but I think copyright is important enough for that.

    Ref T210

commit 1739e7d010089e8c61489d586a5ecfb122c88787
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Sun Jan 10 12:14:09 2016 +0100

    Change method to use normalised channels. Also fixes crash in XYZA 32bit/float

    Not sure what to do for 32bitfloat in case of LAB and CMYK.

    Ref T429, T210

commit f9cbaa135e449864ca4298a7f3c9f34187c68fcf
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Sat Jan 9 21:56:33 2016 +0100

    Add gamut point calculation thingy.

    This allows us to investigate CMYK and other cLUT only colorspaces in the colorspace browser.
    Also good for future gamut checking.

    Things that don't work:
    * Anything but 8bit colorspace, proly due to architecture stuffs. Maybe use from normalised instead
    of quint8 data...
    * Matrix profiles still default to relative colorimetric, which is kinda annoying
    * Need to investigate how to get the correct conversion flags over.
    * XYZA32bit float doesnt work...?

    Other:
    * Need to clean up
    * Need to check if I can get whitepoint/colorants simplified into the cs.
    * Need to see if this is also possible for the trc.
    * Maybe investigate boundary-checking-thingy for CMYK.

    Ref T429

commit 8680486f3c64b9d6ebf4f175b8ca776120d64c1e
Merge: 613e10c 31aebe61
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Wed Jan 6 14:11:35 2016 +0100

    Merge branch 'master' into krita-testing-wolthera

commit 613e10c8888abd11467d9176a7b00109d5cfa981
Merge: c8e2959 6131b4c5
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Tue Jan 5 18:48:00 2016 +0100

    Merge branch 'master' into krita-testing-wolthera

commit c8e29598d95f69d724727f9ad9dd07c2f98e0eba
Merge: 49fa9f3 b378feaf
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Mon Jan 4 19:30:52 2016 +0100

    Merge branch 'master' into krita-testing-wolthera

commit 49fa9f3ed2a31f4b1b8bfb7000aac0735e8cb503
Merge: d79d158 68e74a59
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Tue Dec 22 22:46:55 2015 +0100

    Merge branch 'master' into krita-testing-wolthera

commit d79d158aa4960a849fcf235648b800c29fed78e3
Merge: c060d02 c87f8eb0
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Tue Dec 22 21:12:16 2015 +0100

    Merge branch 'master' into krita-testing-wolthera

commit c060d0261ea6e8ed0ba85e88d080dc01ce12cf60
Merge: 8cdac6d eb65d912
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Mon Dec 21 22:02:04 2015 +0100

    Merge branch 'master' into krita-testing-wolthera

commit 8cdac6d644237f1491623c9fb8520e55833980fa
Merge: d94ac2a dd1c87ba
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Sun Dec 20 16:21:00 2015 +0100

    Merge branch 'master' into krita-testing-wolthera

commit d94ac2a0422d8c83e9fe2eb1eca73497f56c1717
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Sat Dec 19 17:07:37 2015 +0100

    Add ICC version and rendering intent information to color space browser

    Matrix shaper profiles can't use anything but relative colorimetric, but an ICC profile can contain
    both Matrix and several cLUT profile data, which affects which intents are possible.
    For now the data is printed into the color space browser. We'll do proper disabling later.

    Still have an issue with lists in richtext...

    Ref T429

commit b43600feac454b981b4d8dd88e5e2d8eee3a6647
Merge: 2874c08 60d5223c
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Fri Dec 18 14:58:40 2015 +0100

    Merge branch 'master' into krita-testing-wolthera

commit 2874c08e069b829ba792b950121ae6f07861bd09
Merge: 430a544 e7c035c9
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Thu Dec 17 19:55:44 2015 +0100

    Merge branch 'master' into krita-testing-wolthera

commit 430a544fd94b40d211859b4ba28b2cf6f14c2e37
Merge: ce83961 2e4082ff
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Thu Dec 17 15:25:26 2015 +0100

    Merge branch 'master' into krita-testing-wolthera

commit ce839615e616c58f95eb913fcdcc7b28e5ef856b
Merge: 28e9fc2 b19a225a
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Mon Dec 14 15:02:00 2015 +0100

    Merge branch 'master' into krita-testing-wolthera

commit 28e9fc21449177eb96d287cefd22eb7bd19f7318
Merge: a20d5f4 56634cb
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Mon Dec 14 15:00:43 2015 +0100

    Merge branch 'krita-testing-wolthera' of git://anongit.kde.org/krita into krita-testing-wolthera

commit 56634cb4fb8ab99902b2c6ec27205355560668d8
Author: Boudewijn Rempt <boud@valdyas.org>
Date:   Sat Dec 12 16:16:51 2015 +0100

    Cut down on the float/double/qreal confusion a bit

    And do a bit of coding style cleanup (function names start with
    a lower case letter).

    There are some more places where a similar change would be good,
    esp. in the normalise api (and normalise should be renamed to
    normalize).

commit a20d5f4f47c5a82cd38cd2a8ba312729d23b961b
Merge: 5e2a606 af869a54
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Fri Dec 11 14:56:53 2015 +0100

    Merge branch 'master' into krita-testing-wolthera

commit 5e2a60659e343bd9358d10edf594c5da22bbf64a
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Fri Dec 11 14:46:11 2015 +0100

    Disable subpixel precision in the color smudge brush only for smearing mode

    Auditors: rempt, dkazakov, timotheegiet

    Original bug that caused the initial method was 327235, and that was only for
    smearing mode. In dulling mode the lack of subpixel precision is very obvious,
    while in smearing mode it isn't.

    Therefore, I propose we only disable subpixel precision for smearing mode.

commit 7c02c37f7af3635dfb4a1a4e6c619070061c0718
Merge: d619f0b 46bd5924
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Thu Dec 10 16:50:25 2015 +0100

    Merge branch 'master' into krita-testing-wolthera

commit d619f0b23bec9fb56bfbe493feaed71f5b301e73
Merge: 4ed97dd e1c06787
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Mon Dec 7 19:06:55 2015 +0100

    Merge branch 'master' into krita-testing-wolthera

commit 4ed97dd9f9baa1b284b3ea3652440fcdcb4ba938
Merge: be202e5 031cfb1b
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Thu Dec 3 19:40:05 2015 +0100

    Merge branch 'master' into krita-testing-wolthera

commit be202e5bf4a63efee301c9e877b15394fe9bdeb7
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Thu Dec 3 17:47:01 2015 +0100

    Alphabetize PNG importer

    Shouldn't this become a color browser?

commit 5c9c14ef69f92e2c2927a4efc76aaf013b612f48
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Wed Dec 2 16:44:00 2015 +0100

    Tweak colorsmudge algortihms to work better with pure black.

commit d911b722c1c5cd223daa7c013b780e0264aaa4c6
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Wed Dec 2 02:26:42 2015 +0100

    clean up color browser UI by moving things to the tooltips.

commit c82c5b9369bbf725f70a6cfdfcd185e31cb139d1
Merge: db339e7 c1c20d43
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Tue Dec 1 17:08:11 2015 +0100

    Merge branch 'master' into krita-testing-wolthera

commit db339e79a18fe836bef9e44c3235bc71c6ac83eb
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Tue Dec 1 13:07:36 2015 +0100

    Fix sat maintaining and advanced dulling mode, support blending mode for both

    The mixing itself works now, blendingmodes sorta as well, though different from
    regular dulling. Strange results with orange+black.

    Ref T691

commit c094e8181eac3c20e897f346ed4887c19ac8d9c3
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Sun Nov 29 19:19:51 2015 +0100

    Make sure that CMYK/XYZ get mixed in LAB space

    This prevents crashes, but the results aren't really pretty.

    Ref T691

commit ee6d609c9fb100b3df56b522bd2c8c0b6596c968
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Sun Nov 29 18:35:51 2015 +0100

    Implement basis of advanced color mixing.

    Now we have linearised colormixing+gamma correction :D
    Though the alpha formula isn't quite right, and sat-maintaining
    blending could use work...

    Similarly, this hasn't been properlytested in the non-rgb spaces yet.

    Ref T210
    Ref T691

commit 2ffcca78e26e5967eeb9a1cb62be699ff3ead2a8
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Sat Nov 28 15:58:14 2015 +0100

    Partial fix mixing gradients in the colorspace of the image.

    The remaining problems of course are:
    * No higher than 1.0 floating point.
    * The colorspace of the gradients are STILL in sRGB, meaning colors outside that can't be picked.

    Ref T210
    Ref T121

commit b148f84621d6944accbdc08ef35aa2ca4f962d75
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Sat Nov 28 15:22:53 2015 +0100

    Modify and fix floating point for HSI/HSY/YUV adjustments

commit e9a352a0e30c92e6a645e57729300ec184d4e23a
Merge: 5bf45c1 8a971d77
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Fri Nov 27 13:41:06 2015 +0100

    Merge branch 'master' into krita-testing-wolthera

commit 5bf45c1e9b8f7c3988b22262cdad0341afe217f0
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Sat Nov 21 21:57:20 2015 +0100

    Start with preciser color smudge by forcing a 16bit or higher colorspace

    This reduces errors in the mixing, though it's not as smooth as actual 16bit
    needs more investigation, and I also want to make this configurable.

commit 027f33af95e6de05a0fefcbbc3823318dcff5879
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Sat Nov 21 21:54:06 2015 +0100

    Add HSI/HSY/YUV to the hsv adjustment filter.

    Ideally we'd replace the small transform commands with this entirely, but
    I have no idea how to make this filter accept LAB space.
    It also doesn't linearize, something which I need help for.

    However, it does use the luma coefficients of the color profile.

    ref T210

commit e8ae9e9e52c35c65edd5d3dacbd9e3c8d5dd6d41
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Fri Nov 20 22:43:50 2015 +0100

    Fix LCH and R/G/B/Y actions for LAB

    That leaves XYZ to be fixed.

    Ref T210

commit a1d66bfe11bc0250f9a346a873afdaa97c8a0a1a
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Fri Nov 20 20:45:37 2015 +0100

    Fix Redder/Greener/Yellower/Bluer actions for CMYK

    I wanted to do the same thing for HSY, but it seems that
    CMYK has a huge issue with saturation.
    To wit, the convert-from-q-color method of getting saturation
    doesn't seem to work either, even though this should be pretty
    full-proof. Regardless, some hotkeys work, so...

    Ref T220

commit e225166f12b736b57cd12b10d32e1ba8135d21b7
Merge: d1b9f2e 747b18bd
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Thu Nov 19 22:40:59 2015 +0100

    Merge branch 'master' into krita-testing-wolthera

commit d1b9f2e9880d92ec540127b78374aaa9553201a1
Merge: a516116 3434ec61
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Tue Nov 17 18:09:03 2015 +0100

    Merge branch 'master' into krita-testing-wolthera

commit a516116b91a035db8c3ad5bf9410a993e5e3d93c
Merge: 2b979ef a6277982
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Sun Nov 15 19:56:27 2015 +0100

    Merge branch 'master' into krita-testing-wolthera

commit 2b979ef74dcf1065f3c6c63ed8989917f448db3a
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Sat Nov 14 17:26:34 2015 +0100

    Change YCbCr to YUV formula, this makes the hotkeys work proper.

    Todo:
    * Fix LAB(inverted) and XYZ(too agressive)
    * Find an alternative for CMYK

    Ref T210

commit 3f42fac080e868009ed9a3cb453c4671cce67517
Merge: 406405a 4c5de2cc
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Fri Nov 13 22:05:19 2015 +0100

    Merge branch 'master' into krita-testing-wolthera

commit 406405a4d25c9c765fd3ab7499db8228aec43930
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Fri Nov 13 21:44:41 2015 +0100

    First stages YCbCr formula. Not satisfied yet

    There's redder/greener/bluer/yellower actions now, but as long
    as I am not satisfied with the formula they can be considered broken

commit b148b48bad374cdd5e3efb80b0ad3b522f1b9e93
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Fri Nov 13 15:07:56 2015 +0100

    Crunch the luma of HSY to 2.2 by default.

    This makes it easier to select darker colors while keeping the HSY correct.
    We might want to make this a config option in the future.

    Ref T210

commit 11e791f3c99c222c53cbefa6be7ccf77be0ebae9
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Fri Nov 13 14:32:45 2015 +0100

    Make faster linearisation functions+linearisize advanced selector

commit 82ee9cf059fc91582a6c7c2794007b10547fc9b6
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Fri Nov 13 13:04:05 2015 +0100

    Experiment with linearising color selector

    Also doesn't work because linearisation function is too slow

    Ref T210

commit d102f1f168212d0a084306f927081ff76026b3d1
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Fri Nov 13 13:03:02 2015 +0100

    Experiment with HDR Values for the lighter/darker buttons

    This doesn't quite work yet, because HSY only really works in a 0-1.0 sceme

commit cf4c780af6a28ad630ff3b21988d8379273b276b
Merge: bef8552 1fc48d50
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Wed Nov 11 17:28:01 2015 +0100

    Merge branch 'master' into krita-testing-wolthera

commit bef85521356bdb52e063d956c70d61ada9863a6b
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Wed Nov 11 17:21:35 2015 +0100

    Add basic Gamma crunching to lightness button

    Ref 210

commit 55bffbc4566d0dbcc134f049f6b6a3db54d3b14a
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Wed Nov 11 15:48:19 2015 +0100

    Color manage darker/lighter, add actions for sat/desat/hue

    This still needs a lot of work.

    * It's all linear, we need to crunch the luma.
    * It's not working for XYZ/YCrCb/LAB properly yet. This'll require LCH/xyY
    * Hue-clockwise has issues.
    * QVector <double> needs to become QVector <float> for consistency.

    Ref T210

commit 09404852c6489a38cd2e1fc47a76175cb8884ccd
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Tue Nov 10 18:06:38 2015 +0100

    Some cleanup for the TRC widget and pigment

    Ref T210

commit 5a6874d179032766ac1be8f78366e1277330bf0e
Merge: 0cb7cce 1e70cdc6
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Tue Nov 10 15:29:09 2015 +0100

    Merge branch 'master' into krita-testing-wolthera

commit 0cb7cce7dd7b1a7d1258b20caf6cc98d07cc07c1
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Tue Nov 10 00:09:04 2015 +0100

    Add basic Tone Response Curve widget.

    It is based on receiving QPolygons filled with points, so it's cm agnostic.

    TODO:
    * Document
    * Cleanup
    * Move elements about(rgb to the tooltip of the tongue widget?)
    * Maybe render a grayscale in a given colorspace for the TRC widget?

commit ff8b31a6f4cb34e5f7df30bdcbea10d71e3f7911
Merge: ef0275d 74e7e5a6
Author: Wolthera van Hövell <griffinvalley@gmail.com>
Date:   Mon Nov 9 19:08:34 2015 +0100

    Merge branch 'master' into krita-testing-wolthera

commit ef0275d7a082a1bc15cbd5bc0ead95e46543dc4d
Author: Wolthera van Hovell tot Westerflier <griffinvalley@gmail.com>
Date:   Sun Nov 8 17:50:34 2015 +0100

    Add basic TRC linearisation functions to the color profiles
parent c2706b36
......@@ -273,6 +273,94 @@
<isCheckable>false</isCheckable>
<statusTip></statusTip>
</Action>
<Action name="make_brush_color_saturated">
<icon></icon>
<text>Make brush color more saturated</text>
<whatsThis></whatsThis>
<toolTip>Make brush color more saturated</toolTip>
<iconText>Make brush color more saturated</iconText>
<shortcut></shortcut>
<defaultShortcut></defaultShortcut>
<isCheckable>false</isCheckable>
<statusTip></statusTip>
</Action>
<Action name="make_brush_color_desaturated">
<icon></icon>
<text>Make brush color more desaturated</text>
<whatsThis></whatsThis>
<toolTip>Make brush color more desaturated</toolTip>
<iconText>Make brush color more desaturated</iconText>
<shortcut></shortcut>
<defaultShortcut></defaultShortcut>
<isCheckable>false</isCheckable>
<statusTip></statusTip>
</Action>
<Action name="shift_brush_color_clockwise">
<icon></icon>
<text>Shift brush color hue clockwise</text>
<whatsThis></whatsThis>
<toolTip>Shift brush color hue clockwise</toolTip>
<iconText>Shift brush color hue clockwise</iconText>
<shortcut></shortcut>
<defaultShortcut></defaultShortcut>
<isCheckable>false</isCheckable>
<statusTip></statusTip>
</Action>
<Action name="shift_brush_color_counter_clockwise">
<icon></icon>
<text>Shift brush color hue counter-clockwise</text>
<whatsThis></whatsThis>
<toolTip>Shift brush color hue counter-clockwise</toolTip>
<iconText>Shift brush color hue counter-clockwise</iconText>
<shortcut></shortcut>
<defaultShortcut></defaultShortcut>
<isCheckable>false</isCheckable>
<statusTip></statusTip>
</Action>
<Action name="make_brush_color_redder">
<icon></icon>
<text>Make brush color more red</text>
<whatsThis></whatsThis>
<toolTip>Make brush color more red</toolTip>
<iconText>Make brush color more red</iconText>
<shortcut></shortcut>
<defaultShortcut></defaultShortcut>
<isCheckable>false</isCheckable>
<statusTip></statusTip>
</Action>
<Action name="make_brush_color_greener">
<icon></icon>
<text>Make brush color more green</text>
<whatsThis></whatsThis>
<toolTip>Make brush color more green</toolTip>
<iconText>Make brush color more green</iconText>
<shortcut></shortcut>
<defaultShortcut></defaultShortcut>
<isCheckable>false</isCheckable>
<statusTip></statusTip>
</Action>
<Action name="make_brush_color_bluer">
<icon></icon>
<text>Make brush color more blue</text>
<whatsThis></whatsThis>
<toolTip>Make brush color more blue</toolTip>
<iconText>Make brush color more blue</iconText>
<shortcut></shortcut>
<defaultShortcut></defaultShortcut>
<isCheckable>false</isCheckable>
<statusTip></statusTip>
</Action>
<Action name="make_brush_color_yellower">
<icon></icon>
<text>Make brush color more yellow</text>
<whatsThis></whatsThis>
<toolTip>Make brush color more yellow</toolTip>
<iconText>Make brush color more yellow</iconText>
<shortcut></shortcut>
<defaultShortcut></defaultShortcut>
<isCheckable>false</isCheckable>
<statusTip></statusTip>
</Action>
<Action name="increase_opacity">
<icon></icon>
<text>Increase opacity</text>
......
......@@ -44,7 +44,7 @@ public:
/// creates an invalid range of 0,0
DoubleRange(void) : minVal(0), maxVal(0) { }
/// creates
DoubleRange(double _minVal, double _maxVal) : minVal(_minVal), maxVal(_maxVal) { Q_ASSERT(minVal <= maxVal); }
DoubleRange(qreal _minVal, qreal _maxVal) : minVal(_minVal), maxVal(_maxVal) { Q_ASSERT(minVal <= maxVal); }
/// true if this range is usable
bool isValid(void) const { return minVal < maxVal; }
};
......
......@@ -34,7 +34,7 @@
template<typename _channels_type_>
struct KoCmykTraits : public KoColorSpaceTrait<_channels_type_, 5, 4> {
typedef _channels_type_ channels_type;
typedef KoColorSpaceTrait<_channels_type_, 4, 3> parent;
typedef KoColorSpaceTrait<_channels_type_, 5, 4> parent;
static const qint32 c_pos = 0;
static const qint32 m_pos = 1;
......
This diff is collapsed.
......@@ -68,6 +68,17 @@ KRITAPIGMENT_EXPORT void RGBToHCI(const qreal r, const qreal g, const qreal b, q
KRITAPIGMENT_EXPORT void HCYToRGB(const qreal h, const qreal s, const qreal y, qreal *red, qreal *green, qreal *blue, qreal R=0.299, qreal G=0.587, qreal B=0.114);
KRITAPIGMENT_EXPORT void RGBToHCY(const qreal r, const qreal g, const qreal b, qreal *h, qreal *c, qreal *y, qreal R=0.299, qreal G=0.587, qreal B=0.114);
KRITAPIGMENT_EXPORT void RGBToYUV( qreal r, qreal g, qreal b, qreal *y, qreal *cb, qreal *cr, qreal R=0.299, qreal G=0.587, qreal B=0.114);
KRITAPIGMENT_EXPORT void YUVToRGB(const qreal y, const qreal cb, const qreal cr, qreal *r, qreal *g, qreal *b, qreal R=0.299, qreal G=0.587, qreal B=0.114);
KRITAPIGMENT_EXPORT void LabToLCH(const qreal l, const qreal a, const qreal b, qreal *L, qreal *C, qreal *H);
KRITAPIGMENT_EXPORT void LCHToLab(const qreal L, const qreal C, const qreal H, qreal *l, qreal *a, qreal *b);
KRITAPIGMENT_EXPORT void XYZToxyY(const qreal X, const qreal Y, const qreal Z, qreal *x, qreal *y, qreal *yY);
KRITAPIGMENT_EXPORT void xyYToXYZ(const qreal x, const qreal y, const qreal yY, qreal *X, qreal *Y, qreal *Z);
KRITAPIGMENT_EXPORT void CMYToCMYK(qreal *c, qreal *m, qreal *y, qreal *k);
KRITAPIGMENT_EXPORT void CMYKToCMY(qreal *c, qreal *m, qreal *y, qreal *k);
#endif // _KO_COLORCONVERSIONS_H_
......@@ -24,6 +24,8 @@ struct Q_DECL_HIDDEN KoColorProfile::Private {
QString name;
QString info;
QString fileName;
QString manufacturer;
QString copyright;
};
KoColorProfile::KoColorProfile(const QString &fileName) : d(new Private)
......@@ -63,7 +65,14 @@ QString KoColorProfile::info() const
{
return d->info;
}
QString KoColorProfile::manufacturer() const
{
return d->manufacturer;
}
QString KoColorProfile::copyright() const
{
return d->copyright;
}
QString KoColorProfile::fileName() const
{
return d->fileName;
......@@ -82,3 +91,11 @@ void KoColorProfile::setInfo(const QString &info)
{
d->info = info;
}
void KoColorProfile::setManufacturer(const QString &manufacturer)
{
d->manufacturer = manufacturer;
}
void KoColorProfile::setCopyright(const QString &copyright)
{
d->copyright = copyright;
}
\ No newline at end of file
......@@ -85,6 +85,13 @@ public:
* @return the info of this profile
*/
QString info() const;
/** @return manufacturer of the profile
*/
QString manufacturer() const;
/**
* @return the copyright of the profile
*/
QString copyright() const;
/**
* @return the filename of the profile (it might be empty)
*/
......@@ -94,6 +101,10 @@ public:
*/
void setFileName(const QString &filename);
/**
* Return version
*/
virtual float version() const = 0;
/**
* @return true if you can use this profile can be used to convert color from a different
* profile to this one
......@@ -108,6 +119,13 @@ public:
*/
virtual bool isSuitableForDisplay() const = 0;
/**
* @return which rendering intents are supported
*/
virtual bool supportsPerceptual() const = 0;
virtual bool supportsSaturation() const = 0;
virtual bool supportsAbsolute() const = 0;
virtual bool supportsRelative() const = 0;
/**
* @return if the profile has colorants.
*/
......@@ -115,24 +133,45 @@ public:
/**
* @return a qvector <double>(9) with the RGB colorants in XYZ
*/
virtual QVector <double> getColorantsXYZ() const = 0;
virtual QVector <qreal> getColorantsXYZ() const = 0;
/**
* @return a qvector <double>(9) with the RGB colorants in xyY
*/
virtual QVector <double> getColorantsxyY() const = 0;
virtual QVector <qreal> getColorantsxyY() const = 0;
/**
* @return a qvector <double>(3) with the whitepoint in XYZ
*/
virtual QVector <double> getWhitePointXYZ() const = 0;
virtual QVector <qreal> getWhitePointXYZ() const = 0;
/**
* @return a qvector <double>(3) with the whitepoint in xyY
*/
virtual QVector <double> getWhitePointxyY() const = 0;
virtual QVector <qreal> getWhitePointxyY() const = 0;
/**
* @return estimated gamma for RGB and Grayscale profiles
*/
virtual QVector <double> getEstimatedTRC() const = 0;
virtual QVector <qreal> getEstimatedTRC() const = 0;
/**
* @return if the profile has a TRC(required for linearisation).
*/
virtual bool hasTRC() const = 0;
/**
* Linearizes a QVector of 3 doubles long, if it's possible to Linearize
* if not, returns the same QVector
*/
virtual void linearizeFloatValue(QVector <qreal> & Value) const = 0;
/**
* Delinearizes a QVector of 3 doubles long, if it's possible to delinearize
* if not, returns the same QVector. Effectively undoes LinearizeFloatValue.
*/
virtual void delinearizeFloatValue(QVector <qreal> & Value) const = 0;
/**
* More imprecise versions of the above(limited to 16bit, and can't
* delinearize above 1.0.) Use this for filters and images.
*/
virtual void linearizeFloatValueFast(QVector <qreal> & Value) const = 0;
virtual void delinearizeFloatValueFast(QVector <qreal> & Value) const = 0;
virtual bool operator==(const KoColorProfile&) const = 0;
......@@ -152,6 +191,14 @@ protected:
* Allows to set the information string of that profile.
*/
void setInfo(const QString &info);
/**
* Allows to set the manufacturer string of that profile.
*/
void setManufacturer(const QString &manufacturer);
/**
* Allows to set the copyright string of that profile.
*/
void setCopyright(const QString &copyright);
private:
struct Private;
......
This diff is collapsed.
......@@ -101,6 +101,23 @@ protected:
virtual ~KoColorSpace();
public:
//========== Gamut and other basic info ===================================//
/*
* @returns QPolygonF with 5*channel samples converted to xyY.
* maybe convert to 3d space in future?
*/
QPolygonF gamutXYY() const;
/*
* @returns a polygon with 5 samples per channel converted to xyY, but unlike
* gamutxyY it focuses on the luminance. This then can be used to visualise
* the approximate trc of a given colorspace.
*/
QPolygonF estimatedTRCXYY() const;
QVector <qreal> colorants() const;
QVector <qreal> lumaCoefficients() const;
//========== Channels =====================================================//
/// Return a list describing all the channels this color model has. The order
......@@ -476,6 +493,23 @@ public:
*/
virtual quint8 intensity8(const quint8 * src) const = 0;
/*
*increase luminosity by step
*/
virtual void increaseLuminosity(quint8 * pixel, qreal step) const;
virtual void decreaseLuminosity(quint8 * pixel, qreal step) const;
virtual void increaseSaturation(quint8 * pixel, qreal step) const;
virtual void decreaseSaturation(quint8 * pixel, qreal step) const;
virtual void increaseHue(quint8 * pixel, qreal step) const;
virtual void decreaseHue(quint8 * pixel, qreal step) const;
virtual void increaseRed(quint8 * pixel, qreal step) const;
virtual void increaseGreen(quint8 * pixel, qreal step) const;
virtual void increaseBlue(quint8 * pixel, qreal step) const;
virtual void increaseYellow(quint8 * pixel, qreal step) const;
virtual void toHSY(QVector <double> channelValues, qreal *hue, qreal *sat, qreal *luma) const = 0;
virtual QVector <double> fromHSY(qreal *hue, qreal *sat, qreal *luma) const = 0;
virtual void toYUV(QVector <double> channelValues, qreal *y, qreal *u, qreal *v) const = 0;
virtual QVector <double> fromYUV(qreal *y, qreal *u, qreal *v) const = 0;
/**
* Compose two arrays of pixels together. If source and target
* are not the same color model, the source pixels will be
......
......@@ -22,6 +22,7 @@
#include "KoColorSpace.h"
#include <QThreadStorage>
#include <QPolygonF>
struct Q_DECL_HIDDEN KoColorSpace::Private {
......@@ -38,6 +39,11 @@ struct Q_DECL_HIDDEN KoColorSpace::Private {
mutable KoColorConversionTransformation* transfoFromRGBA16;
mutable KoColorConversionTransformation* transfoToLABA16;
mutable KoColorConversionTransformation* transfoFromLABA16;
QPolygonF gamutXYY;
QPolygonF TRCXYY;
QVector <qreal> colorants;
QVector <qreal> lumaCoefficients;
Deletability deletability;
};
......
......@@ -37,7 +37,10 @@ bool KoDummyColorProfile::valid() const
{
return true;
}
float KoDummyColorProfile::version() const
{
return 0.0;
}
bool KoDummyColorProfile::isSuitableForOutput() const
{
return true;
......@@ -52,11 +55,30 @@ bool KoDummyColorProfile::isSuitableForDisplay() const
{
return true;
}
bool KoDummyColorProfile::supportsPerceptual() const
{
return true;
}
bool KoDummyColorProfile::supportsSaturation() const
{
return true;
}
bool KoDummyColorProfile::supportsAbsolute() const
{
return true;
}
bool KoDummyColorProfile::supportsRelative() const
{
return true;
}
bool KoDummyColorProfile::hasColorants() const
{
return true;
}
bool KoDummyColorProfile::hasTRC() const
{
return true;
}
QVector<double> KoDummyColorProfile::getColorantsXYZ() const
{
QVector<double> d50Dummy(3);
......@@ -86,12 +108,27 @@ QVector<double> KoDummyColorProfile::getWhitePointxyY() const
}
QVector <double> KoDummyColorProfile::getEstimatedTRC() const
{
QVector<double> Dummy(3);
Dummy.fill(2.2);
return Dummy;
}
void KoDummyColorProfile::linearizeFloatValue(QVector <double> & ) const
{
}
void KoDummyColorProfile::delinearizeFloatValue(QVector <double> & ) const
{
}
void KoDummyColorProfile::linearizeFloatValueFast(QVector <double> & ) const
{
}
void KoDummyColorProfile::delinearizeFloatValueFast(QVector <double> & ) const
{
}
bool KoDummyColorProfile::operator==(const KoColorProfile& rhs) const
{
return dynamic_cast<const KoDummyColorProfile*>(&rhs);
......
......@@ -29,15 +29,25 @@ public:
virtual ~KoDummyColorProfile();
virtual KoColorProfile* clone() const;
virtual bool valid() const;
virtual float version() const;
virtual bool isSuitableForOutput() const;
virtual bool isSuitableForPrinting() const;
virtual bool isSuitableForDisplay() const;
virtual bool supportsPerceptual() const;
virtual bool supportsSaturation() const;
virtual bool supportsAbsolute() const;
virtual bool supportsRelative() const;
virtual bool hasColorants() const;
virtual bool hasTRC() const;
virtual QVector <double> getColorantsXYZ() const;
virtual QVector <double> getColorantsxyY() const;
virtual QVector <double> getWhitePointXYZ() const;
virtual QVector <double> getWhitePointxyY() const;
virtual QVector <double> getEstimatedTRC() const;
virtual void linearizeFloatValue(QVector <double> & Value) const;
virtual void delinearizeFloatValue(QVector <double> & Value) const;
virtual void linearizeFloatValueFast(QVector <double> & Value) const;
virtual void delinearizeFloatValueFast(QVector <double> & Value) const;
virtual bool operator==(const KoColorProfile&) const;
};
......
......@@ -158,6 +158,24 @@ public:
virtual void colorFromXML(quint8* , const QDomElement&) const {
warnPigment << i18n("Undefined operation in the alpha color space");
}
virtual void toHSY(QVector <double>, qreal *, qreal *, qreal *) const {
warnPigment << i18n("Undefined operation in the alpha color space");
}
virtual QVector <double> fromHSY(qreal *, qreal *, qreal *) const {
warnPigment << i18n("Undefined operation in the alpha color space");
QVector <double> channelValues (1);
channelValues.fill(0.0);
return channelValues;
}
virtual void toYUV(QVector <double>, qreal *, qreal *, qreal *) const {
warnPigment << i18n("Undefined operation in the alpha color space");
}
virtual QVector <double> fromYUV(qreal *, qreal *, qreal *) const {
warnPigment << i18n("Undefined operation in the alpha color space");
QVector <double> channelValues (1);
channelValues.fill(0.0);
return channelValues;
}
protected:
virtual bool preferCompositionInSourceColorSpace() const;
......
......@@ -30,6 +30,7 @@
#include "KoChannelInfo.h"
#include "KoID.h"
#include "KoIntegerMaths.h"
#include "KoColorConversions.h"
#include "../compositeops/KoCompositeOps.h"
......@@ -163,3 +164,33 @@ void KoLabColorSpace::toQColor(const quint8 * src, QColor *c, const KoColorProfi
c->setRgba(qRgba(R, G, B, A));
}
void KoLabColorSpace::toHSY(QVector <double> channelValues, qreal *hue, qreal *sat, qreal *luma) const
{
LabToLCH(channelValues[0],channelValues[1],channelValues[2], luma, sat, hue);
}
QVector <double> KoLabColorSpace::fromHSY(qreal *hue, qreal *sat, qreal *luma) const
{
QVector <double> channelValues(4);
LCHToLab(*luma, *sat, *hue, &channelValues[0],&channelValues[1],&channelValues[2]);
channelValues[3]=1.0;
return channelValues;
}
void KoLabColorSpace::toYUV(QVector <double> channelValues, qreal *y, qreal *u, qreal *v) const
{
*y =channelValues[0];
*v=channelValues[1];
*u=channelValues[2];
}
QVector <double> KoLabColorSpace::fromYUV(qreal *y, qreal *u, qreal *v) const
{
QVector <double> channelValues(4);
channelValues[0]=*y;
channelValues[1]=*v;
channelValues[2]=*u;
channelValues[3]=1.0;
return channelValues;
}
\ No newline at end of file
......@@ -46,6 +46,11 @@ public:
virtual void fromQColor(const QColor& color, quint8 *dst, const KoColorProfile * profile = 0) const;
virtual void toQColor(const quint8 *src, QColor *c, const KoColorProfile * profile = 0) const;
virtual void toHSY(QVector <double> channelValues, qreal *hue, qreal *sat, qreal *luma) const;
virtual QVector <double> fromHSY(qreal *hue, qreal *sat, qreal *luma) const;
virtual void toYUV(QVector <double> channelValues, qreal *y, qreal *u, qreal *v) const;
virtual QVector <double> fromYUV(qreal *y, qreal *u, qreal *v) const;
private:
......
......@@ -31,6 +31,7 @@
#include "KoID.h"
#include "KoIntegerMaths.h"
#include "KoColorConversions.h"
KoRgbU16ColorSpace::KoRgbU16ColorSpace() :
KoSimpleColorSpace<KoBgrU16Traits>(colorSpaceId(),
......@@ -68,3 +69,30 @@ void KoRgbU16ColorSpace::toQColor(const quint8 * src, QColor *c, const KoColorPr
normalisedChannelsValue(src, channelValues);
c->setRgbF(channelValues[2], channelValues[1], channelValues[0], channelValues[3]);
}
void KoRgbU16ColorSpace::toHSY(QVector <double> channelValues, qreal *hue, qreal *sat, qreal *luma) const
{
RGBToHSY(channelValues[0],channelValues[1],channelValues[2], hue, sat, luma);
}
QVector <double> KoRgbU16ColorSpace::fromHSY(qreal *hue, qreal *sat, qreal *luma) const
{
QVector <double> channelValues(4);
HSYToRGB(*hue, *sat, *luma, &channelValues[0],&channelValues[1],&channelValues[2]);
channelValues[3]=1.0;
return channelValues;
}
void KoRgbU16ColorSpace::toYUV(QVector <double> channelValues, qreal *y, qreal *u, qreal *v) const
{
RGBToYUV(channelValues[0],channelValues[1],channelValues[2], y, u, v);
}
QVector <double> KoRgbU16ColorSpace::fromYUV(qreal *y, qreal *u, qreal *v) const
{
QVector <double> channelValues(4);
YUVToRGB(*y, *u, *v, &channelValues[0],&channelValues[1],&channelValues[2]);
channelValues[3]=1.0;
return channelValues;
}
\ No newline at end of file
......@@ -46,6 +46,11 @@ public:
virtual void fromQColor(const QColor& color, quint8 *dst, const KoColorProfile * profile = 0) const;
virtual void toQColor(const quint8 *src, QColor *c, const KoColorProfile * profile = 0) const;
virtual void toHSY(QVector <double> channelValues, qreal *hue, qreal *sat, qreal *luma) const;
virtual QVector <double> fromHSY(qreal *hue, qreal *sat, qreal *luma) const;
virtual void toYUV(QVector <double> channelValues, qreal *y, qreal *u, qreal *v) const;
virtual QVector <double> fromYUV(qreal *y, qreal *u, qreal *v) const;
};
......
......@@ -31,6 +31,8 @@
#include "KoIntegerMaths.h"
#include "compositeops/KoCompositeOps.h"
#include "KoColorConversions.h"
KoRgbU8ColorSpace::KoRgbU8ColorSpace() :
......@@ -80,3 +82,30 @@ void KoRgbU8ColorSpace::toQColor(const quint8 * src, QColor *c, const KoColorPro
normalisedChannelsValue(src, channelValues);
c->setRgbF(channelValues[2], channelValues[1], channelValues[0], channelValues[3]);
}
void KoRgbU8ColorSpace::toHSY(QVector <double> channelValues, qreal *hue, qreal *sat, qreal *luma) const
{
RGBToHSY(channelValues[0],channelValues[1],channelValues[2], hue, sat, luma);
}
QVector <double> KoRgbU8ColorSpace::fromHSY(qreal *hue, qreal *sat, qreal *luma) const
{
QVector <double> channelValues(4);
HSYToRGB(*hue, *sat, *luma, &channelValues[0],&channelValues[1],&channelValues[2]);
channelValues[3]=1.0;
return channelValues;
}
void KoRgbU8ColorSpace::toYUV(QVector <double> channelValues, qreal *y, qreal *u, qreal *v) const
{
RGBToYUV(channelValues[0],channelValues[1],channelValues[2], y, u, v);
}