summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qcolorspace.h
Commit message (Collapse)AuthorAgeFilesLines
* Centralize the implementation of move assignment operatorsGiuseppe D'Angelo2020-10-031-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At the moment we have two main strategies for dealing with move assignment in Qt: 1) move-and-swap, used by "containers" (in the broad sense): containers, but also smart pointers and similar classes that can hold user-defined types; 2) pure swap, used by containers that hold only memory (e.g. QString, QByteArray, ...) as well as most implicitly shared datatypes. Given the fact that a move assignment operator's code is just boilerplate (whether it's move-and-swap or pure swap), provide two _strictly internal_ macros to help write them, and apply the macros across corelib and gui, porting away from the hand-rolled implementations. The rule of thumb when porting to the new macros is: * Try to stick to the existing code behavior, unless broken * if changing, then follow this checklist: * if the class does not have a move constructor => pure swap (but consider ADDING a move constructor, if possible!) * if the class does have a move constructor, try to follow the criteria above, namely: * if the class holds only memory, pure swap; * if the class may hold anything else but memory (file handles, etc.), then move and swap. Noteworthy details: * some operators planned to be removed in Qt 6 were not ported; * as drive-by, some move constructors were simplified to be using qExchange(); others were outright broken and got fixed; * some contained some more interesting code and were not touched. Change-Id: Idaab3489247dcbabb6df3fa1e5286b69e1d372e9 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Register QColorSpace as a QtGui metatypeAllan Sandfeld Jensen2020-01-251-0/+2
| | | | | | | Helps pass it through QVariant, and needed for QML support. Change-Id: Id161ff9b8f81ad55a7ee7a7c4c614bdf74bca4a1 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Remove BT.2020 support from QColorSpaceAllan Sandfeld Jensen2019-09-081-6/+3
| | | | | | | | | | | | BT.2020 is an HDR color space and its luminance range doesn't match that of the rest of the currently available color spaces. Without support for white-point luminance in 5.14, there would be a behavior change when luminance support is later introduced, so it is better to remove it now, and reintroduce it when the necessary handling of different luminance levels is available. Change-Id: Ie29e4dd757faae3ac91d4252e1206acce42801dc Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Simplify QColorSpace named presetsTor Arne Vestbø2019-09-031-8/+10
| | | | | | | | | | | | | | We don't need a getter for the 'preset' of a color-space, as color spaces can be compared to the presets directly. This allows us to remove the Undefined and Unknown values from the presets. Internally we still distinguish known presets from unknown or undefined presets via the magic 0-value. The validity of a QColorSpace is not based on this preset, but on its actual values. Fixes: QTBUG-77963 Change-Id: I1e0a2a4be83021b8c82b3c778019f680fd46455b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fixup includesAllan Sandfeld Jensen2019-09-021-0/+2
| | | | | | | One include too many and one too little. Change-Id: I9963adb02523305d753135c0f5a6baefb83a06f1 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Fixup move semantics of QColorSpaceAllan Sandfeld Jensen2019-09-021-3/+11
| | | | | | | | | | | | Stop using QExplicitlySharedDataPointer, makes it possible to inline the move constructor and assign operator. Also protect other methods from nullptr d_ptr, and change the default constructed value to also have a null d_ptr, to match the result after a move. Change-Id: I40928feef90cc956ef84d0516a77b0ee0f8986c7 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Add an easier way to change colorspacesAllan Sandfeld Jensen2019-08-021-0/+7
| | | | | | | | | | Adds setters for transfer-functions and primaries. This allows us to remove use of private QColorSpace API from the PNG handler. Change-Id: Ieeff81c813c253649500acd1e53f35247b872325 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Improve our color space terminologyAllan Sandfeld Jensen2019-08-021-5/+5
| | | | | | | | | | | | | | | Replace our use of 'gamut' with 'primaries'. One is the axes of the color space, the other the volume of representable values. For the currently supported color spaces those are mostly equivalent, but when we later add support for scRgb, this would be misleading as it has the same primaries as sRGB but a much wider gamut, and we would like to use the same primaries/"gamut" id for it. Also few people would know what "the sRGB gamut" is, but "the sRGB primaries" is easily googable. Change-Id: I3348ccaae27a071ec77a4356331b9bbbf92e0d19 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Remove public d_func from QColorSpaceAllan Sandfeld Jensen2019-07-231-3/+1
| | | | | | | Replaced with getter in private. Change-Id: I968eb45052a80b45750213cf6a0c08b5973dfc4d Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* ABI fixups for QColorSpaceAllan Sandfeld Jensen2019-07-121-2/+7
| | | | | | | Declare it shared to Qt and make the move method noexcept. Change-Id: I25d5d255d300fda109ffa1a08e1849b15e9ff29c Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Custom color-space based on chromaticitiesAllan Sandfeld Jensen2019-05-021-0/+3
| | | | | Change-Id: I7fa6efa8993aa2b79ea60b6a21bf57c4f67a120f Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Long live QColorSpace and friendsAllan Sandfeld Jensen2019-02-081-0/+136
Adds QColorSpace and QColorTransform classes, and parsing of a common subset of ICC profiles found in images, and also parses the ICC profiles in PNG and JPEGs. For backwards compatibility no automatic color handling is done by this patch. [ChangeLog][QtGui] A QColorSpace class has been added, and color spaces are now parsed from PNG and JPEG images. No automatic color space conversion is done however, and applications must request it. Change-Id: Ic09935f84640a716467fa3a9ed1e73c02daf3675 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>