[Qt-embedded-interest] Graphics Driver
Bryce Salmi
Bryce.Salmi at zoran.com
Fri Jul 10 17:41:28 CEST 2009
Carlos and Tom,
Thanks for the replies! Including <QImage> and changing from int to QImage* seemed to do the trick. I did notice that both vopuimage and vopuscreenFb which are declared in ::connect do not seem to be declared in ::blit. This is probably a really simple C++ error that I am missing but I don't think I should have to redeclare them in the blit. Am I missing something to pass them through to blit? Should I declare it globally and use a Unary Score Resolution Operator :: like ::vopuscreenFb?
Bryce
-----Original Message-----
From: Carlos Becker [mailto:carlosbecker at gmail.com]
Sent: Fri 7/10/2009 7:45 AM
To: Bryce Salmi
Subject: Re: [Qt-embedded-interest] Graphics Driver
Hi Bryce. Looks as if vopuimage is not of the right type, maybe int, or you
forgot to include <QImage>
#include <QImage>
QImage *vopuimage;
vopuimage = new QImage(w, h, QImage::Format_RGB888);
Carlos
On Fri, Jul 10, 2009 at 11:36 AM, Bryce Salmi <Bryce.Salmi at zoran.com> wrote:
> Qt list,
>
> I seem to have a reoccuring problem when compiling the QImage (it
> happened before when I was playing around with the driver). I am not sure
> but it seems to have something to do with the "new" function which if my
> research is correct is much like malloc in C. I am still fairly new to C++
> (but came from a decent background in C) so it may be an easy fix. When
> compiling I get the following error:
>
> vopuScreenDriver.cpp: In member function 'bool
> vopuScreenDriver::connect()':
> vopuScreenDriver.cpp:37: error: invalid conversion from 'QImage*' to 'int'
>
> And line 37 is:
>
> vopuimage = new QImage(w, h, QImage::Format_RGB888);
>
>
> Any ideas?
>
>
> Thanks,
> Bryce
>
>
> -----Original Message-----
> From: qt-embedded-interest-bounces at trolltech.com on behalf of Bryce Salmi
> Sent: Fri 7/10/2009 5:57 AM
> To: qt-embedded-interest at trolltech.com
> Subject: Re: [Qt-embedded-interest] Graphics Driver
>
> Tom,
> Thank you for the reply. That does make more sense; it actually
> looks a lot more like a simple C frame buffer implementation I wrote a
> while ago for the same board (more of a test like the frame buffer test
> that comes with Qt). I must have missed the facts that open and write
> could be used in C++. I did a search for reading and writing to files
> (/dev/fb0) in C++ and I did not seem to find any suggestions relating to
> using those functions. I will try to get something working today and
> see what happens.
>
>
>
> Thanks,
> Bryce
>
> -----Original Message-----
> From: qt-embedded-interest-bounces at trolltech.com
> [mailto:qt-embedded-interest-bounces at trolltech.com<qt-embedded-interest-bounces at trolltech.com>]
> On Behalf Of Tom
> Cooksey
> Sent: Friday, July 10, 2009 2:35 AM
> To: qt-embedded-interest at trolltech.com
> Subject: Re: [Qt-embedded-interest] Graphics Driver
>
> > Qt list,
> > Ok, so after a lot of experimenting I have come to a point
> > where I need some more guidance, maybe not answers but at least
> > some pointers to get going again. Using the suggestions from Tom
> > Cooksay I tried to write my own driver (which was emailed out
> > several days ago yet had no replies) so then I tried to modify the
> > dbscreen driver supplied with Qt. I managed to figure out that it
> > relies on the QScreen::connect call given by every application
> > rather than re-implementing it. After some investigation into
> > QScreenLinuxFb, I am pretty sure that the mapping is occurring in
> > the connect function. So I have a few questions:
> >
> >
> > * Does the mapping occur in QScreen::connect?
> > * How do I set the screen address pointer?
> > * Does this use QImage::data?
> > * How do I implement uchar * QImage::bits();?
> >
> > I would really enjoy ANY help or suggestions or anything. Just
> > getting to a point where I know there is at least some base plug-in
> > that can be recognized by the Qt application (I use analogclock as
> > a test application). Even if you don't know if your suggestion
> > will help it may steer me in the correct direction so I look
> > forward to hearing from anyone who has anything to add!
>
> In ::connect(), you need to set the pointer to your "fake"
> framebuffer. The pointer is a protected member of QScreen, I think
> called "data", but can't remember exactly.
>
> E.g.
>
>
> MyScreen::MyScreen(int d)
> : QScreen(d)
> {
> }
>
> bool MyScreen::connect()
> {
> m_screenFd = open("/dev/fb0"...);
>
> w = 640;
> h = 480;
> d = 16;
>
> m_image = new QImage(w, h, QImage::Format_RGB16);
> data = m_image->bits();
> }
>
> void MyScreen::blit(const QImage &img,
> const QPoint &topLeft,
> const QRegion ®ion)
> {
> QScreen::blit(img, topLeft, region);
> write(m_screenFd, m_image.bits(), m_image.size());
> }
>
> void MyScreen::solidFill(const QColor &color, const QRegion ®ion)
> {
> QScreen::solidFill(color, region);
> write(m_screenFd, m_image.bits(), m_image.size());
> }
>
>
>
>
> _______________________________________________
> Qt-embedded-interest mailing list
> Qt-embedded-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-embedded-interest
>
> _______________________________________________
> Qt-embedded-interest mailing list
> Qt-embedded-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-embedded-interest
>
>
> _______________________________________________
> Qt-embedded-interest mailing list
> Qt-embedded-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-embedded-interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-embedded-interest/attachments/20090710/3e8a7495/attachment.html
More information about the Qt-embedded-interest
mailing list