57 #if defined(QBBBUFFER_DEBUG) 58 qDebug() <<
"QBBBuffer::QBBBuffer - empty";
65 #if defined(QBBBUFFER_DEBUG) 66 qDebug() <<
"QBBBuffer::QBBBuffer - normal";
72 int result = screen_get_buffer_property_iv(buffer, SCREEN_PROPERTY_BUFFER_SIZE, size);
74 qFatal(
"QBB: failed to query buffer size, errno=%d",
errno);
80 result = screen_get_buffer_property_iv(buffer, SCREEN_PROPERTY_STRIDE, &stride);
82 qFatal(
"QBB: failed to query buffer stride, errno=%d",
errno);
87 uchar* dataPtr = NULL;
88 result = screen_get_buffer_property_pv(buffer, SCREEN_PROPERTY_POINTER, (
void **)&dataPtr);
90 qFatal(
"QBB: failed to query buffer pointer, errno=%d",
errno);
92 if (dataPtr == NULL) {
93 qFatal(
"QBB: buffer pointer is NULL, errno=%d",
errno);
99 result = screen_get_buffer_property_iv(buffer, SCREEN_PROPERTY_FORMAT, &screenFormat);
101 qFatal(
"QBB: failed to query buffer format, errno=%d",
errno);
106 switch (screenFormat) {
107 case SCREEN_FORMAT_RGBX4444:
110 case SCREEN_FORMAT_RGBA4444:
113 case SCREEN_FORMAT_RGBX5551:
116 case SCREEN_FORMAT_RGB565:
119 case SCREEN_FORMAT_RGBX8888:
122 case SCREEN_FORMAT_RGBA8888:
126 qFatal(
"QBB: unsupported buffer format, format=%d", screenFormat);
130 mImage =
QImage(dataPtr, size[0], size[1], stride, imageFormat);
137 #if defined(QBBBUFFER_DEBUG) 138 qDebug() <<
"QBBBuffer::QBBBuffer - copy";
144 #if defined(QBBBUFFER_DEBUG) 145 qDebug() <<
"QBBBuffer::~QBBBuffer";
151 #if defined(QBBBUFFER_DEBUG) 152 qDebug() <<
"QBBBuffer::invalidateInCache";
157 qFatal(
"QBB: can't invalidate cache for null buffer");
164 qFatal(
"QBB: failed to invalidate cache, errno=%d",
errno);
Format
The following image formats are available in Qt.
#define QT_END_NAMESPACE
This macro expands to.
int bytesPerLine() const
Returns the number of bytes per image scanline.
Q_CORE_EXPORT void qDebug(const char *,...)
#define QT_BEGIN_NAMESPACE
This macro expands to.
The QImage class provides a hardware-independent image representation that allows direct access to th...
uchar * bits()
Returns a pointer to the first pixel data.
Q_CORE_EXPORT void qFatal(const char *,...)
int height() const
Returns the height of the image.