1 #ifndef DALI_PIXEL_DATA_INTEG_H
2 #define DALI_PIXEL_DATA_INTEG_H
5 * Copyright (c) 2023 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.
25 #include <dali/public-api/images/pixel-data.h>
26 #include <dali/public-api/images/pixel.h>
28 namespace Dali::Integration
31 * Struct to keep the buffer pointer and the allocation method.
33 * @note Need to find a better solution - one library should not
34 * be freeing data from a different source with potentially
35 * different allocators.
37 struct PixelDataBuffer
41 Dali::PixelData::ReleaseFunction releaseFunction;
43 PixelDataBuffer(uint8_t* buffer,
45 Dali::PixelData::ReleaseFunction releaseFunction)
47 bufferSize(bufferSize),
48 releaseFunction(releaseFunction)
54 * Get the buffer from a pixel data object, zero it in the pixel data object
55 * and release the handle.
56 * @param[in,out] pixelData The pixel data object to take the buffer from
57 * @return the buffer and the data release mechanism
59 DALI_CORE_API PixelDataBuffer ReleasePixelDataBuffer(Dali::PixelData& pixelData);
62 * Get the buffer from a pixel data object.
63 * @param[in] pixelData The pixel data object to get the buffer from
64 * @return the buffer of pixelData.
66 DALI_CORE_API PixelDataBuffer GetPixelDataBuffer(const Dali::PixelData& pixelData);
68 } // namespace Dali::Integration
70 #endif // DALI_PIXEL_DATA_INTEG_H