(test) formatting

This commit is contained in:
Nick Fisher
2025-05-21 13:16:06 +08:00
parent 5ce2efa638
commit 1f58c13179

View File

@@ -119,11 +119,11 @@ void main() async {
}
// Improved blending - treating black pixels as transparent
final blendedImage = Float32List(width * height * 4);
final weightSums = List<double>.filled(width * height, 0.0);
final blendedImage = Float32List(width * height * 4);
final weightSums = List<double>.filled(width * height, 0.0);
// For each image
for (final image in images) {
for (final image in images) {
// For each pixel in the image
for (int p = 0; p < width * height; p++) {
final baseIdx = p * 4;
@@ -148,10 +148,10 @@ for (final image in images) {
weightSums[p] += weight;
}
}
}
}
// Normalize by the accumulated weights
for (int p = 0; p < width * height; p++) {
for (int p = 0; p < width * height; p++) {
final baseIdx = p * 4;
final weightSum = weightSums[p];
@@ -168,7 +168,7 @@ for (int p = 0; p < width * height; p++) {
blendedImage[baseIdx + 2] = 0;
blendedImage[baseIdx + 3] = 0;
}
}
}
// Set the blended data to the projectedImage
final data = await projectedImage.getData();
data.setRange(0, data.length, blendedImage);