1 /* 2 * Copyright (c) 2024 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 DRAWING_CANVAS_H 17 #define DRAWING_CANVAS_H 18 #include "draw/canvas.h" 19 #include "drawing_error_code.h" 20 #include "utils/rect.h" 21 #include "utils/sampling_options.h" 22 23 namespace OHOS { 24 namespace Media { 25 class PixelMap; 26 } 27 } 28 29 class DrawingCanvasUtils { 30 public: 31 static OH_Drawing_ErrorCode DrawPixelMapNine(OHOS::Rosen::Drawing::Canvas* canvas, 32 std::shared_ptr<OHOS::Media::PixelMap> pixelMap, const OHOS::Rosen::Drawing::Rect* center, 33 const OHOS::Rosen::Drawing::Rect* dst, const OHOS::Rosen::Drawing::FilterMode mode); 34 static void DrawPixelMapRect(OHOS::Rosen::Drawing::Canvas* canvas, std::shared_ptr<OHOS::Media::PixelMap> pixelMap, 35 const OHOS::Rosen::Drawing::Rect* src, const OHOS::Rosen::Drawing::Rect* dst, 36 const OHOS::Rosen::Drawing::SamplingOptions* sampling); 37 }; 38 39 extern OH_Drawing_ErrorCode g_drawingErrorCode; 40 #endif // DRAWING_CANVAS_H