From c94db7e9b8fa62cd53836b060c0e2e76d6177de4 Mon Sep 17 00:00:00 2001 From: laurenspriem Date: Fri, 6 Sep 2024 13:10:56 +0200 Subject: [PATCH] [mob][photos] Remove unused method --- mobile/lib/utils/image_ml_util.dart | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/mobile/lib/utils/image_ml_util.dart b/mobile/lib/utils/image_ml_util.dart index 5713527108..d1410b65fc 100644 --- a/mobile/lib/utils/image_ml_util.dart +++ b/mobile/lib/utils/image_ml_util.dart @@ -373,29 +373,6 @@ List> _createGrayscaleIntMatrixFromNormalized2List( ); } -Float32List _createFloat32ListFromImageChannelsFirst( - Image image, - ByteData byteDataRgba, { - double Function(num) normFunction = _normalizePixelRange2, -}) { - final convertedBytes = Float32List(3 * image.height * image.width); - final buffer = Float32List.view(convertedBytes.buffer); - - int pixelIndex = 0; - final int channelOffsetGreen = image.height * image.width; - final int channelOffsetBlue = 2 * image.height * image.width; - for (var h = 0; h < image.height; h++) { - for (var w = 0; w < image.width; w++) { - final pixel = _readPixelColor(image, byteDataRgba, w, h); - buffer[pixelIndex] = normFunction(pixel.red); - buffer[pixelIndex + channelOffsetGreen] = normFunction(pixel.green); - buffer[pixelIndex + channelOffsetBlue] = normFunction(pixel.blue); - pixelIndex++; - } - } - return convertedBytes.buffer.asFloat32List(); -} - /// Function normalizes the pixel value to be in range [-1, 1]. /// /// It assumes that the pixel value is originally in range [0, 255]