1 #ifndef DALI_ENCODED_IMAGE_BUFFER_IMPL_H
2 #define DALI_ENCODED_IMAGE_BUFFER_IMPL_H
5 * Copyright (c) 2022 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.
21 #include <dali/public-api/common/dali-vector.h>
22 #include <dali/public-api/common/intrusive-ptr.h>
23 #include <dali/public-api/object/base-object.h>
26 #include <dali/public-api/adaptor-framework/encoded-image-buffer.h>
27 #include <dali/public-api/dali-adaptor-common.h>
33 class EncodedImageBuffer : public BaseObject
36 using RawBufferType = Dali::EncodedImageBuffer::RawBufferType;
40 * @param [in] buffer The raw buffer of image.
42 EncodedImageBuffer(const RawBufferType& buffer);
45 * @copydoc Dali::EncodedImageBuffer::New
47 static IntrusivePtr<EncodedImageBuffer> New(const RawBufferType& buffer);
50 * @copydoc Dali::EncodedImageBuffer::GetRawBuffer
52 const RawBufferType& GetRawBuffer() const;
55 * @copydoc Dali::EncodedImageBuffer::GetHash
57 const std::size_t GetHash() const;
63 ~EncodedImageBuffer();
67 EncodedImageBuffer(const EncodedImageBuffer& imageBuffer);
70 EncodedImageBuffer& operator=(const EncodedImageBuffer& imageBuffer);
73 Dali::Vector<uint8_t> mBuffer;
74 std::size_t mBufferHash;
77 } // namespace Internal
79 inline const Internal::EncodedImageBuffer& GetImplementation(const Dali::EncodedImageBuffer& encodedImageBuffer)
81 DALI_ASSERT_ALWAYS(encodedImageBuffer && "EncodedImageBuffer handle is empty");
83 const BaseObject& handle = encodedImageBuffer.GetBaseObject();
85 return static_cast<const Internal::EncodedImageBuffer&>(handle);
88 inline Internal::EncodedImageBuffer& GetImplementation(Dali::EncodedImageBuffer& encodedImageBuffer)
90 DALI_ASSERT_ALWAYS(encodedImageBuffer && "EncodedImageBuffer handle is empty");
92 BaseObject& handle = encodedImageBuffer.GetBaseObject();
94 return static_cast<Internal::EncodedImageBuffer&>(handle);
99 #endif // DALI_ENCODED_IMAGE_BUFFER_IMPL_H