Merge "use modern construct '= default' for special functions." into devel/master
[platform/core/uifw/dali-core.git] / dali / public-api / images / pixel-data.cpp
index 1432b5d..7086e7d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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, pixelFormat, releaseFunction);
+  return PixelData(internal.Get());
 }
 
-PixelData::PixelData()
-{
-}
+PixelData::PixelData() = default;
 
-PixelData::~PixelData()
-{
-}
+PixelData::~PixelData() = default;
 
-PixelData::PixelData( Internal::PixelData* internal )
-: BaseHandle( internal )
+PixelData::PixelData(Internal::PixelData* internal)
+: BaseHandle(internal)
 {
 }
 
-PixelData::PixelData(const PixelData& handle)
-: BaseHandle( handle )
-{
-}
+PixelData::PixelData(const PixelData& handle) = default;
 
-PixelData& PixelData::operator=(const PixelData& rhs)
-{
-  BaseHandle::operator=(rhs);
-  return *this;
-}
+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();
 }