Qt 4.8
Functions
eglnullwsscreen.cpp File Reference
#include "eglnullwsscreen.h"
#include "eglnullwswindowsurface.h"
#include "eglnullwsscreenplugin.h"
#include <QHash>
#include <QDebug>

Go to the source code of this file.

Functions

static int depthForFormat (QImage::Format format)
 
static const QHash< QString, QImage::FormatformatDictionary ()
 
static void printHelp (const QHash< QString, QImage::Format > &formatDictionary)
 

Function Documentation

◆ depthForFormat()

static int depthForFormat ( QImage::Format  format)
static

Definition at line 82 of file eglnullwsscreen.cpp.

Referenced by EGLNullWSScreen::connect().

83 {
84  switch (format) {
85  case QImage::Format_RGB32: return 32;
86  case QImage::Format_ARGB32: return 32;
87  case QImage::Format_RGB16: return 16;
88  case QImage::Format_RGB666: return 24;
89  case QImage::Format_RGB555: return 16;
90  case QImage::Format_RGB888: return 24;
91  case QImage::Format_RGB444: return 16;
92  default:
93  Q_ASSERT_X(false, "EGLNullWSScreen", "Unknown format");
94  return -1;
95  }
96 }
#define Q_ASSERT_X(cond, where, what)
Definition: qglobal.h:1837

◆ formatDictionary()

static const QHash<QString, QImage::Format> formatDictionary ( )
static

Definition at line 69 of file eglnullwsscreen.cpp.

Referenced by EGLNullWSScreen::connect().

70 {
72  dictionary["rgb32"] = QImage::Format_RGB32;
73  dictionary["argb32"] = QImage::Format_ARGB32;
74  dictionary["rgb16"] = QImage::Format_RGB16;
75  dictionary["rgb666"] = QImage::Format_RGB666;
76  dictionary["rgb555"] = QImage::Format_RGB555;
77  dictionary["rgb888"] = QImage::Format_RGB888;
78  dictionary["rgb444"] = QImage::Format_RGB444;
79  return dictionary;
80 }
The QHash class is a template class that provides a hash-table-based dictionary.
Definition: qdatastream.h:66

◆ printHelp()

static void printHelp ( const QHash< QString, QImage::Format > &  formatDictionary)
static

Definition at line 98 of file eglnullwsscreen.cpp.

Referenced by EGLNullWSScreen::connect().

99 {
100  QByteArray formatsBuf;
101  QTextStream(&formatsBuf) << QStringList(formatDictionary.keys()).join(", ");
102  qWarning(
103  "%s: Valid options are:\n"
104  "size=WIDTHxHEIGHT Screen size reported by this driver\n"
105  "format=FORMAT Screen format, where FORMAT is one of the following:\n"
106  " %s\n",
107  PluginName,
108  formatsBuf.constData());
109 }
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
const char *const PluginName
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
Q_CORE_EXPORT void qWarning(const char *,...)
const char * constData() const
Returns a pointer to the data stored in the byte array.
Definition: qbytearray.h:433
The QTextStream class provides a convenient interface for reading and writing text.
Definition: qtextstream.h:73
QList< Key > keys() const
Returns a list containing all the keys in the hash, in an arbitrary order.
Definition: qhash.h:648