[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-kimageshop
Subject: Re: QRegion
From: Boudewijn Rempt <boud () valdyas ! org>
Date: 2007-06-06 8:27:34
Message-ID: 200706061027.39996.boud () valdyas ! org
[Download RAW message or body]
[Attachment #2 (multipart/signed)]
On Monday 04 June 2007, Boudewijn Rempt wrote:
> It uses internally some X11 stuff that's meant for optimizing screen
> updates. Yes, having a class that collects rects, computes the smallest set
> of the biggests possible rects is an interesting problem.
I did think a bit on a KisRegion class and I fairly sure that I cannot make it
work.
My first though was to have an internal vector of QRects and juggle the rects
whenever a new rect was added so they didn't overlap -- or only juggle the
rects as soon as a rect or a vector of rects were extracted. I couldn't get
that working, though -- one problem is that it degrades to pixels at some
point. Another is that it's pretty hard to model for someone with little or
no maths experience. I can do the situation where a new rect only overlaps
with a single existing rect, but beyond that it becomes a mess of recursive
splitting of rects. Maybe a real maths wizard can come up with something
better than QRegion...
My second thought was to create a bitmap representing 64x64 rects and flip the
bits that are covered with rects in the region (because we don't necessarily
need the smallest possible rects covered by the region, just an approximation
that's fast and doesn't degrade to scanlines), but then I realized that we
already have something like this, and it's called the tile system -- and we
cannot use the tile system because layers can be moved which mean the tile
boundaries don't align anymore, which means that in a complex layer stack
soon we'll have problems marking layers as clean during the projection
phase.
Anyway, we need a way to mark areas of layers dirty and clean them up;
otherwise we'll always have to recomposite the entire visible area of the
projection, which may well be the entire image, including applying all effect
masks and adjustment layers. (And we'll have to recomposite the entire image
anyway for the histogram computation.) But we lose the QRegion slowness.
--
Boudewijn Rempt
http://www.valdyas.org/fading/index.cgi
["signature.asc" (application/pgp-signature)]
_______________________________________________
kimageshop mailing list
kimageshop@kde.org
https://mail.kde.org/mailman/listinfo/kimageshop
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic