Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_wdg_options_heightmap.cpp File Reference
#include "kis_wdg_options_heightmap.h"
#include <QtMath>
#include <QToolTip>
#include <kis_assert.h>
#include <kis_paint_layer.h>

Go to the source code of this file.

Functions

static constexpr quint32 nextPow2 (quint32 n)
 
static constexpr quint32 prevPow2 (quint32 n)
 
static void showErrorTooltip (const QString &msg)
 

Function Documentation

◆ nextPow2()

static constexpr quint32 nextPow2 ( quint32 n)
staticconstexpr

Definition at line 15 of file kis_wdg_options_heightmap.cpp.

16{
17 return ((((((n - 1) | n >> 1) | n >> 2) | n >> 4) | n >> 8) | n >> 16) + 1 + (quint32)(n == 0);
18}

◆ prevPow2()

static constexpr quint32 prevPow2 ( quint32 n)
staticconstexpr

Definition at line 20 of file kis_wdg_options_heightmap.cpp.

21{
22 return nextPow2(n) >> 1;
23}
static constexpr quint32 nextPow2(quint32 n)

References nextPow2().

◆ showErrorTooltip()

static void showErrorTooltip ( const QString & msg)
static

Definition at line 25 of file kis_wdg_options_heightmap.cpp.

26{
27 QToolTip::showText(QCursor::pos(), i18n("Error: ") + msg);
28}