1 /*
2 * Copyright (c) 2025 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 #include "modifier_ng/appearance/rs_pixel_stretch_modifier.h"
17
18 namespace OHOS::Rosen::ModifierNG {
SetPixelStretchSize(const Vector4f & stretchSize)19 void RSPixelStretchModifier::SetPixelStretchSize(const Vector4f& stretchSize)
20 {
21 Setter(RSPropertyType::PIXEL_STRETCH_SIZE, stretchSize);
22 }
23
GetPixelStretchSize() const24 Vector4f RSPixelStretchModifier::GetPixelStretchSize() const
25 {
26 return Getter<Vector4f>(RSPropertyType::PIXEL_STRETCH_SIZE, {});
27 }
28
SetPixelStretchTileMode(int stretchTileMode)29 void RSPixelStretchModifier::SetPixelStretchTileMode(int stretchTileMode)
30 {
31 Setter<RSProperty>(RSPropertyType::PIXEL_STRETCH_TILE_MODE, stretchTileMode);
32 }
33
GetPixelStretchTileMode() const34 int RSPixelStretchModifier::GetPixelStretchTileMode() const
35 {
36 return Getter<int>(RSPropertyType::PIXEL_STRETCH_TILE_MODE, {});
37 }
38
SetPixelStretchPercent(const Vector4f & stretchPercent)39 void RSPixelStretchModifier::SetPixelStretchPercent(const Vector4f& stretchPercent)
40 {
41 Setter(RSPropertyType::PIXEL_STRETCH_PERCENT, stretchPercent);
42 }
43
GetPixelStretchPercent() const44 Vector4f RSPixelStretchModifier::GetPixelStretchPercent() const
45 {
46 return Getter<Vector4f>(RSPropertyType::PIXEL_STRETCH_PERCENT, {});
47 }
48 } // namespace OHOS::Rosen::ModifierNG
49