1/* 2 * Copyright (C) 2018 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 17package android.hardware.display; 18 19import android.os.Parcel; 20import android.os.Parcelable; 21 22/** @hide */ 23public final class Curve implements Parcelable { 24 private final float[] mX; 25 private final float[] mY; 26 27 public Curve(float[] x, float[] y) { 28 mX = x; 29 mY = y; 30 } 31 32 public float[] getX() { 33 return mX; 34 } 35 36 public float[] getY() { 37 return mY; 38 } 39 40 public static final Creator<Curve> CREATOR = new Creator<Curve>() { 41 public Curve createFromParcel(Parcel in) { 42 float[] x = in.createFloatArray(); 43 float[] y = in.createFloatArray(); 44 return new Curve(x, y); 45 } 46 47 public Curve[] newArray(int size) { 48 return new Curve[size]; 49 } 50 }; 51 52 @Override 53 public void writeToParcel(Parcel out, int flags) { 54 out.writeFloatArray(mX); 55 out.writeFloatArray(mY); 56 } 57 58 @Override 59 public int describeContents() { 60 return 0; 61 } 62} 63