Make NativeImageSource.GetWidth() GetHeight() as public 00/299100/1
authorEunki Hong <eunkiki.hong@samsung.com>
Tue, 19 Sep 2023 18:46:54 +0000 (03:46 +0900)
committerEunki Hong <eunkiki.hong@samsung.com>
Tue, 19 Sep 2023 18:51:53 +0000 (03:51 +0900)
And also, make minor fix-up that unsigned int --> uint32_t

Change-Id: I3308d664ca7e0d1f0241083aa1b245440c8aa055
Signed-off-by: Eunki Hong <eunkiki.hong@samsung.com>
21 files changed:
dali/internal/imaging/android/native-image-source-impl-android.cpp
dali/internal/imaging/android/native-image-source-impl-android.h
dali/internal/imaging/common/native-bitmap-buffer-impl.cpp
dali/internal/imaging/common/native-bitmap-buffer-impl.h
dali/internal/imaging/common/native-image-source-impl.h
dali/internal/imaging/macos/native-image-source-factory-mac.cpp
dali/internal/imaging/macos/native-image-source-factory-mac.h
dali/internal/imaging/macos/native-image-source-impl-mac.cpp
dali/internal/imaging/macos/native-image-source-impl-mac.h
dali/internal/imaging/tizen/native-image-source-impl-tizen.cpp
dali/internal/imaging/tizen/native-image-source-impl-tizen.h
dali/internal/imaging/tizen/native-image-source-queue-impl-tizen.cpp
dali/internal/imaging/tizen/native-image-source-queue-impl-tizen.h
dali/internal/imaging/ubuntu-x11/native-image-source-impl-x.cpp
dali/internal/imaging/ubuntu-x11/native-image-source-impl-x.h
dali/internal/imaging/windows/native-image-source-factory-win.cpp
dali/internal/imaging/windows/native-image-source-factory-win.h
dali/internal/imaging/windows/native-image-source-impl-win.cpp
dali/internal/imaging/windows/native-image-source-impl-win.h
dali/public-api/adaptor-framework/native-image-source.cpp
dali/public-api/adaptor-framework/native-image-source.h

index 1b25af1..96a9f4f 100644 (file)
@@ -132,9 +132,9 @@ Any NativeImageSourceAndroid::GetNativeImageSource() const
   return Any(mPixmap);
 }
 
