generated from vignetteapp/dotnet-template
-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* These pointers are C++ strings, not C strings * Create a `DummyResourceManager` as an example * Hide unsafe APIs * Oops * Using a `Span` results in segfaults :( * Handle exceptions in `provideResource` * Remove stray comment * Document the delegates Co-authored-by: Ayane Satomi <[email protected]>
- Loading branch information
Showing
6 changed files
with
66 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright (c) homuler and The Vignette Authors | ||
// This file is part of MediaPipe.NET. | ||
// MediaPipe.NET is licensed under the MIT License. See LICENSE for details. | ||
|
||
using System; | ||
using System.IO; | ||
using Mediapipe.Net.Util; | ||
|
||
namespace Mediapipe.Net.Examples.FaceMesh | ||
{ | ||
public class DummyResourceManager : ResourceManager | ||
{ | ||
public override PathResolver ResolvePath => (path) => | ||
{ | ||
Console.WriteLine($"PathResolver: (not) resolving path '{path}'"); | ||
return path; | ||
}; | ||
|
||
public unsafe override ResourceProvider ProvideResource => (path) => | ||
{ | ||
Console.WriteLine($"ResourceProvider: providing resource '{path}'"); | ||
byte[] bytes = File.ReadAllBytes(path); | ||
return bytes; | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters