mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-03-26 08:54:42 +01:00
22 lines
493 B
Dart
22 lines
493 B
Dart
import 'dart:typed_data';
|
|
|
|
/// Container of pixel data stored in RGBA format
|
|
class Rgba8Image {
|
|
const Rgba8Image(this.pixel, this.width, this.height);
|
|
|
|
factory Rgba8Image.fromJson(Map<String, dynamic> json) => Rgba8Image(
|
|
json["pixel"],
|
|
json["width"],
|
|
json["height"],
|
|
);
|
|
|
|
Map<String, dynamic> toJson() => {
|
|
"pixel": pixel,
|
|
"width": width,
|
|
"height": height,
|
|
};
|
|
|
|
final Uint8List pixel;
|
|
final int width;
|
|
final int height;
|
|
}
|