Skip to content

Commit

Permalink
Fix CMYK8888 on big-endian platforms
Browse files Browse the repository at this point in the history
Fixes: QTBUG-132875
Change-Id: If7e945607125a5ae5ce1f8323df27ab8481e329c
Reviewed-by: Giuseppe D'Angelo <[email protected]>
(cherry picked from commit 7ad2083)
Reviewed-by: Qt Cherry-pick Bot <[email protected]>
(cherry picked from commit 4d34eee)
  • Loading branch information
Allan Sandfeld Jensen authored and Qt Cherry-pick Bot committed Jan 19, 2025
1 parent f4d2bab commit 4a45159
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/gui/painting/qcmyk_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ class QCmyk32
QCmyk32() = default;

constexpr QCmyk32(int cyan, int magenta, int yellow, int black) :
#if QT_BYTE_ORDER == Q_BIG_ENDIAN
m_cmyk(cyan << 24 | magenta << 16 | yellow << 8 | black)
#if Q_BYTE_ORDER == Q_BIG_ENDIAN
m_cmyk(uint(cyan) << 24 | magenta << 16 | yellow << 8 | black)
#else
m_cmyk(cyan | magenta << 8 | yellow << 16 | black << 24)
m_cmyk(cyan | magenta << 8 | yellow << 16 | uint(black) << 24)
#endif
{
}

#if QT_BYTE_ORDER == Q_BIG_ENDIAN
#if Q_BYTE_ORDER == Q_BIG_ENDIAN
constexpr int cyan() const noexcept { return (m_cmyk >> 24) & 0xff; }
constexpr int magenta() const noexcept { return (m_cmyk >> 16) & 0xff; }
constexpr int yellow() const noexcept { return (m_cmyk >> 8) & 0xff; }
Expand Down

0 comments on commit 4a45159

Please sign in to comment.