To set saved jpeg image quality of Capture 57/230557/15
authorSeungho, Baek <sbsh.baek@samsung.com>
Fri, 10 Apr 2020 12:52:56 +0000 (21:52 +0900)
committerSeungho, Baek <sbsh.baek@samsung.com>
Fri, 8 May 2020 01:46:09 +0000 (10:46 +0900)
 - Adds parameter at the Capture::Start to control saved jpeg quality

Change-Id: I9b0edc0e22e77672a7acf460303585ee4ebcdc3b
Signed-off-by: Seungho, Baek <sbsh.baek@samsung.com>
18 files changed:
dali/devel-api/adaptor-framework/bitmap-saver.cpp
dali/devel-api/adaptor-framework/bitmap-saver.h
dali/devel-api/adaptor-framework/native-image-source-devel.cpp
dali/devel-api/adaptor-framework/native-image-source-devel.h
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-image-source-impl.h
dali/internal/imaging/tizen/native-image-source-impl-tizen.cpp
dali/internal/imaging/tizen/native-image-source-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-impl-win.cpp
dali/internal/imaging/windows/native-image-source-impl-win.h
dali/internal/system/common/capture-impl.cpp
dali/internal/system/common/capture-impl.h
dali/public-api/adaptor-framework/native-image-source.cpp
dali/public-api/capture/capture.cpp
dali/public-api/capture/capture.h

