[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-kimageshop
Subject:    Re: High-level pixel access methods
From:       Boudewijn Rempt <boud () calcifer ! valdyas ! org>
Date:       2004-02-15 17:04:43
Message-ID: 200402151804.43802.boud () valdyas ! org
[Download RAW message or body]

On Sunday 15 February 2004 17:02, Patrick Julien wrote:

>
> Well, the problem with that is that it will almost certainly fail with
> medium/large images has you need one large buffer to hold all the pixels.
>

How about a producer/consumer kind of thing. That is, define an interface that 
KisPaintDevice can use to fill its KisPixelData, and pass that to 
KisPaintDevice:

class PixelProducer {
	imageType() = 0;
	depth() = 0;
	boolean nextPixel(Pixel & p) = 0;
}


KisPaintDevice::fillWithPixels(PixelProducer source) {
	if source -> depth == depth() && source -> imageType() == imageType() {
		Pixel p;
		int i = 0;
		KisPixelData data;
		while (nextPixel( &p)) {
			data[i] = p;
			i++;
		}
	}
}

Or something like that, but proper C++, and not an unholy mixture of C++ and 
Python, but anyway, that kind of idea.
-- 
Boudewijn Rempt | http://www.valdyas.org/fading/index.cgi
_______________________________________________
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