1 #ifndef DALI_ENCODED_IMAGE_BUFFER_H
2 #define DALI_ENCODED_IMAGE_BUFFER_H
4 * Copyright (c) 2021 Samsung Electronics Co., Ltd.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
21 #include <dali/public-api/object/base-handle.h>
22 #include <dali/public-api/common/dali-vector.h>
25 #include <dali/public-api/dali-adaptor-common.h>
29 namespace Internal DALI_INTERNAL
31 class EncodedImageBuffer;
35 * @brief EncodedImageBuffer contains the large encoded raw buffer informations.
37 * We can upload this buffer by generated url.
38 * The images are loaded by a worker thread to avoid blocking the main event thread.
39 * @note cannot change raw buffer after make handle.
40 * @note only regular image upload support now.
42 class DALI_ADAPTOR_API EncodedImageBuffer : public BaseHandle
45 using RawBufferType = Dali::Vector<uint8_t>;
49 * @brief Create a new EncodedImageBuffer.
51 * @param [in] buffer The encoded raw buffer
52 * @return A handle to a new EncodedImageBuffer.
54 static EncodedImageBuffer New(const RawBufferType& buffer);
57 * @brief Create an empty handle.
59 * Calling member functions of an empty handle is not allowed.
66 ~EncodedImageBuffer();
69 * @brief This copy constructor is required for (smart) pointer semantics.
71 * @param [in] handle A reference to the copied handle
73 EncodedImageBuffer(const EncodedImageBuffer& handle);
76 * @brief This assignment operator is required for (smart) pointer semantics.
78 * @param [in] handle A reference to the copied handle
79 * @return A reference to this
81 EncodedImageBuffer& operator=(const EncodedImageBuffer& handle);
84 * @brief Get raw buffer data
85 * @note this method return const value. Mean, you cannot change raw buffer
86 * @return A RawBufferType this buffer have
88 const RawBufferType& GetRawBuffer() const;
90 public: // Not intended for developer use
91 explicit DALI_INTERNAL EncodedImageBuffer(Internal::EncodedImageBuffer* impl);
96 #endif // DALI_ENCODED_IMAGE_BUFFER_H