Krita Source Code Documentation
Loading...
Searching...
No Matches
KoUnit.h File Reference
#include "kritaglobal_export.h"
#include <QString>
#include <QDebug>
#include <QMetaType>
#include <QStringList>
#include <QLocale>
#include <math.h>
#include <boost/operators.hpp>

Go to the source code of this file.

Classes

class  KoUnit
 

Functions

constexpr qreal CC_TO_POINT (qreal cc)
 
constexpr qreal CM_TO_POINT (qreal cm)
 
constexpr qreal DM_TO_POINT (qreal dm)
 
constexpr qreal INCH_TO_MM (qreal inch)
 
constexpr qreal INCH_TO_POINT (qreal inch)
 
constexpr qreal MM_TO_INCH (qreal mm)
 
constexpr qreal MM_TO_POINT (qreal mm)
 
KRITAGLOBAL_EXPORT QDebug operator<< (QDebug, const KoUnit &)
 
constexpr qreal PI_TO_POINT (qreal pi)
 
constexpr qreal POINT_TO_CC (qreal px)
 
constexpr qreal POINT_TO_CM (qreal px)
 
constexpr qreal POINT_TO_DM (qreal px)
 
constexpr qreal POINT_TO_INCH (qreal px)
 
constexpr qreal POINT_TO_MM (qreal px)
 
constexpr qreal POINT_TO_PI (qreal px)
 

Variables

static const qreal CC_ROUNDING {100000.0}
 
static const qreal CM_ROUNDING {10000.0}
 
static const qreal DM_ROUNDING {10000.0}
 
static const qreal IN_ROUNDING {100000.0}
 
static const qreal MM_ROUNDING {10000.0}
 
static const qreal PI_ROUNDING {100000.0}
 
static const qreal PT_ROUNDING {1000.0}
 

Function Documentation

◆ CC_TO_POINT()

constexpr qreal CC_TO_POINT ( qreal cc)
constexpr

Definition at line 44 of file KoUnit.h.

44{return (cc)*12.840103;}

◆ CM_TO_POINT()

constexpr qreal CM_TO_POINT ( qreal cm)
constexpr

Definition at line 34 of file KoUnit.h.

34{return (cm)*28.3465058;}

◆ DM_TO_POINT()

constexpr qreal DM_TO_POINT ( qreal dm)
constexpr

Definition at line 36 of file KoUnit.h.

36{return (dm)*283.465058;}

◆ INCH_TO_MM()

constexpr qreal INCH_TO_MM ( qreal inch)
constexpr

Definition at line 40 of file KoUnit.h.

40{return (inch)*25.399956;}

◆ INCH_TO_POINT()

constexpr qreal INCH_TO_POINT ( qreal inch)
constexpr

Definition at line 38 of file KoUnit.h.

38{return (inch)*72.0;}

◆ MM_TO_INCH()

constexpr qreal MM_TO_INCH ( qreal mm)
constexpr

Definition at line 39 of file KoUnit.h.

39{return (mm)*0.039370147;}

◆ MM_TO_POINT()

constexpr qreal MM_TO_POINT ( qreal mm)
constexpr

Definition at line 32 of file KoUnit.h.

32{return mm*2.83465058;}

◆ operator<<()

KRITAGLOBAL_EXPORT QDebug operator<< ( QDebug debug,
const KoUnit & unit )

Definition at line 398 of file KoUnit.cpp.

399{
400#ifndef NDEBUG
401 debug.nospace() << unit.symbol();
402#else
403 Q_UNUSED(unit);
404#endif
405 return debug.space();
406
407}
QString symbol() const
Get the symbol string of the unit.
Definition KoUnit.cpp:347
PyObject * debug(PyObject *, PyObject *args)

References KoUnit::symbol().

◆ PI_TO_POINT()

constexpr qreal PI_TO_POINT ( qreal pi)
constexpr

Definition at line 43 of file KoUnit.h.

43{return (pi)*12;}

◆ POINT_TO_CC()

constexpr qreal POINT_TO_CC ( qreal px)
constexpr

Definition at line 42 of file KoUnit.h.

42{return (px)*0.077880997;}

◆ POINT_TO_CM()

constexpr qreal POINT_TO_CM ( qreal px)
constexpr

Definition at line 33 of file KoUnit.h.

33{return (px)*0.0352777167;}

◆ POINT_TO_DM()

constexpr qreal POINT_TO_DM ( qreal px)
constexpr

Definition at line 35 of file KoUnit.h.

35{return (px)*0.00352777167;}

◆ POINT_TO_INCH()

constexpr qreal POINT_TO_INCH ( qreal px)
constexpr

Definition at line 37 of file KoUnit.h.

37{return (px)*0.01388888888889;}

◆ POINT_TO_MM()

constexpr qreal POINT_TO_MM ( qreal px)
constexpr

Definition at line 31 of file KoUnit.h.

31{return (px)*0.352777167;}

◆ POINT_TO_PI()

constexpr qreal POINT_TO_PI ( qreal px)
constexpr

Definition at line 41 of file KoUnit.h.

41{return (px)*0.083333333;}

Variable Documentation

◆ CC_ROUNDING

const qreal CC_ROUNDING {100000.0}
static

Definition at line 57 of file KoUnit.h.

57{100000.0}; // cicero

◆ CM_ROUNDING

const qreal CM_ROUNDING {10000.0}
static

Definition at line 50 of file KoUnit.h.

50{10000.0};

◆ DM_ROUNDING

const qreal DM_ROUNDING {10000.0}
static

Definition at line 51 of file KoUnit.h.

51{10000.0};

◆ IN_ROUNDING

const qreal IN_ROUNDING {100000.0}
static

Definition at line 54 of file KoUnit.h.

54{100000.0};

◆ MM_ROUNDING

const qreal MM_ROUNDING {10000.0}
static

Definition at line 52 of file KoUnit.h.

52{10000.0};

◆ PI_ROUNDING

const qreal PI_ROUNDING {100000.0}
static

Definition at line 56 of file KoUnit.h.

56{100000.0}; // pico

◆ PT_ROUNDING

const qreal PT_ROUNDING {1000.0}
static

Definition at line 47 of file KoUnit.h.

47{1000.0};