index c39bb70..68adfc7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 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.
@@ -91,13 +91,14 @@ bool EncodeToFormat( const unsigned char* pixelBuffer,
                      FileFormat formatEncoding,
                      std::size_t width,
                      std::size_t height,
-                     Pixel::Format pixelFormat )
+                     Pixel::Format pixelFormat,
+                     const uint32_t quality )
 {
   switch( formatEncoding )
   {
     case JPG_FORMAT:
     {
-      return TizenPlatform::EncodeToJpeg( pixelBuffer, encodedPixels, width, height, pixelFormat );
+      return TizenPlatform::EncodeToJpeg( pixelBuffer, encodedPixels, width, height, pixelFormat, quality );
       break;
     }
     case PNG_FORMAT:
@@ -122,10 +123,20 @@ bool EncodeToFile(const unsigned char* const pixelBuffer,
                   const std::size_t width,
                   const std::size_t height )
 {
+  return EncodeToFile( pixelBuffer, filename, pixelFormat, width, height, DEFAULT_JPG_QUALITY );
+}
+
+bool EncodeToFile(const unsigned char* const pixelBuffer,
+                  const std::string& filename,
+                  const Pixel::Format pixelFormat,
+                  const std::size_t width,
+                  const std::size_t height,
+                  const uint32_t quality )
+{
   DALI_ASSERT_DEBUG(pixelBuffer != 0 && filename.size() > 4 && width > 0 && height > 0);
   Vector< unsigned char > pixbufEncoded;
   const FileFormat format = GetFormatFromFileName( filename );
-  const bool encodeResult = EncodeToFormat( pixelBuffer, pixbufEncoded, format, width, height, pixelFormat );
+  const bool encodeResult = EncodeToFormat( pixelBuffer, pixbufEncoded, format, width, height, pixelFormat, quality );
   if(!encodeResult)
   {
     DALI_LOG_ERROR("Encoding pixels failed\n");
index e1f6ab7..1a5a8b1 100755 (executable)
@@ -2,7 +2,7 @@
 #define DALI_ADAPTOR_BITMAP_SAVER_H
 
 /*
- * Copyright (c) 2019 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.
@@ -27,6 +27,8 @@
 namespace Dali
 {
 
+static constexpr uint32_t DEFAULT_JPG_QUALITY = 100;
+
 /**
  * Store the given pixel data to a file.
  * The suffix of the filename determines what type of file will be stored,
@@ -46,6 +48,27 @@ DALI_ADAPTOR_API bool EncodeToFile(const unsigned char* const pixelBuffer,
                                   const std::size_t width,
                                   const std::size_t height);
 
+/**
+ * Store the given pixel data to a file.
+ * The suffix of the filename determines what type of file will be stored,
+ * currently only jpeg and png formats are supported.
+ *
+ * @param[in] pixelBuffer Pointer to the pixel data
+ * @param[in] filename    Filename to save
+ * @param[in] pixelFormat The format of the buffer's pixels
+ * @param[in] width       The width of the image in pixels
+ * @param[in] height      The height of the image in pixels
+ * @param[in] quality     The value to control image quality for jpeg file format in the range [1, 100]
+ *
+ * @return true if the file was saved
+ */
+DALI_ADAPTOR_API bool EncodeToFile(const unsigned char* const pixelBuffer,
+                                  const std::string& filename,
+                                  const Pixel::Format pixelFormat,
+                                  const std::size_t width,
+                                  const std::size_t height,
+                                  const uint32_t quality);
+
 } // namespace Dali
 
 
index 3072690..3250d44 100755 (executable)
@@ -28,6 +28,11 @@ namespace Dali
 namespace DevelNativeImageSource\r
 {\r
 \r
+bool EncodeToFile( NativeImageSource& image, const std::string& filename, const uint32_t quality )\r
+{\r
+  return Dali::Internal::Adaptor::NativeImageSource::GetImplementation( image ).EncodeToFile( filename, quality );\r
+}\r
+\r
 uint8_t* AcquireBuffer( NativeImageSource& image, uint16_t& width, uint16_t& height, uint16_t& stride )\r
 {\r
   return Dali::Internal::Adaptor::NativeImageSource::GetImplementation( image ).AcquireBuffer( width, height, stride );\r
index 0c470c8..eeea436 100755 (executable)
@@ -27,6 +27,19 @@ namespace DevelNativeImageSource
 {\r
 \r
 /**\r
+ * @brief Converts the current pixel contents to either a JPEG or PNG format\r
+ * and write that to the filesystem.\r
+ *\r
+ * @param[in] image The instance of NativeImageSource.\r
+ * @param[in] filename Identify the filesystem location at which to write the encoded image.\r
+ *                     The extension determines the encoding used.\r
+ *                     The two valid encoding are (".jpeg"|".jpg") and ".png".\r
+ * @param[in] quality The value to control image quality for jpeg file format in the range [1, 100]\r
+ * @return    @c true if the pixels were written, and @c false otherwise\r
+ */\r
+DALI_ADAPTOR_API bool EncodeToFile( NativeImageSource& image, const std::string& filename, const uint32_t quality );\r
+\r
+/**\r
  * @brief Acquire buffer and information of an internal native image.\r
  *\r
  * AcquireBuffer() and ReleaseBuffer() are a pair.\r
index 53fdc8c..19312b5 100755 (executable)
@@ -29,7 +29,6 @@
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/bitmap-saver.h>
 #include <dali/integration-api/adaptor-framework/render-surface-interface.h>
 #include <dali/internal/graphics/common/egl-image-extensions.h>
 #include <dali/internal/graphics/gles/egl-graphics.h>
@@ -191,19 +190,6 @@ bool NativeImageSourceAndroid::GetPixels(std::vector<unsigned char>& pixbuf, uns
   return success;
 }
 
-bool NativeImageSourceAndroid::EncodeToFile(const std::string& filename) const
-{
-  std::vector< unsigned char > pixbuf;
-  unsigned int width(0), height(0);
-  Pixel::Format pixelFormat;
-
-  if( GetPixels( pixbuf, width, height, pixelFormat ) )
-  {
-    return Dali::EncodeToFile( &pixbuf[0], filename, pixelFormat, width, height );
-  }
-  return false;
-}
-
 void NativeImageSourceAndroid::SetSource( Any source )
 {
   if( mPixmap )
index 7d941ca..3b68f1c 100755 (executable)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_NATIVE_IMAGE_SOURCE_H
 
 /*
- * Copyright (c) 2019 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.
@@ -69,11 +69,6 @@ public:
   bool GetPixels(std::vector<unsigned char> &pixbuf, uint32_t &width, uint32_t &height, Pixel::Format& pixelFormat ) const override;
 
   /**
-   * @copydoc Dali::NativeImageSource::EncodeToFile(const std::string& )
-   */
-  bool EncodeToFile(const std::string& filename) const override;
-
-  /**
    * @copydoc Dali::NativeImageSource::SetSource( Any source )
    */
   void SetSource( Any source ) override;
index d5f292f..0833f51 100755 (executable)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_NATIVE_IMAGE_SOURCE_IMPL_H
 
 /*
- * Copyright (c) 2018 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.
@@ -20,6 +20,7 @@
 
 // INTERNAL INCLUDES
 #include <dali/public-api/adaptor-framework/native-image-source.h>
+#include <dali/devel-api/adaptor-framework/bitmap-saver.h>
 
 namespace Dali
 {
@@ -37,6 +38,8 @@ class NativeImageSource
 {
 public:
 
+  static constexpr uint32_t DEFAULT_QUALITY = 100;
+
   /**
    * Create a new NativeImageSource internally.
    * Depending on hardware the width and height may have to be a power of two.
@@ -61,11 +64,6 @@ public:
   virtual bool GetPixels(std::vector<unsigned char> &pixbuf, uint32_t &width, uint32_t &height, Pixel::Format& pixelFormat ) const = 0;
 
   /**
-   * @copydoc Dali::NativeImageSource::EncodeToFile(const std::string& )
-   */
-  virtual bool EncodeToFile(const std::string& filename) const = 0;
-
-  /**
    * @copydoc Dali::NativeImageSource::SetSource( Any source )
    */
   virtual void SetSource( Any source ) = 0;
@@ -130,6 +128,37 @@ public:
    */
   virtual bool ReleaseBuffer() = 0;
 
+  /**
+   * @copydoc Dali::NativeImageSource::EncodeToFile(const std::string& )
+   */
+  inline bool EncodeToFile( const std::string& filename ) const
+  {
+    return EncodeToFile( filename, DEFAULT_QUALITY );
+  }
+
+  /**
+   * @brief Converts the current pixel contents to either a JPEG or PNG format
+   * and write that to the filesystem.
+   *
+   * @param[in] filename Identify the filesystem location at which to write the encoded image.
+   *                     The extension determines the encoding used.
+   *                     The two valid encoding are (".jpeg"|".jpg") and ".png".
+   * @param[in] quality The quality of encoded jpeg image
+   * @return    @c true if the pixels were written, and @c false otherwise
+   */
+  inline bool EncodeToFile( const std::string& filename, const uint32_t quality ) const
+  {
+    std::vector< uint8_t > pixbuf;
+    uint32_t width( 0 ), height( 0 );
+    Pixel::Format pixelFormat;
+
+    if( GetPixels( pixbuf, width, height, pixelFormat ) )
+    {
+      return Dali::EncodeToFile( &pixbuf[0], filename, pixelFormat, width, height, quality );
+    }
+    return false;
+  }
+
 public:
   inline static Internal::Adaptor::NativeImageSource& GetImplementation( Dali::NativeImageSource& image ) { return *image.mImpl; }
 };
index 2682522..096944c 100755 (executable)
@@ -30,9 +30,6 @@
 #include <dali/internal/adaptor/common/adaptor-impl.h>
 #include <dali/integration-api/adaptor-framework/render-surface-interface.h>
 
-// Allow this to be encoded and saved:
-#include <dali/devel-api/adaptor-framework/bitmap-saver.h>
-
 namespace Dali
 {
 
@@ -301,10 +298,10 @@ bool NativeImageSourceTizen::GetPixels(std::vector<unsigned char>& pixbuf, unsig
           {
             cOffset = c*4;
             offset = cOffset + r*stride;
-            *(bufptr+cOffset) = ptr[offset];
-            *(bufptr+cOffset+1) = ptr[offset+3];
-            *(bufptr+cOffset+2) = ptr[offset+2];
-            *(bufptr+cOffset+3) = ptr[offset+1];
+            *(bufptr+cOffset)   = ptr[offset+2];
+            *(bufptr+cOffset+1) = ptr[offset+1];
+            *(bufptr+cOffset+2) = ptr[offset];
+            *(bufptr+cOffset+3) = ptr[offset+3];
           }
         }
         break;
@@ -333,19 +330,6 @@ bool NativeImageSourceTizen::GetPixels(std::vector<unsigned char>& pixbuf, unsig
   return false;
 }
 
-bool NativeImageSourceTizen::EncodeToFile(const std::string& filename) const
-{
-  std::vector< unsigned char > pixbuf;
-  unsigned int width(0), height(0);
-  Pixel::Format pixelFormat;
-
-  if(GetPixels(pixbuf, width, height, pixelFormat))
-  {
-    return Dali::EncodeToFile(&pixbuf[0], filename, pixelFormat, width, height);
-  }
-  return false;
-}
-
 void NativeImageSourceTizen::SetSource( Any source )
 {
   Dali::Mutex::ScopedLock lock( mMutex );
index d40142c..9264a25 100755 (executable)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_NATIVE_IMAGE_SOURCE_IMPL_TIZEN_H
 
 /*
- * Copyright (c) 2017 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.
@@ -69,12 +69,7 @@ public:
   /**
    * @copydoc Dali::NativeImageSource::GetPixels()
    */
-  bool GetPixels(std::vector<unsigned char> &pixbuf, uint32_t &width, uint32_t &height, Pixel::Format& pixelFormat ) const  override;
-
-  /**
-   * @copydoc Dali::NativeImageSource::EncodeToFile(const std::string& )
-   */
-  bool EncodeToFile(const std::string& filename) const override;
+  bool GetPixels(std::vector<unsigned char> &pixbuf, uint32_t &width, uint32_t &height, Pixel::Format& pixelFormat ) const override;
 
   /**
    * @copydoc Dali::NativeImageSource::SetSource( Any source )
index 51c89d3..c222d3b 100755 (executable)
@@ -28,7 +28,6 @@
 #include <dali/internal/graphics/common/egl-image-extensions.h>
 #include <dali/internal/graphics/gles/egl-graphics.h>
 #include <dali/internal/adaptor/common/adaptor-impl.h>
-#include <dali/devel-api/adaptor-framework/bitmap-saver.h>
 #include <dali/integration-api/adaptor-framework/render-surface-interface.h>
 
 namespace Dali
@@ -264,19 +263,6 @@ bool NativeImageSourceX::GetPixels(std::vector<unsigned char>& pixbuf, unsigned&
   return success;
 }
 
-bool NativeImageSourceX::EncodeToFile(const std::string& filename) const
-{
-  std::vector< unsigned char > pixbuf;
-  unsigned int width(0), height(0);
-  Pixel::Format pixelFormat;
-
-  if(GetPixels(pixbuf, width, height, pixelFormat))
-  {
-    return Dali::EncodeToFile(&pixbuf[0], filename, pixelFormat, width, height);
-  }
-  return false;
-}
-
 void NativeImageSourceX::SetSource( Any source )
 {
   mPixmap = GetPixmapFromAny( source );
index 5306938..1f37eaa 100755 (executable)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_NATIVE_IMAGE_SOURCE_H
 
 /*
- * Copyright (c) 2019 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.
@@ -69,11 +69,6 @@ public:
   bool GetPixels(std::vector<unsigned char> &pixbuf, uint32_t &width, uint32_t &height, Pixel::Format& pixelFormat ) const override;
 
   /**
-   * @copydoc Dali::NativeImageSource::EncodeToFile(const std::string& )
-   */
-  bool EncodeToFile(const std::string& filename) const override;
-
-  /**
    * @copydoc Dali::NativeImageSource::SetSource( Any source )
    */
   void SetSource( Any source ) override;
index 12db4fd..aabcdff 100755 (executable)
@@ -26,7 +26,6 @@
 #include <dali/internal/graphics/gles/egl-graphics.h>
 #include <dali/internal/adaptor/common/adaptor-impl.h>
 #include <dali/internal/window-system/windows/platform-implement-win.h>
-#include <dali/devel-api/adaptor-framework/bitmap-saver.h>
 #include <dali/integration-api/adaptor-framework/render-surface-interface.h>
 
 namespace Dali
@@ -119,19 +118,6 @@ bool NativeImageSourceWin::GetPixels(std::vector<uint8_t>& pixbuf, unsigned& wid
   return success;
 }
 
-bool NativeImageSourceWin::EncodeToFile(const std::string& filename) const
-{
-  std::vector< uint8_t > pixbuf;
-  uint32_t width(0), height(0);
-  Pixel::Format pixelFormat;
-
-  if(GetPixels(pixbuf, width, height, pixelFormat))
-  {
-    return Dali::EncodeToFile(&pixbuf[0], filename, pixelFormat, width, height);
-  }
-  return false;
-}
-
 void NativeImageSourceWin::SetSource( Any source )
 {
   mPixmap = GetPixmapFromAny( source );
index 6fe3fab..bc2a257 100755 (executable)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_NATIVE_IMAGE_SOURCE_H
 
 /*
- * Copyright (c) 2019 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.
@@ -64,11 +64,6 @@ public:
   bool GetPixels(std::vector<unsigned char> &pixbuf, unsigned int &width, unsigned int &height, Pixel::Format& pixelFormat ) const override;
 
   /**
-   * @copydoc Dali::NativeImageSource::EncodeToFile(const std::string& )
-   */
-  bool EncodeToFile(const std::string& filename) const override;
-
-  /**
    * @copydoc Dali::NativeImageSource::SetSource( Any source )
    */
   void SetSource( Any source ) override;
index 8dc77b9..2724dd2 100644 (file)
@@ -28,6 +28,7 @@
 
 // INTERNAL INCLUDES
 #include <dali/integration-api/adaptor-framework/adaptor.h>
+#include <dali/devel-api/adaptor-framework/native-image-source-devel.h>
 
 namespace
 {
@@ -44,7 +45,8 @@ namespace Adaptor
 {
 
 Capture::Capture()
-: mTimer(),
+: mQuality( DEFAULT_QUALITY ),
+  mTimer(),
   mPath(),
   mNativeImageSourcePtr( NULL ),
   mFileSave( false )
@@ -52,7 +54,8 @@ Capture::Capture()
 }
 
 Capture::Capture( Dali::CameraActor cameraActor )
-: mCameraActor( cameraActor ),
+: mQuality( DEFAULT_QUALITY ),
+  mCameraActor( cameraActor ),
   mTimer(),
   mPath(),
   mNativeImageSourcePtr( NULL ),
@@ -79,6 +82,12 @@ CapturePtr Capture::New( Dali::CameraActor cameraActor )
   return pWorker;
 }
 
+void Capture::Start( Dali::Actor source, const Dali::Vector2& size, const std::string &path, const Dali::Vector4& clearColor, const uint32_t quality )
+{
+  mQuality = quality;
+  Start( source, size, path, clearColor );
+}
+
 void Capture::Start( Dali::Actor source, const Dali::Vector2& size, const std::string &path, const Dali::Vector4& clearColor )
 {
   DALI_ASSERT_ALWAYS(path.size() > 4 && "Path is invalid.");
@@ -306,7 +315,7 @@ bool Capture::SaveFile()
 {
   DALI_ASSERT_ALWAYS(mNativeImageSourcePtr && "mNativeImageSourcePtr is NULL");
 
-  return mNativeImageSourcePtr->EncodeToFile( mPath );
+  return Dali::DevelNativeImageSource::EncodeToFile( *mNativeImageSourcePtr, mPath, mQuality );
 }
 
 }  // End of namespace Adaptor
index 61e116a..11c29e9 100644 (file)
@@ -48,6 +48,9 @@ typedef IntrusivePtr<Capture> CapturePtr;
 class Capture : public BaseObject, public ConnectionTracker
 {
 public:
+
+  static constexpr uint32_t DEFAULT_QUALITY = 100;
+
   /**
    * @brief Constructor.
    */
@@ -68,6 +71,11 @@ public:
   /**
    * @copydoc Dali::Capture::Start
    */
+  void Start( Dali::Actor source, const Dali::Vector2& size, const std::string &path, const Dali::Vector4& clearColor, const uint32_t quality );
+
+  /**
+   * @copydoc Dali::Capture::Start
+   */
   void Start( Dali::Actor source, const Dali::Vector2& size, const std::string &path, const Dali::Vector4& clearColor );
 
   /**
@@ -186,6 +194,7 @@ private:
   Capture& operator=( const Capture& rhs );
 
 private:
+  uint32_t                                    mQuality;
   Dali::Texture                               mNativeTexture;
   Dali::FrameBuffer                           mFrameBuffer;
   Dali::RenderTask                            mRenderTask;
index 9672c60..5aa9262 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 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.
@@ -53,7 +53,7 @@ bool NativeImageSource::GetPixels( std::vector<unsigned char> &pixbuf, unsigned
 
 bool NativeImageSource::EncodeToFile(const std::string& filename) const
 {
-  return mImpl->EncodeToFile(filename);
+  return mImpl->EncodeToFile( filename );
 }
 
 void NativeImageSource::SetSource( Any source )
index 701db7d..ca7c098 100644 (file)
@@ -62,6 +62,11 @@ Capture& Capture::operator=( const Capture& rhs )
   return *this;
 }
 
+void Capture::Start( Actor source, const Vector2& size, const std::string &path, const Vector4& clearColor, const uint32_t quality )
+{
+  GetImpl( *this ).Start( source, size, path, clearColor, quality );
+}
+
 void Capture::Start( Actor source, const Vector2& size, const std::string &path, const Vector4& clearColor )
 {
   GetImpl( *this ).Start( source, size, path, clearColor );
index b3ec14f..6bff5b3 100755 (executable)
@@ -177,6 +177,19 @@ public:
    * @param[in] size captured size.
    * @param[in] path image file path to be saved as a file.
    * @param[in] clearColor background color of captured scene
+   * @param[in] quality The value to control image quality for jpeg file format in the range [1, 100]
+   */
+  void Start( Actor source, const Vector2& size, const std::string &path, const Vector4& clearColor, const uint32_t quality );
+
+  /**
+   * @brief Start capture and save the image as a file.
+   *
+   * @SINCE_1_9.10
+   *
+   * @param[in] source source actor to be used for capture.
+   * @param[in] size captured size.
+   * @param[in] path image file path to be saved as a file.
+   * @param[in] clearColor background color of captured scene
    */
   void Start( Actor source, const Vector2& size, const std::string &path, const Vector4& clearColor );