2 * Copyright (c) 2016 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.
18 using static Interop.ImageUtil;
19 using static Interop.ImageUtil.Transform;
21 namespace Tizen.Multimedia.Util
26 /// <since_tizen> 4 </since_tizen>
27 public class ResizeTransform : ImageTransform
32 /// Initializes a new instance of the <see cref="ResizeTransform"/> class.
34 /// <param name="size">The size that an image is resized to.</param>
35 /// <exception cref="ArgumentOutOfRangeException">
36 /// The width of <paramref name="size"/> is less than or equal to zero.<br/>
38 /// The height of <paramref name="size"/> is less than or equal to zero.
40 /// <since_tizen> 4 </since_tizen>
41 public ResizeTransform(Size size)
46 internal override string GenerateNotSupportedErrorMessage(VideoMediaFormat format)
47 => $"'{format.MimeType}' is not supported by ResizeTransform.";
50 /// Gets or sets the size that an image is resized to.
52 /// <exception cref="ArgumentOutOfRangeException">
53 /// The width of <paramref name="value"/> is less than or equal to zero.<br/>
55 /// The height of <paramref name="value"/> is less than or equal to zero.
57 /// <since_tizen> 4 </since_tizen>
65 throw new ArgumentOutOfRangeException(nameof(Size), value,
66 "Width of the size can't be less than or equal to zero.");
69 if (value.Height <= 0)
71 throw new ArgumentOutOfRangeException(nameof(Size), value,
72 "Height of the size can't be less than or equal to zero.");
79 internal override void Configure(TransformHandle handle)
81 SetResolution(handle, (uint)Size.Width, (uint)Size.Height);