Extends the output device and output configuration interfaces with the ability
to query and set the RGB color intensity curves (gamma ramps) of the
associated output.
Details
- Reviewers
graesslin romangg - Group Reviewers
Frameworks - Commits
- R127:3d06279076f1: Output device color curves correction
Manually. Auto tests will be added to this diff soon.
Diff Detail
- Repository
- R127 KWayland
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
src/client/outputconfiguration.h | ||
---|---|---|
212 | The documentation could state how many elements need to be in the vectors. Ideally, every component could have any number of elements, and if there are too few, the other elements are interpolated. But it is probably simpler to just state "The number of elements in each vector must be 256 or 1024, depending on the depth of the framebuffer (24 bits or 30 bits)." | |
src/server/outputconfiguration_interface.cpp | ||
221 | X11 uses 16 bit values even for 24 bit screens, because the actual values that are sent to the DAC can have higher precision than the screen pixmap. I doubt that Wayland has reduced the precision, so I don't think checking values here is right. |
src/client/outputconfiguration.cpp | ||
---|---|---|
193 | Maybe static_cast? I haven't used wl_array but can't you allocate big enough contiguous chunk of memory and call memcpy, e.g. wl_array wlRed; wl_array_init(&wlRed); auto* redDest = wl_array_add(&wlRed, sizeof(uint16_t) * red.count()); memcpy(redDest, red.data(), sizeof(uint16_t) * red.count()); |
src/client/outputconfiguration.cpp | ||
---|---|---|
193 | Good point about allocating directly all of the memory. I looked up the wl_array definition and should be no problem. | |
src/client/outputconfiguration.h | ||
212 | Number of elements depends on the OutputDevice technical possibilities (i.e. for example as you said 256 for 8bit color ramps and 1024 for 10bit ones and every other value between 1 and 16bit ramp size). Will add a comment to the doc. | |
src/server/outputconfiguration_interface.cpp | ||
221 | I forget to remove this comment. This is not an issue since we can "stretch" the image over the whole uint16_t value domain linearly such that image 1 is associated with the largest uint16_t value. By that we have well defined arguments in any case. The array size though is checked before that in the checkArg call by comparing it with the size set first by the compositor. |
Looks pretty good. +1
src/client/outputdevice.cpp | ||
---|---|---|
332 | You can do this all in once destination->resize(curve->size); |
Please increase the versions.
src/client/protocols/output-management.xml | ||
---|---|---|
82โ83 | please increment version | |
146 | since is missing | |
146 | you cannot add requests in between, a new request must be the last. | |
src/client/protocols/outputdevice.xml | ||
31โ32 | version needs incrementation | |
189 | you cannot add events in between, new one needs to be last. |
src/client/outputconfiguration.cpp | ||
---|---|---|
189 | You forgot const. :-D |
src/client/outputdevice.cpp | ||
---|---|---|
330 | That's not C so you can get rid of struct keyword. ;-) | |
src/server/outputconfiguration_interface.cpp | ||
228 | constify newColor? | |
241 | constify wl_array? | |
src/server/outputdevice_interface.cpp | ||
425 | constify origin? Can't you memcpy here? |
- Use const size_t instead of int
- Remove struct keyword on function calls
- More const keyword
- memcpy in sendColorCurves
Increase org_kde_kwin_outputmanagement version as well
(needed to create config objects of version 2)
src/server/outputconfiguration_interface.cpp | ||
---|---|---|
241 | You can resize v and call memcpy (or use std::copy?) |
Comadeering to rebase on top of my changes that also moved outputdevice to version 2.
src/client/outputconfiguration.h | ||
---|---|---|
203 โ | (On Diff #37879) | rm |