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

List:       kde-kimageshop
Subject:    Re: High-level pixel access methods
From:       Patrick Julien <freak () codepimps ! org>
Date:       2004-02-15 23:06:45
Message-ID: 200402151806.45524.freak () codepimps ! org
[Download RAW message or body]

On February 15, 2004 12:04 pm, Boudewijn Rempt wrote:
> 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.

This has the issues... I still thnkt that an iterator is the way to go
_______________________________________________
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