Removed forward declaration of (removed) FrameBufferTexture
[platform/core/uifw/dali-core.git] / dali / internal / event / images / pixel-manipulation.h
1 #ifndef DALI_EVENT_IMAGES_PIXEL_MANIPULATION_H
2 #define DALI_EVENT_IMAGES_PIXEL_MANIPULATION_H
3
4 /*
5  * Copyright (c) 2017 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19
20 #include <dali/public-api/images/pixel.h>
21
22 namespace Dali
23 {
24
25 namespace Internal
26 {
27
28 namespace Pixel
29 {
30
31 enum Channel
32 {
33   LUMINANCE,
34   RED,
35   GREEN,
36   BLUE,
37   ALPHA,
38   MAX_NUMBER_OF_CHANNELS
39 };
40
41 /**
42  * Return true if the channel exists in the pixel format
43  * @param[in] pixelFormat The pixelFormat
44  * @param[in] channel The channel to test for
45  * @return true if the channel exists
46  */
47 bool HasChannel( Dali::Pixel::Format pixelFormat, Channel channel );
48
49
50 /**
51  * Read a colour channel from the pixel with the given pixel format.
52  * Returns zero if the format does not support the channel
53  * @param[in] pixelData Location of the pixel
54  * @param[in] pixelFormat The format of the pixel
55  * @param[in] channel The channel to read
56  * @return the channel value
57  */
58 unsigned int ReadChannel( unsigned char* pixelData,
59                           Dali::Pixel::Format pixelFormat,
60                           Channel channel );
61
62 /**
63  * Write a colour channel to the pixel with the given pixel format.
64  * @param[in] pixelData Location of the pixel
65  * @param[in] pixelFormat The format of the pixel
66  * @param[in] channel The channel to write
67  * @param[in] channelValue the value to write to the channel
68  */
69 void WriteChannel( unsigned char* pixelData,
70                    Dali::Pixel::Format pixelFormat,
71                    Channel channel,
72                    unsigned int channelValue );
73
74 void ConvertColorChannelsToRGBA8888(
75   unsigned char* srcPixel,  int srcOffset,  Dali::Pixel::Format srcFormat,
76   unsigned char* destPixel, int destOffset );
77
78 } // Pixel
79 } // Internal
80 } // Dali
81
82
83 #endif // DALI_EVENT_IMAGES_PIXEL_MANIPULATION_H