/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
// CLASS HEADER
-#include "pixel-data.h"
-
-// EXTERNAL INLCUDES
-#include <stdlib.h>
+#include <dali/public-api/images/pixel-data.h>
// INTERNAL INCLUDES
#include <dali/internal/event/images/pixel-data-impl.h>
namespace Dali
{
-
-PixelData PixelData::New(unsigned char* buffer,
- unsigned int bufferSize,
- unsigned int width,
- unsigned int height,
- Pixel::Format pixelFormat,
+PixelData PixelData::New(uint8_t* buffer,
+ uint32_t bufferSize,
+ uint32_t width,
+ uint32_t height,
+ Pixel::Format pixelFormat,
ReleaseFunction releaseFunction)
{
- IntrusivePtr<Internal::PixelData> internal = Internal::PixelData::New( buffer, bufferSize, width, height, pixelFormat, releaseFunction );
- return PixelData( internal.Get() );
+ IntrusivePtr<Internal::PixelData> internal = Internal::PixelData::New(buffer, bufferSize, width, height, 0, pixelFormat, releaseFunction);
+ return PixelData(internal.Get());
}
-PixelData::PixelData()
+PixelData PixelData::New(uint8_t* buffer,
+ uint32_t bufferSize,
+ uint32_t width,
+ uint32_t height,
+ uint32_t stride,
+ Pixel::Format pixelFormat,
+ ReleaseFunction releaseFunction)
{
+ IntrusivePtr<Internal::PixelData> internal = Internal::PixelData::New(buffer, bufferSize, width, height, stride, pixelFormat, releaseFunction);
+ return PixelData(internal.Get());
}
-PixelData::~PixelData()
-{
-}
+PixelData::PixelData() = default;
-PixelData::PixelData( Internal::PixelData* internal )
-: BaseHandle( internal )
-{
-}
+PixelData::~PixelData() = default;
-PixelData::PixelData(const PixelData& handle)
-: BaseHandle( handle )
+PixelData::PixelData(Internal::PixelData* internal)
+: BaseHandle(internal)
{
}
-PixelData& PixelData::operator=(const PixelData& rhs)
-{
- BaseHandle::operator=(rhs);
- return *this;
-}
+PixelData::PixelData(const PixelData& handle) = default;
+
+PixelData& PixelData::operator=(const PixelData& rhs) = default;
+
+PixelData::PixelData(PixelData&& rhs) = default;
+
+PixelData& PixelData::operator=(PixelData&& rhs) = default;
-unsigned int PixelData::GetWidth() const
+uint32_t PixelData::GetWidth() const
{
return GetImplementation(*this).GetWidth();
}
-unsigned int PixelData::GetHeight() const
+uint32_t PixelData::GetHeight() const
{
return GetImplementation(*this).GetHeight();
}
return GetImplementation(*this).GetPixelFormat();
}
+uint32_t PixelData::GetStride() const
+{
+ return GetImplementation(*this).GetStride();
+}
+
} // namespace Dali