English 中文(简体)
模棱两可
原标题:Qt motion (linear) blur

是否有一个简单的解决方案来增加 motion语,以达到Qt的形象? Have发现任何精良的bl。 我确实需要一点简单,我可以理解,如果我能够改变模糊的视角,那将确实是好的。

最佳回答

Qt hasn t a initiative blurfil。 我研究了<代码>QGraphicsBlurEffect;它使用<代码>QPixmapBlurEffect,该编码本身使用一个称为<代码>expblur的内部助手方法(对应)。

expblur itself uses a one-dimensional blur effect (motion blur in X direction, method qt_blurrow) twice. It rotates the image between the two blurs by 90 degrees and afterwards rotates it back.

实际上, Qt has 动议模糊不清,但只是内部的。 因此,你需要写自己的效果。 为此,请参阅<代码>qt_blurrrow,可在<代码>上的Qt来源中找到。 这将为过滤器提供良好的质量,因为过滤器是一种超标的过滤器,而不是一条线。

If you don t want to go so deep into the Qt source code, take this pseudo-code as a start:

foreach pixel (x, y) in image {
    for dx = -r to r with x+dx within image {
        for dy = -r to r with y+dy within image {
            Add pixel (x+dx, y+dy) of the source image with ↩
            factor (matrix[dx, dy]) to the target image.
        }
    }
}

where matrix might be defined like this (for horizontal motion blur with radius 2):

0   0   0   0   0
0   0   0   0   0
0.1 0.2 0.4 0.2 0.1
0   0   0   0   0
0   0   0   0   0

通知说,所有条目的总和必须是1个,或你必须按矩阵条目的总和分立。

如果你想允许对α的任意gle角(而不仅仅是90度步骤),就很难为特定rad和角状α建立这一矩阵。 [EDIT:见关于这种矩阵的轻松生成的第3号一般性意见。]

问题回答

暂无回答




相关问题
Qt: Do events get processed in order?

If I had a class A, where one of its functions does: void A::func() { emit first_signal(); emit second_signal(); } Assuming that a class B has 2 slots, one connected to first_signal, and the ...

How to determine how much free space on a drive in Qt?

I m using Qt and want a platform-independent way of getting the available free disk space. I know in Linux I can use statfs and in Windows I can use GetDiskFreeSpaceEx(). I know boost has a way, ...

Drag & drop with .ui files

I m having big troubles with drag & drop. I ve created a new Qt Designer Form Class in which I have one QListWidget and one QWidget. Now I want to enable dragging & dropping between these two ...

Link errors on Snow Leopard

I creating a small desktop application using Qt and Poco on Mac OS X Snow Leopard. Qt works fine, but once I started linking with Poco I get the following warning: ld: warning: in /Developer/SDKs/...

Showing two windows in Qt4

My friend and I have each created parts of a GUI using Qt 4. They both work independently and I am trying to integrate his form with the my main window. As of now this is the code I am using to try ...

Qt equivalent of .NET data binding?

Is there an equivalent of .NET s data binding in Qt? I want to populate some combo boxes and other widgets with QStrings that refer to specific entities in my database. However, it would be cleaner ...

热门标签