1234567891011121314151617181920212223242526272829303132333435 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using Emgu.CV;
- using Emgu.CV.Structure;
- namespace bbiwarg.Images
- {
- public enum TouchImageState {
- none = 0,
- touchArea = 1,
- touchAreaMatched = 2,
- touchAreaStatusBar = 3,
- touchDetected = 4,
- touchTracked = 5
- }
- class TouchImage
- {
- private Image<Gray, Int16> image;
- public TouchImage(DepthImage depthImage) {
- image = depthImage.getImage().CopyBlank();
- }
- public void setTouchAt(int x, int y, TouchImageState tis) {
- image.Data[y, x, 0] = (Int16) tis;
- }
- public TouchImageState getStateAt(int x, int y) {
- return (TouchImageState)image.Data[y, x, 0];
- }
- }
- }
|