2 * Copyright (c) 2016 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.
20 #include <dali-test-suite-utils.h>
22 #include "platform-abstractions/tizen/image-loaders/loader-ico.h"
23 #include "image-loaders.h"
30 static const LoadFunctions IcoLoaders( TizenPlatform::LoadIcoHeader, TizenPlatform::LoadBitmapFromIco );
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.
39 uint32_t ImageCheckData_Ico4x4_32bpp_8alpha[] = {
40 0xff0000ff, 0x00ff00ff, 0x0000ffff, 0xff00ffff,
41 0xc04040ff, 0x40c040ff, 0x4040c0ff, 0xffff00ff,
42 0xa06060ff, 0x60a060ff, 0x6060a0ff, 0x00ffffff,
43 0xffffffff, 0x808080ff, 0x000000ff, 0x00000000
46 uint32_t ImageCheckData_Ico4x4_24bpp[] = {
47 0xff0000ff, 0x00ff00ff, 0x0000ffff, 0xff00ffff,
48 0xc04040ff, 0x40c040ff, 0x4040c0ff, 0xffff00ff,
49 0xa06060ff, 0x60a060ff, 0x6060a0ff, 0x00ffffff,
50 0xffffffff, 0x808080ff, 0x000000ff, 0x00000000
53 uint32_t ImageCheckData_Ico4x4_8bpp[] = {
54 0xff0000ff, 0x00ff00ff, 0x0000ffff, 0xff00ffff,
55 0xc04040ff, 0x40c040ff, 0x4040c0ff, 0xffff00ff,
56 0xa06060ff, 0x60a060ff, 0x6060a0ff, 0x00ffffff,
57 0xffffffff, 0x808080ff, 0x000000ff, 0x00000000
60 uint32_t ImageCheckData_Ico4x4_4bpp[] = {
61 0xff0000ff, 0x00ff00ff, 0x0000ffff, 0xff00ffff,
62 0xc04040ff, 0x40c040ff, 0x4040c0ff, 0xffff00ff,
63 0xa06060ff, 0x60a060ff, 0x6060a0ff, 0x00ffffff,
64 0xffffffff, 0x808080ff, 0x000000ff, 0x00000000
67 uint32_t ImageCheckData_Ico4x4_1bpp[] = {
68 0xA18783ff, 0xA18783ff, 0xA18783ff, 0xA18783ff,
69 0xA18783ff, 0xA18783ff, 0xA18783ff, 0xA18783ff,
70 0xA18783ff, 0xA18783ff, 0xA18783ff, 0xA18783ff,
71 0xA18783ff, 0xA18783ff, 0xA18783ff, 0xA1878300
75 } // Unnamed namespace.
78 int UtcDaliIco32bpp8alpha(void)
80 ImageDetails image( TEST_IMAGE_DIR "/test-image-4x4-32bpp.ico", 4u, 4u );
82 CompareLoadedImageData( image, IcoLoaders, ImageCheckData_Ico4x4_32bpp_8alpha );
88 int UtcDaliIco24bpp1alpha(void)
90 ImageDetails image( TEST_IMAGE_DIR "/test-image-4x4-24bpp.ico", 4u, 4u );
92 CompareLoadedImageData( image, IcoLoaders, ImageCheckData_Ico4x4_24bpp );
98 int UtcDaliIco8bpp1alpha(void)
100 ImageDetails image( TEST_IMAGE_DIR "/test-image-4x4-8bpp.ico", 4u, 4u );
102 CompareLoadedImageData( image, IcoLoaders, ImageCheckData_Ico4x4_8bpp );
108 int UtcDaliIco4bpp1alpha(void)
110 ImageDetails image( TEST_IMAGE_DIR "/test-image-4x4-4bpp.ico", 4u, 4u );
112 CompareLoadedImageData( image, IcoLoaders, ImageCheckData_Ico4x4_4bpp );
118 int UtcDaliIco1bpp1alpha(void)
120 ImageDetails image( TEST_IMAGE_DIR "/test-image-4x4-1bpp.ico", 4u, 4u );
122 CompareLoadedImageData( image, IcoLoaders, ImageCheckData_Ico4x4_1bpp );