Syntax clean up in qimagescale
Corrects a few white-spaces, return statements and else statements to fit Qt coding style. Comment updated to indicate how far the code is getting from its original roots. No semantic changes. Change-Id: Ia2288c501788a291bfc4e8b70e8eb1efb7a90128 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
This commit is contained in:
parent
e5d85ff44e
commit
71fe2df773
@ -77,6 +77,8 @@ QT_BEGIN_NAMESPACE
|
||||
*
|
||||
* Changes include formatting, namespaces and other C++'ings, removal of old
|
||||
* #ifdef'ed code, and removal of unneeded border calculation code.
|
||||
* Later the code has been refactored and an SSE4.1 optimizated path have been
|
||||
* added instead of the removed MMX assembler.
|
||||
*
|
||||
* Imlib2 is (C) Carsten Haitzler and various contributors. The MMX code
|
||||
* is by Willem Monsuwe <willem@stack.nl>. All other modifications are
|
||||
@ -155,7 +157,7 @@ int* QImageScale::qimageCalcXPoints(int sw, int dw)
|
||||
p[dw - i - 1] = tmp;
|
||||
}
|
||||
}
|
||||
return(p);
|
||||
return p;
|
||||
}
|
||||
|
||||
int* QImageScale::qimageCalcApoints(int s, int d, int up)
|
||||
@ -168,12 +170,10 @@ int* QImageScale::qimageCalcApoints(int s, int d, int up)
|
||||
}
|
||||
p = new int[d];
|
||||
|
||||
/* scaling up */
|
||||
if (up) {
|
||||
qint64 val, inc;
|
||||
|
||||
val = 0x8000 * s / d - 0x8000;
|
||||
inc = (((qint64)s) << 16) / d;
|
||||
/* scaling up */
|
||||
qint64 val = 0x8000 * s / d - 0x8000;
|
||||
qint64 inc = (((qint64)s) << 16) / d;
|
||||
for (int i = 0; i < d; i++) {
|
||||
int pos = val >> 16;
|
||||
if (pos < 0)
|
||||
@ -184,9 +184,8 @@ int* QImageScale::qimageCalcApoints(int s, int d, int up)
|
||||
p[j++] = (val >> 8) - ((val >> 8) & 0xffffff00);
|
||||
val += inc;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* scaling down */
|
||||
else {
|
||||
qint64 val = 0;
|
||||
qint64 inc = (((qint64)s) << 16) / d;
|
||||
int Cp = (((d << 14) + s - 1) / s);
|
||||
@ -239,20 +238,20 @@ QImageScaleInfo* QImageScale::qimageCalcScaleInfo(const QImage &img,
|
||||
|
||||
isi->xpoints = qimageCalcXPoints(img.width(), scw);
|
||||
if (!isi->xpoints)
|
||||
return(qimageFreeScaleInfo(isi));
|
||||
return qimageFreeScaleInfo(isi);
|
||||
isi->ypoints = qimageCalcYPoints((const unsigned int *)img.scanLine(0),
|
||||
img.bytesPerLine() / 4, img.height(), sch);
|
||||
if (!isi->ypoints)
|
||||
return(qimageFreeScaleInfo(isi));
|
||||
return qimageFreeScaleInfo(isi);
|
||||
if (aa) {
|
||||
isi->xapoints = qimageCalcApoints(img.width(), scw, isi->xup_yup & 1);
|
||||
if (!isi->xapoints)
|
||||
return(qimageFreeScaleInfo(isi));
|
||||
return qimageFreeScaleInfo(isi);
|
||||
isi->yapoints = qimageCalcApoints(img.height(), sch, isi->xup_yup & 2);
|
||||
if (!isi->yapoints)
|
||||
return(qimageFreeScaleInfo(isi));
|
||||
return qimageFreeScaleInfo(isi);
|
||||
}
|
||||
return(isi);
|
||||
return isi;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user