utc-Dali-Hash.cpp
utc-Dali-HitTestAlgorithm.cpp
utc-Dali-HoverProcessing.cpp
- utc-Dali-Image.cpp
utc-Dali-IntrusivePtr.cpp
utc-Dali-KeyEvent.cpp
utc-Dali-Layer.cpp
utc-Dali-Renderer.cpp
utc-Dali-RenderTask.cpp
utc-Dali-RenderTaskList.cpp
- utc-Dali-ResourceImage.cpp
utc-Dali-RotationGesture.cpp
utc-Dali-RotationGestureDetector.cpp
utc-Dali-RotationGestureRecognizer.cpp
}
}
-void PrepareResourceImage( TestApplication& application, uint32_t imageWidth, uint32_t imageHeight, Pixel::Format pixelFormat )
-{
- TestPlatformAbstraction& platform = application.GetPlatform();
- platform.SetClosestImageSize(Vector2( imageWidth, imageHeight));
-
- Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_RETAIN );
- Integration::PixelBuffer* pixbuffer = bitmap->GetPackedPixelsProfile()->ReserveBuffer( pixelFormat, imageWidth, imageHeight, imageWidth, imageHeight );
- uint32_t bytesPerPixel = GetBytesPerPixel( pixelFormat );
- uint32_t initialColor = 0xFF;
- memset( pixbuffer, initialColor, imageHeight*imageWidth*bytesPerPixel);
-
- Integration::ResourcePointer resourcePtr(bitmap);
- platform.SetSynchronouslyLoadedResource( resourcePtr );
-}
-
namespace Test
{
}
};
-// Prepare a resource image to be loaded. Should be called before creating the ResourceImage
-void PrepareResourceImage( TestApplication& application, uint32_t imageWidth, uint32_t imageHeight, Pixel::Format pixelFormat );
-
// Test namespace to prevent pollution of Dali namespace, add Test helper functions here
namespace Test
{
// CLASS HEADER
#include "mesh-builder.h"
-// EXTERNAL INCLUDES
-#include <dali/devel-api/images/texture-set-image.h>
-
namespace Dali
{
return TextureSet::New();
}
-TextureSet CreateTextureSet( Image image )
-{
- TextureSet textureSet = TextureSet::New();
- TextureSetImage( textureSet, 0u, image );
- return textureSet;
-}
-
TextureSet CreateTextureSet( Texture texture )
{
TextureSet textureSet = TextureSet::New();
Shader CreateShader();
TextureSet CreateTextureSet();
-TextureSet CreateTextureSet( Image image );
TextureSet CreateTextureSet( Texture texture );
Geometry CreateQuadGeometry();
PropertyBuffer CreatePropertyBuffer();
// EXTERNAL INCLUDES
#include <dali/public-api/dali-core.h>
-#include <dali/devel-api/images/texture-set-image.h>
// INTERNAL INCLUDES
#include "mesh-builder.h"
return actor;
}
-Actor CreateRenderableActor( Image texture )
-{
- return CreateRenderableActor( texture, VERTEX_SHADER, FRAGMENT_SHADER );
-}
-
-Actor CreateRenderableActor( Image texture, const std::string& vertexShader, const std::string& fragmentShader )
-{
- // Create the geometry
- Geometry geometry = CreateQuadGeometry();
-
- // Create Shader
- Shader shader = Shader::New( vertexShader, fragmentShader );
-
- // Create renderer from geometry and material
- Renderer renderer = Renderer::New( geometry, shader );
-
- // Create actor and set renderer
- Actor actor = Actor::New();
- actor.AddRenderer( renderer );
-
- // If we a texture, then create a texture-set and add to renderer
- if( texture )
- {
- TextureSet textureSet = TextureSet::New();
- TextureSetImage( textureSet, 0u, texture );
- renderer.SetTextures( textureSet );
-
- // Set actor to the size of the texture if set
- actor.SetProperty( Actor::Property::SIZE, Vector2( texture.GetWidth(), texture.GetHeight() ) );
- }
-
- return actor;
-}
-
} // namespace Dali
* @param[in] texture Texture to set.
* @return An actor with a renderer.
*/
-Actor CreateRenderableActor( Image texture );
-
-/**
- * @brief Creates a renderable-actor with a texture and custom shaders.
- * @param[in] texture Texture to set.
- * @param[in] vertexShader The vertex-shader.
- * @param[in] fragmentShader The fragment-shader.
- * @return An actor with a renderer.
- */
-Actor CreateRenderableActor( Image texture, const std::string& vertexShader, const std::string& fragmentShader );
-
-/**
- * @brief Creates a renderable-actor with a texture.
- * @param[in] texture Texture to set.
- * @return An actor with a renderer.
- */
Actor CreateRenderableActor( Texture texture );
/**
+++ /dev/null
-/*
- * 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.
- * 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.
- *
- */
-
-#include <iostream>
-#include <algorithm>
-#include <stdlib.h>
-#include <dali/public-api/dali-core.h>
-#include <dali/integration-api/bitmap.h>
-#include <dali-test-suite-utils.h>
-#include <test-native-image.h>
-
-using namespace Dali;
-
-void utc_dali_image_startup(void)
-{
- test_return_value = TET_UNDEF;
-}
-
-void utc_dali_image_cleanup(void)
-{
- test_return_value = TET_PASS;
-}
-
-static const char* gTestImageFilename = "icon_wrt.png";
-
-namespace
-{
-
-}
-
-int UtcDaliImageDownCast(void)
-{
- TestApplication application;
- tet_infoline("Testing Dali::Image::DownCast()");
-
- Image image = ResourceImage::New(gTestImageFilename);
-
- BaseHandle object(image);
-
- Image image2 = Image::DownCast(object);
- DALI_TEST_CHECK(image2);
-
- Image image3 = DownCast< Image >(object);
- DALI_TEST_CHECK(image3);
-
- BaseHandle unInitializedObject;
- Image image4 = Image::DownCast(unInitializedObject);
- DALI_TEST_CHECK(!image4);
-
- Image image5 = DownCast< Image >(unInitializedObject);
- DALI_TEST_CHECK(!image5);
- END_TEST;
-}
-
-int UtcDaliImageGetWidthHeight(void)
-{
- TestApplication application;
-
- tet_infoline("UtcDaliImageGetWidthHeight - Image::GetWidth() & Image::GetHeight");
-
- Vector2 testSize(8.0f, 16.0f);
- application.GetPlatform().SetClosestImageSize(testSize);
- PrepareResourceImage( application, testSize.x, testSize.y, Pixel::RGBA8888 );
- Image image1 = ResourceImage::New(gTestImageFilename);
- DALI_TEST_EQUALS( image1.GetWidth(), testSize.x, TEST_LOCATION );
- DALI_TEST_EQUALS( image1.GetHeight(), testSize.y, TEST_LOCATION );
-
- testSize = Vector2(128.0f, 256.0f);
- PrepareResourceImage( application, testSize.x, testSize.y, Pixel::RGBA8888 );
- Image image2 = ResourceImage::New( gTestImageFilename, ImageDimensions(testSize.x, testSize.y), FittingMode::SCALE_TO_FILL, SamplingMode::DEFAULT );
- DALI_TEST_EQUALS( image2.GetWidth(), testSize.x, TEST_LOCATION );
- DALI_TEST_EQUALS( image2.GetHeight(), testSize.y, TEST_LOCATION );
-
- END_TEST;
-}
-
-int UtcDaliImageDiscard01(void)
-{
- TestApplication application;
- tet_infoline("UtcDaliImageDiscard01 - no actors");
-
- {
- Image image = ResourceImage::New(gTestImageFilename);
-
- // Load image
- application.SendNotification();
- application.Render(16);
- std::vector<GLuint> ids;
- ids.push_back( 23 );
- application.GetGlAbstraction().SetNextTextureIds( ids );
- application.Render(16);
- application.SendNotification();
- } // Drop image handle
-
- application.SendNotification();
- application.Render(16);
- application.Render(16);
- application.SendNotification();
-
- // Shouldn't have been sent to GL...
- const std::vector<GLuint>& texIds = application.GetGlAbstraction().GetNextTextureIds();
- DALI_TEST_CHECK( texIds.size() == 1 );
- DALI_TEST_CHECK( texIds[0] == 23 );
- END_TEST;
-}
Actor CreateRenderableActorSuccess(TestApplication& application, std::string filename)
{
- PrepareResourceImage( application, 80u, 80u, Pixel::RGBA8888 );
- Image image = ResourceImage::New(filename);
- Actor actor = CreateRenderableActor(image);
+ Actor actor = CreateRenderableActor();
actor.SetProperty( Actor::Property::SIZE, Vector2( 80.0f, 80.0f ) );
return actor;
}
-Actor CreateRenderableActorFailed(TestApplication& application, std::string filename)
+Texture CreateTexture()
{
- Image image = ResourceImage::New(filename);
- DALI_TEST_CHECK( image );
- Actor actor = CreateRenderableActor(image);
- actor.SetProperty( Actor::Property::SIZE, Vector2( 80.0f, 80.0f ) );
- return actor;
-}
-
-Image CreateResourceImage(TestApplication& application, std::string filename)
-{
- PrepareResourceImage( application, 80u, 80u, Pixel::RGBA8888 );
- Image image = ResourceImage::New(filename);
- DALI_TEST_CHECK( image );
- return image;
+ return Texture::New(TextureType::TEXTURE_2D, Pixel::RGBA8888, 80u, 80u);
}
RenderTask CreateRenderTask(TestApplication& application,
CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
Stage::GetCurrent().Add( offscreenCameraActor );
- Actor secondRootActor = CreateRenderableActorFailed(application, "aFile.jpg");
+ Actor secondRootActor = CreateRenderableActorSuccess(application, "aFile.jpg");
Stage::GetCurrent().Add(secondRootActor);
RenderTask newTask = CreateRenderTask(application, offscreenCameraActor, rootActor, secondRootActor, RenderTask::REFRESH_ALWAYS, true);
Stage::GetCurrent().Add( offscreenCameraActor );
Shader shader = CreateShader();
- Image image = CreateResourceImage(application, "aFile.jpg");
+ Texture image = CreateTexture();
TextureSet textureSet = CreateTextureSet( image );
Geometry geometry = CreateQuadGeometry();
Stage::GetCurrent().Add( offscreenCameraActor );
Shader shader = CreateShader();
- Image image = CreateResourceImage(application, "aFile.jpg");
+ Texture image = CreateTexture();
TextureSet textureSet = CreateTextureSet( image );
Geometry geometry = CreateQuadGeometry();
Stage::GetCurrent().Add( offscreenCameraActor );
Shader shader = CreateShader();
- Image image = CreateResourceImage(application, "aFile.jpg");
+ Texture image = CreateTexture();
TextureSet textureSet = CreateTextureSet( image );
Geometry geometry = CreateQuadGeometry();
Stage::GetCurrent().Add( offscreenCameraActor );
Shader shader = CreateShader();
- Image image = CreateResourceImage(application, "aFile.jpg");
+ Texture image = CreateTexture();
TextureSet textureSet = CreateTextureSet( image );
Geometry geometry = CreateQuadGeometry();
CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
Stage::GetCurrent().Add( offscreenCameraActor );
- Actor secondRootActor = CreateRenderableActorFailed(application, "aFile.jpg");
+ Actor secondRootActor = CreateRenderableActorSuccess(application, "aFile.jpg");
Stage::GetCurrent().Add(secondRootActor);
RenderTask newTask = CreateRenderTask(application, offscreenCameraActor, rootActor, secondRootActor, RenderTask::REFRESH_ALWAYS, false);
rootActor.SetProperty( Actor::Property::SIZE, Vector2( 10.0f, 10.0f ) );
stage.Add( rootActor );
- Actor actorWithMissingImage = CreateRenderableActor( Image() );
+ Actor actorWithMissingImage = CreateRenderableActor( Texture() );
actorWithMissingImage.SetProperty( Actor::Property::SIZE, Vector2( 10.0f, 10.0f ) );
stage.Add( actorWithMissingImage );
#include <dali/devel-api/rendering/renderer-devel.h>
#include <dali/public-api/dali-core.h>
-#include <dali/devel-api/images/texture-set-image.h>
#include <dali/integration-api/render-task-list-integ.h>
#include <cstdio>
#include <string>
+++ /dev/null
-/*
- * Copyright (c) 2017 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.
- *
- */
-
-#include <iostream>
-#include <algorithm>
-#include <stdlib.h>
-#include <dali/public-api/dali-core.h>
-#include <dali-test-suite-utils.h>
-
-using namespace Dali;
-
-void utc_dali_resource_image_startup(void)
-{
- test_return_value = TET_UNDEF;
-}
-
-void utc_dali_resource_image_cleanup(void)
-{
- test_return_value = TET_PASS;
-}
-
-namespace
-{
-const char* gTestImageFilename = "icon_wrt.png";
-} // unnamed namespace
-
-
-// 1.1
-int UtcDaliResourceImageNew01(void)
-{
- TestApplication application;
-
- tet_infoline("UtcDaliResourceImageNew01 - ResourceImage::New(const std::string&)");
-
- // invoke default handle constructor
- ResourceImage image;
-
- DALI_TEST_CHECK( !image );
-
- // initialise handle
- image = ResourceImage::New(gTestImageFilename);
-
- DALI_TEST_CHECK( image );
- END_TEST;
-}
-
-// 1.2
-int UtcDaliResourceImageNew02(void)
-{
- TestApplication application;
-
- tet_infoline("UtcDaliREsourceImageNew02 - ResourceImage New( const std::string& url, ImageDimensions size, FittingMode scalingMode, SamplingMode samplingMode, bool orientationCorrection = true )");
-
- // invoke default handle constructor
- ResourceImage image;
-
- DALI_TEST_CHECK( !image );
-
- // initialise handle
- image = ResourceImage::New(gTestImageFilename, ImageDimensions( 128, 256 ), FittingMode::FIT_HEIGHT );
-
- DALI_TEST_CHECK( image );
- END_TEST;
-}
-
-// 1.7
-int UtcDaliResourceImageDownCast(void)
-{
- TestApplication application;
- tet_infoline("Testing Dali::ResourceImage::DownCast()");
-
- ResourceImage image = ResourceImage::New(gTestImageFilename);
-
- BaseHandle object(image);
-
- ResourceImage image2 = ResourceImage::DownCast(object);
- DALI_TEST_CHECK(image2);
-
- ResourceImage image3 = DownCast< ResourceImage >(object);
- DALI_TEST_CHECK(image3);
-
- BaseHandle unInitializedObject;
- ResourceImage image4 = ResourceImage::DownCast(unInitializedObject);
- DALI_TEST_CHECK(!image4);
-
- ResourceImage image5 = DownCast< ResourceImage >(unInitializedObject);
- DALI_TEST_CHECK(!image5);
-
- Image image6 = ResourceImage::New(gTestImageFilename);
- ResourceImage image7 = ResourceImage::DownCast(image6);
- DALI_TEST_CHECK(image7);
- END_TEST;
-}
-
-// 1.8
-int UtcDaliResourceImageGetImageSize(void)
-{
- TestApplication application;
- TestPlatformAbstraction& platform = application.GetPlatform();
-
- tet_infoline("UtcDaliResourceImageGetImageSize - ResourceImage::GetImageSize()");
-
- Vector2 testSize(8.0f, 16.0f);
- platform.SetClosestImageSize(testSize);
-
- const ImageDimensions size = ResourceImage::GetImageSize(gTestImageFilename);
-
- DALI_TEST_CHECK( application.GetPlatform().GetTrace().FindMethod("GetClosestImageSize"));
- DALI_TEST_EQUALS( Vector2( size.GetX(), size.GetY() ), testSize, TEST_LOCATION);
- END_TEST;
-}
-
-// 1.9
-int UtcDaliResourceImageGetUrl(void)
-{
- TestApplication application;
-
- tet_infoline("UtcDaliResourceImageGetFilename - ResourceImage::GetUrl()");
-
- // invoke default handle constructor
- ResourceImage image;
-
- DALI_TEST_CHECK( !image );
-
- // initialise handle
- image = ResourceImage::New(gTestImageFilename);
-
- DALI_TEST_EQUALS( image.GetUrl(), gTestImageFilename, TEST_LOCATION);
- END_TEST;
-}
-
-// 1.10
-int UtcDaliResourceImageGetLoadingState01(void)
-{
- TestApplication application;
- tet_infoline("UtcDaliResourceImageGetLoadingState01");
-
- ResourceImage image = ResourceImage::New(gTestImageFilename);
- DALI_TEST_CHECK(image.GetLoadingState() == ResourceLoadingFailed);
-
- // simulate load success
- PrepareResourceImage( application, 100u, 100u, Pixel::RGBA8888 );
- image.Reload();
-
- // Test state == ResourceLoadingSucceeded
- DALI_TEST_CHECK(image.GetLoadingState() == ResourceLoadingSucceeded);
- END_TEST;
-}
-
-// 1.11
-int UtcDaliResourceImageGetLoadingState02(void)
-{
- TestApplication application;
-
- tet_infoline("UtcDaliResourceImageGetLoadingState02");
-
- // invoke default handle constructor
- ResourceImage image;
-
- DALI_TEST_CHECK( !image );
-
- // initialise handle
- image = ResourceImage::New(gTestImageFilename);
-
- // Test state == ResourceLoadingFailed
- DALI_TEST_CHECK(image.GetLoadingState() == ResourceLoadingFailed);
-
- PrepareResourceImage( application, 100u, 100u, Pixel::RGBA8888 );
- image.Reload();
-
- // Test state == ResourceLoadingFailed
- DALI_TEST_CHECK(image.GetLoadingState() == ResourceLoadingSucceeded);
- END_TEST;
-}
-
-static bool SignalLoadFlag = false;
-
-static void SignalLoadHandler(ResourceImage image)
-{
- tet_infoline("Received image load finished signal");
-
- SignalLoadFlag = true;
-}
-
-// 1.13
-int UtcDaliResourceImageSignalLoadingFinished(void)
-{
- TestApplication application;
-
- tet_infoline("UtcDaliResourceImageSignalLoadingFinished");
-
- SignalLoadFlag = false;
-
- PrepareResourceImage( application, 100u, 100u, Pixel::RGBA8888 );
- ResourceImage image = ResourceImage::New(gTestImageFilename);
-
- image.LoadingFinishedSignal().Connect( SignalLoadHandler );
- image.Reload();
- application.SendNotification();
- application.Render(16);
-
- DALI_TEST_CHECK( SignalLoadFlag == true );
- END_TEST;
-}
// EXTERNAL INCLUDES
#include <dali/public-api/dali-core.h>
-#include <dali/devel-api/images/texture-set-image.h>
#include <unistd.h>
#include <string.h>
// EXTERNAL INCLUDES
#include <dali/public-api/dali-core.h>
-#include <dali/devel-api/images/texture-set-image.h>
// INTERNAL INCLUDES
#include <dali-test-suite-utils.h>
${devel_api_src_dir}/events/touch-data-devel.cpp
${devel_api_src_dir}/events/key-event-devel.cpp
${devel_api_src_dir}/images/distance-field.cpp
- ${devel_api_src_dir}/images/texture-set-image.cpp
${devel_api_src_dir}/images/pixel-data-devel.cpp
${devel_api_src_dir}/object/handle-devel.cpp
${devel_api_src_dir}/object/csharp-type-registry.cpp
SET( devel_api_core_images_header_files
${devel_api_src_dir}/images/distance-field.h
${devel_api_src_dir}/images/native-image-interface-extension.h
- ${devel_api_src_dir}/images/texture-set-image.h
${devel_api_src_dir}/images/pixel-data-devel.h
)
+++ /dev/null
-/*
- * Copyright (c) 2018 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.
- *
- */
-
-// CLASS HEADER
-#include "texture-set-image.h"
-
-// INTERNAL INCLUDES
-#include <dali/internal/event/rendering/texture-set-impl.h>
-#include <dali/internal/event/images/image-impl.h>
-
-namespace Dali
-{
-
-void TextureSetImage( TextureSet textureSet, size_t index, Image image )
-{
- Internal::ImagePtr imagePointer( NULL );
- if( image )
- {
- imagePointer = &GetImplementation( image );
- }
-
- GetImplementation( textureSet ).SetImage( static_cast<uint32_t>( index ), imagePointer );
-}
-
-Image TextureGetImage( TextureSet textureSet, size_t index )
-{
- // Get a pointer to the image implementation.
- Internal::Image* imagePointer = GetImplementation( textureSet ).GetImage( static_cast<uint32_t>( index ) );
-
- // Return a handle to the image.
- return Dali::Image( imagePointer );
-}
-
-} // namespace Dali
+++ /dev/null
-#ifndef DALI_TEXTURE_SET_IMAGE_H
-#define DALI_TEXTURE_SET_IMAGE_H
-
-/*
- * Copyright (c) 2018 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.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <stdlib.h>
-
-// INTERNAL INCLUDES
-#include <dali/public-api/common/dali-common.h>
-
-namespace Dali
-{
-
-class Image;
-class TextureSet;
-
-/**
- * @brief Set the image at the specified position index.
- * @param[in] textureSet The TextureSet to use
- * @param[in] index The position in the TextureSet that the image will be set
- * @param[in] image The image to set
- */
-DALI_CORE_API void TextureSetImage( TextureSet textureSet, size_t index, Image image );
-
-/**
- * @brief Get the image at the specified position index.
- * @param[in] textureSet The TextureSet to use
- * @param[in] index The position in the TextureSet that the image will be set
- * @return A handle to the image at the the specified position
- */
-DALI_CORE_API Image TextureGetImage( TextureSet textureSet, size_t index );
-
-} //namespace Dali
-
-#endif // DALI_TEXTURE_SET_IMAGE_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.
#include <dali/internal/update/animation/scene-graph-constraint.h>
-#include <dali/internal/event/images/image-impl.h>
-
#include <dali/internal/update/nodes/node.h>
#include <dali/internal/update/nodes/scene-graph-layer.h>
const std::size_t LAYER_MEMORY_SIZE(
sizeof( Internal::Layer ) +
sizeof( Internal::SceneGraph::Layer ) );
-const std::size_t IMAGE_MEMORY_SIZE(
- sizeof( Internal::Image ) +
- sizeof( Integration::Bitmap ) );
const std::size_t RENDERER_MEMORY_SIZE(
sizeof( Internal::Renderer ) +
sizeof( Internal::SceneGraph::Renderer ) +
+++ /dev/null
-/*
- * Copyright (c) 2018 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.
- *
- */
-
-// CLASS HEADER
-#include <dali/internal/event/images/image-impl.h>
-
-// EXTERNAL INCLUDES
-#include <cstring> // for strcmp
-
-// INTERNAL INCLUDES
-#include <dali/public-api/common/dali-common.h>
-#include <dali/public-api/object/type-registry.h>
-
-#include <dali/integration-api/debug.h>
-#include <dali/internal/event/common/thread-local-storage.h>
-#include <dali/internal/event/common/stage-impl.h>
-
-using namespace Dali::Integration;
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-unsigned int Image::GetWidth() const
-{
- return mWidth;
-}
-
-unsigned int Image::GetHeight() const
-{
- return mHeight;
-}
-
-Vector2 Image::GetNaturalSize() const
-{
- return Vector2( static_cast<float>( mWidth ), static_cast<float>( mHeight ) );
-}
-
-Image::Image()
-: mTexture(),
- mWidth( 0 ),
- mHeight( 0 ),
- mConnectionCount( 0 )
-{
-}
-
-Image::~Image()
-{
- if( Stage::IsInstalled() )
- {
- UnregisterObject();
- }
-}
-
-void Image::Initialize()
-{
- RegisterObject();
-}
-
-} // namespace Internal
-
-} // namespace Dali
+++ /dev/null
-#ifndef DALI_INTERNAL_IMAGE_H
-#define DALI_INTERNAL_IMAGE_H
-
-/*
- * Copyright (c) 2019 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.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <string>
-
-// INTERNAL INCLUDES
-#include <dali/public-api/images/image.h>
-#include <dali/public-api/object/base-object.h>
-#include <dali/internal/event/rendering/texture-impl.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-class Image;
-class ImageFactory;
-typedef IntrusivePtr<Image> ImagePtr;
-
-/**
- * Image represents an image resource that can be added to actors etc.
- * When the Image object is created, resource loading will be attempted.
- * Provided this is successful, the resource will exist until the Image is destroyed.
- */
-class Image : public BaseObject
-{
-public:
-
- /**
- * @copydoc Dali::Image::UploadedSignal()
- */
- Dali::Image::ImageSignalType& UploadedSignal() { return mUploaded; }
-
- /**
- * Get the width of the image.
- * Only to be used after the image has finished loading.
- * (Ticket's LoadingSucceeded callback was called)
- * The returned value will reflect the true image dimensions once the asynchronous loading has finished.
- * @pre image should be loaded
- */
- virtual unsigned int GetWidth() const;
-
- /**
- * Get the height of the image.
- * Only to be used after the image has finished loading.
- * (Ticket's LoadingSucceeded callback was called)
- * The returned value will reflect the true image dimensions once the asynchronous loading has finished.
- * @pre image should be loaded
- */
- virtual unsigned int GetHeight() const;
-
- /**
- * Return the natural size of the image.
- * This is the size that the loaded image will take
- */
- virtual Vector2 GetNaturalSize() const;
-
- /**
- * Returns a pointer to the internal texture used by the image
- */
- Texture* GetTexture() const
- {
- return mTexture.Get();
- }
-
-public:
-
- /**
- * Indicates that the image is used.
- */
- virtual void Connect() {}
-
- /**
- * Indicates that the image is not used anymore.
- */
- virtual void Disconnect() {}
-
-protected:
-
- /**
- * A reference counted object may only be deleted by calling Unreference()
- */
- virtual ~Image();
-
- /**
- * Constructor, with default parameters
- */
- Image();
-
- /**
- * Second stage initialization
- */
- void Initialize();
-
-protected:
-
- TexturePtr mTexture; ///< smart pointer to the texture used by the image
-
- unsigned int mWidth; ///< natural width of the image
- unsigned int mHeight; ///< natural height of the image
-
- unsigned int mConnectionCount; ///< number of on-stage objects using this image
-
-private:
-
- Dali::Image::ImageSignalType mUploaded;
-};
-
-} // namespace Internal
-
-/**
- * Helper methods for public API.
- */
-inline Internal::Image& GetImplementation(Dali::Image& image)
-{
- DALI_ASSERT_ALWAYS( image && "Image handle is empty" );
-
- BaseObject& handle = image.GetBaseObject();
-
- return static_cast<Internal::Image&>(handle);
-}
-
-inline const Internal::Image& GetImplementation(const Dali::Image& image)
-{
- DALI_ASSERT_ALWAYS( image && "Image handle is empty" );
-
- const BaseObject& handle = image.GetBaseObject();
-
- return static_cast<const Internal::Image&>(handle);
-}
-
-} // namespace Dali
-#endif // DALI_INTERNAL_IMAGE_H
+++ /dev/null
-/*
- * 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.
- * 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.
- *
- */
-
-// CLASS HEADER
-#include <dali/internal/event/images/resource-image-impl.h>
-
-// EXTERNAL INCLUDES
-#include <cstring> // for strcmp
-
-// INTERNAL INCLUDES
-#include <dali/public-api/common/dali-common.h>
-#include <dali/public-api/object/type-registry.h>
-#include <dali/integration-api/debug.h>
-#include <dali/integration-api/platform-abstraction.h>
-#include <dali/internal/event/common/thread-local-storage.h>
-#include <dali/internal/event/common/stage-impl.h>
-
-using namespace Dali::Integration;
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-ResourceImage::ResourceImage()
-: Image(),
- mLoadingFinished(),
- mAttributes(),
- mUrl(),
- mLoadingState( Dali::ResourceLoading )
-{
-}
-
-ResourceImage::ResourceImage( const std::string& url, const ImageAttributes& attributes)
-: Image(),
- mLoadingFinished(),
- mAttributes(attributes),
- mUrl(url),
- mLoadingState( Dali::ResourceLoading )
-{
-}
-
-ResourceImagePtr ResourceImage::New()
-{
- ResourceImagePtr image = new ResourceImage;
- image->Initialize();
- return image;
-}
-
-ResourceImagePtr ResourceImage::New( const std::string& url, const ImageAttributes& attributes )
-{
- ResourceImagePtr image;
- image = new ResourceImage(url, attributes);
- image->Initialize();
- image->Reload();
-
- DALI_LOG_SET_OBJECT_STRING( image, url );
-
- return image;
-}
-
-ResourceImage::~ResourceImage()
-{
-}
-
-const ImageAttributes& ResourceImage::GetAttributes() const
-{
- return mAttributes;
-}
-
-const std::string& ResourceImage::GetUrl() const
-{
- return mUrl;
-}
-
-void ResourceImage::Reload()
-{
- ThreadLocalStorage& tls = ThreadLocalStorage::Get();
- Integration::PlatformAbstraction& platformAbstraction = tls.GetPlatformAbstraction();
- Integration::BitmapResourceType resourceType( ImageDimensions(mAttributes.GetWidth(), mAttributes.GetHeight()),
- mAttributes.GetScalingMode(),
- mAttributes.GetFilterMode(),
- mAttributes.GetOrientationCorrection() );
-
- // Note, bitmap is only destroyed when the image is destroyed.
- Integration::ResourcePointer resource = platformAbstraction.LoadImageSynchronously( resourceType, mUrl );
- if( resource )
- {
- Integration::Bitmap* bitmap = static_cast<Integration::Bitmap*>( resource.Get() );
- unsigned width = bitmap->GetImageWidth();
- unsigned height = bitmap->GetImageHeight();
-
- //Create texture
- Pixel::Format format = bitmap->GetPixelFormat();
- mTexture = Texture::New( Dali::TextureType::TEXTURE_2D, format, width, height );
-
- //Upload data to the texture
- uint32_t bufferSize = bitmap->GetBufferSize();
- PixelDataPtr pixelData = PixelData::New( bitmap->GetBufferOwnership(), bufferSize, width, height, format,
- static_cast< Dali::PixelData::ReleaseFunction >( bitmap->GetReleaseFunction() ) );
- mTexture->Upload( pixelData );
-
- mWidth = mAttributes.GetWidth();
- if( mWidth == 0 )
- {
- mWidth = width;
- }
-
- mHeight = mAttributes.GetHeight();
- if( mHeight == 0 )
- {
- mHeight = height;
- }
-
- mLoadingState = Dali::ResourceLoadingSucceeded;
-
- }
- else
- {
- mTexture = Texture::New( Dali::TextureType::TEXTURE_2D, Pixel::RGBA8888, 0u, 0u );
- mWidth = mHeight = 0u;
- mLoadingState = Dali::ResourceLoadingFailed;
- }
-
- mLoadingFinished.Emit( Dali::ResourceImage( this ) );
-}
-
-unsigned int ResourceImage::GetWidth() const
-{
- return mWidth;
-}
-
-unsigned int ResourceImage::GetHeight() const
-{
- return mHeight;
-}
-
-Vector2 ResourceImage::GetNaturalSize() const
-{
- return Vector2( static_cast<float>( mWidth ), static_cast<float>( mHeight ) );
-}
-
-
-} // namespace Internal
-
-} // namespace Dali
+++ /dev/null
-#ifndef DALI_INTERNAL_RESOURCE_IMAGE_H
-#define DALI_INTERNAL_RESOURCE_IMAGE_H
-
-/*
- * Copyright (c) 2019 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.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <string>
-
-// INTERNAL INCLUDES
-#include <dali/public-api/images/resource-image.h>
-#include <dali/internal/event/images/image-impl.h>
-#include <dali/internal/common/image-attributes.h>
-#include <dali/integration-api/debug.h> // For DALI_LOG_OBJECT_STRING_DECLARATION
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-class ResourceImage;
-typedef IntrusivePtr<ResourceImage> ResourceImagePtr;
-
-/**
- * ResourceImage is an image loaded using a URL, it is an image resource that can be added to actors etc.
- */
-class ResourceImage : public Image
-{
-public:
-
- /**
- * Creates a pointer to an uninitialized Image object.
- * @return a pointer to a newly created object.
- */
- static ResourceImagePtr New();
-
- /**
- * Creates object and loads image from filesystem
- * the maximum size of the image is limited by GL_MAX_TEXTURE_SIZE
- * @param [in] url The URL of the image file.
- * @param [in] attributes requested parameters for loading (size, scaling etc.)
- * if width or height is specified as 0, the natural size will be used.
- * @return a pointer to a newly created object.
- */
- static ResourceImagePtr New( const std::string& url,
- const ImageAttributes& attributes );
-
- /**
- * @copydoc Dali::ResourceImage::GetLoadingState()
- */
- Dali::LoadingState GetLoadingState() const { return mLoadingState; }
-
- /**
- * @copydoc Dali::ResourceImage::LoadingFinishedSignal()
- */
- Dali::ResourceImage::ResourceImageSignal& LoadingFinishedSignal() { return mLoadingFinished; }
-
- /**
- * Get the attributes of the image.
- * Only to be used after the image has finished loading.
- * (Ticket's LoadingSucceeded callback was called)
- * Reflects the last cached values after a LoadComplete.
- * If requested width or height was 0, they are replaced by concrete dimensions.
- * @return a copy of the attributes
- */
- const ImageAttributes& GetAttributes() const;
-
- /**
- * @copydoc Dali::ResourceImage::GetUrl()
- * virtual so deriving class can override it
- */
- virtual const std::string& GetUrl() const;
-
- /**
- * @copydoc Dali::ResourceImage::Reload()
- */
- void Reload();
-
- /**
- * @copydoc Dali::Image::GetWidth()
- */
- virtual unsigned int GetWidth() const;
-
- /**
- * @copydoc Dali::Image::GetWidth()
- */
- virtual unsigned int GetHeight() const;
-
- /**
- * @copydoc Dali::Internal::Image::GetNaturalSize()
- */
- virtual Vector2 GetNaturalSize() const;
-
-
-protected:
-
- /**
- * A reference counted object may only be deleted by calling Unreference()
- */
- virtual ~ResourceImage();
-
- /**
- * Constructor, with default parameters
- */
- ResourceImage();
-
- /**
- * Constructor, with url and attributes
- */
- ResourceImage( const std::string& url, const ImageAttributes& attributes);
-
-private:
- Dali::ResourceImage::ResourceImageSignal mLoadingFinished;
- ImageAttributes mAttributes;
- std::string mUrl;
- Dali::LoadingState mLoadingState;
-
- // Changes scope, should be at end of class
- DALI_LOG_OBJECT_STRING_DECLARATION;
-};
-
-} // namespace Internal
-
-/**
- * Helper methods for public API.
- */
-inline Internal::ResourceImage& GetImplementation(Dali::ResourceImage& image)
-{
- DALI_ASSERT_ALWAYS( image && "Image handle is empty" );
-
- BaseObject& handle = image.GetBaseObject();
-
- return static_cast<Internal::ResourceImage&>(handle);
-}
-
-inline const Internal::ResourceImage& GetImplementation(const Dali::ResourceImage& image)
-{
- DALI_ASSERT_ALWAYS( image && "Image handle is empty" );
-
- const BaseObject& handle = image.GetBaseObject();
-
- return static_cast<const Internal::ResourceImage&>(handle);
-}
-
-} // namespace Dali
-#endif // DALI_INTERNAL_RESOURCE_IMAGE_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.
return result;
}
-void TextureSet::SetImage( uint32_t index, ImagePtr image )
-{
- Texture* texture( NULL );
- if( image )
- {
- uint32_t textureCount = static_cast<uint32_t>( mImages.size() );
- if( index >= textureCount )
- {
- mImages.resize(index + 1);
- }
- mImages[index] = image;
-
- texture = image->GetTexture();
- }
-
- SetTexture( index, texture );
-}
-
-Image* TextureSet::GetImage( uint32_t index ) const
-{
- Image* result( NULL );
- if( index < mImages.size() )
- {
- result = mImages[index].Get();
- }
- else
- {
- DALI_LOG_ERROR( "Error: Invalid index to TextureSet::GetImage\n");
- }
-
- return result;
-}
-
void TextureSet::SetSampler( uint32_t index, SamplerPtr sampler )
{
uint32_t samplerCount = static_cast<uint32_t>( mSamplers.size() );
#define DALI_INTERNAL_TEXTURE_SET_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.
#include <dali/public-api/rendering/texture-set.h> // Dali::TextureSet
#include <dali/internal/event/common/object-impl.h> // Dali::Internal::Object
#include <dali/internal/event/common/property-buffer-impl.h> // Dali::Internal::PropertyBuffer
-#include <dali/internal/event/images/image-impl.h> // Dali::Internal::Image
#include <dali/internal/event/rendering/sampler-impl.h> // Dali::Internal::Sampler
#include <dali/internal/event/rendering/texture-impl.h> // Dali::Internal::Texture
#include <dali/internal/event/rendering/shader-impl.h> // Dali::Internal::Shader
Texture* GetTexture( uint32_t index ) const;
/**
- * @copydoc Dali::TextureSet::SetImage()
- */
- void SetImage( uint32_t index, ImagePtr image );
-
- /**
- * @copydoc Dali::TextureSet::GetImage()
- */
- Image* GetImage( uint32_t index ) const;
-
- /**
* @copydoc Dali::TextureSet::SetSampler()
*/
void SetSampler( uint32_t index, SamplerPtr sampler );
private: // Data
EventThreadServices& mEventThreadServices; ///<Used to send messages to the update thread
SceneGraph::TextureSet* mSceneObject;
- std::vector<ImagePtr> mImages;
std::vector<SamplerPtr> mSamplers;
std::vector<TexturePtr> mTextures;
};
${internal_src_dir}/event/events/tap-gesture/tap-gesture-recognizer.cpp
${internal_src_dir}/event/images/bitmap-packed-pixel.cpp
${internal_src_dir}/event/images/bitmap-compressed.cpp
- ${internal_src_dir}/event/images/image-impl.cpp
- ${internal_src_dir}/event/images/resource-image-impl.cpp
${internal_src_dir}/event/images/pixel-data-impl.cpp
${internal_src_dir}/event/render-tasks/render-task-impl.cpp
${internal_src_dir}/event/render-tasks/render-task-list-impl.cpp
#include <dali/public-api/events/touch-event.h>
#include <dali/public-api/events/touch-point.h>
-#include <dali/public-api/images/image.h>
#include <dali/public-api/images/native-image-interface.h>
-#include <dali/public-api/images/resource-image.h>
#include <dali/public-api/images/pixel.h>
#include <dali/public-api/images/pixel-data.h>
${public_api_src_dir}/events/touch-point.cpp
${public_api_src_dir}/events/touch-event.cpp
${public_api_src_dir}/events/touch-data.cpp
- ${public_api_src_dir}/images/image.cpp
${public_api_src_dir}/images/pixel.cpp
${public_api_src_dir}/images/pixel-data.cpp
- ${public_api_src_dir}/images/resource-image.cpp
${public_api_src_dir}/math/compile-time-math.cpp
${public_api_src_dir}/math/degree.cpp
${public_api_src_dir}/math/matrix.cpp
SET( public_api_core_images_header_files
- ${public_api_src_dir}/images/image.h
${public_api_src_dir}/images/image-operations.h
${public_api_src_dir}/images/pixel.h
${public_api_src_dir}/images/pixel-data.h
- ${public_api_src_dir}/images/resource-image.h
${public_api_src_dir}/images/native-image-interface.h
)
+++ /dev/null
-/*
- * Copyright (c) 2018 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.
- *
- */
-
-// CLASS HEADER
-#include <dali/public-api/images/image.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/event/images/image-impl.h>
-
-
-namespace Dali
-{
-
-Image::Image()
-{
-}
-
-Image::Image(Internal::Image* internal) : BaseHandle(internal)
-{
-}
-
-Image::~Image()
-{
-}
-
-Image::Image(const Image& handle)
-: BaseHandle(handle)
-{
-}
-
-Image& Image::operator=(const Image& rhs)
-{
- BaseHandle::operator=(rhs);
- return *this;
-}
-
-Image Image::DownCast( BaseHandle handle )
-{
- return Image( dynamic_cast<Dali::Internal::Image*>(handle.GetObjectPtr()) );
-}
-
-uint32_t Image::GetWidth() const
-{
- return GetImplementation(*this).GetWidth();
-}
-
-uint32_t Image::GetHeight() const
-{
- return GetImplementation(*this).GetHeight();
-}
-
-Image::ImageSignalType& Image::UploadedSignal()
-{
- return GetImplementation(*this).UploadedSignal();
-}
-
-} // namespace Dali
+++ /dev/null
-#ifndef DALI_IMAGE_H
-#define DALI_IMAGE_H
-
-/*
- * Copyright (c) 2019 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.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <string>
-#include <cstdint> // uint32_t
-
-// INTERNAL INCLUDES
-#include <dali/public-api/object/base-handle.h>
-#include <dali/public-api/signals/dali-signal.h>
-
-namespace Dali
-{
-/**
- * @addtogroup dali_core_images
- * @{
- */
-
-namespace Internal DALI_INTERNAL
-{
-class Image;
-}
-
-/**
- * @DEPRECATED_1_2.41
- *
- * @brief An Image object represents an image resource that can be used for rendering.
- *
- * Image objects can be shared between Actors. This is practical if you have a visual element on screen
- * which is repeatedly used.
- *
- * The image resource is released as soon as the last Image handle is released.
- * @SINCE_1_0.0
- * @note If a resource was shared between Image objects it exists until its last reference is gone.
- *
- * Image objects are responsible for the underlying resource's lifetime.
- *
- * Signals
- * | %Signal Name | Method |
- * |------------------------|------------------------------|
- * | uploaded | @ref UploadedSignal() |
- * @SINCE_1_0.0
- */
-class DALI_CORE_API Image : public BaseHandle
-{
-public:
-
- /**
- * @DEPRECATED_1_2.41
- *
- * @brief Type of signal for Image Uploaded.
- * @SINCE_1_0.0
- */
- typedef Signal< void (Image) > ImageSignalType;
-
-public:
-
- /**
- * @DEPRECATED_1_2.41
- *
- * @brief Constructor which creates an empty Image handle.
- *
- * This class has no New method.
- * Use the appropriate New method of its subclasses to create an initialized handle.
- * (Dali::BufferImage::New(), Dali::EncodedBufferImage::New(), Dali::FrameBufferImage::New(),
- * Dali::NativeImage::New(), Dali::ResourceImage::New()).
- * @SINCE_1_0.0
- */
- Image() DALI_DEPRECATED_API;
-
- /**
- * @DEPRECATED_1_2.41
- *
- * @brief Destructor.
- *
- * This is non-virtual since derived Handle types must not contain data or virtual methods.
- * @SINCE_1_0.0
- */
- ~Image() DALI_DEPRECATED_API;
-
- /**
- * @DEPRECATED_1_2.41
- *
- * @brief This copy constructor is required for (smart) pointer semantics.
- *
- * @SINCE_1_0.0
- * @param[in] handle A reference to the copied handle
- */
- Image(const Image& handle) DALI_DEPRECATED_API;
-
- /**
- * @DEPRECATED_1_2.41
- *
- * @brief This assignment operator is required for (smart) pointer semantics.
- *
- * @SINCE_1_0.0
- * @param[in] rhs A reference to the copied handle
- * @return A reference to this
- */
- Image& operator=(const Image& rhs) DALI_DEPRECATED_API;
-
- /**
- * @DEPRECATED_1_2.41
- *
- * @brief Downcasts a handle to Image handle.
- *
- * If handle points to a Image object, the
- * downcast produces valid handle. If not, the returned handle is left uninitialized.
- * @SINCE_1_0.0
- * @param[in] handle Handle to an object
- * @return Handle to a Image object or an uninitialized handle
- */
- static Image DownCast( BaseHandle handle ) DALI_DEPRECATED_API;
-
- /**
- * @DEPRECATED_1_2.41
- *
- * @brief Returns the width of the image.
- *
- * Returns either the requested width or the actual loaded width if no specific size was requested.
- *
- * @SINCE_1_0.0
- * @return Width of the image in pixels
- */
- uint32_t GetWidth() const DALI_DEPRECATED_API;
-
- /**
- * @DEPRECATED_1_2.41
- *
- * @brief Returns the height of the image.
- *
- * Returns either the requested height or the actual loaded height if no specific size was requested.
- *
- * @SINCE_1_0.0
- * @return Height of the image in pixels
- */
- uint32_t GetHeight() const DALI_DEPRECATED_API;
-
-public: // Signals
-
- /**
- * @DEPRECATED_1_2.41
- *
- * @brief This signal is emitted when the image data gets uploaded to GL.
- *
- * It Will be sent after an actor using the image is added to
- * the stage, when such a staged image is reloaded, or when a staged
- * BufferImage calls Update().
- * @SINCE_1_0.0
- * @return A signal object to Connect() with
- */
- ImageSignalType& UploadedSignal() DALI_DEPRECATED_API;
-
-public: // Not intended for application developers
-
- explicit DALI_INTERNAL Image(Internal::Image*);
-};
-
-/**
- * @}
- */
-} // namespace Dali
-
-#endif // DALI_IMAGE_H
+++ /dev/null
-/*
- * Copyright (c) 2015 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.
- *
- */
-
-// CLASS HEADER
-#include <dali/public-api/images/resource-image.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/common/image-attributes.h>
-#include <dali/internal/event/images/resource-image-impl.h>
-#include <dali/internal/event/common/thread-local-storage.h>
-#include <dali/integration-api/platform-abstraction.h>
-
-namespace Dali
-{
-
-ImageDimensions ResourceImage::GetImageSize( const std::string& url )
-{
- const Internal::ImageAttributes& attribs = Internal::ImageAttributes::DEFAULT_ATTRIBUTES;
- const ImageDimensions desiredSize = ImageDimensions( attribs.GetWidth(), attribs.GetHeight() );
- const ImageDimensions size = Internal::ThreadLocalStorage::Get().GetPlatformAbstraction().GetClosestImageSize( url, desiredSize, attribs.GetScalingMode(), attribs.GetFilterMode(), attribs.GetOrientationCorrection() );
- return size;
-}
-
-ResourceImage::ResourceImage()
-{
-}
-
-ResourceImage::ResourceImage(Internal::ResourceImage* internal) : Image(internal)
-{
-}
-
-ResourceImage::~ResourceImage()
-{
-}
-
-ResourceImage::ResourceImage( const ResourceImage& handle )
-: Image(handle)
-{
-}
-
-ResourceImage& ResourceImage::operator=( const ResourceImage& rhs )
-{
- BaseHandle::operator=(rhs);
- return *this;
-}
-
-ResourceImage ResourceImage::New( const std::string& url, bool orientationCorrection )
-{
- Internal::ImageAttributes attributes = Internal::ImageAttributes::DEFAULT_ATTRIBUTES;
- attributes.SetOrientationCorrection( orientationCorrection );
- return ResourceImage( Internal::ResourceImage::New( url, attributes ).Get() );
-}
-
-ResourceImage ResourceImage::New( const std::string& url, ImageDimensions size, FittingMode::Type scalingMode, SamplingMode::Type samplingMode, bool orientationCorrection )
-{
- Internal::ImageAttributes attributes = Internal::ImageAttributes::DEFAULT_ATTRIBUTES;
- attributes.SetSize( Size( size.GetWidth(), size.GetHeight() ) );
- attributes.SetScalingMode( scalingMode );
- attributes.SetFilterMode( samplingMode );
- attributes.SetOrientationCorrection( orientationCorrection );
- return ResourceImage( Internal::ResourceImage::New( url, attributes ).Get() );
-}
-
-ResourceImage ResourceImage::DownCast( BaseHandle handle )
-{
- return ResourceImage( dynamic_cast<Dali::Internal::ResourceImage*>(handle.GetObjectPtr()) );
-}
-
-LoadingState ResourceImage::GetLoadingState() const
-{
- return GetImplementation(*this).GetLoadingState();
-}
-
-std::string ResourceImage::GetUrl() const
-{
- return GetImplementation(*this).GetUrl();
-}
-
-void ResourceImage::Reload()
-{
- GetImplementation(*this).Reload();
-}
-
-ResourceImage::ResourceImageSignal& ResourceImage::LoadingFinishedSignal()
-{
- return GetImplementation(*this).LoadingFinishedSignal();
-}
-
-} // namespace Dali
+++ /dev/null
-#ifndef DALI_RESOURCE_IMAGE_H
-#define DALI_RESOURCE_IMAGE_H
-
-/*
- * Copyright (c) 2019 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.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <string>
-
-// INTERNAL INCLUDES
-#include <dali/public-api/common/loading-state.h>
-#include <dali/public-api/images/image.h>
-#include <dali/public-api/signals/dali-signal.h>
-#include <dali/public-api/images/image-operations.h>
-
-namespace Dali
-{
-/**
- * @addtogroup dali_core_images
- * @{
- */
-
-namespace Internal DALI_INTERNAL
-{
-class ResourceImage;
-}
-
-/**
- * @DEPRECATED_1_2.41
- *
- * @brief ResourceImage is an image loaded using a URL.
- *
- * <i>Customizing load requests</i>
- *
- * Size, scaling mode, filter mode, and orientation compensation can be set when requesting an image.
- *
- * <i>Reloading images</i>
- *
- * The same request used on creating the ResourceImage is re-issued when reloading images.
- * If the file changed since the last load operation, this might result in a different resource.
- * Reload only takes effect if the ResourceImage has already finished loading.
- *
- * Signals
- * | %Signal Name | Method |
- * |----------------------|------------------------------|
- * | imageLoadingFinished | @ref LoadingFinishedSignal() |
- * @SINCE_1_0.0
- */
-class DALI_CORE_API ResourceImage : public Image
-{
-public:
-
- /**
- * @DEPRECATED_1_2.41
- *
- * @brief Type of signal for LoadingFinished and Uploaded.
- * @SINCE_1_0.0
- */
- typedef Signal< void (ResourceImage) > ResourceImageSignal;
-
-public:
-
- /**
- * @DEPRECATED_1_2.41
- *
- * @brief Gets the size of an image from disk.
- *
- * This function will read the header info from file on disk and is
- * synchronous, so it should not be used repeatedly or in tight
- * loops.
- *
- * @SINCE_1_0.0
- * @REMARK_STORAGE
- * @param[in] url The URL of the image file
- * @return The width and height in pixels of the image
- */
- static ImageDimensions GetImageSize( const std::string& url ) DALI_DEPRECATED_API;
-
- /**
- * @DEPRECATED_1_2.41
- *
- * @brief Constructor which creates an empty ResourceImage object.
- *
- * Use ResourceImage::New(...) to create an initialised object.
- * @SINCE_1_0.0
- */
- ResourceImage() DALI_DEPRECATED_API;
-
- /**
- * @DEPRECATED_1_2.41
- *
- * @brief Destructor.
- *
- * This is non-virtual since derived Handle types must not contain data or virtual methods.
- * @SINCE_1_0.0
- */
- ~ResourceImage() DALI_DEPRECATED_API;
-
- /**
- * @DEPRECATED_1_2.41
- *
- * @brief This copy constructor is required for (smart) pointer semantics.
- *
- * @SINCE_1_0.0
- * @param[in] handle A reference to the copied handle
- */
- ResourceImage( const ResourceImage& handle ) DALI_DEPRECATED_API;
-
- /**
- * @DEPRECATED_1_2.41
- *
- * @brief This assignment operator is required for (smart) pointer semantics.
- *
- * @SINCE_1_0.0
- * @param[in] rhs A reference to the copied handle
- * @return A reference to this
- */
- ResourceImage& operator=( const ResourceImage& rhs ) DALI_DEPRECATED_API;
-
- /**
- * @name ResourceImageFactoryFunctions
- * Creates ResourceImage object instances using these functions.
- */
- ///@{
-
- /**
- * @DEPRECATED_1_2.41
- *
- * @brief Creates an initialized ResourceImage object.
- *
- * Uses defaults for all options.
- *
- * @sa Dali::FittingMode::Type Dali::SamplingMode::Type
- * @SINCE_1_0.0
- * @REMARK_INTERNET
- * @REMARK_STORAGE
- * @param[in] url The URL of the image file to use
- * @param[in] orientationCorrection Reorient the image to respect any orientation metadata in its header
- * @return A handle to a newly allocated object
- */
- static ResourceImage New( const std::string& url, bool orientationCorrection = true ) DALI_DEPRECATED_API;
-
- /**
- * @DEPRECATED_1_2.41
- *
- * @brief Creates an initialized ResourceImage object.
- *
- * @SINCE_1_0.0
- * @REMARK_INTERNET
- * @REMARK_STORAGE
- * @param[in] url The URL of the image file to use
- * @param[in] size The width and height to fit the loaded image to
- * @param[in] fittingMode The method used to fit the shape of the image before loading to the shape defined by the size parameter
- * @param[in] samplingMode The filtering method used when sampling pixels from the input image while fitting it to desired size
- * @param[in] orientationCorrection Reorient the image to respect any orientation metadata in its header
- * @return A handle to a newly allocated object
- */
- static ResourceImage New( const std::string& url,
- ImageDimensions size,
- FittingMode::Type fittingMode = FittingMode::DEFAULT,
- SamplingMode::Type samplingMode = SamplingMode::DEFAULT,
- bool orientationCorrection = true ) DALI_DEPRECATED_API;
-
- ///@}
-
- /**
- * @DEPRECATED_1_2.41
- *
- * @brief Downcasts a handle to ResourceImage handle.
- *
- * If handle points to a ResourceImage object, the
- * downcast produces valid handle. If not, the returned handle is left uninitialized.
- * @SINCE_1_0.0
- * @param[in] handle Handle to an object
- * @return Handle to a Image object or an uninitialized handle
- */
- static ResourceImage DownCast( BaseHandle handle ) DALI_DEPRECATED_API;
-
- /**
- * @DEPRECATED_1_2.41
- *
- * @brief Queries whether the image data has loaded.
- *
- * The asynchronous loading begins when the Image object is created.
- * After the Image object is discarded, the image data will be released from memory.
- * @SINCE_1_0.0
- * @return The loading state, either Loading, Success or Failed
- */
- LoadingState GetLoadingState() const DALI_DEPRECATED_API;
-
- /**
- * @DEPRECATED_1_2.41
- *
- * @brief Returns the URL of the image.
- *
- * @SINCE_1_0.0
- * @return The URL of the image file
- */
- std::string GetUrl() const DALI_DEPRECATED_API;
-
- /**
- * @DEPRECATED_1_2.41
- *
- * @brief Reloads image from filesystem.
- *
- * The original set of image loading attributes (requested dimensions, scaling
- * mode and filter mode) are used when requesting the image again.
- * @SINCE_1_0.0
- * @note If image is offstage and OnDemand policy is set, the reload request is ignored.
- */
- void Reload() DALI_DEPRECATED_API;
-
-public: // Signals
-
- /**
- * @DEPRECATED_1_2.41
- *
- * @brief Emitted when the image data loads successfully, or when the loading fails.
- *
- * @SINCE_1_0.0
- * @return A signal object to Connect() with
- */
- ResourceImageSignal& LoadingFinishedSignal() DALI_DEPRECATED_API;
-
-public: // Not intended for application developers
-
- explicit DALI_INTERNAL ResourceImage( Internal::ResourceImage* );
-};
-
-/**
- * @}
- */
-} // namespace Dali
-
-#endif // DALI_RESOURCE_IMAGE_H