1 /*
2  * Copyright (C) 2021 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package android.hardware.face;
18 
19 import android.annotation.NonNull;
20 import android.os.Parcel;
21 import android.os.Parcelable;
22 
23 /**
24  * A matrix cell, corresponding to a desired face image, that may be captured during enrollment.
25  *
26  * @hide
27  */
28 public final class FaceEnrollCell implements Parcelable {
29     private final int mX;
30     private final int mY;
31     private final int mZ;
32 
33     /**
34      * A matrix cell, corresponding to a desired face image, that may be captured during enrollment.
35      *
36      * @param x The horizontal coordinate of this cell.
37      * @param y The vertical coordinate of this cell.
38      * @param z The depth coordinate of this cell.
39      */
FaceEnrollCell(int x, int y, int z)40     public FaceEnrollCell(int x, int y, int z) {
41         mX = x;
42         mY = y;
43         mZ = z;
44     }
45 
46     /**
47      * @return The horizontal coordinate of this cell.
48      */
getX()49     public int getX() {
50         return mX;
51     }
52 
53     /**
54      * @return The vertical coordinate of this cell.
55      */
getY()56     public int getY() {
57         return mY;
58     }
59 
60     /**
61      * @return The depth coordinate of this cell.
62      */
getZ()63     public int getZ() {
64         return mZ;
65     }
66 
FaceEnrollCell(@onNull Parcel source)67     private FaceEnrollCell(@NonNull Parcel source) {
68         mX = source.readInt();
69         mY = source.readInt();
70         mZ = source.readInt();
71     }
72 
73     @Override
describeContents()74     public int describeContents() {
75         return 0;
76     }
77 
78     @Override
writeToParcel(Parcel dest, int flags)79     public void writeToParcel(Parcel dest, int flags) {
80         dest.writeInt(mX);
81         dest.writeInt(mY);
82         dest.writeInt(mZ);
83     }
84 
85     public static final Creator<FaceEnrollCell> CREATOR = new Creator<FaceEnrollCell>() {
86         @Override
87         public FaceEnrollCell createFromParcel(Parcel source) {
88             return new FaceEnrollCell(source);
89         }
90 
91         @Override
92         public FaceEnrollCell[] newArray(int size) {
93             return new FaceEnrollCell[size];
94         }
95     };
96 }
97