Krita Source Code Documentation
Loading...
Searching...
No Matches
KisGLImageF16 Class Reference

#include <KisGLImageF16.h>

+ Inheritance diagram for KisGLImageF16:

Classes

struct  Private
 

Public Member Functions

void clearPixels ()
 
const half * constData () const
 
half * data ()
 
int height () const
 
bool isNull () const
 
 KisGLImageF16 ()
 
 KisGLImageF16 (const KisGLImageF16 &rhs)
 
 KisGLImageF16 (const QSize &size, bool clearPixels=false)
 
 KisGLImageF16 (int width, int height, bool clearPixels=false)
 
KisGLImageF16operator= (const KisGLImageF16 &rhs)
 
void resize (const QSize &size, bool clearPixels=false)
 
QSize size () const
 
int width () const
 
 ~KisGLImageF16 ()
 

Private Attributes

QSharedDataPointer< Privatem_d
 

Friends

bool operator== (const KisGLImageF16 &lhs, const KisGLImageF16 &rhs)
 

Detailed Description

Definition at line 16 of file KisGLImageF16.h.

Constructor & Destructor Documentation

◆ KisGLImageF16() [1/4]

KisGLImageF16::KisGLImageF16 ( )

Definition at line 20 of file KisGLImageF16.cpp.

21 : m_d(new Private)
22{
23}
QSharedDataPointer< Private > m_d

◆ KisGLImageF16() [2/4]

KisGLImageF16::KisGLImageF16 ( const QSize & size,
bool clearPixels = false )

Definition at line 25 of file KisGLImageF16.cpp.

26 : m_d(new Private)
27{
29}
void resize(const QSize &size, bool clearPixels=false)
QSize size() const

References clearPixels(), resize(), and size().

◆ KisGLImageF16() [3/4]

KisGLImageF16::KisGLImageF16 ( int width,
int height,
bool clearPixels = false )

Definition at line 31 of file KisGLImageF16.cpp.

33{
34}
int height() const
int width() const

◆ KisGLImageF16() [4/4]

KisGLImageF16::KisGLImageF16 ( const KisGLImageF16 & rhs)

Definition at line 36 of file KisGLImageF16.cpp.

37 : m_d(rhs.m_d)
38{
39}

◆ ~KisGLImageF16()

KisGLImageF16::~KisGLImageF16 ( )

Definition at line 52 of file KisGLImageF16.cpp.

53{
54}

Member Function Documentation

◆ clearPixels()

void KisGLImageF16::clearPixels ( )

Definition at line 56 of file KisGLImageF16.cpp.

57{
58 if (!m_d->data.isEmpty()) {
59 m_d->data.fill(0);
60 }
61}

References m_d.

◆ constData()

const half * KisGLImageF16::constData ( ) const

Definition at line 75 of file KisGLImageF16.cpp.

76{
77 Q_ASSERT(!m_d->data.isNull());
78 return reinterpret_cast<const half*>(m_d->data.data());
79}

References m_d.

◆ data()

half * KisGLImageF16::data ( )

Definition at line 81 of file KisGLImageF16.cpp.

82{
83 m_d->data.detach();
84 Q_ASSERT(!m_d->data.isNull());
85
86 return reinterpret_cast<half*>(m_d->data.data());
87}

References m_d.

◆ height()

int KisGLImageF16::height ( ) const

Definition at line 99 of file KisGLImageF16.cpp.

100{
101 return m_d->size.height();
102}

References m_d.

◆ isNull()

bool KisGLImageF16::isNull ( ) const

Definition at line 104 of file KisGLImageF16.cpp.

105{
106 return m_d->data.isNull();
107}

References m_d.

◆ operator=()

KisGLImageF16 & KisGLImageF16::operator= ( const KisGLImageF16 & rhs)

Definition at line 41 of file KisGLImageF16.cpp.

42{
43 m_d = rhs.m_d;
44 return *this;
45}

References m_d.

◆ resize()

void KisGLImageF16::resize ( const QSize & size,
bool clearPixels = false )

Definition at line 63 of file KisGLImageF16.cpp.

64{
65 const int pixelSize = 2 * 4;
66
67 m_d->size = size;
68 m_d->data.resize(size.width() * size.height() * pixelSize);
69
70 if (clearPixels) {
71 m_d->data.fill(0);
72 }
73}

References clearPixels(), m_d, and size().

◆ size()

QSize KisGLImageF16::size ( ) const

Definition at line 89 of file KisGLImageF16.cpp.

90{
91 return m_d->size;
92}

References m_d.

◆ width()

int KisGLImageF16::width ( ) const

Definition at line 94 of file KisGLImageF16.cpp.

95{
96 return m_d->size.width();
97}

References m_d.

Friends And Related Symbol Documentation

◆ operator==

bool operator== ( const KisGLImageF16 & lhs,
const KisGLImageF16 & rhs )
friend

Definition at line 47 of file KisGLImageF16.cpp.

48{
49 return lhs.m_d == rhs.m_d;
50}

Member Data Documentation

◆ m_d

QSharedDataPointer<Private> KisGLImageF16::m_d
private

Definition at line 43 of file KisGLImageF16.h.


The documentation for this class was generated from the following files: