2 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
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.
23 #include <dali/public-api/dali-core.h>
24 #include <dali/devel-api/images/distance-field.h>
25 #include <dali-test-suite-utils.h>
33 static const float ROTATION_EPSILON = 0.0001f;
35 static unsigned char sourceImage[] =
37 0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,
38 0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,
39 0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,
40 0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,
41 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
42 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
43 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
44 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF
47 } // anonymous namespace
51 int UtcDaliGenerateDistanceField(void)
53 unsigned char distanceField[4*4];
55 GenerateDistanceFieldMap(sourceImage, Size(8.0f, 8.0f), distanceField, Size(4.0f, 4.0f), 0, Size(4.0f, 4.0f));
57 if(distanceField[0] <= distanceField[5] &&
58 distanceField[5] <= distanceField[10] &&
59 distanceField[10] <= distanceField[15])