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 KNUCKLE_GLOW_TRACE_SYSTEM_H 17 #define KNUCKLE_GLOW_TRACE_SYSTEM_H 18 19 #include <vector> 20 21 #include "draw/canvas.h" 22 #include "image/bitmap.h" 23 #include "include/core/SkPath.h" 24 #include "pipeline/rs_recording_canvas.h" 25 #include "render/rs_pixel_map_util.h" 26 27 #include "knuckle_divergent_point.h" 28 #include "knuckle_glow_point.h" 29 30 namespace OHOS { 31 namespace MMI { 32 class KnuckleGlowTraceSystem { 33 public: 34 KnuckleGlowTraceSystem(int32_t pointSize, std::shared_ptr<OHOS::Media::PixelMap> pixelMap, 35 int32_t maxDivergenceNum); 36 ~KnuckleGlowTraceSystem() = default; 37 void Clear(); 38 void Update(); 39 void Draw(Rosen::ExtendRecordingCanvas* canvas); 40 void ResetDivergentPoints(double pointX, double pointY); 41 void AddGlowPoints(const Rosen::Drawing::Path &path, int64_t timeInterval); 42 43 private: 44 std::vector<std::shared_ptr<KnuckleGlowPoint>> glowPoints_; 45 std::vector<std::shared_ptr<KnuckleDivergentPoint>> divergentPoints_; 46 int32_t maxDivergenceNum_ { 0 }; 47 }; 48 } // namespace MMI 49 } // namespace OHOS 50 #endif // KNUCKLE_GLOW_TRACE_SYSTEM_H 51