示例#1
0
 protected override void DispatchSaveInstanceState(SparseArray container)
 {
     if (Id > 0)
     {
         container.Append(Id, (Java.Lang.Object)OnSaveInstanceState());
     }
 }
        private double GetPositionRatio(int position)
        {
            double ratio = SPositionHeightRatios.Get(position, 0.0);

            // if not yet done generate and stash the columns height
            // in our real world scenario this will be determined by
            // some match based on the known height and width of the image
            // and maybe a helpful way to get the column height!
            if (ratio == 0)
            {
                ratio = RandomHeightRatio;
                SPositionHeightRatios.Append(position, ratio);
                Console.WriteLine(TAG, "getPositionRatio:" + position + " ratio:" + ratio);
            }
            return(ratio);
        }
示例#3
0
        private TrackedModel getTrackedModel(FaceInfo faceInfo, ImageFrame frame)
        {
            TrackedModel face = trackingFaces.Get(faceInfo.FaceId);

            if (face == null)
            {
                face = pool.Take();
                if (face == null)
                {
                    face = new TrackedModel();
                }
                trackingFaces.Append(faceInfo.FaceId, face);
                face.setTrackId(Guid.NewGuid().ToString());
                face.setEvent(Event.OnEnter);
            }
            face.setInfo(faceInfo);
            face.setFrame(frame);
            return(face);
        }