/*
- * 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 <dali/public-api/rendering/texture.h> // Dali::Texture
+#include <dali/public-api/rendering/texture.h> // Dali::Texture
// INTERNAL INCLUDES
-#include <dali/internal/event/rendering/texture-impl.h> // Dali::Internal::Texture
#include <dali/internal/event/images/pixel-data-impl.h> // Dali::Internal::PixelData
-
+#include <dali/internal/event/rendering/texture-impl.h> // Dali::Internal::Texture
namespace Dali
{
-
-Texture Texture::New( TextureType::Type type, Pixel::Format format, unsigned int width, unsigned int height )
+Texture Texture::New(TextureType::Type type, Pixel::Format format, uint32_t width, uint32_t height)
{
- Internal::TexturePtr texture = Internal::Texture::New(type, format, width, height );
- return Texture( texture.Get() );
+ Internal::TexturePtr texture = Internal::Texture::New(type, format, width, height);
+ return Texture(texture.Get());
}
-Texture Texture::New( NativeImageInterface& nativeImageInterface )
+Texture Texture::New(NativeImageInterface& nativeImageInterface)
{
- Internal::TexturePtr texture = Internal::Texture::New( nativeImageInterface );
- return Texture( texture.Get() );
+ Internal::TexturePtr texture = Internal::Texture::New(nativeImageInterface);
+ return Texture(texture.Get());
}
-Texture::Texture()
-{
-}
+Texture::Texture() = default;
-Texture::~Texture()
-{
-}
+Texture::~Texture() = default;
-Texture::Texture( const Texture& handle )
-: BaseHandle( handle )
-{
-}
+Texture::Texture(const Texture& handle) = default;
-Texture Texture::DownCast( BaseHandle handle )
+Texture Texture::DownCast(BaseHandle handle)
{
- return Texture( dynamic_cast<Dali::Internal::Texture*>(handle.GetObjectPtr()));
+ return Texture(dynamic_cast<Dali::Internal::Texture*>(handle.GetObjectPtr()));
}
-Texture& Texture::operator=( const Texture& handle )
-{
- BaseHandle::operator=( handle );
- return *this;
-}
+Texture& Texture::operator=(const Texture& handle) = default;
+
+Texture::Texture(Texture&& rhs) noexcept = default;
-bool Texture::Upload( PixelData pixelData )
+Texture& Texture::operator=(Texture&& rhs) noexcept = default;
+
+bool Texture::Upload(PixelData pixelData)
{
- Internal::PixelData& internalPixelData = GetImplementation( pixelData );
- return GetImplementation(*this).Upload( &internalPixelData );
+ Internal::PixelData& internalPixelData = GetImplementation(pixelData);
+ return GetImplementation(*this).Upload(&internalPixelData);
}
-bool Texture::Upload( PixelData pixelData,
- unsigned int layer, unsigned int mipmap,
- unsigned int xOffset, unsigned int yOffset,
- unsigned int width, unsigned int height )
+bool Texture::Upload(PixelData pixelData,
+ uint32_t layer,
+ uint32_t mipmap,
+ uint32_t xOffset,
+ uint32_t yOffset,
+ uint32_t width,
+ uint32_t height)
{
- Internal::PixelData& internalPixelData = GetImplementation( pixelData );
- return GetImplementation(*this).Upload( &internalPixelData, layer, mipmap, xOffset, yOffset, width, height );
+ Internal::PixelData& internalPixelData = GetImplementation(pixelData);
+ return GetImplementation(*this).Upload(&internalPixelData, layer, mipmap, xOffset, yOffset, width, height);
}
void Texture::GenerateMipmaps()
return GetImplementation(*this).GenerateMipmaps();
}
-unsigned int Texture::GetWidth() const
+uint32_t Texture::GetWidth() const
{
return GetImplementation(*this).GetWidth();
}
-unsigned int Texture::GetHeight() const
+uint32_t Texture::GetHeight() const
{
return GetImplementation(*this).GetHeight();
}
-Texture::Texture( Internal::Texture* pointer )
-: BaseHandle( pointer )
+Pixel::Format Texture::GetPixelFormat() const
+{
+ return GetImplementation(*this).GetPixelFormat();
+}
+
+Texture::Texture(Internal::Texture* pointer)
+: BaseHandle(pointer)
{
}