Skip to content

Commit

Permalink
refactor: get PixelData
Browse files Browse the repository at this point in the history
  • Loading branch information
homuler committed Nov 29, 2020
1 parent 682b6a8 commit 9d386dc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 1 addition & 4 deletions Assets/MediaPipe/Examples/Scripts/SceneDirector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,7 @@ IEnumerator RunGraph() {
break;
}

var colors = webCamScreenController.GetPixels32();
var width = webCamScreenController.Width();
var height = webCamScreenController.Height();
var pixelData = new PixelData(colors, width, height);
var pixelData = webCamScreenController.GetPixelData();

graph.PushInput(pixelData).AssertOk();
graph.RenderOutput(webCamScreenController, pixelData);
Expand Down
4 changes: 4 additions & 0 deletions Assets/MediaPipe/Examples/Scripts/WebCamScreenController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ public Color32[] GetPixels32() {
return IsPlaying() ? webCamTexture.GetPixels32(pixelData) : null;
}

public PixelData GetPixelData() {
return new PixelData(GetPixels32(), Width(), Height());
}

public Texture2D GetScreen() {
return outputTexture;
}
Expand Down

0 comments on commit 9d386dc

Please sign in to comment.