1 /* 2 * Copyright (C) 2023 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 #pragma once 18 19 namespace android { 20 namespace hardware { 21 namespace camera { 22 namespace provider { 23 namespace implementation { 24 25 template <class T> struct Rect { 26 Rect() = default; RectRect27 Rect(T w, T h) : width(w), height(h) {} 28 T width, height; 29 30 bool operator==(const Rect& rhs) const { 31 return (width == rhs.width) && (height == rhs.height); 32 } 33 areaRect34 size_t area() const { return size_t(width) * height; } 35 }; 36 37 } // namespace implementation 38 } // namespace provider 39 } // namespace camera 40 } // namespace hardware 41 } // namespace android 42