1 /* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef RESIZE_COMPUTER_H 17 #define RESIZE_COMPUTER_H 18 19 #include "picture_utils.h" 20 21 namespace IC { 22 class ResizeComputer { 23 public: 24 explicit ResizeComputer(const PicInfo &pInfo); 25 ~ResizeComputer() = default; 26 int Compute(uint8_t *pDest, uint8_t *src, int pDestSize, int srcSize); 27 28 private: 29 int sw_; 30 int sh_; 31 int dw_; 32 int dh_; 33 int B_; 34 int N_; 35 int x_; 36 int y_; 37 uint8_t *pLinePrev_; 38 uint8_t *pLineNext_; 39 uint8_t *pA_; 40 uint8_t *pB_; 41 uint8_t *pC_; 42 uint8_t *pD_; 43 }; 44 } // namespace IC 45 #endif // RESIZE_COMPUTER_H