1122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik/* 2122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik * Copyright (C) 2018 The Android Open Source Project 3122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik * 4122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik * Licensed under the Apache License, Version 2.0 (the "License"); 5122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik * you may not use this file except in compliance with the License. 6122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik * You may obtain a copy of the License at 7122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik * 8122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik * http://www.apache.org/licenses/LICENSE-2.0 9122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik * 10122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik * Unless required by applicable law or agreed to in writing, software 11122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik * distributed under the License is distributed on an "AS IS" BASIS, 12122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik * See the License for the specific language governing permissions and 14122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik * limitations under the License. 15122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik */ 16122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik 17122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittikpackage android.hardware.display; 18122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik 19122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittikimport android.os.Parcel; 20122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittikimport android.os.Parcelable; 21122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik 22122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik/** @hide */ 23122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittikpublic final class Curve implements Parcelable { 24122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik private final float[] mX; 25122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik private final float[] mY; 26122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik 27122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik public Curve(float[] x, float[] y) { 28122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik mX = x; 29122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik mY = y; 30122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik } 31122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik 32122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik public float[] getX() { 33122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik return mX; 34122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik } 35122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik 36122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik public float[] getY() { 37122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik return mY; 38122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik } 39122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik 40122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik public static final Creator<Curve> CREATOR = new Creator<Curve>() { 41122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik public Curve createFromParcel(Parcel in) { 42122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik float[] x = in.createFloatArray(); 43122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik float[] y = in.createFloatArray(); 44122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik return new Curve(x, y); 45122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik } 46122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik 47122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik public Curve[] newArray(int size) { 48122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik return new Curve[size]; 49122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik } 50122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik }; 51122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik 52122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik @Override 53122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik public void writeToParcel(Parcel out, int flags) { 54122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik out.writeFloatArray(mX); 55122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik out.writeFloatArray(mY); 56122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik } 57122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik 58122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik @Override 59122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik public int describeContents() { 60122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik return 0; 61122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik } 62122df868919f3e2b9a92d6e9dc66808884f3f080Dan Gittik} 63