mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-21 23:10:40 +00:00
Compare commits
4 commits
b4be0cced3
...
bc6d01f87c
Author | SHA1 | Date | |
---|---|---|---|
|
bc6d01f87c | ||
|
4f4b6cf1eb | ||
|
ab54de7612 | ||
|
26619ce3de |
3 changed files with 54 additions and 27 deletions
|
@ -399,7 +399,7 @@
|
|||
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
CODE_SIGN_STYLE = Manual;
|
||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||
DEVELOPMENT_TEAM = "";
|
||||
|
@ -414,7 +414,7 @@
|
|||
PRODUCT_BUNDLE_IDENTIFIER = com.vodemn.lightmeter;
|
||||
PRODUCT_NAME = Lightmeter;
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Lightmeter Distribution";
|
||||
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Lightmeter Development";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
SWIFT_VERSION = 5.0;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
|
@ -536,7 +536,7 @@
|
|||
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
CODE_SIGN_STYLE = Manual;
|
||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||
DEVELOPMENT_TEAM = "";
|
||||
|
@ -551,7 +551,7 @@
|
|||
PRODUCT_BUNDLE_IDENTIFIER = com.vodemn.lightmeter;
|
||||
PRODUCT_NAME = Lightmeter;
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Lightmeter Distribution";
|
||||
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Lightmeter Development";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 5.0;
|
||||
|
@ -567,7 +567,7 @@
|
|||
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
CODE_SIGN_STYLE = Manual;
|
||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||
DEVELOPMENT_TEAM = "";
|
||||
|
@ -582,7 +582,7 @@
|
|||
PRODUCT_BUNDLE_IDENTIFIER = com.vodemn.lightmeter;
|
||||
PRODUCT_NAME = Lightmeter;
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Lightmeter Distribution";
|
||||
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Lightmeter Development";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
SWIFT_VERSION = 5.0;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
|
|
|
@ -36,7 +36,6 @@ class LightmeterAnalyticsFirebase implements ILightmeterAnalyticsApi {
|
|||
stackTrace,
|
||||
reason: reason,
|
||||
information: information,
|
||||
fatal: true,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import 'dart:math';
|
||||
|
||||
import 'package:camera/camera.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:lightmeter/res/dimens.dart';
|
||||
|
||||
|
@ -64,6 +65,19 @@ class _CameraHistogramState extends State<CameraHistogram> {
|
|||
histogramG = List.filled(256, 0);
|
||||
histogramB = List.filled(256, 0);
|
||||
|
||||
switch (defaultTargetPlatform) {
|
||||
case TargetPlatform.android:
|
||||
_yuv420toRgb(image);
|
||||
case TargetPlatform.iOS:
|
||||
_bgra8888toRgb(image);
|
||||
default:
|
||||
}
|
||||
|
||||
if (mounted) setState(() {});
|
||||
});
|
||||
}
|
||||
|
||||
void _yuv420toRgb(CameraImage image) {
|
||||
final int uvRowStride = image.planes[1].bytesPerRow;
|
||||
final int uvPixelStride = image.planes[1].bytesPerPixel!;
|
||||
|
||||
|
@ -85,9 +99,23 @@ class _CameraHistogramState extends State<CameraHistogram> {
|
|||
histogramB[b.round().clamp(0, 255)]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (mounted) setState(() {});
|
||||
});
|
||||
void _bgra8888toRgb(CameraImage image) {
|
||||
for (int i = 0; i < image.planes.first.bytes.length; i++) {
|
||||
final int channel = i % 4;
|
||||
switch (channel) {
|
||||
case 3:
|
||||
break;
|
||||
case 2:
|
||||
histogramR[image.planes.first.bytes[i]]++;
|
||||
case 1:
|
||||
histogramG[image.planes.first.bytes[i]]++;
|
||||
case 0:
|
||||
histogramB[image.planes.first.bytes[i]]++;
|
||||
default:
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue