Krita Source Code Documentation
Loading...
Searching...
No Matches
KisMediaEncoderRunnable::Frame Class Reference

#include <KisMediaEncoderWrapper.h>

Public Member Functions

 Frame (const QString &path=QString(), int instances=0)
 
int instances () const
 
const QString & path () const
 
bool readImage (QImage &outImage) const
 

Private Attributes

int m_instances
 
QString m_path
 

Detailed Description

Definition at line 86 of file KisMediaEncoderWrapper.h.

Constructor & Destructor Documentation

◆ Frame()

KisMediaEncoderRunnable::Frame::Frame ( const QString & path = QString(),
int instances = 0 )
inlineexplicit

Member Function Documentation

◆ instances()

int KisMediaEncoderRunnable::Frame::instances ( ) const
inline

Definition at line 100 of file KisMediaEncoderWrapper.h.

101 {
102 return m_instances;
103 }

References m_instances.

◆ path()

const QString & KisMediaEncoderRunnable::Frame::path ( ) const
inline

Definition at line 95 of file KisMediaEncoderWrapper.h.

96 {
97 return m_path;
98 }

References m_path.

◆ readImage()

bool KisMediaEncoderRunnable::Frame::readImage ( QImage & outImage) const

Definition at line 46 of file KisMediaEncoderWrapper.cpp.

47{
48 QImageReader reader(m_path);
49 if (reader.read(&outImage)) {
50 // Should be non-null on success, but we'll guard against mayhem.
51 if (outImage.isNull() || outImage.size().isEmpty()) {
52 warnFile.nospace() << "Got null image reading frame from file '" << m_path << "'";
53 return false;
54 } else {
55 return true;
56 }
57 } else {
58 warnFile.nospace() << "Error " << reader.error() << " reading frame from file '" << m_path
59 << "': " << reader.errorString();
60 // Again, should be null anyway, but let's be extra sure.
61 outImage = QImage();
62 return false;
63 }
64}
#define warnFile
Definition kis_debug.h:99

References m_path, and warnFile.

Member Data Documentation

◆ m_instances

int KisMediaEncoderRunnable::Frame::m_instances
private

Definition at line 109 of file KisMediaEncoderWrapper.h.

◆ m_path

QString KisMediaEncoderRunnable::Frame::m_path
private

Definition at line 108 of file KisMediaEncoderWrapper.h.


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