[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-kimageshop
Subject: optimizing the scaling code
From: Michael Thaler <michael.thaler () physik ! tu-muenchen ! de>
Date: 2005-06-28 7:41:56
Message-ID: 200506280941.56123.michael.thaler () physik ! tu-muenchen ! de
[Download RAW message or body]
Hello,
I think the main speed problem in my current scaling code is that I read
single pixels using
QUANTUM *tmp = new QUANTUM[ pixelSize * sizeof(QUANTUM) ];
m_dev -> readBytes(tmp, x, y, 1, 1);
I am currently rewriting the code to read whole lines and I wonder what is the
best way to do this. Casper's transform visitor does this:
KisHLineIteratorPixel srcIt = src->createHLineIterator(left, y, w, true);
int i = 0;
while(!srcIt.isDone())
{
Q_UINT8 *data;
data = srcIt.rawData();
memcpy(&tmpLine[i*pixelSize], data, pixelSize);
++srcIt;
i++;
}
which creates a temporary array with the pixel data of a line.
Another method would be to just use
QUANTUM *tmp = new QUANTUM[ width * pixelSize * sizeof(QUANTUM) ];
m_dev -> readBytes(tmp, 0, y, width, 1);
What is faster? Or is there any other method to read a line as fast as
possible?
_______________________________________________
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