Qt 4.8
Classes | Macros | Typedefs | Functions
qscreentransformed_qws.cpp File Reference
#include "qscreentransformed_qws.h"
#include <qscreendriverfactory_qws.h>
#include <qvector.h>
#include <private/qpainter_p.h>
#include <private/qmemrotate_p.h>
#include <qmatrix.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <errno.h>
#include <qwindowsystem_qws.h>
#include <qwsdisplay_qws.h>

Go to the source code of this file.

Classes

class  QTransformedScreenPrivate
 

Macros

#define SET_BLIT_FUNC(dst, src, rotation, func)
 

Typedefs

typedef void(* BlitFunc) (QScreen *, const QImage &, const QRect &, const QPoint &)
 

Functions

template<class DST , class SRC >
static void blit180 (QScreen *screen, const QImage &image, const QRect &rect, const QPoint &topLeft)
 
template<class DST , class SRC >
static void blit270 (QScreen *screen, const QImage &image, const QRect &rect, const QPoint &topLeft)
 
template<class DST , class SRC >
static void blit90 (QScreen *screen, const QImage &image, const QRect &rect, const QPoint &topLeft)
 
static QRect correctNormalized (const QRect &r)
 
static QTransformedScreen::Transformation filterTransformation (QString &spec)
 
static int getDisplayId (const QString &spec)
 
Q_DECL_EXPORT void qws_setScreenTransformation (QScreen *that, int t)
 

Macro Definition Documentation

◆ SET_BLIT_FUNC

#define SET_BLIT_FUNC (   dst,
  src,
  rotation,
  func 
)
Value:
do { \
switch (rotation) { \
case Rot90: \
func = blit90<dst, src>; \
break; \
case Rot180: \
func = blit180<dst, src>; \
break; \
case Rot270: \
func = blit270<dst, src>; \
break; \
default: \
break; \
} \
} while (0)

Definition at line 348 of file qscreentransformed_qws.cpp.

Referenced by QTransformedScreen::blit().

Typedef Documentation

◆ BlitFunc

typedef void(* BlitFunc) (QScreen *, const QImage &, const QRect &, const QPoint &)

Definition at line 346 of file qscreentransformed_qws.cpp.

Function Documentation

◆ blit180()

template<class DST , class SRC >
static void blit180 ( QScreen screen,
const QImage image,
const QRect rect,
const QPoint topLeft 
)
inlinestatic

Definition at line 325 of file qscreentransformed_qws.cpp.

327 {
328  const SRC *src = (const SRC*)(image.scanLine(rect.top())) + rect.left();
329  DST *dest = (DST*)(screen->base() + topLeft.y() * screen->linestep())
330  + topLeft.x();
331  qt_memrotate180(src, rect.width(), rect.height(), image.bytesPerLine(),
332  dest, screen->linestep());
333 }
int left() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:240
int width() const
Returns the width of the rectangle.
Definition: qrect.h:303
int bytesPerLine() const
Returns the number of bytes per image scanline.
Definition: qimage.cpp:1812
int height() const
Returns the height of the rectangle.
Definition: qrect.h:306
void Q_GUI_QWS_EXPORT qt_memrotate180(const quint32 *, int, int, int, quint32 *, int)
int linestep() const
Returns the length of each scanline of the framebuffer in bytes.
Definition: qscreen_qws.h:232
uchar * base() const
Returns a pointer to the beginning of the framebuffer.
Definition: qscreen_qws.h:235
int top() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:243
int y() const
Returns the y coordinate of this point.
Definition: qpoint.h:131
int x() const
Returns the x coordinate of this point.
Definition: qpoint.h:128
uchar * scanLine(int)
Returns a pointer to the pixel data at the scanline with index i.
Definition: qimage.cpp:1886

◆ blit270()

template<class DST , class SRC >
static void blit270 ( QScreen screen,
const QImage image,
const QRect rect,
const QPoint topLeft 
)
inlinestatic

Definition at line 336 of file qscreentransformed_qws.cpp.

338 {
339  const SRC *src = (const SRC *)(image.scanLine(rect.top())) + rect.left();
340  DST *dest = (DST*)(screen->base() + topLeft.y() * screen->linestep())
341  + topLeft.x();
342  qt_memrotate270(src, rect.width(), rect.height(), image.bytesPerLine(),
343  dest, screen->linestep());
344 }
int left() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:240
int width() const
Returns the width of the rectangle.
Definition: qrect.h:303
int bytesPerLine() const
Returns the number of bytes per image scanline.
Definition: qimage.cpp:1812
int height() const
Returns the height of the rectangle.
Definition: qrect.h:306
int linestep() const
Returns the length of each scanline of the framebuffer in bytes.
Definition: qscreen_qws.h:232
uchar * base() const
Returns a pointer to the beginning of the framebuffer.
Definition: qscreen_qws.h:235
int top() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:243
void Q_GUI_QWS_EXPORT qt_memrotate270(const quint32 *, int, int, int, quint32 *, int)
int y() const
Returns the y coordinate of this point.
Definition: qpoint.h:131
int x() const
Returns the x coordinate of this point.
Definition: qpoint.h:128
uchar * scanLine(int)
Returns a pointer to the pixel data at the scanline with index i.
Definition: qimage.cpp:1886

