Dali 3D User Interface Engine
utc-Dali-IcoLoader.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17 
18 #include <iostream>
19 #include <stdlib.h>
20 #include <dali-test-suite-utils.h>
21 
23 #include "image-loaders.h"
24 
25 using namespace Dali;
26 
27 namespace
28 {
29 
31 
32 
33 // Golden master image data for each icon type:
34 // Note: The bottom right corner of each image is fully transparent.
35 // Note: The first 4 sets of data *happen* to be the same, but could be different depending on the image converted.
36 // In this case as the original image contains few colors, they can easily fit inside an 8bit palette, thus
37 // Causing no image degradation.
38 
40  0xff0000ff, 0x00ff00ff, 0x0000ffff, 0xff00ffff,
41  0xc04040ff, 0x40c040ff, 0x4040c0ff, 0xffff00ff,
42  0xa06060ff, 0x60a060ff, 0x6060a0ff, 0x00ffffff,
43  0xffffffff, 0x808080ff, 0x000000ff, 0x00000000
44 };
45 
47  0xff0000ff, 0x00ff00ff, 0x0000ffff, 0xff00ffff,
48  0xc04040ff, 0x40c040ff, 0x4040c0ff, 0xffff00ff,
49  0xa06060ff, 0x60a060ff, 0x6060a0ff, 0x00ffffff,
50  0xffffffff, 0x808080ff, 0x000000ff, 0x00000000
51 };
52 
54  0xff0000ff, 0x00ff00ff, 0x0000ffff, 0xff00ffff,
55  0xc04040ff, 0x40c040ff, 0x4040c0ff, 0xffff00ff,
56  0xa06060ff, 0x60a060ff, 0x6060a0ff, 0x00ffffff,
57  0xffffffff, 0x808080ff, 0x000000ff, 0x00000000
58 };
59 
61  0xff0000ff, 0x00ff00ff, 0x0000ffff, 0xff00ffff,
62  0xc04040ff, 0x40c040ff, 0x4040c0ff, 0xffff00ff,
63  0xa06060ff, 0x60a060ff, 0x6060a0ff, 0x00ffffff,
64  0xffffffff, 0x808080ff, 0x000000ff, 0x00000000
65 };
66 
68  0xA18783ff, 0xA18783ff, 0xA18783ff, 0xA18783ff,
69  0xA18783ff, 0xA18783ff, 0xA18783ff, 0xA18783ff,
70  0xA18783ff, 0xA18783ff, 0xA18783ff, 0xA18783ff,
71  0xA18783ff, 0xA18783ff, 0xA18783ff, 0xA1878300
72 };
73 
74 
75 } // Unnamed namespace.
76 
77 
79 {
80  ImageDetails image( TEST_IMAGE_DIR "/test-image-4x4-32bpp.ico", 4u, 4u );
81 
83 
84  END_TEST;
85 }
86 
87 
89 {
90  ImageDetails image( TEST_IMAGE_DIR "/test-image-4x4-24bpp.ico", 4u, 4u );
91 
93 
94  END_TEST;
95 }
96 
97 
99 {
100  ImageDetails image( TEST_IMAGE_DIR "/test-image-4x4-8bpp.ico", 4u, 4u );
101 
103 
104  END_TEST;
105 }
106 
107 
109 {
110  ImageDetails image( TEST_IMAGE_DIR "/test-image-4x4-4bpp.ico", 4u, 4u );
111 
113 
114  END_TEST;
115 }
116 
117 
119 {
120  ImageDetails image( TEST_IMAGE_DIR "/test-image-4x4-1bpp.ico", 4u, 4u );
121 
123 
124  END_TEST;
125 }
126 
127 
128 
Dali Docs Home
Read more about Dali