--- /dev/null
+/*
+ * Copyright (c) 2021 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/capture-devel.h>
+#include <dali/internal/system/common/capture-impl.h>
+
+
+namespace Dali
+{
+namespace DevelCapture
+{
+
+Dali::Devel::PixelBuffer GetCapturedBuffer(Dali::Capture capture)
+{
+ return GetImpl(capture).GetCapturedBuffer();
+}
+
+} // namespace DevelWindow
+
+} // namespace Dali
--- /dev/null
+#ifndef DALI_CAPTURE_DEVEL_H
+#define DALI_CAPTURE_DEVEL_H
+
+/*
+ * Copyright (c) 2021 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/public-api/capture/capture.h>
+#include <dali/devel-api/adaptor-framework/pixel-buffer.h>
+
+namespace Dali
+{
+
+namespace DevelCapture
+{
+
+/**
+ * @brief Get PixelBuffer of captured image.
+ *
+ * @return PixelBuffer Captured result
+ */
+DALI_ADAPTOR_API Dali::Devel::PixelBuffer GetCapturedBuffer(Dali::Capture capture);
+
+} // namespace DevelCapture
+
+} // namespace Dali
+
+#endif // DALI_CAPTURE_DEVEL_H
${adaptor_devel_api_dir}/adaptor-framework/autofill-item.cpp
${adaptor_devel_api_dir}/adaptor-framework/autofill-manager.cpp
${adaptor_devel_api_dir}/adaptor-framework/bitmap-saver.cpp
+ ${adaptor_devel_api_dir}/adaptor-framework/capture-devel.cpp
${adaptor_devel_api_dir}/adaptor-framework/clipboard.cpp
${adaptor_devel_api_dir}/adaptor-framework/clipboard-event-notifier.cpp
${adaptor_devel_api_dir}/adaptor-framework/color-controller.cpp
${adaptor_devel_api_dir}/adaptor-framework/autofill-item.h
${adaptor_devel_api_dir}/adaptor-framework/autofill-manager.h
${adaptor_devel_api_dir}/adaptor-framework/bitmap-saver.h
+ ${adaptor_devel_api_dir}/adaptor-framework/capture-devel.h
${adaptor_devel_api_dir}/adaptor-framework/clipboard-event-notifier.h
${adaptor_devel_api_dir}/adaptor-framework/clipboard.h
${adaptor_devel_api_dir}/adaptor-framework/color-controller-plugin.h
return mTexture;
}
+Dali::Devel::PixelBuffer Capture::GetCapturedBuffer()
+{
+ if(!mPixelBuffer || !mPixelBuffer.GetBuffer())
+ {
+ uint8_t* bufferPointer;
+ uint32_t width, height;
+ Dali::Pixel::Format pixelFormat;
+ if(mIsNativeImageSourcePossible)
+ {
+ std::vector<uint8_t> buffer;
+ if(!mNativeImageSourcePtr->GetPixels(buffer, width, height, pixelFormat))
+ {
+ return Dali::Devel::PixelBuffer();
+ }
+ bufferPointer = &buffer[0];
+ }
+ else
+ {
+ width = mTexture.GetWidth();
+ height = mTexture.GetHeight();
+ pixelFormat = Dali::Pixel::RGBA8888;
+ bufferPointer = mFrameBuffer.GetRenderedBuffer();
+ }
+ mPixelBuffer = Dali::Devel::PixelBuffer::New(width, height, pixelFormat);
+
+ memcpy(mPixelBuffer.GetBuffer(), bufferPointer, width * height * Dali::Pixel::GetBytesPerPixel(pixelFormat));
+ }
+
+ return mPixelBuffer;
+}
+
Dali::Capture::CaptureFinishedSignalType& Capture::FinishedSignal()
{
return mFinishedSignal;
#include <dali/public-api/capture/capture.h>
#include <dali/public-api/adaptor-framework/native-image-source.h>
#include <dali/public-api/adaptor-framework/timer.h>
+#include <dali/devel-api/adaptor-framework/pixel-buffer.h>
namespace Dali
{
Dali::Texture GetTexture();
/**
+ * @copydoc Dali::Capture::GetCapturedBuffer
+ */
+ Dali::Devel::PixelBuffer GetCapturedBuffer();
+
+ /**
* @copydoc Dali::Capture::FinishedSignal
*/
Dali::Capture::CaptureFinishedSignalType& FinishedSignal();
Dali::Capture::CaptureFinishedSignalType mFinishedSignal;
std::string mPath;
Dali::NativeImageSourcePtr mNativeImageSourcePtr; ///< pointer to surface image
+ Dali::Devel::PixelBuffer mPixelBuffer;
bool mFileSave;
bool mIsNativeImageSourcePossible;
};