comparison exporters.pde @ 227:2d424d096281

Fix mpImportFromImage() to return true when successful.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 05 Sep 2018 22:21:18 +0300
parents 1c9deae71fb1
children a53b3fe97412
comparison
equal deleted inserted replaced
226:caefc3c9e78c 227:2d424d096281
1303 avg = 0; 1303 avg = 0;
1304 for (avy = 0; avy < baly; avy++) 1304 for (avy = 0; avy < baly; avy++)
1305 for (avx = 0; avx < balx; avx++) 1305 for (avx = 0; avx < balx; avx++)
1306 { 1306 {
1307 c = image.get(x2 + avx, y2 + avy); 1307 c = image.get(x2 + avx, y2 + avy);
1308 rr = rr + int(red(c)); 1308 rr += int(red(c));
1309 gg = gg + int(green(c)); 1309 gg += int(green(c));
1310 bb = bb + int(blue(c)); 1310 bb += int(blue(c));
1311 avg++; 1311 avg++;
1312 } 1312 }
1313 1313
1314 rr = int(rr / avg); 1314 rr = int(rr / avg);
1315 gg = int(gg / avg); 1315 gg = int(gg / avg);
1344 makepoint(xx, yy); 1344 makepoint(xx, yy);
1345 } 1345 }
1346 } 1346 }
1347 } 1347 }
1348 } 1348 }
1349 return true;
1349 } 1350 }
1350 1351
1351 1352
1352 void mpRenderToImageAt(PImage output, int xoffs, int yoffs, int omag) 1353 void mpRenderToImageAt(PImage output, int xoffs, int yoffs, int omag)
1353 { 1354 {