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
 
bool readImage (QImage &outImage) const
 

Private Attributes

int m_instances
 
QString m_path
 

Detailed Description

Definition at line 79 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 88 of file KisMediaEncoderWrapper.h.

89 {
90 return m_instances;
91 }

References m_instances.

◆ readImage()

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

Definition at line 42 of file KisMediaEncoderWrapper.cpp.

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

References m_path, and warnFile.

Member Data Documentation

◆ m_instances

int KisMediaEncoderRunnable::Frame::m_instances
private

Definition at line 97 of file KisMediaEncoderWrapper.h.

◆ m_path

QString KisMediaEncoderRunnable::Frame::m_path
private

Definition at line 96 of file KisMediaEncoderWrapper.h.


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