Hi,
I am trying to modify HSV values of a Qimage and am finding dithered
edges in the modified image after manipulating the pixels.
Can you provide some pointers on how to fix this issue. My code is given
below ...
public QImage applyImageFilter(final QImage origimg) {
// img is the original image and img1 is the resultant img
QImage img1 = new QImage(80, 80, QImage.Format.Format_ARGB32);
img1.convertToFormat(QImage.Format.Format_ARGB32,
ImageConversionFlag.AlphaDither_Mask);
img1.fill(QColor.transparent.value());
QPainter p = new QPainter(img1);
QSvgRenderer svgrenderer = new QSvgRenderer();
p.setRenderHint(QPainter.RenderHint.Antialiasing, true);
for (int i = 0; i < 80; i++) {
for (int j = 0; j < 80; j++) {
int col = origimg.pixel(i, j);
if (col == 0) {
continue;
}
QColor qcol = new QColor(col);
qcol.setHsvF(0.0, 1.0, 0.5, 1.0);
QPen pen = new QPen(qcol, 1.0, PenStyle.SolidLine,
PenCapStyle.FlatCap, PenJoinStyle.RoundJoin);
p.setPen(pen);
p.drawPoint(i, j);
}
}
p.end();
svgrenderer.render(p);
return img1;
}
Thanks
Chetan
>-----Original Message-----
>From: [email protected]
>[mailto:[email protected]] On Behalf Of
>ext [email protected]
>Sent: Tuesday, January 13, 2009 4:30 PM
>To: [email protected]
>Subject: Qt-jambi-interest Digest, Vol 12, Issue 10
>
>Send Qt-jambi-interest mailing list submissions to
> [email protected]
>
>To subscribe or unsubscribe via the World Wide Web, visit
> http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest
>or, via email, send a message with subject or body 'help' to
> [email protected]
>
>You can reach the person managing the list at
> [email protected]
>
>When replying, please edit your Subject line so it is more
>specific than "Re: Contents of Qt-jambi-interest digest..."
>
>
>Today's Topics:
>
> 1. Re: MP3 support gone in 4.4.2? (Dennis Kehrig)
> 2. Re: MP3 support gone in 4.4.2? (Eskil Abrahamsen Blomfeldt)
> 3. QGraphicsScene performance problem (Matthias Kleine)
> 4. Re: QGraphicsScene performance problem (Gunnar Sletta)
>
>
>----------------------------------------------------------------------
>
>Message: 1
>Date: Mon, 12 Jan 2009 16:18:54 +0100
>From: Dennis Kehrig <[email protected]>
>Subject: Re: [Qt-jambi-interest] MP3 support gone in 4.4.2?
>To: Eskil Abrahamsen Blomfeldt <[email protected]>
>Cc: [email protected]
>Message-ID: <[email protected]>
>Content-Type: text/plain; charset=UTF-8
>
>Hi Eskil,
>
>thank you for taking the time to deal with my problem.
>
>> This sounds very strange, and we have not been able to reproduce it
>> locally. All the codecs for supported file types are located on your
>> system (Phonon plugs into the framework called DirectShow to
>play back
>> media) and should not change for different versions of Qt Jambi.
>
>I just dug a little deeper.
>
>I noticed that not only MP3 files do no longer work with Jambi
>> 4.4.0, but also WAV files (quite possibly all formats except
>Ogg, which you probably handle on your own).
>availableMimeTypes() claims to have support for the usual
>formats, though. When I open an MP3 or WAV file with the Media
>Player example from 4.4.3, it does not even show the duration
>of the song, only the file name.
>
>Turns out that when I start my application from within
>Eclipse, a temporary folder named
>QtJambi_Dennis_x86_4.4.0_01_msvc2005-20080608-0905 is created
>(or QtJambi_Dennis_x86_4.4.3_01_msvc2005-20080925-1845, respectively).
>By replacing plugins\phonon_backend\phonon_ds94.dll in the 4.3
>folder with the one from the 4.0 folder, I get my MP3 and WAV
>support back.
>
>So something changed in phonon_ds94.dll since Qt 4.4.0 that is
>incompatible with at least my configuration.
>
>> Some questions:
>> 1. Does this happen with some specific MP3-files that we could test?
>
>Nope, all Ogg files I tested work, but none of the MP3 or WAV
>files I tested (4.4.0 plays them all, though).
>
>> 2. Are you doing all your tests on the same machine?
>
>Yes. However, I checked which files are accessed using Filemon
>and made sure that no temporary folders remained from
>different versions.
>
>...and now I tested on my other computer as well. It's
>basically the same configuration, though, and the qtjambi.exe
>version behaves exactly as below...
>
>> 3. Do MP3-files still work if you run your application against Qt
>> Jambi 4.4.0 now?
>
>Yes. Same thing with running qtjambi.exe, I can even run
>version 4.4.0 and version 4.4.3 in parallel, the former
>playing MP3s, the latter not.
>
>> 4. Have you tried running the application from a console to see if
>> there is any output at all from the application?
>
>I start my application from within Eclipse and use the
>console, I suppose it would capture any output.
>
>> 5. In your own application, could you call the errorString()
>method on
>> your media object to see if it returns anything?
>
>I did that, but the error string is empty, unfortunately.
>
>BTW, are there any plans on adding meta data support for MP3
>files? All Jambi versions I tried seem to support Ogg meta
>data only. Or maybe that is what changed in 4.4.2?
>
>Again, thank you for your time!
>
>Greetings,
>
>Dennis
>
>
>------------------------------
>
>Message: 2
>Date: Mon, 12 Jan 2009 17:12:31 +0100
>From: Eskil Abrahamsen Blomfeldt <[email protected]>
>Subject: Re: [Qt-jambi-interest] MP3 support gone in 4.4.2?
>To: Dennis Kehrig <[email protected]>
>Cc: [email protected]
>Message-ID: <[email protected]>
>Content-Type: text/plain; charset=UTF-8; format=flowed
>
>Dennis Kehrig wrote:
>> Turns out that when I start my application from within Eclipse, a
>> temporary folder named
>> QtJambi_Dennis_x86_4.4.0_01_msvc2005-20080608-0905 is created (or
>> QtJambi_Dennis_x86_4.4.3_01_msvc2005-20080925-1845, respectively).
>> By replacing plugins\phonon_backend\phonon_ds94.dll in the
>4.3 folder
>> with the one from the 4.0 folder, I get my MP3 and WAV support back.
>>
>> So something changed in phonon_ds94.dll since Qt 4.4.0 that is
>> incompatible with at least my configuration.
>>
>>
>Hi again, Dennis.
>
>I asked the developer of the Phonon DS backend about this, and
>since we are not seeing the bug on any of the three machines
>we've tested on here, he suspects we may be using different
>mp3 codecs with DirectShow.
>
>There is tool called graphedit (graphedt.exe) provided with
>the Platform SDK. Could you try running this, open your
>mp3-file, take a screenshot of the graphedit window and send
>it to me? We might be able to understand more about the
>problem if we have this info.
>
>-- Eskil
>
>
>------------------------------
>
>Message: 3
>Date: Mon, 12 Jan 2009 23:21:47 +0100
>From: Matthias Kleine <[email protected]>
>Subject: [Qt-jambi-interest] QGraphicsScene performance problem
>To: [email protected]
>Message-ID: <[email protected]>
>Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
>Hi there,
>
>I'm currently working on an application which makes use of
>QtJambi and I experience major performance problems. The
>situation is the following:
>I've got a QGraphicsView which is used to display a street map
>and cars moving on it. Streets and cars both are custom
>graphics items. The graphics view displays only a small
>fraction of the map. Every 50ms the position of all cars is updated.
>
>QtJambi takes too much time redrawing the graphics view. Profiling the
>C++ Qt libraries, I found out that in my case more than 40% of the time
>is spent in QGraphicsScene::items(const QPolygonF &polygon,
>...) (called by QGraphicsView::paintEvent to determine the
>visible items) which makes use of several methods which in
>turn call QGraphicsItem::boundingRect.
>As the graphics items are custom graphics items implemented in
>Java, a call to boundingRect (C++ -> Java) is very expensive.
>
>First of all I'm wondering whether this is a known problem
>(with a known solution)?
>
>If not, a solution to it would be to install a bounding rect
>cache somewhere on the C++ layer, either directly in
>QGraphicsItem or in QGraphicsScene. I'm not that familiar with
>the Qt code so I'm asking you whether this is a good idea at
>all or whether you see any other way to fix this problem.
>
>Regards,
>Matthias Kleine
>
>
>------------------------------
>
>Message: 4
>Date: Tue, 13 Jan 2009 09:53:12 +0100
>From: Gunnar Sletta <[email protected]>
>Subject: Re: [Qt-jambi-interest] QGraphicsScene performance problem
>To: Matthias Kleine <[email protected]>
>Cc: [email protected]
>Message-ID: <[email protected]>
>Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
>Matthias Kleine wrote:
>> Hi there,
>>
>> I'm currently working on an application which makes use of
>QtJambi and
>> I experience major performance problems. The situation is
>the following:
>> I've got a QGraphicsView which is used to display a street map and
>> cars moving on it. Streets and cars both are custom graphics items.
>> The graphics view displays only a small fraction of the map. Every
>> 50ms the position of all cars is updated.
>>
>> QtJambi takes too much time redrawing the graphics view.
>Profiling the
>> C++ Qt libraries, I found out that in my case more than 40% of the
>> C++ time
>> is spent in QGraphicsScene::items(const QPolygonF &polygon, ...)
>> (called by QGraphicsView::paintEvent to determine the visible items)
>> which makes use of several methods which in turn call
>QGraphicsItem::boundingRect.
>> As the graphics items are custom graphics items implemented
>in Java, a
>> call to boundingRect (C++ -> Java) is very expensive.
>
>Compared to calling it in C++, it is rather costly, yes...
>
>> First of all I'm wondering whether this is a known problem (with a
>> known solution)?
>
>Many moving items in a scene is a common degenerate usecase
>for the default configuration of QGraphicsView. You can change
>the viewport update mode to do a full viewport update, in
>which case less time is spent in figuring out collisions etc...
>
>http://doc.trolltech.com/qtjambi-4.4/html/com/trolltech/qt/gui/
>QGraphicsView.ViewportUpdateMode.html#FullViewportUpdate
>http://doc.trolltech.com/qtjambi-4.4/html/com/trolltech/qt/gui/
>QGraphicsView.html#setViewportUpdateMode(com.trolltech.qt.gui.Q
>GraphicsView.ViewportUpdateMode)
>
>best regards,
>Gunnar
>
>
>------------------------------
>
>_______________________________________________
>Qt-jambi-interest mailing list
>[email protected]
>http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest
>
>
>End of Qt-jambi-interest Digest, Vol 12, Issue 10
>*************************************************
>
_______________________________________________
Qt-jambi-interest mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest