1 #ifndef DALI_PIXEL_DATA_DEVEL_H
2 #define DALI_PIXEL_DATA_DEVEL_H
5 * Copyright (c) 2017 Samsung Electronics Co., Ltd.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
22 #include <dali/public-api/images/pixel-data.h>
25 #include <dali/public-api/images/pixel.h>
30 namespace DevelPixelData
34 * Struct to keep the buffer pointer and the allocation method.
36 * @note Need to find a better solution - one library should not
37 * be freeing data from a different source with potentially
38 * different allocators.
40 struct PixelDataBuffer
42 unsigned char* buffer;
43 unsigned int bufferSize;
44 PixelData::ReleaseFunction releaseFunction;
46 PixelDataBuffer( unsigned char* buffer,
47 unsigned int bufferSize,
48 PixelData::ReleaseFunction releaseFunction )
50 bufferSize(bufferSize),
51 releaseFunction(releaseFunction)
57 * Get the buffer from a pixel data object, zero it in the pixel data object
58 * and release the handle.
59 * @param[in,out] pixelData The pixel data object to take the buffer from
60 * @return the buffer and the data release mechanism
62 PixelDataBuffer ReleasePixelDataBuffer( PixelData& pixelData );
64 } // namespace DevelPixelData
68 #endif // DALI_PIXEL_DATA_DEVEL_H