◆ blit90()

template<class DST , class SRC >
static void blit90 ( QScreen screen,
const QImage image,
const QRect rect,
const QPoint topLeft 
)
inlinestatic

Definition at line 314 of file qscreentransformed_qws.cpp.

316 {
317  const SRC *src = (const SRC*)(image.scanLine(rect.top())) + rect.left();
318  DST *dest = (DST*)(screen->base() + topLeft.y() * screen->linestep())
319  + topLeft.x();
320  qt_memrotate90(src, rect.width(), rect.height(), image.bytesPerLine(),
321  dest, screen->linestep());
322 }
int left() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:240
int width() const
Returns the width of the rectangle.
Definition: qrect.h:303
int bytesPerLine() const
Returns the number of bytes per image scanline.
Definition: qimage.cpp:1812
int height() const
Returns the height of the rectangle.
Definition: qrect.h:306
void Q_GUI_EXPORT qt_memrotate90(const quint32 *, int, int, int, quint32 *, int)
int linestep() const
Returns the length of each scanline of the framebuffer in bytes.
Definition: qscreen_qws.h:232
uchar * base() const
Returns a pointer to the beginning of the framebuffer.
Definition: qscreen_qws.h:235
int top() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:243
int y() const
Returns the y coordinate of this point.
Definition: qpoint.h:131
int x() const
Returns the x coordinate of this point.
Definition: qpoint.h:128
uchar * scanLine(int)
Returns a pointer to the pixel data at the scanline with index i.
Definition: qimage.cpp:1886

◆ correctNormalized()

static QRect correctNormalized ( const QRect r)
inlinestatic

Definition at line 304 of file qscreentransformed_qws.cpp.

Referenced by QTransformedScreen::mapFromDevice(), and QTransformedScreen::mapToDevice().

304  {
305  const int x1 = qMin(r.left(), r.right());
306  const int x2 = qMax(r.left(), r.right());
307  const int y1 = qMin(r.top(), r.bottom());
308  const int y2 = qMax(r.top(), r.bottom());
309 
310  return QRect( QPoint(x1,y1), QPoint(x2,y2) );
311 }
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
int left() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:240
int bottom() const
Returns the y-coordinate of the rectangle&#39;s bottom edge.
Definition: qrect.h:249
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
int top() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:243
int right() const
Returns the x-coordinate of the rectangle&#39;s right edge.
Definition: qrect.h:246
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58

◆ filterTransformation()

static QTransformedScreen::Transformation filterTransformation ( QString spec)
static

Definition at line 196 of file qscreentransformed_qws.cpp.

Referenced by QTransformedScreen::connect().

197 {
198  QRegExp regexp(QLatin1String("\\bRot(\\d+):?\\b"), Qt::CaseInsensitive);
199  if (regexp.indexIn(spec) == -1)
201 
202  const int degrees = regexp.cap(1).toInt();
203  spec.remove(regexp.pos(0), regexp.matchedLength());
204 
205  return static_cast<QTransformedScreen::Transformation>(degrees / 90);
206 }
The QRegExp class provides pattern matching using regular expressions.
Definition: qregexp.h:61
Transformation
This enum describes the various rotations a transformed screen can have.
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
QString & remove(int i, int len)
Removes n characters from the string, starting at the given position index, and returns a reference t...
Definition: qstring.cpp:1867

◆ getDisplayId()

static int getDisplayId ( const QString spec)
static

Definition at line 186 of file qscreentransformed_qws.cpp.

Referenced by QTransformedScreen::connect().

187 {
188  QRegExp regexp(QLatin1String(":(\\d+)\\b"));
189  if (regexp.lastIndexIn(spec) != -1) {
190  const QString capture = regexp.cap(1);
191  return capture.toInt();
192  }
193  return 0;
194 }
The QRegExp class provides pattern matching using regular expressions.
Definition: qregexp.h:61
int toInt(bool *ok=0, int base=10) const
Returns the string converted to an int using base base, which is 10 by default and must be between 2 ...
Definition: qstring.cpp:6090
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QString class provides a Unicode character string.
Definition: qstring.h:83

◆ qws_setScreenTransformation()

Q_DECL_EXPORT void qws_setScreenTransformation ( QScreen that,
int  t 
)

Definition at line 97 of file qscreentransformed_qws.cpp.

Referenced by getTransformationFunction().

98 {
99  QTransformedScreen *tscreen = static_cast<QTransformedScreen*>(that);
101 }
Transformation
This enum describes the various rotations a transformed screen can have.
void setTransformation(Transformation t)
Rotates this screen object according to the specified transformation.
The QTransformedScreen class implements a screen driver for a transformed screen. ...