| Line | Source Code | Coverage |
|---|
| 1 | /**************************************************************************** | - |
| 2 | ** | - |
| 3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). | - |
| 4 | ** Contact: http://www.qt-project.org/legal | - |
| 5 | ** | - |
| 6 | ** This file is part of the QtGui module of the Qt Toolkit. | - |
| 7 | ** | - |
| 8 | ** $QT_BEGIN_LICENSE:LGPL$ | - |
| 9 | ** Commercial License Usage | - |
| 10 | ** Licensees holding valid commercial Qt licenses may use this file in | - |
| 11 | ** accordance with the commercial license agreement provided with the | - |
| 12 | ** Software or, alternatively, in accordance with the terms contained in | - |
| 13 | ** a written agreement between you and Digia. For licensing terms and | - |
| 14 | ** conditions see http://qt.digia.com/licensing. For further information | - |
| 15 | ** use the contact form at http://qt.digia.com/contact-us. | - |
| 16 | ** | - |
| 17 | ** GNU Lesser General Public License Usage | - |
| 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser | - |
| 19 | ** General Public License version 2.1 as published by the Free Software | - |
| 20 | ** Foundation and appearing in the file LICENSE.LGPL included in the | - |
| 21 | ** packaging of this file. Please review the following information to | - |
| 22 | ** ensure the GNU Lesser General Public License version 2.1 requirements | - |
| 23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. | - |
| 24 | ** | - |
| 25 | ** In addition, as a special exception, Digia gives you certain additional | - |
| 26 | ** rights. These rights are described in the Digia Qt LGPL Exception | - |
| 27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. | - |
| 28 | ** | - |
| 29 | ** GNU General Public License Usage | - |
| 30 | ** Alternatively, this file may be used under the terms of the GNU | - |
| 31 | ** General Public License version 3.0 as published by the Free Software | - |
| 32 | ** Foundation and appearing in the file LICENSE.GPL included in the | - |
| 33 | ** packaging of this file. Please review the following information to | - |
| 34 | ** ensure the GNU General Public License version 3.0 requirements will be | - |
| 35 | ** met: http://www.gnu.org/copyleft/gpl.html. | - |
| 36 | ** | - |
| 37 | ** | - |
| 38 | ** $QT_END_LICENSE$ | - |
| 39 | ** | - |
| 40 | ****************************************************************************/ | - |
| 41 | #include <private/qimagescale_p.h> | - |
| 42 | #include <private/qdrawhelper_p.h> | - |
| 43 | | - |
| 44 | #include "qimage.h" | - |
| 45 | #include "qcolor.h" | - |
| 46 | | - |
| 47 | QT_BEGIN_NAMESPACE | - |
| 48 | | - |
| 49 | namespace QImageScale { | - |
| 50 | struct QImageScaleInfo; | - |
| 51 | } | - |
| 52 | | - |
| 53 | typedef void (*qt_qimageScaleFunc)(QImageScale::QImageScaleInfo *isi, unsigned int *dest, | - |
| 54 | int dxx, int dyy, int dx, int dy, int dw, | - |
| 55 | int dh, int dow, int sow); | - |
| 56 | | - |
| 57 | static void qt_qimageScaleAARGB(QImageScale::QImageScaleInfo *isi, unsigned int *dest, | - |
| 58 | int dxx, int dyy, int dx, int dy, int dw, | - |
| 59 | int dh, int dow, int sow); | - |
| 60 | | - |
| 61 | static void qt_qimageScaleAARGBA(QImageScale::QImageScaleInfo *isi, unsigned int *dest, | - |
| 62 | int dxx, int dyy, int dx, int dy, int dw, | - |
| 63 | int dh, int dow, int sow); | - |
| 64 | | - |
| 65 | qt_qimageScaleFunc qt_qimageScaleArgb = qt_qimageScaleAARGBA; | - |
| 66 | qt_qimageScaleFunc qt_qimageScaleRgb = qt_qimageScaleAARGB; | - |
| 67 | | - |
| 68 | | - |
| 69 | /* | - |
| 70 | * Copyright (C) 2004, 2005 Daniel M. Duley | - |
| 71 | * | - |
| 72 | * Redistribution and use in source and binary forms, with or without | - |
| 73 | * modification, are permitted provided that the following conditions | - |
| 74 | * are met: | - |
| 75 | * | - |
| 76 | * 1. Redistributions of source code must retain the above copyright | - |
| 77 | * notice, this list of conditions and the following disclaimer. | - |
| 78 | * 2. Redistributions in binary form must reproduce the above copyright | - |
| 79 | * notice, this list of conditions and the following disclaimer in the | - |
| 80 | * documentation and/or other materials provided with the distribution. | - |
| 81 | * | - |
| 82 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | - |
| 83 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | - |
| 84 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | - |
| 85 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | - |
| 86 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | - |
| 87 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | - |
| 88 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | - |
| 89 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | - |
| 90 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | - |
| 91 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | - |
| 92 | * | - |
| 93 | */ | - |
| 94 | | - |
| 95 | /* OTHER CREDITS: | - |
| 96 | * | - |
| 97 | * This is the normal smoothscale method, based on Imlib2's smoothscale. | - |
| 98 | * | - |
| 99 | * Originally I took the algorithm used in NetPBM and Qt and added MMX/3dnow | - |
| 100 | * optimizations. It ran in about 1/2 the time as Qt. Then I ported Imlib's | - |
| 101 | * C algorithm and it ran at about the same speed as my MMX optimized one... | - |
| 102 | * Finally I ported Imlib's MMX version and it ran in less than half the | - |
| 103 | * time as my MMX algorithm, (taking only a quarter of the time Qt does). | - |
| 104 | * After further optimization it seems to run at around 1/6th. | - |
| 105 | * | - |
| 106 | * Changes include formatting, namespaces and other C++'ings, removal of old | - |
| 107 | * #ifdef'ed code, and removal of unneeded border calculation code. | - |
| 108 | * | - |
| 109 | * Imlib2 is (C) Carsten Haitzler and various contributors. The MMX code | - |
| 110 | * is by Willem Monsuwe <willem@stack.nl>. All other modifications are | - |
| 111 | * (C) Daniel M. Duley. | - |
| 112 | */ | - |
| 113 | | - |
| 114 | | - |
| 115 | namespace QImageScale { | - |
| 116 | struct QImageScaleInfo { | - |
| 117 | int *xpoints; | - |
| 118 | unsigned int **ypoints; | - |
| 119 | int *xapoints, *yapoints; | - |
| 120 | int xup_yup; | - |
| 121 | }; | - |
| 122 | | - |
| 123 | unsigned int** qimageCalcYPoints(unsigned int *src, int sw, int sh, | - |
| 124 | int dh); | - |
| 125 | int* qimageCalcXPoints(int sw, int dw); | - |
| 126 | int* qimageCalcApoints(int s, int d, int up); | - |
| 127 | QImageScaleInfo* qimageFreeScaleInfo(QImageScaleInfo *isi); | - |
| 128 | QImageScaleInfo *qimageCalcScaleInfo(const QImage &img, int sw, int sh, | - |
| 129 | int dw, int dh, char aa); | - |
| 130 | } | - |
| 131 | | - |
| 132 | using namespace QImageScale; | - |
| 133 | | - |
| 134 | // | - |
| 135 | // Code ported from Imlib... | - |
| 136 | // | - |
| 137 | | - |
| 138 | // FIXME: replace with qRed, etc... These work on pointers to pixels, not | - |
| 139 | // pixel values | - |
| 140 | #define A_VAL(p) (qAlpha(*p)) | - |
| 141 | #define R_VAL(p) (qRed(*p)) | - |
| 142 | #define G_VAL(p) (qGreen(*p)) | - |
| 143 | #define B_VAL(p) (qBlue(*p)) | - |
| 144 | | - |
| 145 | #define INV_XAP (256 - xapoints[x]) | - |
| 146 | #define XAP (xapoints[x]) | - |
| 147 | #define INV_YAP (256 - yapoints[dyy + y]) | - |
| 148 | #define YAP (yapoints[dyy + y]) | - |
| 149 | | - |
| 150 | unsigned int** QImageScale::qimageCalcYPoints(unsigned int *src, | - |
| 151 | int sw, int sh, int dh) | - |
| 152 | { | - |
| 153 | unsigned int **p; executed (the execution status of this line is deduced): unsigned int **p; | - |
| 154 | int i, j = 0; executed (the execution status of this line is deduced): int i, j = 0; | - |
| 155 | int val, inc, rv = 0; executed (the execution status of this line is deduced): int val, inc, rv = 0; | - |
| 156 | | - |
| 157 | if(dh < 0){ partially evaluated: dh < 0| no Evaluation Count:0 | yes Evaluation Count:236 |
| 0-236 |
| 158 | dh = -dh; never executed (the execution status of this line is deduced): dh = -dh; | - |
| 159 | rv = 1; never executed (the execution status of this line is deduced): rv = 1; | - |
| 160 | } | 0 |
| 161 | p = new unsigned int* [dh+1]; executed (the execution status of this line is deduced): p = new unsigned int* [dh+1]; | - |
| 162 | | - |
| 163 | int up = qAbs(dh) >= sh; executed (the execution status of this line is deduced): int up = qAbs(dh) >= sh; | - |
| 164 | val = up ? 0x8000 * sh / dh - 0x8000 : 0; evaluated: up| yes Evaluation Count:81 | yes Evaluation Count:155 |
| 81-155 |
| 165 | inc = (sh << 16) / dh; executed (the execution status of this line is deduced): inc = (sh << 16) / dh; | - |
| 166 | for(i = 0; i < dh; i++){ evaluated: i < dh| yes Evaluation Count:66715 | yes Evaluation Count:236 |
| 236-66715 |
| 167 | p[j++] = src + qMax(0, val >> 16) * sw; executed (the execution status of this line is deduced): p[j++] = src + qMax(0, val >> 16) * sw; | - |
| 168 | val += inc; executed (the execution status of this line is deduced): val += inc; | - |
| 169 | } executed: }Execution Count:66715 | 66715 |
| 170 | if(rv){ partially evaluated: rv| no Evaluation Count:0 | yes Evaluation Count:236 |
| 0-236 |
| 171 | for(i = dh / 2; --i >= 0; ){ never evaluated: --i >= 0 | 0 |
| 172 | unsigned int *tmp = p[i]; never executed (the execution status of this line is deduced): unsigned int *tmp = p[i]; | - |
| 173 | p[i] = p[dh - i - 1]; never executed (the execution status of this line is deduced): p[i] = p[dh - i - 1]; | - |
| 174 | p[dh - i - 1] = tmp; never executed (the execution status of this line is deduced): p[dh - i - 1] = tmp; | - |
| 175 | } | 0 |
| 176 | } | 0 |
| 177 | return(p); executed: return(p);Execution Count:236 | 236 |
| 178 | } | - |
| 179 | | - |
| 180 | int* QImageScale::qimageCalcXPoints(int sw, int dw) | - |
| 181 | { | - |
| 182 | int *p, i, j = 0; executed (the execution status of this line is deduced): int *p, i, j = 0; | - |
| 183 | int val, inc, rv = 0; executed (the execution status of this line is deduced): int val, inc, rv = 0; | - |
| 184 | | - |
| 185 | if(dw < 0){ partially evaluated: dw < 0| no Evaluation Count:0 | yes Evaluation Count:236 |
| 0-236 |
| 186 | dw = -dw; never executed (the execution status of this line is deduced): dw = -dw; | - |
| 187 | rv = 1; never executed (the execution status of this line is deduced): rv = 1; | - |
| 188 | } | 0 |
| 189 | p = new int[dw+1]; executed (the execution status of this line is deduced): p = new int[dw+1]; | - |
| 190 | | - |
| 191 | int up = qAbs(dw) >= sw; executed (the execution status of this line is deduced): int up = qAbs(dw) >= sw; | - |
| 192 | val = up ? 0x8000 * sw / dw - 0x8000 : 0; evaluated: up| yes Evaluation Count:67 | yes Evaluation Count:169 |
| 67-169 |
| 193 | inc = (sw << 16) / dw; executed (the execution status of this line is deduced): inc = (sw << 16) / dw; | - |
| 194 | for(i = 0; i < dw; i++){ evaluated: i < dw| yes Evaluation Count:66659 | yes Evaluation Count:236 |
| 236-66659 |
| 195 | p[j++] = qMax(0, val >> 16); executed (the execution status of this line is deduced): p[j++] = qMax(0, val >> 16); | - |
| 196 | val += inc; executed (the execution status of this line is deduced): val += inc; | - |
| 197 | } executed: }Execution Count:66659 | 66659 |
| 198 | | - |
| 199 | if(rv){ partially evaluated: rv| no Evaluation Count:0 | yes Evaluation Count:236 |
| 0-236 |
| 200 | for(i = dw / 2; --i >= 0; ){ never evaluated: --i >= 0 | 0 |
| 201 | int tmp = p[i]; never executed (the execution status of this line is deduced): int tmp = p[i]; | - |
| 202 | p[i] = p[dw - i - 1]; never executed (the execution status of this line is deduced): p[i] = p[dw - i - 1]; | - |
| 203 | p[dw - i - 1] = tmp; never executed (the execution status of this line is deduced): p[dw - i - 1] = tmp; | - |
| 204 | } | 0 |
| 205 | } | 0 |
| 206 | return(p); executed: return(p);Execution Count:236 | 236 |
| 207 | } | - |
| 208 | | - |
| 209 | int* QImageScale::qimageCalcApoints(int s, int d, int up) | - |
| 210 | { | - |
| 211 | int *p, i, j = 0, rv = 0; executed (the execution status of this line is deduced): int *p, i, j = 0, rv = 0; | - |
| 212 | | - |
| 213 | if(d < 0){ partially evaluated: d < 0| no Evaluation Count:0 | yes Evaluation Count:472 |
| 0-472 |
| 214 | rv = 1; never executed (the execution status of this line is deduced): rv = 1; | - |
| 215 | d = -d; never executed (the execution status of this line is deduced): d = -d; | - |
| 216 | } | 0 |
| 217 | p = new int[d]; executed (the execution status of this line is deduced): p = new int[d]; | - |
| 218 | | - |
| 219 | /* scaling up */ | - |
| 220 | if(up){ evaluated: up| yes Evaluation Count:148 | yes Evaluation Count:324 |
| 148-324 |
| 221 | int val, inc; executed (the execution status of this line is deduced): int val, inc; | - |
| 222 | | - |
| 223 | val = 0x8000 * s / d - 0x8000; executed (the execution status of this line is deduced): val = 0x8000 * s / d - 0x8000; | - |
| 224 | inc = (s << 16) / d; executed (the execution status of this line is deduced): inc = (s << 16) / d; | - |
| 225 | for(i = 0; i < d; i++){ evaluated: i < d| yes Evaluation Count:20970 | yes Evaluation Count:148 |
| 148-20970 |
| 226 | int pos = val >> 16; executed (the execution status of this line is deduced): int pos = val >> 16; | - |
| 227 | if (pos < 0) evaluated: pos < 0| yes Evaluation Count:247 | yes Evaluation Count:20723 |
| 247-20723 |
| 228 | p[j++] = 0; executed: p[j++] = 0;Execution Count:247 | 247 |
| 229 | else if (pos >= (s - 1)) evaluated: pos >= (s - 1)| yes Evaluation Count:254 | yes Evaluation Count:20469 |
| 254-20469 |
| 230 | p[j++] = 0; executed: p[j++] = 0;Execution Count:254 | 254 |
| 231 | else | - |
| 232 | p[j++] = (val >> 8) - ((val >> 8) & 0xffffff00); executed: p[j++] = (val >> 8) - ((val >> 8) & 0xffffff00);Execution Count:20469 | 20469 |
| 233 | val += inc; executed (the execution status of this line is deduced): val += inc; | - |
| 234 | } executed: }Execution Count:20970 | 20970 |
| 235 | } executed: }Execution Count:148 | 148 |
| 236 | /* scaling down */ | - |
| 237 | else{ | - |
| 238 | int val, inc, ap, Cp; executed (the execution status of this line is deduced): int val, inc, ap, Cp; | - |
| 239 | val = 0; executed (the execution status of this line is deduced): val = 0; | - |
| 240 | inc = (s << 16) / d; executed (the execution status of this line is deduced): inc = (s << 16) / d; | - |
| 241 | Cp = ((d << 14) / s) + 1; executed (the execution status of this line is deduced): Cp = ((d << 14) / s) + 1; | - |
| 242 | for(i = 0; i < d; i++){ evaluated: i < d| yes Evaluation Count:112404 | yes Evaluation Count:324 |
| 324-112404 |
| 243 | ap = ((0x100 - ((val >> 8) & 0xff)) * Cp) >> 8; executed (the execution status of this line is deduced): ap = ((0x100 - ((val >> 8) & 0xff)) * Cp) >> 8; | - |
| 244 | p[j] = ap | (Cp << 16); executed (the execution status of this line is deduced): p[j] = ap | (Cp << 16); | - |
| 245 | j++; executed (the execution status of this line is deduced): j++; | - |
| 246 | val += inc; executed (the execution status of this line is deduced): val += inc; | - |
| 247 | } executed: }Execution Count:112404 | 112404 |
| 248 | } executed: }Execution Count:324 | 324 |
| 249 | if(rv){ partially evaluated: rv| no Evaluation Count:0 | yes Evaluation Count:472 |
| 0-472 |
| 250 | int tmp; never executed (the execution status of this line is deduced): int tmp; | - |
| 251 | for(i = d / 2; --i >= 0; ){ never evaluated: --i >= 0 | 0 |
| 252 | tmp = p[i]; never executed (the execution status of this line is deduced): tmp = p[i]; | - |
| 253 | p[i] = p[d - i - 1]; never executed (the execution status of this line is deduced): p[i] = p[d - i - 1]; | - |
| 254 | p[d - i - 1] = tmp; never executed (the execution status of this line is deduced): p[d - i - 1] = tmp; | - |
| 255 | } | 0 |
| 256 | } | 0 |
| 257 | return(p); executed: return(p);Execution Count:472 | 472 |
| 258 | } | - |
| 259 | | - |
| 260 | QImageScaleInfo* QImageScale::qimageFreeScaleInfo(QImageScaleInfo *isi) | - |
| 261 | { | - |
| 262 | if(isi){ partially evaluated: isi| yes Evaluation Count:236 | no Evaluation Count:0 |
| 0-236 |
| 263 | delete[] isi->xpoints; executed (the execution status of this line is deduced): delete[] isi->xpoints; | - |
| 264 | delete[] isi->ypoints; executed (the execution status of this line is deduced): delete[] isi->ypoints; | - |
| 265 | delete[] isi->xapoints; executed (the execution status of this line is deduced): delete[] isi->xapoints; | - |
| 266 | delete[] isi->yapoints; executed (the execution status of this line is deduced): delete[] isi->yapoints; | - |
| 267 | delete isi; executed (the execution status of this line is deduced): delete isi; | - |
| 268 | } executed: }Execution Count:236 | 236 |
| 269 | return 0; executed: return 0;Execution Count:236 | 236 |
| 270 | } | - |
| 271 | | - |
| 272 | QImageScaleInfo* QImageScale::qimageCalcScaleInfo(const QImage &img, | - |
| 273 | int sw, int sh, | - |
| 274 | int dw, int dh, char aa) | - |
| 275 | { | - |
| 276 | QImageScaleInfo *isi; executed (the execution status of this line is deduced): QImageScaleInfo *isi; | - |
| 277 | int scw, sch; executed (the execution status of this line is deduced): int scw, sch; | - |
| 278 | | - |
| 279 | scw = dw * qlonglong(img.width()) / sw; executed (the execution status of this line is deduced): scw = dw * qlonglong(img.width()) / sw; | - |
| 280 | sch = dh * qlonglong(img.height()) / sh; executed (the execution status of this line is deduced): sch = dh * qlonglong(img.height()) / sh; | - |
| 281 | | - |
| 282 | isi = new QImageScaleInfo; executed (the execution status of this line is deduced): isi = new QImageScaleInfo; | - |
| 283 | if(!isi) partially evaluated: !isi| no Evaluation Count:0 | yes Evaluation Count:236 |
| 0-236 |
| 284 | return 0; never executed: return 0; | 0 |
| 285 | memset(isi, 0, sizeof(QImageScaleInfo)); executed (the execution status of this line is deduced): memset(isi, 0, sizeof(QImageScaleInfo)); | - |
| 286 | | - |
| 287 | isi->xup_yup = (qAbs(dw) >= sw) + ((qAbs(dh) >= sh) << 1); executed (the execution status of this line is deduced): isi->xup_yup = (qAbs(dw) >= sw) + ((qAbs(dh) >= sh) << 1); | - |
| 288 | | - |
| 289 | isi->xpoints = qimageCalcXPoints(img.width(), scw); executed (the execution status of this line is deduced): isi->xpoints = qimageCalcXPoints(img.width(), scw); | - |
| 290 | if(!isi->xpoints) partially evaluated: !isi->xpoints| no Evaluation Count:0 | yes Evaluation Count:236 |
| 0-236 |
| 291 | return(qimageFreeScaleInfo(isi)); never executed: return(qimageFreeScaleInfo(isi)); | 0 |
| 292 | isi->ypoints = qimageCalcYPoints((unsigned int *)img.scanLine(0), executed (the execution status of this line is deduced): isi->ypoints = qimageCalcYPoints((unsigned int *)img.scanLine(0), | - |
| 293 | img.bytesPerLine() / 4, img.height(), sch); executed (the execution status of this line is deduced): img.bytesPerLine() / 4, img.height(), sch); | - |
| 294 | if (!isi->ypoints) partially evaluated: !isi->ypoints| no Evaluation Count:0 | yes Evaluation Count:236 |
| 0-236 |
| 295 | return(qimageFreeScaleInfo(isi)); never executed: return(qimageFreeScaleInfo(isi)); | 0 |
| 296 | if(aa) { partially evaluated: aa| yes Evaluation Count:236 | no Evaluation Count:0 |
| 0-236 |
| 297 | isi->xapoints = qimageCalcApoints(img.width(), scw, isi->xup_yup & 1); executed (the execution status of this line is deduced): isi->xapoints = qimageCalcApoints(img.width(), scw, isi->xup_yup & 1); | - |
| 298 | if(!isi->xapoints) partially evaluated: !isi->xapoints| no Evaluation Count:0 | yes Evaluation Count:236 |
| 0-236 |
| 299 | return(qimageFreeScaleInfo(isi)); never executed: return(qimageFreeScaleInfo(isi)); | 0 |
| 300 | isi->yapoints = qimageCalcApoints(img.height(), sch, isi->xup_yup & 2); executed (the execution status of this line is deduced): isi->yapoints = qimageCalcApoints(img.height(), sch, isi->xup_yup & 2); | - |
| 301 | if(!isi->yapoints) partially evaluated: !isi->yapoints| no Evaluation Count:0 | yes Evaluation Count:236 |
| 0-236 |
| 302 | return(qimageFreeScaleInfo(isi)); never executed: return(qimageFreeScaleInfo(isi)); | 0 |
| 303 | } executed: }Execution Count:236 | 236 |
| 304 | return(isi); executed: return(isi);Execution Count:236 | 236 |
| 305 | } | - |
| 306 | | - |
| 307 | /* FIXME: NEED to optimize ScaleAARGBA - currently its "ok" but needs work*/ | - |
| 308 | | - |
| 309 | /* scale by area sampling */ | - |
| 310 | static void qt_qimageScaleAARGBA(QImageScaleInfo *isi, unsigned int *dest, | - |
| 311 | int dxx, int dyy, int dx, int dy, int dw, | - |
| 312 | int dh, int dow, int sow) | - |
| 313 | { | - |
| 314 | unsigned int *sptr, *dptr; executed (the execution status of this line is deduced): unsigned int *sptr, *dptr; | - |
| 315 | int x, y, end; executed (the execution status of this line is deduced): int x, y, end; | - |
| 316 | unsigned int **ypoints = isi->ypoints; executed (the execution status of this line is deduced): unsigned int **ypoints = isi->ypoints; | - |
| 317 | int *xpoints = isi->xpoints; executed (the execution status of this line is deduced): int *xpoints = isi->xpoints; | - |
| 318 | int *xapoints = isi->xapoints; executed (the execution status of this line is deduced): int *xapoints = isi->xapoints; | - |
| 319 | int *yapoints = isi->yapoints; executed (the execution status of this line is deduced): int *yapoints = isi->yapoints; | - |
| 320 | | - |
| 321 | end = dxx + dw; executed (the execution status of this line is deduced): end = dxx + dw; | - |
| 322 | /* scaling up both ways */ | - |
| 323 | if(isi->xup_yup == 3){ evaluated: isi->xup_yup == 3| yes Evaluation Count:19 | yes Evaluation Count:123 |
| 19-123 |
| 324 | /* go through every scanline in the output buffer */ | - |
| 325 | for(y = 0; y < dh; y++){ evaluated: y < dh| yes Evaluation Count:2175 | yes Evaluation Count:19 |
| 19-2175 |
| 326 | /* calculate the source line we'll scan from */ | - |
| 327 | dptr = dest + dx + ((y + dy) * dow); executed (the execution status of this line is deduced): dptr = dest + dx + ((y + dy) * dow); | - |
| 328 | sptr = ypoints[dyy + y]; executed (the execution status of this line is deduced): sptr = ypoints[dyy + y]; | - |
| 329 | if(YAP > 0){ evaluated: (yapoints[dyy + y]) > 0| yes Evaluation Count:2006 | yes Evaluation Count:169 |
| 169-2006 |
| 330 | for(x = dxx; x < end; x++){ evaluated: x < end| yes Evaluation Count:427762 | yes Evaluation Count:2006 |
| 2006-427762 |
| 331 | int r, g, b, a; executed (the execution status of this line is deduced): int r, g, b, a; | - |
| 332 | int rr, gg, bb, aa; executed (the execution status of this line is deduced): int rr, gg, bb, aa; | - |
| 333 | unsigned int *pix; executed (the execution status of this line is deduced): unsigned int *pix; | - |
| 334 | | - |
| 335 | if(XAP > 0){ evaluated: (xapoints[x]) > 0| yes Evaluation Count:423752 | yes Evaluation Count:4010 |
| 4010-423752 |
| 336 | pix = ypoints[dyy + y] + xpoints[x]; executed (the execution status of this line is deduced): pix = ypoints[dyy + y] + xpoints[x]; | - |
| 337 | r = R_VAL(pix) * INV_XAP; executed (the execution status of this line is deduced): r = (qRed(*pix)) * (256 - xapoints[x]); | - |
| 338 | g = G_VAL(pix) * INV_XAP; executed (the execution status of this line is deduced): g = (qGreen(*pix)) * (256 - xapoints[x]); | - |
| 339 | b = B_VAL(pix) * INV_XAP; executed (the execution status of this line is deduced): b = (qBlue(*pix)) * (256 - xapoints[x]); | - |
| 340 | a = A_VAL(pix) * INV_XAP; executed (the execution status of this line is deduced): a = (qAlpha(*pix)) * (256 - xapoints[x]); | - |
| 341 | pix++; executed (the execution status of this line is deduced): pix++; | - |
| 342 | r += R_VAL(pix) * XAP; executed (the execution status of this line is deduced): r += (qRed(*pix)) * (xapoints[x]); | - |
| 343 | g += G_VAL(pix) * XAP; executed (the execution status of this line is deduced): g += (qGreen(*pix)) * (xapoints[x]); | - |
| 344 | b += B_VAL(pix) * XAP; executed (the execution status of this line is deduced): b += (qBlue(*pix)) * (xapoints[x]); | - |
| 345 | a += A_VAL(pix) * XAP; executed (the execution status of this line is deduced): a += (qAlpha(*pix)) * (xapoints[x]); | - |
| 346 | pix += sow; executed (the execution status of this line is deduced): pix += sow; | - |
| 347 | rr = R_VAL(pix) * XAP; executed (the execution status of this line is deduced): rr = (qRed(*pix)) * (xapoints[x]); | - |
| 348 | gg = G_VAL(pix) * XAP; executed (the execution status of this line is deduced): gg = (qGreen(*pix)) * (xapoints[x]); | - |
| 349 | bb = B_VAL(pix) * XAP; executed (the execution status of this line is deduced): bb = (qBlue(*pix)) * (xapoints[x]); | - |
| 350 | aa = A_VAL(pix) * XAP; executed (the execution status of this line is deduced): aa = (qAlpha(*pix)) * (xapoints[x]); | - |
| 351 | pix--; executed (the execution status of this line is deduced): pix--; | - |
| 352 | rr += R_VAL(pix) * INV_XAP; executed (the execution status of this line is deduced): rr += (qRed(*pix)) * (256 - xapoints[x]); | - |
| 353 | gg += G_VAL(pix) * INV_XAP; executed (the execution status of this line is deduced): gg += (qGreen(*pix)) * (256 - xapoints[x]); | - |
| 354 | bb += B_VAL(pix) * INV_XAP; executed (the execution status of this line is deduced): bb += (qBlue(*pix)) * (256 - xapoints[x]); | - |
| 355 | aa += A_VAL(pix) * INV_XAP; executed (the execution status of this line is deduced): aa += (qAlpha(*pix)) * (256 - xapoints[x]); | - |
| 356 | r = ((rr * YAP) + (r * INV_YAP)) >> 16; executed (the execution status of this line is deduced): r = ((rr * (yapoints[dyy + y])) + (r * (256 - yapoints[dyy + y]))) >> 16; | - |
| 357 | g = ((gg * YAP) + (g * INV_YAP)) >> 16; executed (the execution status of this line is deduced): g = ((gg * (yapoints[dyy + y])) + (g * (256 - yapoints[dyy + y]))) >> 16; | - |
| 358 | b = ((bb * YAP) + (b * INV_YAP)) >> 16; executed (the execution status of this line is deduced): b = ((bb * (yapoints[dyy + y])) + (b * (256 - yapoints[dyy + y]))) >> 16; | - |
| 359 | a = ((aa * YAP) + (a * INV_YAP)) >> 16; executed (the execution status of this line is deduced): a = ((aa * (yapoints[dyy + y])) + (a * (256 - yapoints[dyy + y]))) >> 16; | - |
| 360 | *dptr++ = qRgba(r, g, b, a); executed (the execution status of this line is deduced): *dptr++ = qRgba(r, g, b, a); | - |
| 361 | } executed: }Execution Count:423752 | 423752 |
| 362 | else{ | - |
| 363 | pix = ypoints[dyy + y] + xpoints[x]; executed (the execution status of this line is deduced): pix = ypoints[dyy + y] + xpoints[x]; | - |
| 364 | r = R_VAL(pix) * INV_YAP; executed (the execution status of this line is deduced): r = (qRed(*pix)) * (256 - yapoints[dyy + y]); | - |
| 365 | g = G_VAL(pix) * INV_YAP; executed (the execution status of this line is deduced): g = (qGreen(*pix)) * (256 - yapoints[dyy + y]); | - |
| 366 | b = B_VAL(pix) * INV_YAP; executed (the execution status of this line is deduced): b = (qBlue(*pix)) * (256 - yapoints[dyy + y]); | - |
| 367 | a = A_VAL(pix) * INV_YAP; executed (the execution status of this line is deduced): a = (qAlpha(*pix)) * (256 - yapoints[dyy + y]); | - |
| 368 | pix += sow; executed (the execution status of this line is deduced): pix += sow; | - |
| 369 | r += R_VAL(pix) * YAP; executed (the execution status of this line is deduced): r += (qRed(*pix)) * (yapoints[dyy + y]); | - |
| 370 | g += G_VAL(pix) * YAP; executed (the execution status of this line is deduced): g += (qGreen(*pix)) * (yapoints[dyy + y]); | - |
| 371 | b += B_VAL(pix) * YAP; executed (the execution status of this line is deduced): b += (qBlue(*pix)) * (yapoints[dyy + y]); | - |
| 372 | a += A_VAL(pix) * YAP; executed (the execution status of this line is deduced): a += (qAlpha(*pix)) * (yapoints[dyy + y]); | - |
| 373 | r >>= 8; executed (the execution status of this line is deduced): r >>= 8; | - |
| 374 | g >>= 8; executed (the execution status of this line is deduced): g >>= 8; | - |
| 375 | b >>= 8; executed (the execution status of this line is deduced): b >>= 8; | - |
| 376 | a >>= 8; executed (the execution status of this line is deduced): a >>= 8; | - |
| 377 | *dptr++ = qRgba(r, g, b, a); executed (the execution status of this line is deduced): *dptr++ = qRgba(r, g, b, a); | - |
| 378 | } executed: }Execution Count:4010 | 4010 |
| 379 | } | - |
| 380 | } executed: }Execution Count:2006 | 2006 |
| 381 | else{ | - |
| 382 | for(x = dxx; x < end; x++){ evaluated: x < end| yes Evaluation Count:22074 | yes Evaluation Count:169 |
| 169-22074 |
| 383 | int r, g, b, a; executed (the execution status of this line is deduced): int r, g, b, a; | - |
| 384 | unsigned int *pix; executed (the execution status of this line is deduced): unsigned int *pix; | - |
| 385 | | - |
| 386 | if(XAP > 0){ evaluated: (xapoints[x]) > 0| yes Evaluation Count:5610 | yes Evaluation Count:16464 |
| 5610-16464 |
| 387 | pix = ypoints[dyy + y] + xpoints[x]; executed (the execution status of this line is deduced): pix = ypoints[dyy + y] + xpoints[x]; | - |
| 388 | r = R_VAL(pix) * INV_XAP; executed (the execution status of this line is deduced): r = (qRed(*pix)) * (256 - xapoints[x]); | - |
| 389 | g = G_VAL(pix) * INV_XAP; executed (the execution status of this line is deduced): g = (qGreen(*pix)) * (256 - xapoints[x]); | - |
| 390 | b = B_VAL(pix) * INV_XAP; executed (the execution status of this line is deduced): b = (qBlue(*pix)) * (256 - xapoints[x]); | - |
| 391 | a = A_VAL(pix) * INV_XAP; executed (the execution status of this line is deduced): a = (qAlpha(*pix)) * (256 - xapoints[x]); | - |
| 392 | pix++; executed (the execution status of this line is deduced): pix++; | - |
| 393 | r += R_VAL(pix) * XAP; executed (the execution status of this line is deduced): r += (qRed(*pix)) * (xapoints[x]); | - |
| 394 | g += G_VAL(pix) * XAP; executed (the execution status of this line is deduced): g += (qGreen(*pix)) * (xapoints[x]); | - |
| 395 | b += B_VAL(pix) * XAP; executed (the execution status of this line is deduced): b += (qBlue(*pix)) * (xapoints[x]); | - |
| 396 | a += A_VAL(pix) * XAP; executed (the execution status of this line is deduced): a += (qAlpha(*pix)) * (xapoints[x]); | - |
| 397 | r >>= 8; executed (the execution status of this line is deduced): r >>= 8; | - |
| 398 | g >>= 8; executed (the execution status of this line is deduced): g >>= 8; | - |
| 399 | b >>= 8; executed (the execution status of this line is deduced): b >>= 8; | - |
| 400 | a >>= 8; executed (the execution status of this line is deduced): a >>= 8; | - |
| 401 | *dptr++ = qRgba(r, g, b, a); executed (the execution status of this line is deduced): *dptr++ = qRgba(r, g, b, a); | - |
| 402 | } executed: }Execution Count:5610 | 5610 |
| 403 | else | - |
| 404 | *dptr++ = sptr[xpoints[x] ]; executed: *dptr++ = sptr[xpoints[x] ];Execution Count:16464 | 16464 |
| 405 | } | - |
| 406 | } executed: }Execution Count:169 | 169 |
| 407 | } | - |
| 408 | } executed: }Execution Count:19 | 19 |
| 409 | /* if we're scaling down vertically */ | - |
| 410 | else if(isi->xup_yup == 1){ evaluated: isi->xup_yup == 1| yes Evaluation Count:13 | yes Evaluation Count:110 |
| 13-110 |
| 411 | /*\ 'Correct' version, with math units prepared for MMXification \*/ | - |
| 412 | int Cy, j; executed (the execution status of this line is deduced): int Cy, j; | - |
| 413 | unsigned int *pix; executed (the execution status of this line is deduced): unsigned int *pix; | - |
| 414 | int r, g, b, a, rr, gg, bb, aa; executed (the execution status of this line is deduced): int r, g, b, a, rr, gg, bb, aa; | - |
| 415 | int yap; executed (the execution status of this line is deduced): int yap; | - |
| 416 | | - |
| 417 | /* go through every scanline in the output buffer */ | - |
| 418 | for(y = 0; y < dh; y++){ evaluated: y < dh| yes Evaluation Count:50012 | yes Evaluation Count:13 |
| 13-50012 |
| 419 | Cy = YAP >> 16; executed (the execution status of this line is deduced): Cy = (yapoints[dyy + y]) >> 16; | - |
| 420 | yap = YAP & 0xffff; executed (the execution status of this line is deduced): yap = (yapoints[dyy + y]) & 0xffff; | - |
| 421 | | - |
| 422 | dptr = dest + dx + ((y + dy) * dow); executed (the execution status of this line is deduced): dptr = dest + dx + ((y + dy) * dow); | - |
| 423 | for(x = dxx; x < end; x++){ evaluated: x < end| yes Evaluation Count:201050 | yes Evaluation Count:50012 |
| 50012-201050 |
| 424 | pix = ypoints[dyy + y] + xpoints[x]; executed (the execution status of this line is deduced): pix = ypoints[dyy + y] + xpoints[x]; | - |
| 425 | r = R_VAL(pix) * yap; executed (the execution status of this line is deduced): r = (qRed(*pix)) * yap; | - |
| 426 | g = G_VAL(pix) * yap; executed (the execution status of this line is deduced): g = (qGreen(*pix)) * yap; | - |
| 427 | b = B_VAL(pix) * yap; executed (the execution status of this line is deduced): b = (qBlue(*pix)) * yap; | - |
| 428 | a = A_VAL(pix) * yap; executed (the execution status of this line is deduced): a = (qAlpha(*pix)) * yap; | - |
| 429 | for(j = (1 << 14) - yap; j > Cy; j -= Cy){ evaluated: j > Cy| yes Evaluation Count:685406 | yes Evaluation Count:201050 |
| 201050-685406 |
| 430 | pix += sow; executed (the execution status of this line is deduced): pix += sow; | - |
| 431 | r += R_VAL(pix) * Cy; executed (the execution status of this line is deduced): r += (qRed(*pix)) * Cy; | - |
| 432 | g += G_VAL(pix) * Cy; executed (the execution status of this line is deduced): g += (qGreen(*pix)) * Cy; | - |
| 433 | b += B_VAL(pix) * Cy; executed (the execution status of this line is deduced): b += (qBlue(*pix)) * Cy; | - |
| 434 | a += A_VAL(pix) * Cy; executed (the execution status of this line is deduced): a += (qAlpha(*pix)) * Cy; | - |
| 435 | } executed: }Execution Count:685406 | 685406 |
| 436 | if(j > 0){ partially evaluated: j > 0| yes Evaluation Count:201050 | no Evaluation Count:0 |
| 0-201050 |
| 437 | pix += sow; executed (the execution status of this line is deduced): pix += sow; | - |
| 438 | r += R_VAL(pix) * j; executed (the execution status of this line is deduced): r += (qRed(*pix)) * j; | - |
| 439 | g += G_VAL(pix) * j; executed (the execution status of this line is deduced): g += (qGreen(*pix)) * j; | - |
| 440 | b += B_VAL(pix) * j; executed (the execution status of this line is deduced): b += (qBlue(*pix)) * j; | - |
| 441 | a += A_VAL(pix) * j; executed (the execution status of this line is deduced): a += (qAlpha(*pix)) * j; | - |
| 442 | } executed: }Execution Count:201050 | 201050 |
| 443 | if(XAP > 0){ evaluated: (xapoints[x]) > 0| yes Evaluation Count:1026 | yes Evaluation Count:200024 |
| 1026-200024 |
| 444 | pix = ypoints[dyy + y] + xpoints[x] + 1; executed (the execution status of this line is deduced): pix = ypoints[dyy + y] + xpoints[x] + 1; | - |
| 445 | rr = R_VAL(pix) * yap; executed (the execution status of this line is deduced): rr = (qRed(*pix)) * yap; | - |
| 446 | gg = G_VAL(pix) * yap; executed (the execution status of this line is deduced): gg = (qGreen(*pix)) * yap; | - |
| 447 | bb = B_VAL(pix) * yap; executed (the execution status of this line is deduced): bb = (qBlue(*pix)) * yap; | - |
| 448 | aa = A_VAL(pix) * yap; executed (the execution status of this line is deduced): aa = (qAlpha(*pix)) * yap; | - |
| 449 | for(j = (1 << 14) - yap; j > Cy; j -= Cy){ evaluated: j > Cy| yes Evaluation Count:85188 | yes Evaluation Count:1026 |
| 1026-85188 |
| 450 | pix += sow; executed (the execution status of this line is deduced): pix += sow; | - |
| 451 | rr += R_VAL(pix) * Cy; executed (the execution status of this line is deduced): rr += (qRed(*pix)) * Cy; | - |
| 452 | gg += G_VAL(pix) * Cy; executed (the execution status of this line is deduced): gg += (qGreen(*pix)) * Cy; | - |
| 453 | bb += B_VAL(pix) * Cy; executed (the execution status of this line is deduced): bb += (qBlue(*pix)) * Cy; | - |
| 454 | aa += A_VAL(pix) * Cy; executed (the execution status of this line is deduced): aa += (qAlpha(*pix)) * Cy; | - |
| 455 | } executed: }Execution Count:85188 | 85188 |
| 456 | if(j > 0){ partially evaluated: j > 0| yes Evaluation Count:1026 | no Evaluation Count:0 |
| 0-1026 |
| 457 | pix += sow; executed (the execution status of this line is deduced): pix += sow; | - |
| 458 | rr += R_VAL(pix) * j; executed (the execution status of this line is deduced): rr += (qRed(*pix)) * j; | - |
| 459 | gg += G_VAL(pix) * j; executed (the execution status of this line is deduced): gg += (qGreen(*pix)) * j; | - |
| 460 | bb += B_VAL(pix) * j; executed (the execution status of this line is deduced): bb += (qBlue(*pix)) * j; | - |
| 461 | aa += A_VAL(pix) * j; executed (the execution status of this line is deduced): aa += (qAlpha(*pix)) * j; | - |
| 462 | } executed: }Execution Count:1026 | 1026 |
| 463 | r = r * INV_XAP; executed (the execution status of this line is deduced): r = r * (256 - xapoints[x]); | - |
| 464 | g = g * INV_XAP; executed (the execution status of this line is deduced): g = g * (256 - xapoints[x]); | - |
| 465 | b = b * INV_XAP; executed (the execution status of this line is deduced): b = b * (256 - xapoints[x]); | - |
| 466 | a = a * INV_XAP; executed (the execution status of this line is deduced): a = a * (256 - xapoints[x]); | - |
| 467 | r = (r + ((rr * XAP))) >> 12; executed (the execution status of this line is deduced): r = (r + ((rr * (xapoints[x])))) >> 12; | - |
| 468 | g = (g + ((gg * XAP))) >> 12; executed (the execution status of this line is deduced): g = (g + ((gg * (xapoints[x])))) >> 12; | - |
| 469 | b = (b + ((bb * XAP))) >> 12; executed (the execution status of this line is deduced): b = (b + ((bb * (xapoints[x])))) >> 12; | - |
| 470 | a = (a + ((aa * XAP))) >> 12; executed (the execution status of this line is deduced): a = (a + ((aa * (xapoints[x])))) >> 12; | - |
| 471 | } executed: }Execution Count:1026 | 1026 |
| 472 | else{ | - |
| 473 | r >>= 4; executed (the execution status of this line is deduced): r >>= 4; | - |
| 474 | g >>= 4; executed (the execution status of this line is deduced): g >>= 4; | - |
| 475 | b >>= 4; executed (the execution status of this line is deduced): b >>= 4; | - |
| 476 | a >>= 4; executed (the execution status of this line is deduced): a >>= 4; | - |
| 477 | } executed: }Execution Count:200024 | 200024 |
| 478 | *dptr = qRgba(r >> 10, g >> 10, b >> 10, a >> 10); executed (the execution status of this line is deduced): *dptr = qRgba(r >> 10, g >> 10, b >> 10, a >> 10); | - |
| 479 | dptr++; executed (the execution status of this line is deduced): dptr++; | - |
| 480 | } executed: }Execution Count:201050 | 201050 |
| 481 | } executed: }Execution Count:50012 | 50012 |
| 482 | } executed: }Execution Count:13 | 13 |
| 483 | /* if we're scaling down horizontally */ | - |
| 484 | else if(isi->xup_yup == 2){ evaluated: isi->xup_yup == 2| yes Evaluation Count:16 | yes Evaluation Count:94 |
| 16-94 |
| 485 | /*\ 'Correct' version, with math units prepared for MMXification \*/ | - |
| 486 | int Cx, j; executed (the execution status of this line is deduced): int Cx, j; | - |
| 487 | unsigned int *pix; executed (the execution status of this line is deduced): unsigned int *pix; | - |
| 488 | int r, g, b, a, rr, gg, bb, aa; executed (the execution status of this line is deduced): int r, g, b, a, rr, gg, bb, aa; | - |
| 489 | int xap; executed (the execution status of this line is deduced): int xap; | - |
| 490 | | - |
| 491 | /* go through every scanline in the output buffer */ | - |
| 492 | for(y = 0; y < dh; y++){ evaluated: y < dh| yes Evaluation Count:1854 | yes Evaluation Count:16 |
| 16-1854 |
| 493 | dptr = dest + dx + ((y + dy) * dow); executed (the execution status of this line is deduced): dptr = dest + dx + ((y + dy) * dow); | - |
| 494 | for(x = dxx; x < end; x++){ evaluated: x < end| yes Evaluation Count:421050 | yes Evaluation Count:1854 |
| 1854-421050 |
| 495 | Cx = XAP >> 16; executed (the execution status of this line is deduced): Cx = (xapoints[x]) >> 16; | - |
| 496 | xap = XAP & 0xffff; executed (the execution status of this line is deduced): xap = (xapoints[x]) & 0xffff; | - |
| 497 | | - |
| 498 | pix = ypoints[dyy + y] + xpoints[x]; executed (the execution status of this line is deduced): pix = ypoints[dyy + y] + xpoints[x]; | - |
| 499 | r = R_VAL(pix) * xap; executed (the execution status of this line is deduced): r = (qRed(*pix)) * xap; | - |
| 500 | g = G_VAL(pix) * xap; executed (the execution status of this line is deduced): g = (qGreen(*pix)) * xap; | - |
| 501 | b = B_VAL(pix) * xap; executed (the execution status of this line is deduced): b = (qBlue(*pix)) * xap; | - |
| 502 | a = A_VAL(pix) * xap; executed (the execution status of this line is deduced): a = (qAlpha(*pix)) * xap; | - |
| 503 | for(j = (1 << 14) - xap; j > Cx; j -= Cx){ evaluated: j > Cx| yes Evaluation Count:813406 | yes Evaluation Count:421050 |
| 421050-813406 |
| 504 | pix++; executed (the execution status of this line is deduced): pix++; | - |
| 505 | r += R_VAL(pix) * Cx; executed (the execution status of this line is deduced): r += (qRed(*pix)) * Cx; | - |
| 506 | g += G_VAL(pix) * Cx; executed (the execution status of this line is deduced): g += (qGreen(*pix)) * Cx; | - |
| 507 | b += B_VAL(pix) * Cx; executed (the execution status of this line is deduced): b += (qBlue(*pix)) * Cx; | - |
| 508 | a += A_VAL(pix) * Cx; executed (the execution status of this line is deduced): a += (qAlpha(*pix)) * Cx; | - |
| 509 | } executed: }Execution Count:813406 | 813406 |
| 510 | if(j > 0){ partially evaluated: j > 0| yes Evaluation Count:421050 | no Evaluation Count:0 |
| 0-421050 |
| 511 | pix++; executed (the execution status of this line is deduced): pix++; | - |
| 512 | r += R_VAL(pix) * j; executed (the execution status of this line is deduced): r += (qRed(*pix)) * j; | - |
| 513 | g += G_VAL(pix) * j; executed (the execution status of this line is deduced): g += (qGreen(*pix)) * j; | - |
| 514 | b += B_VAL(pix) * j; executed (the execution status of this line is deduced): b += (qBlue(*pix)) * j; | - |
| 515 | a += A_VAL(pix) * j; executed (the execution status of this line is deduced): a += (qAlpha(*pix)) * j; | - |
| 516 | } executed: }Execution Count:421050 | 421050 |
| 517 | if(YAP > 0){ evaluated: (yapoints[dyy + y]) > 0| yes Evaluation Count:219426 | yes Evaluation Count:201624 |
| 201624-219426 |
| 518 | pix = ypoints[dyy + y] + xpoints[x] + sow; executed (the execution status of this line is deduced): pix = ypoints[dyy + y] + xpoints[x] + sow; | - |
| 519 | rr = R_VAL(pix) * xap; executed (the execution status of this line is deduced): rr = (qRed(*pix)) * xap; | - |
| 520 | gg = G_VAL(pix) * xap; executed (the execution status of this line is deduced): gg = (qGreen(*pix)) * xap; | - |
| 521 | bb = B_VAL(pix) * xap; executed (the execution status of this line is deduced): bb = (qBlue(*pix)) * xap; | - |
| 522 | aa = A_VAL(pix) * xap; executed (the execution status of this line is deduced): aa = (qAlpha(*pix)) * xap; | - |
| 523 | for(j = (1 << 14) - xap; j > Cx; j -= Cx){ evaluated: j > Cx| yes Evaluation Count:212178 | yes Evaluation Count:219426 |
| 212178-219426 |
| 524 | pix++; executed (the execution status of this line is deduced): pix++; | - |
| 525 | rr += R_VAL(pix) * Cx; executed (the execution status of this line is deduced): rr += (qRed(*pix)) * Cx; | - |
| 526 | gg += G_VAL(pix) * Cx; executed (the execution status of this line is deduced): gg += (qGreen(*pix)) * Cx; | - |
| 527 | bb += B_VAL(pix) * Cx; executed (the execution status of this line is deduced): bb += (qBlue(*pix)) * Cx; | - |
| 528 | aa += A_VAL(pix) * Cx; executed (the execution status of this line is deduced): aa += (qAlpha(*pix)) * Cx; | - |
| 529 | } executed: }Execution Count:212178 | 212178 |
| 530 | if(j > 0){ partially evaluated: j > 0| yes Evaluation Count:219426 | no Evaluation Count:0 |
| 0-219426 |
| 531 | pix++; executed (the execution status of this line is deduced): pix++; | - |
| 532 | rr += R_VAL(pix) * j; executed (the execution status of this line is deduced): rr += (qRed(*pix)) * j; | - |
| 533 | gg += G_VAL(pix) * j; executed (the execution status of this line is deduced): gg += (qGreen(*pix)) * j; | - |
| 534 | bb += B_VAL(pix) * j; executed (the execution status of this line is deduced): bb += (qBlue(*pix)) * j; | - |
| 535 | aa += A_VAL(pix) * j; executed (the execution status of this line is deduced): aa += (qAlpha(*pix)) * j; | - |
| 536 | } executed: }Execution Count:219426 | 219426 |
| 537 | r = r * INV_YAP; executed (the execution status of this line is deduced): r = r * (256 - yapoints[dyy + y]); | - |
| 538 | g = g * INV_YAP; executed (the execution status of this line is deduced): g = g * (256 - yapoints[dyy + y]); | - |
| 539 | b = b * INV_YAP; executed (the execution status of this line is deduced): b = b * (256 - yapoints[dyy + y]); | - |
| 540 | a = a * INV_YAP; executed (the execution status of this line is deduced): a = a * (256 - yapoints[dyy + y]); | - |
| 541 | r = (r + ((rr * YAP))) >> 12; executed (the execution status of this line is deduced): r = (r + ((rr * (yapoints[dyy + y])))) >> 12; | - |
| 542 | g = (g + ((gg * YAP))) >> 12; executed (the execution status of this line is deduced): g = (g + ((gg * (yapoints[dyy + y])))) >> 12; | - |
| 543 | b = (b + ((bb * YAP))) >> 12; executed (the execution status of this line is deduced): b = (b + ((bb * (yapoints[dyy + y])))) >> 12; | - |
| 544 | a = (a + ((aa * YAP))) >> 12; executed (the execution status of this line is deduced): a = (a + ((aa * (yapoints[dyy + y])))) >> 12; | - |
| 545 | } executed: }Execution Count:219426 | 219426 |
| 546 | else{ | - |
| 547 | r >>= 4; executed (the execution status of this line is deduced): r >>= 4; | - |
| 548 | g >>= 4; executed (the execution status of this line is deduced): g >>= 4; | - |
| 549 | b >>= 4; executed (the execution status of this line is deduced): b >>= 4; | - |
| 550 | a >>= 4; executed (the execution status of this line is deduced): a >>= 4; | - |
| 551 | } executed: }Execution Count:201624 | 201624 |
| 552 | *dptr = qRgba(r >> 10, g >> 10, b >> 10, a >> 10); executed (the execution status of this line is deduced): *dptr = qRgba(r >> 10, g >> 10, b >> 10, a >> 10); | - |
| 553 | dptr++; executed (the execution status of this line is deduced): dptr++; | - |
| 554 | } executed: }Execution Count:421050 | 421050 |
| 555 | } executed: }Execution Count:1854 | 1854 |
| 556 | } executed: }Execution Count:16 | 16 |
| 557 | /* if we're scaling down horizontally & vertically */ | - |
| 558 | else{ | - |
| 559 | /*\ 'Correct' version, with math units prepared for MMXification: | - |
| 560 | |*| The operation 'b = (b * c) >> 16' translates to pmulhw, | - |
| 561 | |*| so the operation 'b = (b * c) >> d' would translate to | - |
| 562 | |*| psllw (16 - d), %mmb; pmulh %mmc, %mmb | - |
| 563 | \*/ | - |
| 564 | int Cx, Cy, i, j; executed (the execution status of this line is deduced): int Cx, Cy, i, j; | - |
| 565 | unsigned int *pix; executed (the execution status of this line is deduced): unsigned int *pix; | - |
| 566 | int a, r, g, b, ax, rx, gx, bx; executed (the execution status of this line is deduced): int a, r, g, b, ax, rx, gx, bx; | - |
| 567 | int xap, yap; executed (the execution status of this line is deduced): int xap, yap; | - |
| 568 | | - |
| 569 | for(y = 0; y < dh; y++){ evaluated: y < dh| yes Evaluation Count:1486 | yes Evaluation Count:94 |
| 94-1486 |
| 570 | Cy = YAP >> 16; executed (the execution status of this line is deduced): Cy = (yapoints[dyy + y]) >> 16; | - |
| 571 | yap = YAP & 0xffff; executed (the execution status of this line is deduced): yap = (yapoints[dyy + y]) & 0xffff; | - |
| 572 | | - |
| 573 | dptr = dest + dx + ((y + dy) * dow); executed (the execution status of this line is deduced): dptr = dest + dx + ((y + dy) * dow); | - |
| 574 | for(x = dxx; x < end; x++){ evaluated: x < end| yes Evaluation Count:39720 | yes Evaluation Count:1486 |
| 1486-39720 |
| 575 | Cx = XAP >> 16; executed (the execution status of this line is deduced): Cx = (xapoints[x]) >> 16; | - |
| 576 | xap = XAP & 0xffff; executed (the execution status of this line is deduced): xap = (xapoints[x]) & 0xffff; | - |
| 577 | | - |
| 578 | sptr = ypoints[dyy + y] + xpoints[x]; executed (the execution status of this line is deduced): sptr = ypoints[dyy + y] + xpoints[x]; | - |
| 579 | pix = sptr; executed (the execution status of this line is deduced): pix = sptr; | - |
| 580 | sptr += sow; executed (the execution status of this line is deduced): sptr += sow; | - |
| 581 | rx = R_VAL(pix) * xap; executed (the execution status of this line is deduced): rx = (qRed(*pix)) * xap; | - |
| 582 | gx = G_VAL(pix) * xap; executed (the execution status of this line is deduced): gx = (qGreen(*pix)) * xap; | - |
| 583 | bx = B_VAL(pix) * xap; executed (the execution status of this line is deduced): bx = (qBlue(*pix)) * xap; | - |
| 584 | ax = A_VAL(pix) * xap; executed (the execution status of this line is deduced): ax = (qAlpha(*pix)) * xap; | - |
| 585 | | - |
| 586 | pix++; executed (the execution status of this line is deduced): pix++; | - |
| 587 | for(i = (1 << 14) - xap; i > Cx; i -= Cx){ evaluated: i > Cx| yes Evaluation Count:18783 | yes Evaluation Count:39720 |
| 18783-39720 |
| 588 | rx += R_VAL(pix) * Cx; executed (the execution status of this line is deduced): rx += (qRed(*pix)) * Cx; | - |
| 589 | gx += G_VAL(pix) * Cx; executed (the execution status of this line is deduced): gx += (qGreen(*pix)) * Cx; | - |
| 590 | bx += B_VAL(pix) * Cx; executed (the execution status of this line is deduced): bx += (qBlue(*pix)) * Cx; | - |
| 591 | ax += A_VAL(pix) * Cx; executed (the execution status of this line is deduced): ax += (qAlpha(*pix)) * Cx; | - |
| 592 | pix++; executed (the execution status of this line is deduced): pix++; | - |
| 593 | } executed: }Execution Count:18783 | 18783 |
| 594 | if(i > 0){ partially evaluated: i > 0| yes Evaluation Count:39720 | no Evaluation Count:0 |
| 0-39720 |
| 595 | rx += R_VAL(pix) * i; executed (the execution status of this line is deduced): rx += (qRed(*pix)) * i; | - |
| 596 | gx += G_VAL(pix) * i; executed (the execution status of this line is deduced): gx += (qGreen(*pix)) * i; | - |
| 597 | bx += B_VAL(pix) * i; executed (the execution status of this line is deduced): bx += (qBlue(*pix)) * i; | - |
| 598 | ax += A_VAL(pix) * i; executed (the execution status of this line is deduced): ax += (qAlpha(*pix)) * i; | - |
| 599 | } executed: }Execution Count:39720 | 39720 |
| 600 | | - |
| 601 | r = (rx >> 5) * yap; executed (the execution status of this line is deduced): r = (rx >> 5) * yap; | - |
| 602 | g = (gx >> 5) * yap; executed (the execution status of this line is deduced): g = (gx >> 5) * yap; | - |
| 603 | b = (bx >> 5) * yap; executed (the execution status of this line is deduced): b = (bx >> 5) * yap; | - |
| 604 | a = (ax >> 5) * yap; executed (the execution status of this line is deduced): a = (ax >> 5) * yap; | - |
| 605 | | - |
| 606 | for(j = (1 << 14) - yap; j > Cy; j -= Cy){ evaluated: j > Cy| yes Evaluation Count:18783 | yes Evaluation Count:39720 |
| 18783-39720 |
| 607 | pix = sptr; executed (the execution status of this line is deduced): pix = sptr; | - |
| 608 | sptr += sow; executed (the execution status of this line is deduced): sptr += sow; | - |
| 609 | rx = R_VAL(pix) * xap; executed (the execution status of this line is deduced): rx = (qRed(*pix)) * xap; | - |
| 610 | gx = G_VAL(pix) * xap; executed (the execution status of this line is deduced): gx = (qGreen(*pix)) * xap; | - |
| 611 | bx = B_VAL(pix) * xap; executed (the execution status of this line is deduced): bx = (qBlue(*pix)) * xap; | - |
| 612 | ax = A_VAL(pix) * xap; executed (the execution status of this line is deduced): ax = (qAlpha(*pix)) * xap; | - |
| 613 | pix++; executed (the execution status of this line is deduced): pix++; | - |
| 614 | for(i = (1 << 14) - xap; i > Cx; i -= Cx){ evaluated: i > Cx| yes Evaluation Count:82501 | yes Evaluation Count:18783 |
| 18783-82501 |
| 615 | rx += R_VAL(pix) * Cx; executed (the execution status of this line is deduced): rx += (qRed(*pix)) * Cx; | - |
| 616 | gx += G_VAL(pix) * Cx; executed (the execution status of this line is deduced): gx += (qGreen(*pix)) * Cx; | - |
| 617 | bx += B_VAL(pix) * Cx; executed (the execution status of this line is deduced): bx += (qBlue(*pix)) * Cx; | - |
| 618 | ax += A_VAL(pix) * Cx; executed (the execution status of this line is deduced): ax += (qAlpha(*pix)) * Cx; | - |
| 619 | pix++; executed (the execution status of this line is deduced): pix++; | - |
| 620 | } executed: }Execution Count:82501 | 82501 |
| 621 | if(i > 0){ partially evaluated: i > 0| yes Evaluation Count:18783 | no Evaluation Count:0 |
| 0-18783 |
| 622 | rx += R_VAL(pix) * i; executed (the execution status of this line is deduced): rx += (qRed(*pix)) * i; | - |
| 623 | gx += G_VAL(pix) * i; executed (the execution status of this line is deduced): gx += (qGreen(*pix)) * i; | - |
| 624 | bx += B_VAL(pix) * i; executed (the execution status of this line is deduced): bx += (qBlue(*pix)) * i; | - |
| 625 | ax += A_VAL(pix) * i; executed (the execution status of this line is deduced): ax += (qAlpha(*pix)) * i; | - |
| 626 | } executed: }Execution Count:18783 | 18783 |
| 627 | | - |
| 628 | r += (rx >> 5) * Cy; executed (the execution status of this line is deduced): r += (rx >> 5) * Cy; | - |
| 629 | g += (gx >> 5) * Cy; executed (the execution status of this line is deduced): g += (gx >> 5) * Cy; | - |
| 630 | b += (bx >> 5) * Cy; executed (the execution status of this line is deduced): b += (bx >> 5) * Cy; | - |
| 631 | a += (ax >> 5) * Cy; executed (the execution status of this line is deduced): a += (ax >> 5) * Cy; | - |
| 632 | } executed: }Execution Count:18783 | 18783 |
| 633 | if(j > 0){ partially evaluated: j > 0| yes Evaluation Count:39720 | no Evaluation Count:0 |
| 0-39720 |
| 634 | pix = sptr; executed (the execution status of this line is deduced): pix = sptr; | - |
| 635 | sptr += sow; executed (the execution status of this line is deduced): sptr += sow; | - |
| 636 | rx = R_VAL(pix) * xap; executed (the execution status of this line is deduced): rx = (qRed(*pix)) * xap; | - |
| 637 | gx = G_VAL(pix) * xap; executed (the execution status of this line is deduced): gx = (qGreen(*pix)) * xap; | - |
| 638 | bx = B_VAL(pix) * xap; executed (the execution status of this line is deduced): bx = (qBlue(*pix)) * xap; | - |
| 639 | ax = A_VAL(pix) * xap; executed (the execution status of this line is deduced): ax = (qAlpha(*pix)) * xap; | - |
| 640 | pix++; executed (the execution status of this line is deduced): pix++; | - |
| 641 | for(i = (1 << 14) - xap; i > Cx; i -= Cx){ evaluated: i > Cx| yes Evaluation Count:18783 | yes Evaluation Count:39720 |
| 18783-39720 |
| 642 | rx += R_VAL(pix) * Cx; executed (the execution status of this line is deduced): rx += (qRed(*pix)) * Cx; | - |
| 643 | gx += G_VAL(pix) * Cx; executed (the execution status of this line is deduced): gx += (qGreen(*pix)) * Cx; | - |
| 644 | bx += B_VAL(pix) * Cx; executed (the execution status of this line is deduced): bx += (qBlue(*pix)) * Cx; | - |
| 645 | ax += A_VAL(pix) * Cx; executed (the execution status of this line is deduced): ax += (qAlpha(*pix)) * Cx; | - |
| 646 | pix++; executed (the execution status of this line is deduced): pix++; | - |
| 647 | } executed: }Execution Count:18783 | 18783 |
| 648 | if(i > 0){ partially evaluated: i > 0| yes Evaluation Count:39720 | no Evaluation Count:0 |
| 0-39720 |
| 649 | rx += R_VAL(pix) * i; executed (the execution status of this line is deduced): rx += (qRed(*pix)) * i; | - |
| 650 | gx += G_VAL(pix) * i; executed (the execution status of this line is deduced): gx += (qGreen(*pix)) * i; | - |
| 651 | bx += B_VAL(pix) * i; executed (the execution status of this line is deduced): bx += (qBlue(*pix)) * i; | - |
| 652 | ax += A_VAL(pix) * i; executed (the execution status of this line is deduced): ax += (qAlpha(*pix)) * i; | - |
| 653 | } executed: }Execution Count:39720 | 39720 |
| 654 | | - |
| 655 | r += (rx >> 5) * j; executed (the execution status of this line is deduced): r += (rx >> 5) * j; | - |
| 656 | g += (gx >> 5) * j; executed (the execution status of this line is deduced): g += (gx >> 5) * j; | - |
| 657 | b += (bx >> 5) * j; executed (the execution status of this line is deduced): b += (bx >> 5) * j; | - |
| 658 | a += (ax >> 5) * j; executed (the execution status of this line is deduced): a += (ax >> 5) * j; | - |
| 659 | } executed: }Execution Count:39720 | 39720 |
| 660 | | - |
| 661 | *dptr = qRgba(r >> 23, g >> 23, b >> 23, a >> 23); executed (the execution status of this line is deduced): *dptr = qRgba(r >> 23, g >> 23, b >> 23, a >> 23); | - |
| 662 | dptr++; executed (the execution status of this line is deduced): dptr++; | - |
| 663 | } executed: }Execution Count:39720 | 39720 |
| 664 | } executed: }Execution Count:1486 | 1486 |
| 665 | } executed: }Execution Count:94 | 94 |
| 666 | } | - |
| 667 | | - |
| 668 | /* scale by area sampling - IGNORE the ALPHA byte*/ | - |
| 669 | static void qt_qimageScaleAARGB(QImageScaleInfo *isi, unsigned int *dest, | - |
| 670 | int dxx, int dyy, int dx, int dy, int dw, | - |
| 671 | int dh, int dow, int sow) | - |
| 672 | { | - |
| 673 | unsigned int *sptr, *dptr; executed (the execution status of this line is deduced): unsigned int *sptr, *dptr; | - |
| 674 | int x, y, end; executed (the execution status of this line is deduced): int x, y, end; | - |
| 675 | unsigned int **ypoints = isi->ypoints; executed (the execution status of this line is deduced): unsigned int **ypoints = isi->ypoints; | - |
| 676 | int *xpoints = isi->xpoints; executed (the execution status of this line is deduced): int *xpoints = isi->xpoints; | - |
| 677 | int *xapoints = isi->xapoints; executed (the execution status of this line is deduced): int *xapoints = isi->xapoints; | - |
| 678 | int *yapoints = isi->yapoints; executed (the execution status of this line is deduced): int *yapoints = isi->yapoints; | - |
| 679 | | - |
| 680 | end = dxx + dw; executed (the execution status of this line is deduced): end = dxx + dw; | - |
| 681 | /* scaling up both ways */ | - |
| 682 | if(isi->xup_yup == 3){ evaluated: isi->xup_yup == 3| yes Evaluation Count:23 | yes Evaluation Count:71 |
| 23-71 |
| 683 | /* go through every scanline in the output buffer */ | - |
| 684 | for(y = 0; y < dh; y++){ evaluated: y < dh| yes Evaluation Count:4306 | yes Evaluation Count:23 |
| 23-4306 |
| 685 | /* calculate the source line we'll scan from */ | - |
| 686 | dptr = dest + dx + ((y + dy) * dow); executed (the execution status of this line is deduced): dptr = dest + dx + ((y + dy) * dow); | - |
| 687 | sptr = ypoints[dyy + y]; executed (the execution status of this line is deduced): sptr = ypoints[dyy + y]; | - |
| 688 | if(YAP > 0){ evaluated: (yapoints[dyy + y]) > 0| yes Evaluation Count:4128 | yes Evaluation Count:178 |
| 178-4128 |
| 689 | for(x = dxx; x < end; x++){ evaluated: x < end| yes Evaluation Count:1093904 | yes Evaluation Count:4128 |
| 4128-1093904 |
| 690 | int r = 0, g = 0, b = 0; executed (the execution status of this line is deduced): int r = 0, g = 0, b = 0; | - |
| 691 | int rr = 0, gg = 0, bb = 0; executed (the execution status of this line is deduced): int rr = 0, gg = 0, bb = 0; | - |
| 692 | unsigned int *pix; executed (the execution status of this line is deduced): unsigned int *pix; | - |
| 693 | | - |
| 694 | if(XAP > 0){ evaluated: (xapoints[x]) > 0| yes Evaluation Count:1069936 | yes Evaluation Count:23968 |
| 23968-1069936 |
| 695 | pix = ypoints[dyy + y] + xpoints[x]; executed (the execution status of this line is deduced): pix = ypoints[dyy + y] + xpoints[x]; | - |
| 696 | r = R_VAL(pix) * INV_XAP; executed (the execution status of this line is deduced): r = (qRed(*pix)) * (256 - xapoints[x]); | - |
| 697 | g = G_VAL(pix) * INV_XAP; executed (the execution status of this line is deduced): g = (qGreen(*pix)) * (256 - xapoints[x]); | - |
| 698 | b = B_VAL(pix) * INV_XAP; executed (the execution status of this line is deduced): b = (qBlue(*pix)) * (256 - xapoints[x]); | - |
| 699 | pix++; executed (the execution status of this line is deduced): pix++; | - |
| 700 | r += R_VAL(pix) * XAP; executed (the execution status of this line is deduced): r += (qRed(*pix)) * (xapoints[x]); | - |
| 701 | g += G_VAL(pix) * XAP; executed (the execution status of this line is deduced): g += (qGreen(*pix)) * (xapoints[x]); | - |
| 702 | b += B_VAL(pix) * XAP; executed (the execution status of this line is deduced): b += (qBlue(*pix)) * (xapoints[x]); | - |
| 703 | pix += sow; executed (the execution status of this line is deduced): pix += sow; | - |
| 704 | rr = R_VAL(pix) * XAP; executed (the execution status of this line is deduced): rr = (qRed(*pix)) * (xapoints[x]); | - |
| 705 | gg = G_VAL(pix) * XAP; executed (the execution status of this line is deduced): gg = (qGreen(*pix)) * (xapoints[x]); | - |
| 706 | bb = B_VAL(pix) * XAP; executed (the execution status of this line is deduced): bb = (qBlue(*pix)) * (xapoints[x]); | - |
| 707 | pix --; executed (the execution status of this line is deduced): pix --; | - |
| 708 | rr += R_VAL(pix) * INV_XAP; executed (the execution status of this line is deduced): rr += (qRed(*pix)) * (256 - xapoints[x]); | - |
| 709 | gg += G_VAL(pix) * INV_XAP; executed (the execution status of this line is deduced): gg += (qGreen(*pix)) * (256 - xapoints[x]); | - |
| 710 | bb += B_VAL(pix) * INV_XAP; executed (the execution status of this line is deduced): bb += (qBlue(*pix)) * (256 - xapoints[x]); | - |
| 711 | r = ((rr * YAP) + (r * INV_YAP)) >> 16; executed (the execution status of this line is deduced): r = ((rr * (yapoints[dyy + y])) + (r * (256 - yapoints[dyy + y]))) >> 16; | - |
| 712 | g = ((gg * YAP) + (g * INV_YAP)) >> 16; executed (the execution status of this line is deduced): g = ((gg * (yapoints[dyy + y])) + (g * (256 - yapoints[dyy + y]))) >> 16; | - |
| 713 | b = ((bb * YAP) + (b * INV_YAP)) >> 16; executed (the execution status of this line is deduced): b = ((bb * (yapoints[dyy + y])) + (b * (256 - yapoints[dyy + y]))) >> 16; | - |
| 714 | *dptr++ = qRgba(r, g, b, 0xff); executed (the execution status of this line is deduced): *dptr++ = qRgba(r, g, b, 0xff); | - |
| 715 | } executed: }Execution Count:1069936 | 1069936 |
| 716 | else{ | - |
| 717 | pix = ypoints[dyy + y] + xpoints[x]; executed (the execution status of this line is deduced): pix = ypoints[dyy + y] + xpoints[x]; | - |
| 718 | r = R_VAL(pix) * INV_YAP; executed (the execution status of this line is deduced): r = (qRed(*pix)) * (256 - yapoints[dyy + y]); | - |
| 719 | g = G_VAL(pix) * INV_YAP; executed (the execution status of this line is deduced): g = (qGreen(*pix)) * (256 - yapoints[dyy + y]); | - |
| 720 | b = B_VAL(pix) * INV_YAP; executed (the execution status of this line is deduced): b = (qBlue(*pix)) * (256 - yapoints[dyy + y]); | - |
| 721 | pix += sow; executed (the execution status of this line is deduced): pix += sow; | - |
| 722 | r += R_VAL(pix) * YAP; executed (the execution status of this line is deduced): r += (qRed(*pix)) * (yapoints[dyy + y]); | - |
| 723 | g += G_VAL(pix) * YAP; executed (the execution status of this line is deduced): g += (qGreen(*pix)) * (yapoints[dyy + y]); | - |
| 724 | b += B_VAL(pix) * YAP; executed (the execution status of this line is deduced): b += (qBlue(*pix)) * (yapoints[dyy + y]); | - |
| 725 | r >>= 8; executed (the execution status of this line is deduced): r >>= 8; | - |
| 726 | g >>= 8; executed (the execution status of this line is deduced): g >>= 8; | - |
| 727 | b >>= 8; executed (the execution status of this line is deduced): b >>= 8; | - |
| 728 | *dptr++ = qRgba(r, g, b, 0xff); executed (the execution status of this line is deduced): *dptr++ = qRgba(r, g, b, 0xff); | - |
| 729 | } executed: }Execution Count:23968 | 23968 |
| 730 | } | - |
| 731 | } executed: }Execution Count:4128 | 4128 |
| 732 | else{ | - |
| 733 | for(x = dxx; x < end; x++){ evaluated: x < end| yes Evaluation Count:48212 | yes Evaluation Count:178 |
| 178-48212 |
| 734 | int r = 0, g = 0, b = 0; executed (the execution status of this line is deduced): int r = 0, g = 0, b = 0; | - |
| 735 | unsigned int *pix; executed (the execution status of this line is deduced): unsigned int *pix; | - |
| 736 | | - |
| 737 | if(XAP > 0){ evaluated: (xapoints[x]) > 0| yes Evaluation Count:46168 | yes Evaluation Count:2044 |
| 2044-46168 |
| 738 | pix = ypoints[dyy + y] + xpoints[x]; executed (the execution status of this line is deduced): pix = ypoints[dyy + y] + xpoints[x]; | - |
| 739 | r = R_VAL(pix) * INV_XAP; executed (the execution status of this line is deduced): r = (qRed(*pix)) * (256 - xapoints[x]); | - |
| 740 | g = G_VAL(pix) * INV_XAP; executed (the execution status of this line is deduced): g = (qGreen(*pix)) * (256 - xapoints[x]); | - |
| 741 | b = B_VAL(pix) * INV_XAP; executed (the execution status of this line is deduced): b = (qBlue(*pix)) * (256 - xapoints[x]); | - |
| 742 | pix++; executed (the execution status of this line is deduced): pix++; | - |
| 743 | r += R_VAL(pix) * XAP; executed (the execution status of this line is deduced): r += (qRed(*pix)) * (xapoints[x]); | - |
| 744 | g += G_VAL(pix) * XAP; executed (the execution status of this line is deduced): g += (qGreen(*pix)) * (xapoints[x]); | - |
| 745 | b += B_VAL(pix) * XAP; executed (the execution status of this line is deduced): b += (qBlue(*pix)) * (xapoints[x]); | - |
| 746 | r >>= 8; executed (the execution status of this line is deduced): r >>= 8; | - |
| 747 | g >>= 8; executed (the execution status of this line is deduced): g >>= 8; | - |
| 748 | b >>= 8; executed (the execution status of this line is deduced): b >>= 8; | - |
| 749 | *dptr++ = qRgba(r, g, b, 0xff); executed (the execution status of this line is deduced): *dptr++ = qRgba(r, g, b, 0xff); | - |
| 750 | } executed: }Execution Count:46168 | 46168 |
| 751 | else | - |
| 752 | *dptr++ = sptr[xpoints[x] ]; executed: *dptr++ = sptr[xpoints[x] ];Execution Count:2044 | 2044 |
| 753 | } | - |
| 754 | } executed: }Execution Count:178 | 178 |
| 755 | } | - |
| 756 | } executed: }Execution Count:23 | 23 |
| 757 | /* if we're scaling down vertically */ | - |
| 758 | else if(isi->xup_yup == 1){ evaluated: isi->xup_yup == 1| yes Evaluation Count:12 | yes Evaluation Count:59 |
| 12-59 |
| 759 | /*\ 'Correct' version, with math units prepared for MMXification \*/ | - |
| 760 | int Cy, j; executed (the execution status of this line is deduced): int Cy, j; | - |
| 761 | unsigned int *pix; executed (the execution status of this line is deduced): unsigned int *pix; | - |
| 762 | int r, g, b, rr, gg, bb; executed (the execution status of this line is deduced): int r, g, b, rr, gg, bb; | - |
| 763 | int yap; executed (the execution status of this line is deduced): int yap; | - |
| 764 | | - |
| 765 | /* go through every scanline in the output buffer */ | - |
| 766 | for(y = 0; y < dh; y++){ evaluated: y < dh| yes Evaluation Count:12 | yes Evaluation Count:12 |
| 12 |
| 767 | Cy = YAP >> 16; executed (the execution status of this line is deduced): Cy = (yapoints[dyy + y]) >> 16; | - |
| 768 | yap = YAP & 0xffff; executed (the execution status of this line is deduced): yap = (yapoints[dyy + y]) & 0xffff; | - |
| 769 | | - |
| 770 | dptr = dest + dx + ((y + dy) * dow); executed (the execution status of this line is deduced): dptr = dest + dx + ((y + dy) * dow); | - |
| 771 | for(x = dxx; x < end; x++){ evaluated: x < end| yes Evaluation Count:1050 | yes Evaluation Count:12 |
| 12-1050 |
| 772 | pix = ypoints[dyy + y] + xpoints[x]; executed (the execution status of this line is deduced): pix = ypoints[dyy + y] + xpoints[x]; | - |
| 773 | r = R_VAL(pix) * yap; executed (the execution status of this line is deduced): r = (qRed(*pix)) * yap; | - |
| 774 | g = G_VAL(pix) * yap; executed (the execution status of this line is deduced): g = (qGreen(*pix)) * yap; | - |
| 775 | b = B_VAL(pix) * yap; executed (the execution status of this line is deduced): b = (qBlue(*pix)) * yap; | - |
| 776 | pix += sow; executed (the execution status of this line is deduced): pix += sow; | - |
| 777 | for(j = (1 << 14) - yap; j > Cy; j -= Cy){ evaluated: j > Cy| yes Evaluation Count:86190 | yes Evaluation Count:1050 |
| 1050-86190 |
| 778 | r += R_VAL(pix) * Cy; executed (the execution status of this line is deduced): r += (qRed(*pix)) * Cy; | - |
| 779 | g += G_VAL(pix) * Cy; executed (the execution status of this line is deduced): g += (qGreen(*pix)) * Cy; | - |
| 780 | b += B_VAL(pix) * Cy; executed (the execution status of this line is deduced): b += (qBlue(*pix)) * Cy; | - |
| 781 | pix += sow; executed (the execution status of this line is deduced): pix += sow; | - |
| 782 | } executed: }Execution Count:86190 | 86190 |
| 783 | if(j > 0){ partially evaluated: j > 0| yes Evaluation Count:1050 | no Evaluation Count:0 |
| 0-1050 |
| 784 | r += R_VAL(pix) * j; executed (the execution status of this line is deduced): r += (qRed(*pix)) * j; | - |
| 785 | g += G_VAL(pix) * j; executed (the execution status of this line is deduced): g += (qGreen(*pix)) * j; | - |
| 786 | b += B_VAL(pix) * j; executed (the execution status of this line is deduced): b += (qBlue(*pix)) * j; | - |
| 787 | } executed: }Execution Count:1050 | 1050 |
| 788 | if(XAP > 0){ evaluated: (xapoints[x]) > 0| yes Evaluation Count:1026 | yes Evaluation Count:24 |
| 24-1026 |
| 789 | pix = ypoints[dyy + y] + xpoints[x] + 1; executed (the execution status of this line is deduced): pix = ypoints[dyy + y] + xpoints[x] + 1; | - |
| 790 | rr = R_VAL(pix) * yap; executed (the execution status of this line is deduced): rr = (qRed(*pix)) * yap; | - |
| 791 | gg = G_VAL(pix) * yap; executed (the execution status of this line is deduced): gg = (qGreen(*pix)) * yap; | - |
| 792 | bb = B_VAL(pix) * yap; executed (the execution status of this line is deduced): bb = (qBlue(*pix)) * yap; | - |
| 793 | pix += sow; executed (the execution status of this line is deduced): pix += sow; | - |
| 794 | for(j = (1 << 14) - yap; j > Cy; j -= Cy){ evaluated: j > Cy| yes Evaluation Count:85188 | yes Evaluation Count:1026 |
| 1026-85188 |
| 795 | rr += R_VAL(pix) * Cy; executed (the execution status of this line is deduced): rr += (qRed(*pix)) * Cy; | - |
| 796 | gg += G_VAL(pix) * Cy; executed (the execution status of this line is deduced): gg += (qGreen(*pix)) * Cy; | - |
| 797 | bb += B_VAL(pix) * Cy; executed (the execution status of this line is deduced): bb += (qBlue(*pix)) * Cy; | - |
| 798 | pix += sow; executed (the execution status of this line is deduced): pix += sow; | - |
| 799 | } executed: }Execution Count:85188 | 85188 |
| 800 | if(j > 0){ partially evaluated: j > 0| yes Evaluation Count:1026 | no Evaluation Count:0 |
| 0-1026 |
| 801 | rr += R_VAL(pix) * j; executed (the execution status of this line is deduced): rr += (qRed(*pix)) * j; | - |
| 802 | gg += G_VAL(pix) * j; executed (the execution status of this line is deduced): gg += (qGreen(*pix)) * j; | - |
| 803 | bb += B_VAL(pix) * j; executed (the execution status of this line is deduced): bb += (qBlue(*pix)) * j; | - |
| 804 | } executed: }Execution Count:1026 | 1026 |
| 805 | r = r * INV_XAP; executed (the execution status of this line is deduced): r = r * (256 - xapoints[x]); | - |
| 806 | g = g * INV_XAP; executed (the execution status of this line is deduced): g = g * (256 - xapoints[x]); | - |
| 807 | b = b * INV_XAP; executed (the execution status of this line is deduced): b = b * (256 - xapoints[x]); | - |
| 808 | r = (r + ((rr * XAP))) >> 12; executed (the execution status of this line is deduced): r = (r + ((rr * (xapoints[x])))) >> 12; | - |
| 809 | g = (g + ((gg * XAP))) >> 12; executed (the execution status of this line is deduced): g = (g + ((gg * (xapoints[x])))) >> 12; | - |
| 810 | b = (b + ((bb * XAP))) >> 12; executed (the execution status of this line is deduced): b = (b + ((bb * (xapoints[x])))) >> 12; | - |
| 811 | } executed: }Execution Count:1026 | 1026 |
| 812 | else{ | - |
| 813 | r >>= 4; executed (the execution status of this line is deduced): r >>= 4; | - |
| 814 | g >>= 4; executed (the execution status of this line is deduced): g >>= 4; | - |
| 815 | b >>= 4; executed (the execution status of this line is deduced): b >>= 4; | - |
| 816 | } executed: }Execution Count:24 | 24 |
| 817 | *dptr = qRgba(r >> 10, g >> 10, b >> 10, 0xff); executed (the execution status of this line is deduced): *dptr = qRgba(r >> 10, g >> 10, b >> 10, 0xff); | - |
| 818 | dptr++; executed (the execution status of this line is deduced): dptr++; | - |
| 819 | } executed: }Execution Count:1050 | 1050 |
| 820 | } executed: }Execution Count:12 | 12 |
| 821 | } executed: }Execution Count:12 | 12 |
| 822 | /* if we're scaling down horizontally */ | - |
| 823 | else if(isi->xup_yup == 2){ evaluated: isi->xup_yup == 2| yes Evaluation Count:23 | yes Evaluation Count:36 |
| 23-36 |
| 824 | /*\ 'Correct' version, with math units prepared for MMXification \*/ | - |
| 825 | int Cx, j; executed (the execution status of this line is deduced): int Cx, j; | - |
| 826 | unsigned int *pix; executed (the execution status of this line is deduced): unsigned int *pix; | - |
| 827 | int r, g, b, rr, gg, bb; executed (the execution status of this line is deduced): int r, g, b, rr, gg, bb; | - |
| 828 | int xap; executed (the execution status of this line is deduced): int xap; | - |
| 829 | | - |
| 830 | /* go through every scanline in the output buffer */ | - |
| 831 | for(y = 0; y < dh; y++){ evaluated: y < dh| yes Evaluation Count:4050 | yes Evaluation Count:23 |
| 23-4050 |
| 832 | dptr = dest + dx + ((y + dy) * dow); executed (the execution status of this line is deduced): dptr = dest + dx + ((y + dy) * dow); | - |
| 833 | for(x = dxx; x < end; x++){ evaluated: x < end| yes Evaluation Count:841050 | yes Evaluation Count:4050 |
| 4050-841050 |
| 834 | Cx = XAP >> 16; executed (the execution status of this line is deduced): Cx = (xapoints[x]) >> 16; | - |
| 835 | xap = XAP & 0xffff; executed (the execution status of this line is deduced): xap = (xapoints[x]) & 0xffff; | - |
| 836 | | - |
| 837 | pix = ypoints[dyy + y] + xpoints[x]; executed (the execution status of this line is deduced): pix = ypoints[dyy + y] + xpoints[x]; | - |
| 838 | r = R_VAL(pix) * xap; executed (the execution status of this line is deduced): r = (qRed(*pix)) * xap; | - |
| 839 | g = G_VAL(pix) * xap; executed (the execution status of this line is deduced): g = (qGreen(*pix)) * xap; | - |
| 840 | b = B_VAL(pix) * xap; executed (the execution status of this line is deduced): b = (qBlue(*pix)) * xap; | - |
| 841 | pix++; executed (the execution status of this line is deduced): pix++; | - |
| 842 | for(j = (1 << 14) - xap; j > Cx; j -= Cx){ evaluated: j > Cx| yes Evaluation Count:250790 | yes Evaluation Count:841050 |
| 250790-841050 |
| 843 | r += R_VAL(pix) * Cx; executed (the execution status of this line is deduced): r += (qRed(*pix)) * Cx; | - |
| 844 | g += G_VAL(pix) * Cx; executed (the execution status of this line is deduced): g += (qGreen(*pix)) * Cx; | - |
| 845 | b += B_VAL(pix) * Cx; executed (the execution status of this line is deduced): b += (qBlue(*pix)) * Cx; | - |
| 846 | pix++; executed (the execution status of this line is deduced): pix++; | - |
| 847 | } executed: }Execution Count:250790 | 250790 |
| 848 | if(j > 0){ partially evaluated: j > 0| yes Evaluation Count:841050 | no Evaluation Count:0 |
| 0-841050 |
| 849 | r += R_VAL(pix) * j; executed (the execution status of this line is deduced): r += (qRed(*pix)) * j; | - |
| 850 | g += G_VAL(pix) * j; executed (the execution status of this line is deduced): g += (qGreen(*pix)) * j; | - |
| 851 | b += B_VAL(pix) * j; executed (the execution status of this line is deduced): b += (qBlue(*pix)) * j; | - |
| 852 | } executed: }Execution Count:841050 | 841050 |
| 853 | if(YAP > 0){ evaluated: (yapoints[dyy + y]) > 0| yes Evaluation Count:751226 | yes Evaluation Count:89824 |
| 89824-751226 |
| 854 | pix = ypoints[dyy + y] + xpoints[x] + sow; executed (the execution status of this line is deduced): pix = ypoints[dyy + y] + xpoints[x] + sow; | - |
| 855 | rr = R_VAL(pix) * xap; executed (the execution status of this line is deduced): rr = (qRed(*pix)) * xap; | - |
| 856 | gg = G_VAL(pix) * xap; executed (the execution status of this line is deduced): gg = (qGreen(*pix)) * xap; | - |
| 857 | bb = B_VAL(pix) * xap; executed (the execution status of this line is deduced): bb = (qBlue(*pix)) * xap; | - |
| 858 | pix++; executed (the execution status of this line is deduced): pix++; | - |
| 859 | for(j = (1 << 14) - xap; j > Cx; j -= Cx){ evaluated: j > Cx| yes Evaluation Count:200485 | yes Evaluation Count:751226 |
| 200485-751226 |
| 860 | rr += R_VAL(pix) * Cx; executed (the execution status of this line is deduced): rr += (qRed(*pix)) * Cx; | - |
| 861 | gg += G_VAL(pix) * Cx; executed (the execution status of this line is deduced): gg += (qGreen(*pix)) * Cx; | - |
| 862 | bb += B_VAL(pix) * Cx; executed (the execution status of this line is deduced): bb += (qBlue(*pix)) * Cx; | - |
| 863 | pix++; executed (the execution status of this line is deduced): pix++; | - |
| 864 | } executed: }Execution Count:200485 | 200485 |
| 865 | if(j > 0){ partially evaluated: j > 0| yes Evaluation Count:751226 | no Evaluation Count:0 |
| 0-751226 |
| 866 | rr += R_VAL(pix) * j; executed (the execution status of this line is deduced): rr += (qRed(*pix)) * j; | - |
| 867 | gg += G_VAL(pix) * j; executed (the execution status of this line is deduced): gg += (qGreen(*pix)) * j; | - |
| 868 | bb += B_VAL(pix) * j; executed (the execution status of this line is deduced): bb += (qBlue(*pix)) * j; | - |
| 869 | } executed: }Execution Count:751226 | 751226 |
| 870 | r = r * INV_YAP; executed (the execution status of this line is deduced): r = r * (256 - yapoints[dyy + y]); | - |
| 871 | g = g * INV_YAP; executed (the execution status of this line is deduced): g = g * (256 - yapoints[dyy + y]); | - |
| 872 | b = b * INV_YAP; executed (the execution status of this line is deduced): b = b * (256 - yapoints[dyy + y]); | - |
| 873 | r = (r + ((rr * YAP))) >> 12; executed (the execution status of this line is deduced): r = (r + ((rr * (yapoints[dyy + y])))) >> 12; | - |
| 874 | g = (g + ((gg * YAP))) >> 12; executed (the execution status of this line is deduced): g = (g + ((gg * (yapoints[dyy + y])))) >> 12; | - |
| 875 | b = (b + ((bb * YAP))) >> 12; executed (the execution status of this line is deduced): b = (b + ((bb * (yapoints[dyy + y])))) >> 12; | - |
| 876 | } executed: }Execution Count:751226 | 751226 |
| 877 | else{ | - |
| 878 | r >>= 4; executed (the execution status of this line is deduced): r >>= 4; | - |
| 879 | g >>= 4; executed (the execution status of this line is deduced): g >>= 4; | - |
| 880 | b >>= 4; executed (the execution status of this line is deduced): b >>= 4; | - |
| 881 | } executed: }Execution Count:89824 | 89824 |
| 882 | *dptr = qRgba(r >> 10, g >> 10, b >> 10, 0xff); executed (the execution status of this line is deduced): *dptr = qRgba(r >> 10, g >> 10, b >> 10, 0xff); | - |
| 883 | dptr++; executed (the execution status of this line is deduced): dptr++; | - |
| 884 | } executed: }Execution Count:841050 | 841050 |
| 885 | } executed: }Execution Count:4050 | 4050 |
| 886 | } executed: }Execution Count:23 | 23 |
| 887 | /* fully optimized (i think) - onyl change of algorithm can help */ | - |
| 888 | /* if we're scaling down horizontally & vertically */ | - |
| 889 | else{ | - |
| 890 | /*\ 'Correct' version, with math units prepared for MMXification \*/ | - |
| 891 | int Cx, Cy, i, j; executed (the execution status of this line is deduced): int Cx, Cy, i, j; | - |
| 892 | unsigned int *pix; executed (the execution status of this line is deduced): unsigned int *pix; | - |
| 893 | int r, g, b, rx, gx, bx; executed (the execution status of this line is deduced): int r, g, b, rx, gx, bx; | - |
| 894 | int xap, yap; executed (the execution status of this line is deduced): int xap, yap; | - |
| 895 | | - |
| 896 | for(y = 0; y < dh; y++){ evaluated: y < dh| yes Evaluation Count:2820 | yes Evaluation Count:36 |
| 36-2820 |
| 897 | Cy = YAP >> 16; executed (the execution status of this line is deduced): Cy = (yapoints[dyy + y]) >> 16; | - |
| 898 | yap = YAP & 0xffff; executed (the execution status of this line is deduced): yap = (yapoints[dyy + y]) & 0xffff; | - |
| 899 | | - |
| 900 | dptr = dest + dx + ((y + dy) * dow); executed (the execution status of this line is deduced): dptr = dest + dx + ((y + dy) * dow); | - |
| 901 | for(x = dxx; x < end; x++){ evaluated: x < end| yes Evaluation Count:588136 | yes Evaluation Count:2820 |
| 2820-588136 |
| 902 | Cx = XAP >> 16; executed (the execution status of this line is deduced): Cx = (xapoints[x]) >> 16; | - |
| 903 | xap = XAP & 0xffff; executed (the execution status of this line is deduced): xap = (xapoints[x]) & 0xffff; | - |
| 904 | | - |
| 905 | sptr = ypoints[dyy + y] + xpoints[x]; executed (the execution status of this line is deduced): sptr = ypoints[dyy + y] + xpoints[x]; | - |
| 906 | pix = sptr; executed (the execution status of this line is deduced): pix = sptr; | - |
| 907 | sptr += sow; executed (the execution status of this line is deduced): sptr += sow; | - |
| 908 | rx = R_VAL(pix) * xap; executed (the execution status of this line is deduced): rx = (qRed(*pix)) * xap; | - |
| 909 | gx = G_VAL(pix) * xap; executed (the execution status of this line is deduced): gx = (qGreen(*pix)) * xap; | - |
| 910 | bx = B_VAL(pix) * xap; executed (the execution status of this line is deduced): bx = (qBlue(*pix)) * xap; | - |
| 911 | pix++; executed (the execution status of this line is deduced): pix++; | - |
| 912 | for(i = (1 << 14) - xap; i > Cx; i -= Cx){ evaluated: i > Cx| yes Evaluation Count:200484 | yes Evaluation Count:588136 |
| 200484-588136 |
| 913 | rx += R_VAL(pix) * Cx; executed (the execution status of this line is deduced): rx += (qRed(*pix)) * Cx; | - |
| 914 | gx += G_VAL(pix) * Cx; executed (the execution status of this line is deduced): gx += (qGreen(*pix)) * Cx; | - |
| 915 | bx += B_VAL(pix) * Cx; executed (the execution status of this line is deduced): bx += (qBlue(*pix)) * Cx; | - |
| 916 | pix++; executed (the execution status of this line is deduced): pix++; | - |
| 917 | } executed: }Execution Count:200484 | 200484 |
| 918 | if(i > 0){ partially evaluated: i > 0| yes Evaluation Count:588136 | no Evaluation Count:0 |
| 0-588136 |
| 919 | rx += R_VAL(pix) * i; executed (the execution status of this line is deduced): rx += (qRed(*pix)) * i; | - |
| 920 | gx += G_VAL(pix) * i; executed (the execution status of this line is deduced): gx += (qGreen(*pix)) * i; | - |
| 921 | bx += B_VAL(pix) * i; executed (the execution status of this line is deduced): bx += (qBlue(*pix)) * i; | - |
| 922 | } executed: }Execution Count:588136 | 588136 |
| 923 | | - |
| 924 | r = (rx >> 5) * yap; executed (the execution status of this line is deduced): r = (rx >> 5) * yap; | - |
| 925 | g = (gx >> 5) * yap; executed (the execution status of this line is deduced): g = (gx >> 5) * yap; | - |
| 926 | b = (bx >> 5) * yap; executed (the execution status of this line is deduced): b = (bx >> 5) * yap; | - |
| 927 | | - |
| 928 | for(j = (1 << 14) - yap; j > Cy; j -= Cy){ evaluated: j > Cy| yes Evaluation Count:201317 | yes Evaluation Count:588136 |
| 201317-588136 |
| 929 | pix = sptr; executed (the execution status of this line is deduced): pix = sptr; | - |
| 930 | sptr += sow; executed (the execution status of this line is deduced): sptr += sow; | - |
| 931 | rx = R_VAL(pix) * xap; executed (the execution status of this line is deduced): rx = (qRed(*pix)) * xap; | - |
| 932 | gx = G_VAL(pix) * xap; executed (the execution status of this line is deduced): gx = (qGreen(*pix)) * xap; | - |
| 933 | bx = B_VAL(pix) * xap; executed (the execution status of this line is deduced): bx = (qBlue(*pix)) * xap; | - |
| 934 | pix++; executed (the execution status of this line is deduced): pix++; | - |
| 935 | for(i = (1 << 14) - xap; i > Cx; i -= Cx){ evaluated: i > Cx| yes Evaluation Count:133157 | yes Evaluation Count:201317 |
| 133157-201317 |
| 936 | rx += R_VAL(pix) * Cx; executed (the execution status of this line is deduced): rx += (qRed(*pix)) * Cx; | - |
| 937 | gx += G_VAL(pix) * Cx; executed (the execution status of this line is deduced): gx += (qGreen(*pix)) * Cx; | - |
| 938 | bx += B_VAL(pix) * Cx; executed (the execution status of this line is deduced): bx += (qBlue(*pix)) * Cx; | - |
| 939 | pix++; executed (the execution status of this line is deduced): pix++; | - |
| 940 | } executed: }Execution Count:133157 | 133157 |
| 941 | if(i > 0){ partially evaluated: i > 0| yes Evaluation Count:201317 | no Evaluation Count:0 |
| 0-201317 |
| 942 | rx += R_VAL(pix) * i; executed (the execution status of this line is deduced): rx += (qRed(*pix)) * i; | - |
| 943 | gx += G_VAL(pix) * i; executed (the execution status of this line is deduced): gx += (qGreen(*pix)) * i; | - |
| 944 | bx += B_VAL(pix) * i; executed (the execution status of this line is deduced): bx += (qBlue(*pix)) * i; | - |
| 945 | } executed: }Execution Count:201317 | 201317 |
| 946 | | - |
| 947 | r += (rx >> 5) * Cy; executed (the execution status of this line is deduced): r += (rx >> 5) * Cy; | - |
| 948 | g += (gx >> 5) * Cy; executed (the execution status of this line is deduced): g += (gx >> 5) * Cy; | - |
| 949 | b += (bx >> 5) * Cy; executed (the execution status of this line is deduced): b += (bx >> 5) * Cy; | - |
| 950 | } executed: }Execution Count:201317 | 201317 |
| 951 | if(j > 0){ partially evaluated: j > 0| yes Evaluation Count:588136 | no Evaluation Count:0 |
| 0-588136 |
| 952 | pix = sptr; executed (the execution status of this line is deduced): pix = sptr; | - |
| 953 | sptr += sow; executed (the execution status of this line is deduced): sptr += sow; | - |
| 954 | rx = R_VAL(pix) * xap; executed (the execution status of this line is deduced): rx = (qRed(*pix)) * xap; | - |
| 955 | gx = G_VAL(pix) * xap; executed (the execution status of this line is deduced): gx = (qGreen(*pix)) * xap; | - |
| 956 | bx = B_VAL(pix) * xap; executed (the execution status of this line is deduced): bx = (qBlue(*pix)) * xap; | - |
| 957 | pix++; executed (the execution status of this line is deduced): pix++; | - |
| 958 | for(i = (1 << 14) - xap; i > Cx; i -= Cx){ evaluated: i > Cx| yes Evaluation Count:200484 | yes Evaluation Count:588136 |
| 200484-588136 |
| 959 | rx += R_VAL(pix) * Cx; executed (the execution status of this line is deduced): rx += (qRed(*pix)) * Cx; | - |
| 960 | gx += G_VAL(pix) * Cx; executed (the execution status of this line is deduced): gx += (qGreen(*pix)) * Cx; | - |
| 961 | bx += B_VAL(pix) * Cx; executed (the execution status of this line is deduced): bx += (qBlue(*pix)) * Cx; | - |
| 962 | pix++; executed (the execution status of this line is deduced): pix++; | - |
| 963 | } executed: }Execution Count:200484 | 200484 |
| 964 | if(i > 0){ partially evaluated: i > 0| yes Evaluation Count:588136 | no Evaluation Count:0 |
| 0-588136 |
| 965 | rx += R_VAL(pix) * i; executed (the execution status of this line is deduced): rx += (qRed(*pix)) * i; | - |
| 966 | gx += G_VAL(pix) * i; executed (the execution status of this line is deduced): gx += (qGreen(*pix)) * i; | - |
| 967 | bx += B_VAL(pix) * i; executed (the execution status of this line is deduced): bx += (qBlue(*pix)) * i; | - |
| 968 | } executed: }Execution Count:588136 | 588136 |
| 969 | | - |
| 970 | r += (rx >> 5) * j; executed (the execution status of this line is deduced): r += (rx >> 5) * j; | - |
| 971 | g += (gx >> 5) * j; executed (the execution status of this line is deduced): g += (gx >> 5) * j; | - |
| 972 | b += (bx >> 5) * j; executed (the execution status of this line is deduced): b += (bx >> 5) * j; | - |
| 973 | } executed: }Execution Count:588136 | 588136 |
| 974 | | - |
| 975 | *dptr = qRgb(r >> 23, g >> 23, b >> 23); executed (the execution status of this line is deduced): *dptr = qRgb(r >> 23, g >> 23, b >> 23); | - |
| 976 | dptr++; executed (the execution status of this line is deduced): dptr++; | - |
| 977 | } executed: }Execution Count:588136 | 588136 |
| 978 | } executed: }Execution Count:2820 | 2820 |
| 979 | } executed: }Execution Count:36 | 36 |
| 980 | } | - |
| 981 | | - |
| 982 | #if 0 | - |
| 983 | static void qt_qimageScaleAARGBASetup(QImageScaleInfo *isi, unsigned int *dest, | - |
| 984 | int dxx, int dyy, int dx, int dy, int dw, | - |
| 985 | int dh, int dow, int sow) | - |
| 986 | { | - |
| 987 | qInitDrawhelperAsm(); | - |
| 988 | qt_qimageScaleAARGBA(isi, dest, dxx, dyy, dx, dy, dw, dh, dow, sow); | - |
| 989 | } | - |
| 990 | | - |
| 991 | static void qt_qimageScaleAARGBSetup(QImageScaleInfo *isi, unsigned int *dest, | - |
| 992 | int dxx, int dyy, int dx, int dy, int dw, | - |
| 993 | int dh, int dow, int sow) | - |
| 994 | { | - |
| 995 | qInitDrawhelperAsm(); | - |
| 996 | qt_qimageScaleAARGB(isi, dest, dxx, dyy, dx, dy, dw, dh, dow, sow); | - |
| 997 | } | - |
| 998 | #endif | - |
| 999 | | - |
| 1000 | QImage qSmoothScaleImage(const QImage &src, int dw, int dh) | - |
| 1001 | { | - |
| 1002 | QImage buffer; executed (the execution status of this line is deduced): QImage buffer; | - |
| 1003 | if (src.isNull() || dw <= 0 || dh <= 0) partially evaluated: src.isNull()| no Evaluation Count:0 | yes Evaluation Count:236 |
partially evaluated: dw <= 0| no Evaluation Count:0 | yes Evaluation Count:236 |
partially evaluated: dh <= 0| no Evaluation Count:0 | yes Evaluation Count:236 |
| 0-236 |
| 1004 | return buffer; never executed: return buffer; | 0 |
| 1005 | | - |
| 1006 | int w = src.width(); executed (the execution status of this line is deduced): int w = src.width(); | - |
| 1007 | int h = src.height(); executed (the execution status of this line is deduced): int h = src.height(); | - |
| 1008 | QImageScaleInfo *scaleinfo = executed (the execution status of this line is deduced): QImageScaleInfo *scaleinfo = | - |
| 1009 | qimageCalcScaleInfo(src, w, h, dw, dh, true); executed (the execution status of this line is deduced): qimageCalcScaleInfo(src, w, h, dw, dh, true); | - |
| 1010 | if (!scaleinfo) partially evaluated: !scaleinfo| no Evaluation Count:0 | yes Evaluation Count:236 |
| 0-236 |
| 1011 | return buffer; never executed: return buffer; | 0 |
| 1012 | | - |
| 1013 | buffer = QImage(dw, dh, src.format()); executed (the execution status of this line is deduced): buffer = QImage(dw, dh, src.format()); | - |
| 1014 | if (buffer.isNull()) { partially evaluated: buffer.isNull()| no Evaluation Count:0 | yes Evaluation Count:236 |
| 0-236 |
| 1015 | qWarning("QImage: out of memory, returning null"); never executed (the execution status of this line is deduced): QMessageLogger("painting/qimagescale.cpp", 1015, __PRETTY_FUNCTION__).warning("QImage: out of memory, returning null"); | - |
| 1016 | qimageFreeScaleInfo(scaleinfo); never executed (the execution status of this line is deduced): qimageFreeScaleInfo(scaleinfo); | - |
| 1017 | return QImage(); never executed: return QImage(); | 0 |
| 1018 | } | - |
| 1019 | | - |
| 1020 | if (src.format() == QImage::Format_ARGB32_Premultiplied) evaluated: src.format() == QImage::Format_ARGB32_Premultiplied| yes Evaluation Count:142 | yes Evaluation Count:94 |
| 94-142 |
| 1021 | qt_qimageScaleArgb(scaleinfo, (unsigned int *)buffer.scanLine(0), executed: qt_qimageScaleArgb(scaleinfo, (unsigned int *)buffer.scanLine(0), 0, 0, 0, 0, dw, dh, dw, src.bytesPerLine() / 4);Execution Count:142 | 142 |
| 1022 | 0, 0, 0, 0, dw, dh, dw, src.bytesPerLine() / 4); executed: qt_qimageScaleArgb(scaleinfo, (unsigned int *)buffer.scanLine(0), 0, 0, 0, 0, dw, dh, dw, src.bytesPerLine() / 4);Execution Count:142 | 142 |
| 1023 | else | - |
| 1024 | qt_qimageScaleRgb(scaleinfo, (unsigned int *)buffer.scanLine(0), executed: qt_qimageScaleRgb(scaleinfo, (unsigned int *)buffer.scanLine(0), 0, 0, 0, 0, dw, dh, dw, src.bytesPerLine() / 4);Execution Count:94 | 94 |
| 1025 | 0, 0, 0, 0, dw, dh, dw, src.bytesPerLine() / 4); executed: qt_qimageScaleRgb(scaleinfo, (unsigned int *)buffer.scanLine(0), 0, 0, 0, 0, dw, dh, dw, src.bytesPerLine() / 4);Execution Count:94 | 94 |
| 1026 | | - |
| 1027 | qimageFreeScaleInfo(scaleinfo); executed (the execution status of this line is deduced): qimageFreeScaleInfo(scaleinfo); | - |
| 1028 | return buffer; executed: return buffer;Execution Count:236 | 236 |
| 1029 | } | - |
| 1030 | | - |
| 1031 | QT_END_NAMESPACE | - |
| 1032 | | - |
| | |