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.
17 using System.Threading.Tasks;
18 using static Interop.ImageUtil;
20 namespace Tizen.Multimedia.Util
22 // TODO need to improve performance
24 /// Represents a <see cref="ImageTransform"/> that is a composite of the transforms.
26 /// <since_tizen> 4 </since_tizen>
27 public class ImageTransformGroup : ImageTransform
30 /// Gets or sets the <see cref="ImageTransformCollection"/>.
32 /// <since_tizen> 4 </since_tizen>
33 public ImageTransformCollection Children { get; set; }
36 /// Initializes a new instance of the ImageTransformGroup class.
38 /// <since_tizen> 4 </since_tizen>
39 public ImageTransformGroup()
41 Children = new ImageTransformCollection();
44 internal override void Configure(TransformHandle handle)
49 internal override async Task<MediaPacket> ApplyAsync(MediaPacket source)
51 if (Children.Count == 0)
58 MediaPacket curPacket = await items[0].ApplyAsync(source);
60 for (int i = 1; i < items.Count; ++i)
62 var oldPacket = curPacket;
65 curPacket = await items[i].ApplyAsync(curPacket);
76 internal override string GenerateNotSupportedErrorMessage(VideoMediaFormat format)