201 if (dstStart == dstEnd) {
202 dstEnd = dstStart + 1;
215 if (dstStart == dstEnd) {
216 dstEnd = dstStart + 1;
223 if (dstStart >= dstEnd)
return LinePos(dstStart, 0);
224 if (leftSrcBorder >= rightSrcBorder)
return LinePos(dstStart, 0);
225 if (leftSrcBorder > srcLine.
start()) {
226 leftSrcBorder = srcLine.
start();
228 if (srcLine.
end() > rightSrcBorder) {
229 rightSrcBorder = srcLine.
end();
235 const quint8 *defaultPixel = defaultPixelObject.
data();
236 const quint8 *borderPixel = defaultPixel;
237 quint8 *srcLineBuf =
new quint8[pixelSize * (rightSrcBorder - leftSrcBorder)];
239 int i = leftSrcBorder;
240 quint8 *bufPtr = srcLineBuf;
242 T srcIt = tmp::createIterator<T>(
m_src, srcLine.
start(), line, srcLine.
size());
245 borderPixel = srcIt->rawData();
248 for (; i < srcLine.
start(); i++, bufPtr+=pixelSize) {
249 memcpy(bufPtr, borderPixel, pixelSize);
252 for (; i < srcLine.
end(); i++, bufPtr+=pixelSize) {
253 quint8 *data = srcIt->rawData();
254 memcpy(bufPtr, data, pixelSize);
255 memcpy(data, defaultPixel, pixelSize);
260 borderPixel = bufPtr - pixelSize;
263 for (; i < rightSrcBorder; i++, bufPtr+=pixelSize) {
264 memcpy(bufPtr, borderPixel, pixelSize);
267 const quint8 **colors =
new const quint8* [buffer->
maxSpan()];
269 T dstIt = tmp::createIterator<T>(
m_dst, dstStart, line, dstEnd - dstStart);
270 for (
int i = dstStart; i < dstEnd; i++) {
274 int bufIndexEnd = bufIndexStart + span.
weights->
span;
276 const quint8 **colorsPtr = colors;
277 for (
int j = bufIndexStart; j < bufIndexEnd; j++) {
278 *(colorsPtr++) = srcLineBuf + j * pixelSize;
288 return LinePos(dstStart, qMax(0, dstEnd - dstStart));