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 1b25af141e0f8166a34b48a3edf42fe254d93abb..96a9f4f1600a0154def6f07bee30dddf57dbefc8 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 d7354562b7e275a62f12554730790cfd0bbde92d..3da39a8e0c3fc38414bd358674c07c96d007e2d3 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 cc7051bedd43a23ef3708a685b2a0d148bc79ae3..3e7d7c0ca9a552708f4b9d0024d3fb41c58bfd91 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 64122cc888b583687ac78540946e7c2cab556f6f..aa8f632d98b2ecc0dda455ca1e8b210cb925412e 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 d990c628e62c0a14aed48bee44f7be574e4ed963..6b90eb876054f40a19d78a18e5c0d1d21dd811bf 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 04182e9dbeb36eaa2da5a41093f9eb7f0569a6c6..6584e98abed7725c8a04be656f2e7584467b1373 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 afb0d8986e408c97b667486c124b5c5e2f372a32..d78de43e13573945c45a33e955f6bca51e81c86f 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 f6ad654dcd379bfec73c1b40a58e9b610c9537b5..21a9931ec29d2c117f66669352c3ff90c6f3911b 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 100fa74c2419f28066e426d59719c62414430486..864e3f9bcbf8c5a635659dd44d885923b9c0a66d 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 e5936b3185d85ab981f35129fc85f0f037c7983a..93d28614e314dcd4daa2bedd71b55cc0109c2480 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 e2d1881653fbe0340c328b5d2d6a4065af0e8f61..70f0340dd2020f560b67f564a677214ad537a421 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 144b8261d73a2d91382d0dbb1ec1cd013ab8482c..3cf8ff81e24faa33ecdc4e36d1968c4227a8c1c3 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 16dcf9fbe671df39b41a65c8fd1748de6f566294..cbd5aa7f55a47d2e08cc31592169c73bb34b66d1 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 49aeef5abaa6128fcd3498a04316f03707736b3d..7c86a3e9cb9135a24c5151aa236eef86bb068ebb 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 6890f0e10679b5e453fcc30bb548c25a8737635e..6745c6416935572058f03839c0dc23b8cb4e3c95 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 75746d1c4f191449bd0f5e93257899ee67cb4b8f..9cd362d4ee6703ff0ef57bd937409a7078f452a5 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 05c882f2ede1e19d63c7ab2fa5ec65ba2d4ac9ba..acae63bd6e007a3e98aa8a56864828e927db1f51 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 181204e46985531ce2a4e9187df2b0b026e5e8f3..11a8a87a72d9d0b5fc3261f76315f7f16e8e2de4 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 d5907829ad663f8f7ae498cfd3d13f98a6cf6596..88059d6e4b06dfce025baf9e5c7253cd78f64fd6 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 1eae66438716dd132197e16c09a42c9771deff54..d86a705627ed32741007d675c951c60491939a89 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 2e4c75290260e9abd8da26dd0a772a47a398ca2d..8959242f40c642aac92baadc26ec757836ce9980 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,23 +191,13 @@ private: // native image
   /**
    * @copydoc Dali::NativeImageInterface::TargetTexture()
    */
-  unsigned int TargetTexture() override;
+  uint32_t TargetTexture() override;
 
   /**
    * @copydoc Dali::NativeImageInterface::PrepareTexture()
    */
   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()
    */
@@ -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().