2 * Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef _TVG_PAINT_CPP_
18 #define _TVG_PAINT_CPP_
20 #include "tvgCommon.h"
22 /************************************************************************/
23 /* Internal Class Implementation */
24 /************************************************************************/
26 Paint :: Paint() : pImpl(make_unique<Impl>())
36 /************************************************************************/
37 /* External Class Implementation */
38 /************************************************************************/
40 Result Paint::rotate(float degree) noexcept
42 if (IMPL->ts->rotate(degree)) return Result::Success;
43 return Result::FailedAllocation;
47 Result Paint::scale(float factor) noexcept
49 if (IMPL->ts->scale(factor)) return Result::Success;
50 return Result::FailedAllocation;
54 Result Paint::translate(float x, float y) noexcept
56 if (IMPL->ts->translate(x, y)) return Result::Success;
57 return Result::FailedAllocation;
61 Result Paint::transform(const Matrix& m) noexcept
63 if (IMPL->ts->transform(m)) return Result::Success;
64 return Result::FailedAllocation;
68 Result Paint::bounds(float* x, float* y, float* w, float* h) const noexcept
70 if (IMPL->ts->bounds(x, y, w, h)) return Result::Success;
71 return Result::InsufficientCondition;
74 #endif //_TVG_PAINT_CPP_