Skip to content
3 changes: 2 additions & 1 deletion packages/camera/camera_platform_interface/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## NEXT
## 2.14.0

* Adds `rgba8888` to `ImageFormatGroup` enum.
* Updates minimum supported SDK version to Flutter 3.38/Dart 3.10.

## 2.13.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ ImageFormatGroup _imageFormatGroupFromPlatformData(dynamic data) {
return ImageFormatGroup.yuv420;
case 256: // android.graphics.ImageFormat.JPEG
return ImageFormatGroup.jpeg;
case 1: // android.graphics.PixelFormat.RGBA_8888
return ImageFormatGroup.rgba8888;
Comment thread
Mairramer marked this conversation as resolved.
}
}

Expand All @@ -47,6 +49,9 @@ ImageFormatGroup _imageFormatGroupFromPlatformData(dynamic data) {

case 1111970369: // kCVPixelFormatType_32BGRA
return ImageFormatGroup.bgra8888;

case 1380401729: // kCVPixelFormatType_32RGBA
return ImageFormatGroup.rgba8888;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ enum ImageFormatGroup {
/// On Android, this is `android.graphics.ImageFormat.NV21`. See
/// https://developer.android.com/reference/android/graphics/ImageFormat#NV21
nv21,

/// 32-bit RGBA.
///
/// On Android, this is `android.graphics.PixelFormat.RGBA_8888`. See
/// https://developer.android.com/reference/android/graphics/PixelFormat#RGBA_8888
///
/// On iOS, this is `kCVPixelFormatType_32RGBA`. See
/// https://developer.apple.com/documentation/corevideo/kcvpixelformattype_32rgba
Comment thread
Mairramer marked this conversation as resolved.
Outdated
rgba8888,
}

/// Extension on [ImageFormatGroup] to stringify the enum
Expand All @@ -54,6 +63,8 @@ extension ImageFormatGroupName on ImageFormatGroup {
return 'jpeg';
case ImageFormatGroup.nv21:
return 'nv21';
case ImageFormatGroup.rgba8888:
return 'rgba8888';
case ImageFormatGroup.unknown:
return 'unknown';
}
Expand Down
2 changes: 1 addition & 1 deletion packages/camera/camera_platform_interface/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ repository: https://github.com/flutter/packages/tree/main/packages/camera/camera
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22
# NOTE: We strongly prefer non-breaking changes, even at the expense of a
# less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes
version: 2.13.0
version: 2.14.0

environment:
sdk: ^3.10.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ void main() {
expect(ImageFormatGroup.yuv420.name(), 'yuv420');
expect(ImageFormatGroup.jpeg.name(), 'jpeg');
expect(ImageFormatGroup.nv21.name(), 'nv21');
expect(ImageFormatGroup.rgba8888.name(), 'rgba8888');
expect(ImageFormatGroup.unknown.name(), 'unknown');
});
});
Expand Down