- If developer want to use saved buffer, Dali::Capture can return it.
Change-Id: I03213cec5e54edf8f0e79f00e02a77f70fe16e51
Signed-off-by: Seungho, Baek <sbsh.baek@samsung.com>
/*
- * 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.
Capture::Capture()
: mTimer(),
mPath(),
- mNativeImageSourcePtr( NULL )
+ mNativeImageSourcePtr( NULL ),
+ mFileSave( false )
{
}
: mCameraActor( cameraActor ),
mTimer(),
mPath(),
- mNativeImageSourcePtr( NULL )
+ mNativeImageSourcePtr( NULL ),
+ mFileSave( false )
{
}
Reference();
mPath = path;
+ if( mPath.size() > 0 )
+ {
+ mFileSave = true;
+ }
DALI_ASSERT_ALWAYS(source && "Source is NULL.");
SetupResources( size, clearColor, source );
}
+Dali::NativeImageSourcePtr Capture::GetNativeImageSource() const
+{
+ DALI_ASSERT_ALWAYS( mNativeImageSourcePtr && "mNativeImageSourcePtr is NULL.");
+
+ return mNativeImageSourcePtr;
+}
+
Dali::Capture::CaptureFinishedSignalType& Capture::FinishedSignal()
{
return mFinishedSignal;
mTimer.Stop();
- if( !Save() )
+ if( mFileSave )
{
- state = Dali::Capture::FinishState::FAILED;
- DALI_LOG_ERROR("Fail to Capture Path[%s]", mPath.c_str());
+ if( !SaveFile() )
+ {
+ state = Dali::Capture::FinishState::FAILED;
+ DALI_LOG_ERROR( "Fail to Capture Path[%s]", mPath.c_str() );
+ }
}
Dali::Capture handle( this );
return false;
}
-bool Capture::Save()
+bool Capture::SaveFile()
{
DALI_ASSERT_ALWAYS(mNativeImageSourcePtr && "mNativeImageSourcePtr is NULL");
#define DALI_INTERNAL_CAPTURE_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.
void Start( Dali::Actor source, const Dali::Vector2& size, const std::string &path, const Dali::Vector4& clearColor );
/**
+ * @copydoc Dali::Capture::GetNativeImageSource
+ */
+ Dali::NativeImageSourcePtr GetNativeImageSource() const;
+
+ /**
* @copydoc Dali::Capture::FinishedSignal
*/
Dali::Capture::CaptureFinishedSignalType& FinishedSignal();
*
* @return True is success to save, false is fail.
*/
- bool Save();
+ bool SaveFile();
private:
Dali::Capture::CaptureFinishedSignalType mFinishedSignal;
std::string mPath;
Dali::NativeImageSourcePtr mNativeImageSourcePtr; ///< pointer to surface image
+ bool mFileSave;
};
} // End of namespace Adaptor
/*
- * 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.
GetImpl( *this ).Start( source, size, path, Dali::Color::TRANSPARENT );
}
+Dali::NativeImageSourcePtr Capture::GetNativeImageSource() const
+{
+ return GetImpl( *this ).GetNativeImageSource();
+}
+
Capture::CaptureFinishedSignalType& Capture::FinishedSignal()
{
return GetImpl( *this ).FinishedSignal();
// INTERNAL INCLUDES
#include <dali/public-api/dali-adaptor-common.h>
+#include <dali/public-api/adaptor-framework/native-image-source.h>
namespace Dali
{
void Start( Actor source, const Vector2& size, const std::string &path );
/**
+ * @brief Get NativeImageSourcePtr that is saved captured image.
+ *
+ * @SINCE_1_9.10
+ */
+ Dali::NativeImageSourcePtr GetNativeImageSource() const;
+
+ /**
* @brief Get finished signal.
*
* @SINCE_1_3_4