5 Commits

Author SHA1 Message Date
ce85bd59a4 Add a safe overload for ImageFrame() (#20)
* Add a safe overload for ImageFrame()

Signed-off-by: GitHub <noreply@github.com>

* Reduce code dup by wrapping into the unsafe overload instead

Signed-off-by: GitHub <noreply@github.com>

* dotnet format

Signed-off-by: GitHub <noreply@github.com>

* Le unhaskellize

🖑Hey🖐 buddy,👬 I think🤔 you've 👉got the 🛇wrong🚫 door🚪 the 🐄leather🐄 club's ♴two♴ blocks down☟. 🖕Fuck🖕↗You↘.Oh, Fuck♂You 🐄leather🐄 man Maybe 👬you and I👬 should settle it💪 👇right here👇 on the 💍ring💍 if you think🤔 your so 💪tough💪. Oh yea?😡 I'll kick👣 your ass!👊 Ha!😂 Yeah right👍 man. Let's go!✔ Why don't you🤔 get out of that 🐄leather stuff?🐄 I'll strip👙 down☟ out of this and we'll settle👪 it right here👇 in the ring. What do you say? 🤐Yeah⁉ no problem buddy👬 You got it. 🖒Get out of that uh, jabroni outfit👕👔👖. Yeah, smart🤔 ass. I'll show😡you who's the ☝boss☝ of this 🏋gym.🏋

Signed-off-by: GitHub <noreply@github.com>

* I'll let this Le pass this time

Co-authored-by: Speykious <speykious@gmail.com>
2022-02-02 16:36:42 +01:00
7777028aec The Vignette Authors™️ 2022-01-28 12:07:37 +01:00
3371a2e745 Replace slow Marshal operations with unsafe (#13)
* Remove this bool marshal

* Literally remove all bool marshals

* Remove CharSet.Unicode warning

* Remove most FunctionPtr marshals

* Remove `[return: MarshalAs(...)]`

* Replace all `IntPtr`s with `void*`s

* Replace all `void*.Zero`s with `null`s

* Make native method classes unsafe

* U N S A F E

* Replace `PtrToStructure` with pointer arithmetic

* Run `dotnet format`

* Temp ugly Activator fix

* Remove `.ToPointer()`

* Use `byte` to return a `bool`

* Backwards compatibility with `Activator`

Yeah that sucks :(

* Replace `Marshal.Copy` by pointer arithmetic

* Replace `PtrToStringAnsi()` with `new string()`

* Remove unnecessary usings

* Explicitly type string pointers as `sbyte*`

* It actually doesn't hang?

* `MediaPipeException` -> `MediapipeException`

* Simplify `for` loops

* Remove unnecessary `float*` cast

* Some more explicit types for `ImageFrame`

* Remove unnecessary cast

* Looks like we forgor a `using` 💀

* Create `SafeArrayCopy` helper method

* Document `SafeArrayCopy`
2022-01-28 10:53:30 +01:00
54b990081f Replace methods with C# getters/setters (#11)
* timestamp

* ImageFrame + tests

* whitespace

* stream poller

* fix issue

* gpu

* core

* status
2022-01-23 02:17:36 +08:00
ea5b6e0b8f Port all bindings from MediaPipeUnityPlugin (#2)
* Putting unused usings as warning

As per our latest .NET template fix

* Port `ResourceManager`

Will be very useful to avoir having to have a `mediapipe` folder
every time

* Port `ImageFrame`

We'll really need to review this one in particular

* Port remaining classes of `Mediapipe.Net.Gpu`

* Port `Timestamp`

* Port `Packet`

* Add `Mediapipe.Net.Framework.Protobuf` dependency

* Port `OutputStreamPoller`

* Port the whole `Mediapipe.Net.Framework.Port`

* Port the whole `Mediapipe.Net.Framework.Packet`

* Port the whole `Mediapipe.Net.Framework.Tool`

* Port `CalculatorGraph`

* Port `CalculatorGraphConfigExtension`

And with that, the whole `Mediapipe.Net` port is finished!
Time to port all the tests.

* Fix imports ordering

* Update comment on ImageFrame ctor

Also remove redundant `unsafe`
2022-01-20 09:22:48 +08:00