*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
float max = std::max(rgb.r, std::max(rgb.g, rgb.b));
Vector3 hsl(max - min, 0.f, (max + min) * .5f);
float max = std::max(rgb.r, std::max(rgb.g, rgb.b));
Vector3 hsl(max - min, 0.f, (max + min) * .5f);
- float p = hsl.z * (1.0 - hsl.y);
- float q = hsl.z * (1.0 - (hsl.y * ff));
- float t = hsl.z * (1.0 - (hsl.y * (1.f - ff)));
+ float p = hsl.z * (1.0 - hsl.y);
+ float q = hsl.z * (1.0 - (hsl.y * ff));
+ float t = hsl.z * (1.0 - (hsl.y * (1.f - ff)));
-Geometry CreateTesselatedQuad(unsigned int xVerts, unsigned int yVerts,
- Vector2 scale, VertexFn positionFn, VertexFn texCoordFn)
+Geometry CreateTesselatedQuad(unsigned int xVerts, unsigned int yVerts, Vector2 scale, VertexFn positionFn, VertexFn texCoordFn)
- auto vPos = pos + Vector2{ -.5f, -.5f };
- vertices.push_back(Vertex{ (positionFn ? positionFn(vPos) : vPos) * scale,
- texCoordFn ? texCoordFn(pos) : pos });
+ auto vPos = pos + Vector2{-.5f, -.5f};
+ vertices.push_back(Vertex{(positionFn ? positionFn(vPos) : vPos) * scale,
+ texCoordFn ? texCoordFn(pos) : pos});
- VertexBuffer vertexBuffer = VertexBuffer::New( Property::Map()
- .Add( "aPosition", Property::VECTOR2 )
- .Add( "aTexCoord", Property::VECTOR2 ));
+ VertexBuffer vertexBuffer = VertexBuffer::New(Property::Map()
+ .Add("aPosition", Property::VECTOR2)
+ .Add("aTexCoord", Property::VECTOR2));
- Texture texture = Texture::New(TextureType::TEXTURE_2D, pixelData.GetPixelFormat(),
- pixelData.GetWidth(), pixelData.GetHeight());
+ Texture texture = Texture::New(TextureType::TEXTURE_2D, pixelData.GetPixelFormat(), pixelData.GetWidth(), pixelData.GetHeight());
{
Renderer renderer = Renderer::New(geometry, shader);
renderer.SetProperty(Renderer::Property::BLEND_MODE,
{
Renderer renderer = Renderer::New(geometry, shader);
renderer.SetProperty(Renderer::Property::BLEND_MODE,
- Geometry geom = original.GetGeometry();
- Shader shader = original.GetShader();
- Renderer clone = Renderer::New(geom, shader);
+ Geometry geom = original.GetGeometry();
+ Shader shader = original.GetShader();
+ Renderer clone = Renderer::New(geom, shader);
{
auto actualIndex = Dali::PropertyRanges::DEFAULT_RENDERER_PROPERTY_START_INDEX + i;
clone.SetProperty(actualIndex, original.GetProperty(actualIndex));
{
auto actualIndex = Dali::PropertyRanges::DEFAULT_RENDERER_PROPERTY_START_INDEX + i;
clone.SetProperty(actualIndex, original.GetProperty(actualIndex));
// Don't copy every single one of them.
// Definitely don't copy resize policy related things, which will internally enable
// relayout, which in turn will result in losing the ability to set Z size.
// Don't copy every single one of them.
// Definitely don't copy resize policy related things, which will internally enable
// relayout, which in turn will result in losing the ability to set Z size.
- for (auto i : {
- Actor::Property::PARENT_ORIGIN,
- Actor::Property::ANCHOR_POINT,
- Actor::Property::SIZE,
- Actor::Property::POSITION,
- Actor::Property::ORIENTATION,
- Actor::Property::SCALE,
- Actor::Property::VISIBLE,
- Actor::Property::COLOR,
- Actor::Property::NAME,
- })
+ for(auto i : {
+ Actor::Property::PARENT_ORIGIN,
+ Actor::Property::ANCHOR_POINT,
+ Actor::Property::SIZE,
+ Actor::Property::POSITION,
+ Actor::Property::ORIENTATION,
+ Actor::Property::SCALE,
+ Actor::Property::VISIBLE,
+ Actor::Property::COLOR,
+ Actor::Property::NAME,
+ })