diff --git a/include/Langulus/Asset.hpp b/include/Langulus/Asset.hpp index 650fc90..0baf4d3 100644 --- a/include/Langulus/Asset.hpp +++ b/include/Langulus/Asset.hpp @@ -51,7 +51,7 @@ namespace Langulus::A void Detach(); - virtual bool Generate(TMeta, Offset = 0) = 0; + virtual bool Generate(TMeta, Offset = 0) { return true; } template void Commit(auto&&) const; diff --git a/include/Langulus/Image.hpp b/include/Langulus/Image.hpp index 32bc4bd..009fb56 100644 --- a/include/Langulus/Image.hpp +++ b/include/Langulus/Image.hpp @@ -9,6 +9,7 @@ #pragma once #include "Asset.hpp" #include +#include LANGULUS_DEFINE_TRAIT(Image, "Image unit"); LANGULUS_EXCEPTION(Image); @@ -38,6 +39,7 @@ namespace Langulus NOD() Size GetBytesize() const noexcept; NOD() uint32_t GetChannelCount() const noexcept; NOD() Hash GetHash() const noexcept; + NOD() Math::Scale3 GetScale() const noexcept; }; } // namespace Langulus @@ -54,11 +56,10 @@ namespace Langulus::A public: LANGULUS_BASES(Asset); - Image() - : Resolvable {this} {} + Image() : Resolvable {this} {} - NOD() virtual Ref GetLOD(const Math::LOD&) const = 0; - NOD() virtual void* GetGPUHandle() const noexcept = 0; + NOD() virtual Ref GetLOD(const Math::LOD&) const { return {}; } + NOD() virtual void* GetGPUHandle() const noexcept { return nullptr; } NOD() DMeta GetFormat() const noexcept; NOD() ImageView const& GetView() const noexcept; diff --git a/include/Langulus/Image.inl b/include/Langulus/Image.inl index 519a442..c957c5d 100644 --- a/include/Langulus/Image.inl +++ b/include/Langulus/Image.inl @@ -70,6 +70,13 @@ namespace Langulus ); } + /// Get the scale of the image, represented by real numbers + /// @return the scale + LANGULUS(INLINED) + Math::Scale3 ImageView::GetScale() const noexcept { + return {mWidth, mHeight, mDepth}; + } + } // namespace Langulus namespace Langulus::A diff --git a/source/Pin.hpp b/source/Pin.hpp index 017504e..e1f3669 100644 --- a/source/Pin.hpp +++ b/source/Pin.hpp @@ -98,6 +98,8 @@ namespace Langulus::Entity /// NOD() bool IsLocked() const noexcept; + operator T const& () const noexcept { return mValue; } + T const& operator * () const noexcept; T const* operator -> () const noexcept; T* operator -> () noexcept;