36 lines
1.1 KiB
Dart
36 lines
1.1 KiB
Dart
// import 'dart:async';
|
|
import 'dart:ffi';
|
|
import 'dart:io';
|
|
import 'dart:typed_data';
|
|
// import 'dart:isolate';
|
|
// import 'dart:ui';
|
|
import 'package:archimedes_mobile_lib/archimedes_c_shim.dart';
|
|
import 'package:archimedes_mobile_lib/dynloader.dart';
|
|
import "package:ffi/ffi.dart";
|
|
import "package:path/path.dart" show dirname, join;
|
|
import 'dart:io' show Platform;
|
|
|
|
import 'archimedes_mobile_lib_bindings_generated.dart';
|
|
|
|
/// The dynamic library in which the symbols for [ArchimedesMobileLibBindings] can be found.
|
|
final DynamicLibrary _dylib = getArchimedesCLib();
|
|
|
|
void main(List<String> arguments) {
|
|
final assets = join(HERE.parent.path, "assets");
|
|
final testFrames = join(assets, "test", "frames");
|
|
final firstFrame = join(testFrames, "0001.png");
|
|
final f = File(firstFrame);
|
|
final l = f.readAsBytesSync().cast();
|
|
final myPointer = malloc<Uint8>(l.length);
|
|
for (int i = 0; i < l.length; ++i) {
|
|
myPointer[i] = l[i];
|
|
print(myPointer[i]);
|
|
}
|
|
|
|
Pointer<Frame> frame = newFrame(myPointer, l.length, 768, 768, 64);
|
|
|
|
Pointer<UnsignedChar> data = malloc<UnsignedChar>(l.length * 4);
|
|
|
|
getImageData(frame, data);
|
|
}
|