Пример #1
0
        internal static Model.Face ToFace(this Droid.Contract.PersonFace personFace)
        {
            var face = new Model.Face
            {
                Id       = personFace.PersistedFaceId.ToString(),
                UserData = personFace.UserData
            };

            face.UpdateThumbnailPath();

            return(face);
        }
Пример #2
0
        internal static Model.Face ToFace(this MPOPersonFace mpoFace)
        {
            var face = new Model.Face
            {
                Id       = mpoFace.PersistedFaceId,
                UserData = mpoFace.UserData
            };

            face.UpdateThumbnailPath();

            return(face);
        }
Пример #3
0
        internal static Model.Face ToFace(this Droid.Contract.Face thisFace, bool adaptLandmarks = false, FaceAttributeType [] attributes = null)
        {
            var thatFace = new Model.Face
            {
                Id            = thisFace.FaceId.ToString(),
                FaceRectangle = thisFace.FaceRectangle.ToFaceRectangle(),
                Attributes    = thisFace.FaceAttributes?.ToFaceAttributes(attributes)
            };

            if (adaptLandmarks)
            {
                thatFace.Landmarks = thisFace.FaceLandmarks?.ToFaceLandmarks();
            }

            thatFace.UpdateThumbnailPath();

            return(thatFace);
        }
Пример #4
0
        internal static Model.Face ToFace(this MPOFace mpoFace, bool adaptLandmarks = false, FaceAttributeType [] attributes = null)
        {
            var face = new Model.Face
            {
                Id            = mpoFace.FaceId,
                FaceRectangle = mpoFace.FaceRectangle.ToFaceRectangle(),
                Attributes    = mpoFace.Attributes?.ToFaceAttributes(attributes)
            };

            if (adaptLandmarks)
            {
                face.Landmarks = mpoFace.FaceLandmarks?.ToFaceLandmarks();
            }

            face.UpdateThumbnailPath();

            return(face);
        }
Пример #5
0
 /// <summary>
 /// Saves the thumbnail image using the Face's current thumbnail path.
 /// </summary>
 /// <param name="face">Face.</param>
 /// <param name="thumbnail">Thumbnail image.</param>
 public static void SaveThumbnail(this Model.Face face, UIImage thumbnail)
 {
     face.UpdateThumbnailPath();
     thumbnail.SaveAsJpeg(face.ThumbnailPath);
 }