-bool NativeImageSourceAndroid::GetPixels(std::vector<unsigned char>& pixbuf, unsigned& width, unsigned& height, Pixel::Format& pixelFormat) const
+bool NativeImageSourceAndroid::GetPixels(std::vector<uint8_t>& pixbuf, uint32_t& width, uint32_t& height, Pixel::Format& pixelFormat) const
 {
-  DALI_ASSERT_DEBUG(sizeof(unsigned) == 4);
+  DALI_ASSERT_DEBUG(sizeof(uint32_t) == 4);
   bool success = false;
 
   width  = mWidth;
@@ -182,8 +182,8 @@ bool NativeImageSourceAndroid::GetPixels(std::vector<unsigned char>& pixbuf, uns
     uint32_t size      = dstStride * bufferDescription.height;
     pixbuf.resize(size);
     //copy each row over
-    const unsigned char* ptrSrc = reinterpret_cast<const unsigned char*>(buffer);
-    unsigned char*       ptrDst = pixbuf.data();
+    const uint8_t* ptrSrc = reinterpret_cast<const uint8_t*>(buffer);
+    uint8_t*       ptrDst = pixbuf.data();
     for(int y = 0; y < bufferDescription.height; y++, ptrSrc += srcStride, ptrDst += dstStride)
     {
       memcpy(ptrDst, ptrSrc, dstStride);
index d735456..3da39a8 100644 (file)
@@ -64,7 +64,7 @@ public:
   /**
    * @copydoc Dali::NativeImageSource::GetPixels()
    */
-  bool GetPixels(std::vector<unsigned char>& pixbuf, uint32_t& width, uint32_t& height, Pixel::Format& pixelFormat) const override;
+  bool GetPixels(std::vector<uint8_t>& pixbuf, uint32_t& width, uint32_t& height, Pixel::Format& pixelFormat) const override;
 
   /**
    * @copydoc Dali::NativeImageSource::SetSource( Any source )
index cc7051b..3e7d7c0 100644 (file)
@@ -32,7 +32,7 @@ namespace Internal
 {
 namespace Adaptor
 {
-NativeBitmapBuffer::NativeBitmapBuffer(Adaptor* adaptor, unsigned int width, unsigned int height, Pixel::Format pFormat)
+NativeBitmapBuffer::NativeBitmapBuffer(Adaptor* adaptor, uint32_t width, uint32_t height, Pixel::Format pFormat)
 : mGlAbstraction(nullptr),
   mWidth(width),
   mHeight(height),
@@ -60,7 +60,7 @@ void NativeBitmapBuffer::PrepareTexture()
 
   Integration::ConvertToGlFormat(mPixelFormat, pixelDataType, pixelFormat);
 
-  const unsigned char* buf = mBuffer->Read();
+  const uint8_t* buf = mBuffer->Read();
 
   if(buf && buf != mLastReadBuffer) // Prevent same buffer being uploaded multiple times
   {
@@ -71,7 +71,7 @@ void NativeBitmapBuffer::PrepareTexture()
   }
 }
 
-void NativeBitmapBuffer::Write(const unsigned char* src, size_t size)
+void NativeBitmapBuffer::Write(const uint8_t* src, size_t size)
 {
   mBuffer->Write(src, size); // Write will cause LocklessBuffer to switch to the other buffer
 }
@@ -85,17 +85,17 @@ void NativeBitmapBuffer::DestroyResource()
 {
 }
 
-unsigned int NativeBitmapBuffer::TargetTexture()
+uint32_t NativeBitmapBuffer::TargetTexture()
 {
   return 0;
 }
 
-unsigned int NativeBitmapBuffer::GetWidth() const
+uint32_t NativeBitmapBuffer::GetWidth() const
 {
   return mWidth;
 }
 
-unsigned int NativeBitmapBuffer::GetHeight() const
+uint32_t NativeBitmapBuffer::GetHeight() const
 {
   return mHeight;
 }
index 64122cc..aa8f632 100644 (file)
@@ -51,7 +51,7 @@ public:
    * @param height height of image
    * @param pixelFormat pixel format for image
    */
-  NativeBitmapBuffer(Adaptor* adaptor, unsigned int width, unsigned int height, Pixel::Format pixelFormat);
+  NativeBitmapBuffer(Adaptor* adaptor, uint32_t width, uint32_t height, Pixel::Format pixelFormat);
 
   /**
    * virtual destructor
@@ -64,7 +64,7 @@ public:
    * @param[in] size size of data in bytes
    * @return true if successful, false if currently reading from buffer in render thread
    */
-  void Write(const unsigned char* src, size_t size);
+  void Write(const uint8_t* src, size_t size);
 
 public:
   /**
@@ -80,7 +80,7 @@ public:
   /**
    * @copydoc Dali::NativeImageInterface::TargetTexture()
    */
-  unsigned int TargetTexture() override;
+  uint32_t TargetTexture() override;
 
   /**
    * @copydoc Dali::NativeImageInterface::PrepareTexture()
@@ -90,12 +90,12 @@ public:
   /**
    * @copydoc Dali::NativeImageInterface::GetWidth()
    */
-  unsigned int GetWidth() const override;
+  uint32_t GetWidth() const override;
 
   /**
    * @copydoc Dali::NativeImageInterface::GetHeight()
    */
-  unsigned int GetHeight() const override;
+  uint32_t GetHeight() const override;
 
   /**
    * @copydoc Dali::NativeImageInterface::RequiresBlending()
@@ -144,10 +144,10 @@ private:
   Integration::GlAbstraction* mGlAbstraction; ///< GlAbstraction used
 
   Integration::LocklessBuffer* mBuffer;         ///< bitmap data double buffered
-  unsigned int                 mWidth;          ///< Image width
-  unsigned int                 mHeight;         ///< Image height
+  uint32_t                     mWidth;          ///< Image width
+  uint32_t                     mHeight;         ///< Image height
   Pixel::Format                mPixelFormat;    ///< Image pixelformat
-  const unsigned char*         mLastReadBuffer; ///< last buffer that was read
+  const uint8_t*               mLastReadBuffer; ///< last buffer that was read
 };
 
 } // namespace Adaptor
index d990c62..6b90eb8 100644 (file)
@@ -58,7 +58,7 @@ public:
   /**
    * @copydoc Dali::NativeImageSource::GetPixels()
    */
-  virtual bool GetPixels(std::vector<unsigned char>& pixbuf, uint32_t& width, uint32_t& height, Pixel::Format& pixelFormat) const = 0;
+  virtual bool GetPixels(std::vector<uint8_t>& pixbuf, uint32_t& width, uint32_t& height, Pixel::Format& pixelFormat) const = 0;
 
   /**
    * @copydoc Dali::NativeImageSource::SetSource( Any source )
index 04182e9..6584e98 100644 (file)
@@ -26,8 +26,8 @@ namespace Dali::Internal::Adaptor
 {
 std::unique_ptr<NativeImageSource>
 NativeImageSourceFactoryCocoa::CreateNativeImageSource(
-  unsigned int                        width,
-  unsigned int                        height,
+  uint32_t                            width,
+  uint32_t                            height,
   Dali::NativeImageSource::ColorDepth depth,
   Any                                 nativeImageSource)
 {
@@ -40,8 +40,8 @@ NativeImageSourceFactoryCocoa::CreateNativeImageSource(
 
 std::unique_ptr<NativeImageSourceQueue>
 NativeImageSourceFactoryCocoa::CreateNativeImageSourceQueue(
-  unsigned int                              width,
-  unsigned int                              height,
+  uint32_t                                  width,
+  uint32_t                                  height,
   Dali::NativeImageSourceQueue::ColorFormat colorFormat,
   Any                                       nativeImageSourceQueue)
 {
index afb0d89..d78de43 100644 (file)
@@ -26,14 +26,14 @@ class NativeImageSourceFactoryCocoa : public NativeImageSourceFactory
 {
 public:
   std::unique_ptr<NativeImageSource> CreateNativeImageSource(
-    unsigned int                        width,
-    unsigned int                        height,
+    uint32_t                            width,
+    uint32_t                            height,
     Dali::NativeImageSource::ColorDepth depth,
     Any                                 nativeImageSource) override;
 
   std::unique_ptr<NativeImageSourceQueue> CreateNativeImageSourceQueue(
-    unsigned int                              width,
-    unsigned int                              height,
+    uint32_t                                  width,
+    uint32_t                                  height,
     Dali::NativeImageSourceQueue::ColorFormat colorFormat,
     Any                                       nativeImageSourceQueue) override;
 };
index f6ad654..21a9931 100644 (file)
@@ -32,8 +32,8 @@ namespace Dali::Internal::Adaptor
 using Dali::Integration::PixelBuffer;
 
 NativeImageSourceCocoa* NativeImageSourceCocoa::New(
-  unsigned int                        width,
-  unsigned int                        height,
+  uint32_t                            width,
+  uint32_t                            height,
   Dali::NativeImageSource::ColorDepth depth,
   Any                                 nativeImageSource)
 {
@@ -41,8 +41,8 @@ NativeImageSourceCocoa* NativeImageSourceCocoa::New(
 }
 
 NativeImageSourceCocoa::NativeImageSourceCocoa(
-  unsigned int                        width,
-  unsigned int                        height,
+  uint32_t                            width,
+  uint32_t                            height,
   Dali::NativeImageSource::ColorDepth depth,
   Any                                 nativeImageSource)
 : mImage(MakeRef<CGImageRef>(nullptr)),
@@ -119,12 +119,12 @@ Any NativeImageSourceCocoa::GetNativeImageSource() const
 
 bool NativeImageSourceCocoa::GetPixels(
   std::vector<uint8_t>& pixbuf,
-  unsigned&             width,
-  unsigned&             height,
+  uint32_t&             width,
+  uint32_t&             height,
   Pixel::Format&        pixelFormat) const
 {
-  width  = CGImageGetWidth(mImage.get());
-  height = CGImageGetHeight(mImage.get());
+  width  = static_cast<uint32_t>(CGImageGetWidth(mImage.get()));
+  height = static_cast<uint32_t>(CGImageGetHeight(mImage.get()));
   return true;
 }
 
@@ -146,7 +146,7 @@ void NativeImageSourceCocoa::DestroyResource()
 {
 }
 
-unsigned int NativeImageSourceCocoa::TargetTexture()
+uint32_t NativeImageSourceCocoa::TargetTexture()
 {
   return 0;
 }
@@ -175,14 +175,14 @@ Any NativeImageSourceCocoa::GetNativeImageHandle() const
   return Any(mImage.get());
 }
 
-unsigned int NativeImageSourceCocoa::GetWidth() const
+uint32_t NativeImageSourceCocoa::GetWidth() const
 {
-  return CGImageGetWidth(mImage.get());
+  return static_cast<uint32_t>(CGImageGetWidth(mImage.get()));
 }
 
-unsigned int NativeImageSourceCocoa::GetHeight() const
+uint32_t NativeImageSourceCocoa::GetHeight() const
 {
-  return CGImageGetHeight(mImage.get());
+  return static_cast<uint32_t>(CGImageGetHeight(mImage.get()));
 }
 
 bool NativeImageSourceCocoa::RequiresBlending() const
index 100fa74..864e3f9 100644 (file)
@@ -44,8 +44,8 @@ public:
    * @return A smart-pointer to a newly allocated image.
    */
   static NativeImageSourceCocoa* New(
-    unsigned int                        width,
-    unsigned int                        height,
+    uint32_t                            width,
+    uint32_t                            height,
     Dali::NativeImageSource::ColorDepth depth,
     Any                                 nativeImageSource);
 
@@ -58,10 +58,10 @@ public:
    * @copydoc Dali::NativeImageSource::GetPixels()
    */
   bool GetPixels(
-    std::vector<unsigned char>& pixbuf,
-    unsigned int&               width,
-    unsigned int&               height,
-    Pixel::Format&              pixelFormat) const override;
+    std::vector<uint8_t>& pixbuf,
+    uint32_t&             width,
+    uint32_t&             height,
+    Pixel::Format&        pixelFormat) const override;
 
   /**
    * @copydoc Dali::NativeImageSource::SetSource( Any source )
@@ -91,7 +91,7 @@ public:
   /**
    * @copydoc Dali::NativeImageSource::TargetTexture()
    */
-  unsigned int TargetTexture() override;
+  uint32_t TargetTexture() override;
 
   /**
    * @copydoc Dali::NativeImageSource::PrepareTexture()
@@ -101,12 +101,12 @@ public:
   /**
    * @copydoc Dali::NativeImageSource::GetWidth()
    */
-  unsigned int GetWidth() const override;
+  uint32_t GetWidth() const override;
 
   /**
    * @copydoc Dali::NativeImageSource::GetHeight()
    */
-  unsigned int GetHeight() const override;
+  uint32_t GetHeight() const override;
 
   /**
    * @copydoc Dali::NativeImageSource::RequiresBlending()
@@ -183,8 +183,8 @@ private:
    * @param[in] nativeImageSource contains either: pixmap of type Win32 Pixmap , a WinPixmap or is empty
    */
   NativeImageSourceCocoa(
-    unsigned int                        width,
-    unsigned int                        height,
+    uint32_t                            width,
+    uint32_t                            height,
     Dali::NativeImageSource::ColorDepth depth,
     Any                                 nativeImageSource);
 
index e5936b3..93d2861 100644 (file)
@@ -220,7 +220,7 @@ Any NativeImageSourceTizen::GetNativeImageSource() const
   return Any(mTbmSurface);
 }
 
-bool NativeImageSourceTizen::GetPixels(std::vector<unsigned char>& pixbuf, unsigned& width, unsigned& height, Pixel::Format& pixelFormat) const
+bool NativeImageSourceTizen::GetPixels(std::vector<uint8_t>& pixbuf, uint32_t& width, uint32_t& height, Pixel::Format& pixelFormat) const
 {
   std::scoped_lock lock(mMutex);
   if(mTbmSurface != NULL)
@@ -237,9 +237,9 @@ bool NativeImageSourceTizen::GetPixels(std::vector<unsigned char>& pixbuf, unsig
       return false;
     }
 
-    tbm_format     format = surface_info.format;
-    uint32_t       stride = surface_info.planes[0].stride;
-    unsigned char* ptr    = surface_info.planes[0].ptr;
+    tbm_format format = surface_info.format;
+    uint32_t   stride = surface_info.planes[0].stride;
+    uint8_t*   ptr    = surface_info.planes[0].ptr;
 
     width  = mWidth;
     height = mHeight;
@@ -254,11 +254,11 @@ bool NativeImageSourceTizen::GetPixels(std::vector<unsigned char>& pixbuf, unsig
         lineSize    = width * 3;
         pixelFormat = Pixel::RGB888;
         pixbuf.resize(lineSize * height);
-        unsigned char* bufptr = &pixbuf[0];
+        uint8_t* bufptr = &pixbuf[0];
 
-        for(unsigned int r = 0; r < height; ++r, bufptr += lineSize)
+        for(uint32_t r = 0; r < height; ++r, bufptr += lineSize)
         {
-          for(unsigned int c = 0; c < width; ++c)
+          for(uint32_t c = 0; c < width; ++c)
           {
             cOffset                 = c * 3;
             offset                  = cOffset + r * stride;
@@ -274,11 +274,11 @@ bool NativeImageSourceTizen::GetPixels(std::vector<unsigned char>& pixbuf, unsig
         lineSize    = width * 4;
         pixelFormat = Pixel::RGBA8888;
         pixbuf.resize(lineSize * height);
-        unsigned char* bufptr = &pixbuf[0];
+        uint8_t* bufptr = &pixbuf[0];
 
-        for(unsigned int r = 0; r < height; ++r, bufptr += lineSize)
+        for(uint32_t r = 0; r < height; ++r, bufptr += lineSize)
         {
-          for(unsigned int c = 0; c < width; ++c)
+          for(uint32_t c = 0; c < width; ++c)
           {
             cOffset                 = c * 4;
             offset                  = cOffset + r * stride;
@@ -295,11 +295,11 @@ bool NativeImageSourceTizen::GetPixels(std::vector<unsigned char>& pixbuf, unsig
         lineSize    = width * 4;
         pixelFormat = Pixel::RGBA8888;
         pixbuf.resize(lineSize * height);
-        unsigned char* bufptr = &pixbuf[0];
+        uint8_t* bufptr = &pixbuf[0];
 
-        for(unsigned int r = 0; r < height; ++r, bufptr += lineSize)
+        for(uint32_t r = 0; r < height; ++r, bufptr += lineSize)
         {
-          for(unsigned int c = 0; c < width; ++c)
+          for(uint32_t c = 0; c < width; ++c)
           {
             cOffset                 = c * 4;
             offset                  = cOffset + r * stride;
@@ -397,7 +397,7 @@ bool NativeImageSourceTizen::IsColorDepthSupported(Dali::NativeImageSource::Colo
 
   if(tbm_surface_query_formats(&formats, &formatNum))
   {
-    for(unsigned int i = 0; i < formatNum; i++)
+    for(uint32_t i = 0; i < formatNum; i++)
     {
       if(formats[i] == format)
       {
@@ -534,8 +534,8 @@ Rect<uint32_t> NativeImageSourceTizen::GetUpdatedArea()
       return updatedArea;
     }
 
-    unsigned char* srcBuffer = info.planes[0].ptr;
-    unsigned char* dstBuffer = backBufferInfo.planes[0].ptr;
+    uint8_t* srcBuffer = info.planes[0].ptr;
+    uint8_t* dstBuffer = backBufferInfo.planes[0].ptr;
 
     uint32_t stride        = info.planes[0].stride;
     uint32_t bytesPerPixel = info.bpp >> 3;
index e2d1881..70f0340 100644 (file)
@@ -65,7 +65,7 @@ public:
   /**
    * @copydoc Dali::NativeImageSource::GetPixels()
    */
-  bool GetPixels(std::vector<unsigned char>& pixbuf, uint32_t& width, uint32_t& height, Pixel::Format& pixelFormat) const override;
+  bool GetPixels(std::vector<uint8_t>& pixbuf, uint32_t& width, uint32_t& height, Pixel::Format& pixelFormat) const override;
 
   /**
    * @copydoc Dali::NativeImageSource::SetSource( Any source )
index 144b826..3cf8ff8 100644 (file)
@@ -266,7 +266,7 @@ uint8_t* NativeImageSourceQueueTizen::DequeueBuffer(uint32_t& width, uint32_t& h
     return NULL;
   }
 
-  unsigned char* buffer = info.planes[0].ptr;
+  uint8_t* buffer = info.planes[0].ptr;
   if(!buffer)
   {
     DALI_LOG_ERROR("tbm buffer pointer is null! [%p]\n", tbmSurface);
index 16dcf9f..cbd5aa7 100644 (file)
@@ -197,8 +197,8 @@ private:
   bool CheckBlending(int format);
 
 private:
-  typedef std::pair<tbm_surface_h, void*> EglImagePair;
-  typedef std::pair<tbm_surface_h, void*> BufferPair;
+  typedef std::pair<tbm_surface_h, void*>    EglImagePair;
+  typedef std::pair<tbm_surface_h, uint8_t*> BufferPair;
 
   Dali::Mutex               mMutex;              ///< Mutex
   uint32_t                  mWidth;              ///< image width
index 49aeef5..7c86a3e 100644 (file)
@@ -147,9 +147,9 @@ Any NativeImageSourceX::GetNativeImageSource() const
   return Any(mPixmap);
 }
 
-bool NativeImageSourceX::GetPixels(std::vector<unsigned char>& pixbuf, unsigned& width, unsigned& height, Pixel::Format& pixelFormat) const
+bool NativeImageSourceX::GetPixels(std::vector<uint8_t>& pixbuf, uint32_t& width, uint32_t& height, Pixel::Format& pixelFormat) const
 {
-  DALI_ASSERT_DEBUG(sizeof(unsigned) == 4);
+  DALI_ASSERT_DEBUG(sizeof(uint32_t) == 4);
   bool success = false;
   width        = mWidth;
   height       = mHeight;
@@ -184,18 +184,18 @@ bool NativeImageSourceX::GetPixels(std::vector<unsigned char>& pixbuf, unsigned&
       {
         pixelFormat = Pixel::RGB888;
         pixbuf.resize(width * height * 3);
-        unsigned char* bufPtr = &pixbuf[0];
+        uint8_t* bufPtr = &pixbuf[0];
 
-        for(unsigned y = 0; y < height; ++y)
+        for(uint32_t y = 0; y < height; ++y)
         {
-          for(unsigned x = 0; x < width; ++x, bufPtr += 3)
+          for(uint32_t x = 0; x < width; ++x, bufPtr += 3)
           {
-            const unsigned pixel = XGetPixel(pXImage, x, y);
+            const uint32_t pixel = XGetPixel(pXImage, x, y);
 
             // store as RGB
-            const unsigned blue  = pixel & 0xFFU;
-            const unsigned green = (pixel >> 8) & 0xFFU;
-            const unsigned red   = (pixel >> 16) & 0xFFU;
+            const uint32_t blue  = pixel & 0xFFU;
+            const uint32_t green = (pixel >> 8) & 0xFFU;
+            const uint32_t red   = (pixel >> 16) & 0xFFU;
 
             *bufPtr       = red;
             *(bufPtr + 1) = green;
@@ -212,12 +212,12 @@ bool NativeImageSourceX::GetPixels(std::vector<unsigned char>& pixbuf, unsigned&
           // Sweep through the image, doing a vertical flip, but handling each scanline as
           // an inlined intrinsic/builtin memcpy (should be fast):
           pixbuf.resize(width * height * 4);
-          unsigned*      bufPtr        = reinterpret_cast<unsigned*>(&pixbuf[0]);
-          const unsigned xDataLineSkip = pXImage->bytes_per_line;
+          uint32_t*      bufPtr        = reinterpret_cast<uint32_t*>(&pixbuf[0]);
+          const uint32_t xDataLineSkip = pXImage->bytes_per_line;
           const size_t   copy_count    = static_cast<size_t>(width) * 4;
           pixelFormat                  = Pixel::BGRA8888;
 
-          for(unsigned y = 0; y < height; ++y, bufPtr += width)
+          for(uint32_t y = 0; y < height; ++y, bufPtr += width)
           {
             const char* const in = pXImage->data + xDataLineSkip * y;
 
index 6890f0e..6745c64 100644 (file)
@@ -62,7 +62,7 @@ public:
   /**
    * @copydoc Dali::NativeImageSource::GetPixels()
    */
-  bool GetPixels(std::vector<unsigned char>& pixbuf, uint32_t& width, uint32_t& height, Pixel::Format& pixelFormat) const override;
+  bool GetPixels(std::vector<uint8_t>& pixbuf, uint32_t& width, uint32_t& height, Pixel::Format& pixelFormat) const override;
 
   /**
    * @copydoc Dali::NativeImageSource::SetSource( Any source )
index 75746d1..9cd362d 100644 (file)
@@ -28,12 +28,12 @@ namespace Internal
 {
 namespace Adaptor
 {
-std::unique_ptr<NativeImageSource> NativeImageSourceFactoryWin::CreateNativeImageSource(unsigned int width, unsigned int height, Dali::NativeImageSource::ColorDepth depth, Any nativeImageSource)
+std::unique_ptr<NativeImageSource> NativeImageSourceFactoryWin::CreateNativeImageSource(uint32_t width, uint32_t height, Dali::NativeImageSource::ColorDepth depth, Any nativeImageSource)
 {
   return std::unique_ptr<NativeImageSource>(NativeImageSourceWin::New(width, height, depth, nativeImageSource));
 }
 
-std::unique_ptr<NativeImageSourceQueue> NativeImageSourceFactoryWin::CreateNativeImageSourceQueue(unsigned int width, unsigned int height, Dali::NativeImageSourceQueue::ColorFormat colorFormat, Any nativeImageSourceQueue)
+std::unique_ptr<NativeImageSourceQueue> NativeImageSourceFactoryWin::CreateNativeImageSourceQueue(uint32_t width, uint32_t height, Dali::NativeImageSourceQueue::ColorFormat colorFormat, Any nativeImageSourceQueue)
 {
   return std::unique_ptr<NativeImageSourceQueue>(nullptr);
 }
index 05c882f..acae63b 100644 (file)
@@ -30,9 +30,9 @@ namespace Adaptor
 class NativeImageSourceFactoryWin : public NativeImageSourceFactory
 {
 public:
-  std::unique_ptr<NativeImageSource> CreateNativeImageSource(unsigned int width, unsigned int height, Dali::NativeImageSource::ColorDepth depth, Any nativeImageSource) override;
+  std::unique_ptr<NativeImageSource> CreateNativeImageSource(uint32_t width, uint32_t height, Dali::NativeImageSource::ColorDepth depth, Any nativeImageSource) override;
 
-  std::unique_ptr<NativeImageSourceQueue> CreateNativeImageSourceQueue(unsigned int width, unsigned int height, Dali::NativeImageSourceQueue::ColorFormat colorFormat, Any nativeImageSourceQueue) override;
+  std::unique_ptr<NativeImageSourceQueue> CreateNativeImageSourceQueue(uint32_t width, uint32_t height, Dali::NativeImageSourceQueue::ColorFormat colorFormat, Any nativeImageSourceQueue) override;
 };
 
 } // namespace Adaptor
index 181204e..11a8a87 100644 (file)
@@ -36,7 +36,7 @@ namespace Adaptor
 {
 using Dali::Integration::PixelBuffer;
 
-NativeImageSourceWin* NativeImageSourceWin::New(unsigned int width, unsigned int height, Dali::NativeImageSource::ColorDepth depth, Any nativeImageSource)
+NativeImageSourceWin* NativeImageSourceWin::New(uint32_t width, uint32_t height, Dali::NativeImageSource::ColorDepth depth, Any nativeImageSource)
 {
   NativeImageSourceWin* image = new NativeImageSourceWin(width, height, depth, nativeImageSource);
   DALI_ASSERT_DEBUG(image && "NativeImageSource allocation failed.");
@@ -50,7 +50,7 @@ NativeImageSourceWin* NativeImageSourceWin::New(unsigned int width, unsigned int
   return image;
 }
 
-NativeImageSourceWin::NativeImageSourceWin(unsigned int width, unsigned int height, Dali::NativeImageSource::ColorDepth depth, Any nativeImageSource)
+NativeImageSourceWin::NativeImageSourceWin(uint32_t width, uint32_t height, Dali::NativeImageSource::ColorDepth depth, Any nativeImageSource)
 : mWidth(width),
   mHeight(height),
   mOwnPixmap(true),
@@ -104,9 +104,9 @@ Any NativeImageSourceWin::GetNativeImageSource() const
   return Any(mPixmap);
 }
 
-bool NativeImageSourceWin::GetPixels(std::vector<uint8_t>& pixbuf, unsigned& width, unsigned& height, Pixel::Format& pixelFormat) const
+bool NativeImageSourceWin::GetPixels(std::vector<uint8_t>& pixbuf, uint32_t& width, uint32_t& height, Pixel::Format& pixelFormat) const
 {
-  DALI_ASSERT_DEBUG(sizeof(unsigned) == 4);
+  DALI_ASSERT_DEBUG(sizeof(uint32_t) == 4);
   bool success = false;
   width        = mWidth;
   height       = mHeight;
@@ -165,7 +165,7 @@ void NativeImageSourceWin::DestroyResource()
   }
 }
 
-unsigned int NativeImageSourceWin::TargetTexture()
+uint32_t NativeImageSourceWin::TargetTexture()
 {
   mEglImageExtensions->TargetTextureKHR(mEglImageKHR);
 
index d590782..88059d6 100644 (file)
@@ -22,6 +22,7 @@
 #include <dali/public-api/adaptor-framework/native-image-source.h>
 
 #include <dali/internal/imaging/common/native-image-source-impl.h>
+#include <cstdint>
 
 namespace Dali
 {
@@ -47,8 +48,8 @@ public:
    * @param[in] nativeImageSource contains either: pixmap of type Win32 Pixmap , a WinPixmap or is empty
    * @return A smart-pointer to a newly allocated image.
    */
-  static NativeImageSourceWin* New(unsigned int                        width,
-                                   unsigned int                        height,
+  static NativeImageSourceWin* New(uint32_t                            width,
+                                   uint32_t                            height,
                                    Dali::NativeImageSource::ColorDepth depth,
                                    Any                                 nativeImageSource);
   /**
@@ -59,7 +60,7 @@ public:
   /**
    * @copydoc Dali::NativeImageSource::GetPixels()
    */
-  bool GetPixels(std::vector<unsigned char>& pixbuf, unsigned int& width, unsigned int& height, Pixel::Format& pixelFormat) const override;
+  bool GetPixels(std::vector<uint8_t>& pixbuf, uint32_t& width, uint32_t& height, Pixel::Format& pixelFormat) const override;
 
   /**
    * @copydoc Dali::NativeImageSource::SetSource( Any source )
@@ -89,7 +90,7 @@ public:
   /**
    * @copydoc Dali::NativeImageSource::TargetTexture()
    */
-  unsigned int TargetTexture() override;
+  uint32_t TargetTexture() override;
 
   /**
    * @copydoc Dali::NativeImageSource::PrepareTexture()
@@ -99,7 +100,7 @@ public:
   /**
    * @copydoc Dali::NativeImageSource::GetWidth()
    */
-  unsigned int GetWidth() const override
+  uint32_t GetWidth() const override
   {
     return mWidth;
   }
@@ -107,7 +108,7 @@ public:
   /**
    * @copydoc Dali::NativeImageSource::GetHeight()
    */
-  unsigned int GetHeight() const override
+  uint32_t GetHeight() const override
   {
     return mHeight;
   }
@@ -189,8 +190,8 @@ private:
    * @param[in] colour depth of the image.
    * @param[in] nativeImageSource contains either: pixmap of type Win32 Pixmap , a WinPixmap or is empty
    */
-  NativeImageSourceWin(unsigned int                        width,
-                       unsigned int                        height,
+  NativeImageSourceWin(uint32_t                            width,
+                       uint32_t                            height,
                        Dali::NativeImageSource::ColorDepth depth,
                        Any                                 nativeImageSource);
 
@@ -220,8 +221,8 @@ private:
   void GetPixmapDetails();
 
 private:
-  unsigned int                         mWidth;                       ///< image width
-  unsigned int                         mHeight;                      ///< image heights
+  uint32_t                             mWidth;                       ///< image width
+  uint32_t                             mHeight;                      ///< image heights
   bool                                 mOwnPixmap;                   ///< Whether we created pixmap or not
   unsigned int                         mPixmap;                      ///< From Windows
   bool                                 mBlendingRequired;            ///< Whether blending is required
index 1eae664..d86a705 100644 (file)
@@ -27,7 +27,7 @@
 
 namespace Dali
 {
-NativeImageSourcePtr NativeImageSource::New(unsigned int width, unsigned int height, ColorDepth depth)
+NativeImageSourcePtr NativeImageSource::New(uint32_t width, uint32_t height, ColorDepth depth)
 {
   Any                  empty;
   NativeImageSourcePtr image = new NativeImageSource(width, height, depth, empty);
@@ -45,7 +45,7 @@ NativeImageSourcePtr NativeImageSource::New(Any nativeImageSource)
   return image;
 }
 
-bool NativeImageSource::GetPixels(std::vector<unsigned char>& pixbuf, unsigned int& width, unsigned int& height, Pixel::Format& pixelFormat) const
+bool NativeImageSource::GetPixels(std::vector<uint8_t>& pixbuf, uint32_t& width, uint32_t& height, Pixel::Format& pixelFormat) const
 {
   return mImpl->GetPixels(pixbuf, width, height, pixelFormat);
 }
@@ -75,7 +75,7 @@ void NativeImageSource::DestroyResource()
   mImpl->DestroyResource();
 }
 
-unsigned int NativeImageSource::TargetTexture()
+uint32_t NativeImageSource::TargetTexture()
 {
   return mImpl->TargetTexture();
 }
@@ -85,12 +85,12 @@ void NativeImageSource::PrepareTexture()
   mImpl->PrepareTexture();
 }
 
-unsigned int NativeImageSource::GetWidth() const
+uint32_t NativeImageSource::GetWidth() const
 {
   return mImpl->GetWidth();
 }
 
-unsigned int NativeImageSource::GetHeight() const
+uint32_t NativeImageSource::GetHeight() const
 {
   return mImpl->GetHeight();
 }
@@ -135,7 +135,7 @@ NativeImageInterface::Extension* NativeImageSource::GetExtension()
   return mImpl->GetNativeImageInterfaceExtension();
 }
 
-NativeImageSource::NativeImageSource(unsigned int width, unsigned int height, ColorDepth depth, Any nativeImageSource)
+NativeImageSource::NativeImageSource(uint32_t width, uint32_t height, ColorDepth depth, Any nativeImageSource)
 {
   auto factory = Dali::Internal::Adaptor::GetNativeImageSourceFactory();
   mImpl        = factory->CreateNativeImageSource(width, height, depth, nativeImageSource).release();
index 2e4c752..8959242 100644 (file)
@@ -88,7 +88,7 @@ public:
    * @param[in] depth color depth of the image
    * @return A smart-pointer to a newly allocated image
    */
-  static NativeImageSourcePtr New(unsigned int width, unsigned int height, ColorDepth depth);
+  static NativeImageSourcePtr New(uint32_t width, uint32_t height, ColorDepth depth);
 
   /**
    * @brief Creates a new NativeImageSource from an existing native image source.
@@ -120,7 +120,7 @@ public:
    * @param[out] pixelFormat pixel format used by image
    * @return     @c true if the pixels were gotten, and @c false otherwise
    */
-  bool GetPixels(std::vector<unsigned char>& pixbuf, unsigned int& width, unsigned int& height, Pixel::Format& pixelFormat) const;
+  bool GetPixels(std::vector<uint8_t>& pixbuf, uint32_t& width, uint32_t& height, Pixel::Format& pixelFormat) const;
 
   /**
    * @brief Converts the current pixel contents to either a JPEG or PNG format
@@ -151,6 +151,17 @@ public:
    */
   bool IsColorDepthSupported(ColorDepth colorDepth);
 
+public: // native image
+  /**
+   * @copydoc Dali::NativeImageInterface::GetWidth()
+   */
+  uint32_t GetWidth() const override;
+
+  /**
+   * @copydoc Dali::NativeImageInterface::GetHeight()
+   */
+  uint32_t GetHeight() const override;
+
   /**
    * @copydoc Dali::NativeImageInterface::GetTextureTarget()
    */
@@ -180,7 +191,7 @@ private: // native image
   /**
    * @copydoc Dali::NativeImageInterface::TargetTexture()
    */
-  unsigned int TargetTexture() override;
+  uint32_t TargetTexture() override;
 
   /**
    * @copydoc Dali::NativeImageInterface::PrepareTexture()
@@ -188,16 +199,6 @@ private: // native image
   void PrepareTexture() override;
 
   /**
-   * @copydoc Dali::NativeImageInterface::GetWidth()
-   */
-  unsigned int GetWidth() const override;
-
-  /**
-   * @copydoc Dali::NativeImageInterface::GetHeight()
-   */
-  unsigned int GetHeight() const override;
-
-  /**
    * @copydoc Dali::NativeImageInterface::RequiresBlending()
    */
   bool RequiresBlending() const override;
@@ -232,7 +233,7 @@ private:
    * @param[in] depth color depth of the image
    * @param[in] nativeImageSource contains either: native image source or is empty
    */
-  DALI_INTERNAL NativeImageSource(unsigned int width, unsigned int height, ColorDepth depth, Any nativeImageSource);
+  DALI_INTERNAL NativeImageSource(uint32_t width, uint32_t height, ColorDepth depth, Any nativeImageSource);
 
   /**
    * @brief A reference counted object may only be deleted by calling Unreference().