From: Seungho Baek Date: Wed, 11 Dec 2024 10:16:28 +0000 (+0900) Subject: [NUI] Refactoring of Rendering Directory X-Git-Tag: submit/tizen/20250401.115655~1^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3d2b1b3ec03d24ba5c44dd41ef1c349a9bf343be;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Refactoring of Rendering Directory Signed-off-by: Seungho Baek --- diff --git a/src/Tizen.NUI/src/deprecated/BaseComponents/View_Deprecated.cs b/src/Tizen.NUI/src/deprecated/BaseComponents/View_Deprecated.cs new file mode 100644 index 000000000..542ed3625 --- /dev/null +++ b/src/Tizen.NUI/src/deprecated/BaseComponents/View_Deprecated.cs @@ -0,0 +1,106 @@ +/* + * Copyright(c) 2022 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. + * + */ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Runtime.InteropServices; +using Tizen.NUI.Binding; + +namespace Tizen.NUI.BaseComponents +{ + /// + /// View is the base class for all views. + /// + /// 3 + public partial class View : Container, IResourcesProvider + { + /// + /// Gets the number of renderers held by the view. + /// + /// 3 + public uint RendererCount + { + get + { + return GetRendererCount(); + } + } + + /// + /// Adds a renderer to the view. + /// + /// The renderer to add. + /// The index of the Renderer that was added to the view. + /// 3 + public uint AddRenderer(Renderer renderer) + { + uint ret = Interop.Actor.AddRenderer(SwigCPtr, Renderer.getCPtr(renderer)); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Retrieves the renderer at the specified index. + /// + /// The index of the renderer to retrieve. + /// A Renderer object at the specified index. + /// + /// The index must be between 0 and GetRendererCount()-1 + /// + /// 3 + public Renderer GetRendererAt(uint index) + { + IntPtr cPtr = Interop.Actor.GetRendererAt(SwigCPtr, index); + Renderer ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Renderer; + if (ret != null) + { + Interop.BaseHandle.DeleteBaseHandle(new HandleRef(this, cPtr)); + } + else + { + ret = new Renderer(cPtr, true); + } + NDalicPINVOKE.ThrowExceptionIfExists(); + return ret; + } + + /// + /// Removes the specified renderer from the view. + /// + /// The renderer to remove. + /// 3 + public void RemoveRenderer(Renderer renderer) + { + Interop.Actor.RemoveRenderer(SwigCPtr, Renderer.getCPtr(renderer)); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Removes a renderer at the specified index from the view. + /// + /// The index of the renderer to remove. + /// 3 + public void RemoveRenderer(uint index) + { + Interop.Actor.RemoveRenderer(SwigCPtr, index); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } +} diff --git a/src/Tizen.NUI/src/deprecated/Rendering/FilterModeType_Deprecated.cs b/src/Tizen.NUI/src/deprecated/Rendering/FilterModeType_Deprecated.cs new file mode 100755 index 000000000..e645b259f --- /dev/null +++ b/src/Tizen.NUI/src/deprecated/Rendering/FilterModeType_Deprecated.cs @@ -0,0 +1,67 @@ +/* + * 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. + * + */ + +namespace Tizen.NUI +{ + /// + /// Enumeration of the type of possible filter modes. + /// + /// 3 + public enum FilterModeType + { + /// + /// Use GL defaults (minification NEAREST_MIPMAP_LINEAR, magnification LINEAR). + /// + /// 3 + NONE = 0, + /// + /// Use Dali defaults (minification LINEAR, magnification LINEAR). + /// + /// 3 + DEFAULT, + /// + /// Filter nearest. + /// + /// 3 + NEAREST, + /// + /// Filter linear. + /// + /// 3 + LINEAR, + /// + /// Filter nearest mipmap nearest. + /// + /// 3 + NEAREST_MIPMAP_NEAREST, + /// + /// Filter linear mipmap nearest. + /// + /// 3 + LINEAR_MIPMAP_NEAREST, + /// + /// Filter nearest mipmap linear. + /// + /// 3 + NEAREST_MIPMAP_LINEAR, + /// + /// Filter linear mipmap linear. + /// + /// 3 + LINEAR_MIPMAP_LINEAR + } +} diff --git a/src/Tizen.NUI/src/deprecated/Rendering/Geometry_Deprecated.cs b/src/Tizen.NUI/src/deprecated/Rendering/Geometry_Deprecated.cs new file mode 100755 index 000000000..0d30d7cc5 --- /dev/null +++ b/src/Tizen.NUI/src/deprecated/Rendering/Geometry_Deprecated.cs @@ -0,0 +1,107 @@ +/* + * 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. + * + */ +using System.ComponentModel; + +namespace Tizen.NUI +{ + /// + /// Geometry is handle to an object that can be used to define a geometric elements. + /// + /// 3 + public partial class Geometry : BaseHandle + { + /// + /// Enumeration for the description of the type of geometry, + /// used to determine how the coordinates will be used. + /// + /// Type of primitives this geometry contains. + /// 3 + public enum Type + { + /// + /// Individual points. + /// + POINTS, + + /// + /// Individual lines (made of 2 points each). + /// + LINES, + + /// + /// A strip of lines (made of 1 point each) which also joins the first and last point. + /// + LINE_LOOP, + + /// + /// A strip of lines (made of 1 point each). + /// + LINE_STRIP, + + /// + /// Individual triangles (made of 3 points each). + /// + TRIANGLES, + + /// + /// A fan of triangles around a centre point (after the first triangle, following triangles need only 1 point). + /// + TRIANGLE_FAN, + + /// + /// A strip of triangles (after the first triangle, following triangles need only 1 point). + /// + TRIANGLE_STRIP + } + + /// + /// Adds a PropertyBuffer to be used as source of geometry vertices. + /// + /// PropertyBuffer to be used as source of geometry vertices. + /// Index of the newly added buffer. + /// 3 + public uint AddVertexBuffer(PropertyBuffer vertexBuffer) + { + uint ret = Interop.Geometry.AddVertexBuffer(SwigCPtr, PropertyBuffer.getCPtr(vertexBuffer)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Sets the type of primitives this geometry contains. + /// + /// Array of indices. + /// 3 + public void SetType(Geometry.Type geometryType) + { + Interop.Geometry.SetType(SwigCPtr, (int)geometryType); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Gets the type of primitives this geometry contains. + /// + /// Type of primitives this geometry contains. + /// 3 + public new Geometry.Type GetType() + { + Geometry.Type ret = (Geometry.Type)Interop.Geometry.GetType(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } +} diff --git a/src/Tizen.NUI/src/deprecated/Rendering/RendererConstants_Deprecated.cs b/src/Tizen.NUI/src/deprecated/Rendering/RendererConstants_Deprecated.cs new file mode 100755 index 000000000..b1605b985 --- /dev/null +++ b/src/Tizen.NUI/src/deprecated/Rendering/RendererConstants_Deprecated.cs @@ -0,0 +1,601 @@ +// Copyright (c) 2023 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. + +using System.ComponentModel; + +namespace Tizen.NUI +{ + /// + /// Enumeration for face culling mode. + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public enum FaceCullingModeType + { + /// + /// None of the faces should be culled + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + None = 0, + + /// + /// Cull front face, front faces should never be shown + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Front, + + /// + /// Cull back face, back faces should never be shown + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Back, + + /// + /// Cull front and back faces; if the geometry is composed of triangles none of the faces will be shown + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + FrontAndBack, + } + + /// + /// Enumeration for blend mode. + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public enum BlendModeType + { + /// + /// Blending is disabled. + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Off = 0, + + /// + /// Blending is enabled if there is alpha channel. This is the default mode. + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Auto, + + /// + /// Blending is enabled. + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + On, + + /// + /// Blending is enabled, and don't cull the renderer. + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + OnWithoutCull, + + /// + /// Blending is enabled when the actor is not opaque + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + UseActorOpacity, + } + + /// + /// Enumeration for blend equation. + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public enum BlendEquationType + { + /// + /// The source and destination colors are added to each other. + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Add = 0x8006, + + /// + /// Use minimum value of the source and the destination. + /// + /// + /// It will be supported only if OpenGL es 3.0 or higher version using. + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Min = 0x8007, + + /// + /// Use maximum value of the source and the destination. + /// + /// + /// It will be supported only if OpenGL es 3.0 or higher version using. + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Max = 0x8008, + + /// + /// Subtracts the destination from the source. + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Subtract = 0x800A, + + /// + /// Subtracts the source from the destination. + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + ReverseSubtract = 0x800B, + + //Advanced Blend Equation + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Multiply = 0x9294, + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Screen = 0x9295, + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Overlay = 0x9296, + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Darken = 0x9297, + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Lighten = 0x9298, + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + ColorDodge = 0x9299, + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + ColorBurn = 0x929A, + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + HardLight = 0x929B, + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + SoftLight = 0x929C, + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Difference = 0x929E, + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Exclusion = 0x92A0, + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Hue = 0x92AD, + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Saturation = 0x92AE, + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Color = 0x92AF, + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Luminosity = 0x92B0, + } + + /// + /// Enumeration for blend factor. + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public enum BlendFactorType + { + /// + /// Match as GL_ZERO + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Zero = 0, + + /// + /// Match as GL_ONE + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + One = 1, + + /// + /// Match as GL_SRC_COLOR + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + SrcColor = 0x0300, + + /// + /// Match as GL_ONE_MINUS_SRC_COLOR + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + OneMinusSrcColor = 0x0301, + + /// + /// Match as GL_SRC_ALPHA + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + SrcAlpha = 0x0302, + + /// + /// Match as GL_ONE_MINUS_SRC_ALPHA + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + OneMinusSrcAlpha = 0x0303, + + /// + /// Match as GL_DST_ALPHA + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + DstAlpha = 0x0304, + + /// + /// Match as GL_ONE_MINUS_DST_ALPHA + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + OneMinusDstAlpha = 0x0305, + + /// + /// Match as GL_DST_COLOR + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + DstColor = 0x0306, + + /// + /// Match as GL_ONE_MINUS_DST_COLOR + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + OneMinusDstColor = 0x0307, + + /// + /// Match as GL_SRC_ALPHA_SATURATE + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + SrcAlphaSaturate = 0x0308, + + /// + /// Match as GL_CONSTANT_COLOR + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + ConstantColor = 0x8001, + + /// + /// Match as GL_ONE_MINUS_CONSTANT_COLOR + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + OneMinusConstantColor = 0x8002, + + /// + /// Match as GL_CONSTANT_ALPHA + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + ConstantAlpha = 0x8003, + + /// + /// Match as GL_ONE_MINUS_CONSTANT_ALPHA + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + OneMinusConstantAlpha = 0x8004, + } + + /// + /// Enumeration for depth buffer write modes. + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public enum DepthWriteModeType + { + /// + /// Renderer doesn't write to the depth buffer + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Off = 0, + + /// + /// Renderer only writes to the depth buffer if it's opaque + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Auto, + + /// + /// Renderer writes to the depth buffer + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + On, + } + + /// + /// Enumeration for depth functions. + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public enum DepthFunctionType + { + /// + /// Depth test never passes + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Never = 0, + + /// + /// Depth test always passes + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Always, + + /// + /// Depth test passes if the incoming depth value is less than the stored depth value + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Less, + + /// + /// Depth test passes if the incoming depth value is greater than the stored depth value + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Greater, + + /// + /// Depth test passes if the incoming depth value is equal to the stored depth value + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Equal, + + /// + /// Depth test passes if the incoming depth value is not equal to the stored depth value + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + NotEqual, + + /// + /// Depth test passes if the incoming depth value is less than or equal to the stored depth value + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + LessEqual, + + /// + /// Depth test passes if the incoming depth value is greater than or equal to the stored depth value + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + GreaterEqual, + } + + /// + /// Enumeration for depth buffer test (read) modes. + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public enum DepthTestModeType + { + /// + /// Renderer does not read from the depth buffer + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Off = 0, + + /// + /// Renderer only reads from the depth buffer if in a 3D layer + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Auto, + + /// + /// Renderer reads from the depth buffer based on the DepthFunction + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + On, + } + + /// + /// Enumeration for the controls of how this renderer uses its stencil properties and writes to the color buffer. + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public enum RenderModeType + { + /// + /// Do not write to either color or stencil buffer (But will potentially render to depth buffer). + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + None = 0, + + /// + /// Managed by the View Clipping API. This is the default. + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Auto, + + /// + /// Ingore stencil properties. Write to the color buffer. + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Color, + + /// + /// Use the stencil properties. Do not write to the color buffer. + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Stencil, + + /// + /// Use the stencil properties AND Write to the color buffer. + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + ColorStencil, + } + + /// + /// Enumeration for the comparison function used on the stencil buffer. + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public enum StencilFunctionType + { + /// + /// Always fails + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Never = 0, + + /// + /// Passes if + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Less, + + /// + /// Passes if + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Equal, + + /// + /// Passes if + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + LessEqual, + + /// + /// Passes if ( stencil & mask ) ]]> + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Greater, + + /// + /// Passes if + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + NotEqual, + + /// + /// Passes if = ( stencil & mask ) ]]> + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + GreaterEqual, + + /// + /// Always passes + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Always, + } + + /// + /// Enumeration for specifying the action to take when the stencil (or depth) test fails during stencil test. + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public enum StencilOperationType + { + /// + /// Sets the stencil buffer value to 0 + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Zero = 0, + + /// + /// Keeps the current value + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Keep, + + /// + /// Sets the stencil buffer value to ref, as specified by glStencilFunc + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Replace, + + /// + /// Increments the current stencil buffer value. Clamps to the maximum representable unsigned value + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Increment, + + /// + /// Decrements the current stencil buffer value. Clamps to 0 + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Decrement, + + /// + /// Bitwise inverts the current stencil buffer value + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Invert, + + /// + /// Increments the current stencil buffer value. + /// Wraps stencil buffer value to zero when incrementing the maximum representable unsigned value + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + IncrementWrap, + + /// + /// Decrements the current stencil buffer value. + /// Wraps stencil buffer value to the maximum representable unsigned value when decrementing a stencil buffer value of zero + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + DecrementWrap, + } +} diff --git a/src/Tizen.NUI/src/deprecated/Rendering/Renderer_Deprecated.cs b/src/Tizen.NUI/src/deprecated/Rendering/Renderer_Deprecated.cs new file mode 100755 index 000000000..c245b2e23 --- /dev/null +++ b/src/Tizen.NUI/src/deprecated/Rendering/Renderer_Deprecated.cs @@ -0,0 +1,977 @@ +/* + * 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. + * + */ +using System; +using System.ComponentModel; +using System.Diagnostics.CodeAnalysis; +using System.Runtime.InteropServices; + +namespace Tizen.NUI +{ + /// + /// Renderer is a handle to an object used to show content by combining a Geometry, a TextureSet and a shader. + /// + /// 3 + public class Renderer : Animatable + { + private Geometry CurrentGeometry = null; + private Shader CurrentShader = null; + + /// + /// Create an instance of Renderer. + /// + /// 3 + public Renderer(Geometry geometry, Shader shader) : this(Interop.Renderer.New(Geometry.getCPtr(geometry), Shader.getCPtr(shader)), true) + { + CurrentGeometry = geometry; + CurrentShader = shader; + + NDalicPINVOKE.ThrowExceptionIfExists(); + } + + /// + /// Create an instance of Renderer without Geometry or Shader. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public Renderer() : this(Interop.Renderer.New(), true) + { + NDalicPINVOKE.ThrowExceptionIfExists(); + } + + /// + /// Gets and Sets DepthIndex property. + /// + /// 3 + public int DepthIndex + { + get + { + int temp = 0; + Tizen.NUI.PropertyValue pValue = Tizen.NUI.Object.GetProperty(SwigCPtr, Renderer.Property.DepthIndex); + pValue.Get(out temp); + pValue.Dispose(); + return temp; + } + set + { + var temp = new Tizen.NUI.PropertyValue(value); + Tizen.NUI.Object.SetProperty(SwigCPtr, Renderer.Property.DepthIndex, temp); + temp.Dispose(); + } + } + + /// + /// Gets and Sets FaceCullingMode. + /// + /// 3 + public int FaceCullingMode + { + get + { + return (int)InternalFaceCullingMode; + } + set + { + InternalFaceCullingMode = (FaceCullingModeType)value; + } + } + + /// + /// Gets and Sets FaceCullingMode by FaceCullingModeType enum. + /// + private FaceCullingModeType InternalFaceCullingMode + { + get + { + return (FaceCullingModeType)Object.InternalGetPropertyInt(SwigCPtr, Renderer.Property.FaceCullingMode); + } + set + { + Object.InternalSetPropertyInt(SwigCPtr, Renderer.Property.FaceCullingMode, (int)value); + } + } + + /// + /// Gets and Sets BlendMode. + /// + /// 3 + public int BlendMode + { + get + { + return (int)InternalBlendMode; + } + set + { + InternalBlendMode = (BlendModeType)value; + } + } + + /// + /// Gets and Sets BlendMode by BlendModeType enum. + /// + private BlendModeType InternalBlendMode + { + get + { + return (BlendModeType)Object.InternalGetPropertyInt(SwigCPtr, Renderer.Property.BlendMode); + } + set + { + Object.InternalSetPropertyInt(SwigCPtr, Renderer.Property.BlendMode, (int)value); + } + } + + /// + /// Gets and Sets BlendEquationRgb. + /// + /// 3 + public int BlendEquationRgb + { + get + { + return (int)InternalBlendEquationRgb; + } + set + { + InternalBlendEquationRgb = (BlendEquationType)value; + } + } + + /// + /// Gets and Sets BlendEquationRgb by BlendEquationType enum. + /// + private BlendEquationType InternalBlendEquationRgb + { + get + { + return (BlendEquationType)Object.InternalGetPropertyInt(SwigCPtr, Renderer.Property.BlendEquationRgb); + } + set + { + Object.InternalSetPropertyInt(SwigCPtr, Renderer.Property.BlendEquationRgb, (int)value); + } + } + + /// + /// Gets and Sets BlendEquationAlpha. + /// + /// 3 + public int BlendEquationAlpha + { + get + { + return (int)InternalBlendEquationAlpha; + } + set + { + InternalBlendEquationAlpha = (BlendEquationType)value; + } + } + + /// + /// Gets and Sets BlendEquationRgb by BlendEquationType enum. + /// + private BlendEquationType InternalBlendEquationAlpha + { + get + { + return (BlendEquationType)Object.InternalGetPropertyInt(SwigCPtr, Renderer.Property.BlendEquationAlpha); + } + set + { + Object.InternalSetPropertyInt(SwigCPtr, Renderer.Property.BlendEquationAlpha, (int)value); + } + } + + /// + /// Gets and Sets BlendFactorSrcRgb. + /// + /// 3 + public int BlendFactorSrcRgb + { + get + { + return (int)InternalBlendFactorSrcRgb; + } + set + { + InternalBlendFactorSrcRgb = (BlendFactorType)value; + } + } + + /// + /// Gets and Sets BlendFactorSrcRgb by BlendFactorType enum. + /// + private BlendFactorType InternalBlendFactorSrcRgb + { + get + { + return (BlendFactorType)Object.InternalGetPropertyInt(SwigCPtr, Renderer.Property.BlendFactorSrcRgb); + } + set + { + Object.InternalSetPropertyInt(SwigCPtr, Renderer.Property.BlendFactorSrcRgb, (int)value); + } + } + + /// + /// Gets and Sets BlendFactorDestRgb. + /// + /// 3 + public int BlendFactorDestRgb + { + get + { + return (int)InternalBlendFactorDestRgb; + } + set + { + InternalBlendFactorDestRgb = (BlendFactorType)value; + } + } + + /// + /// Gets and Sets BlendFactorDestRgb by BlendFactorType enum. + /// + private BlendFactorType InternalBlendFactorDestRgb + { + get + { + return (BlendFactorType)Object.InternalGetPropertyInt(SwigCPtr, Renderer.Property.BlendFactorDestRgb); + } + set + { + Object.InternalSetPropertyInt(SwigCPtr, Renderer.Property.BlendFactorDestRgb, (int)value); + } + } + + /// + /// Gets and Sets BlendFactorSrcAlpha. + /// + /// 3 + public int BlendFactorSrcAlpha + { + get + { + return (int)InternalBlendFactorSrcAlpha; + } + set + { + InternalBlendFactorSrcAlpha = (BlendFactorType)value; + } + } + + /// + /// Gets and Sets BlendFactorSrcAlpha by BlendFactorType enum. + /// + private BlendFactorType InternalBlendFactorSrcAlpha + { + get + { + return (BlendFactorType)Object.InternalGetPropertyInt(SwigCPtr, Renderer.Property.BlendFactorSrcAlpha); + } + set + { + Object.InternalSetPropertyInt(SwigCPtr, Renderer.Property.BlendFactorSrcAlpha, (int)value); + } + } + + /// + /// Gets and Sets BlendFactorDestAlpha. + /// + /// 3 + public int BlendFactorDestAlpha + { + get + { + return (int)InternalBlendFactorDestAlpha; + } + set + { + InternalBlendFactorDestAlpha = (BlendFactorType)value; + } + } + + /// + /// Gets and Sets BlendFactorDestAlpha by BlendFactorType enum. + /// + private BlendFactorType InternalBlendFactorDestAlpha + { + get + { + return (BlendFactorType)Object.InternalGetPropertyInt(SwigCPtr, Renderer.Property.BlendFactorDestAlpha); + } + set + { + Object.InternalSetPropertyInt(SwigCPtr, Renderer.Property.BlendFactorDestAlpha, (int)value); + } + } + + /// + /// Gets and Sets BlendColor. + /// + /// 3 + public Vector4 BlendColor + { + get + { + Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); + var pValue = Tizen.NUI.Object.GetProperty(SwigCPtr, Renderer.Property.BlendColor); + pValue.Get(temp); + pValue.Dispose(); + return temp; + } + set + { + var temp = new Tizen.NUI.PropertyValue(value); + Tizen.NUI.Object.SetProperty(SwigCPtr, Renderer.Property.BlendColor, temp); + temp.Dispose(); + } + } + + /// + /// Gets and Sets BlendPreMultipliedAlpha. + /// + /// 3 + public bool BlendPreMultipliedAlpha + { + get + { + bool temp = false; + var pValue = Tizen.NUI.Object.GetProperty(SwigCPtr, Renderer.Property.BlendPreMultipliedAlpha); + pValue.Get(out temp); + pValue.Dispose(); + return temp; + } + set + { + var temp = new Tizen.NUI.PropertyValue(value); + Tizen.NUI.Object.SetProperty(SwigCPtr, Renderer.Property.BlendPreMultipliedAlpha, temp); + temp.Dispose(); + } + } + + /// + /// Gets and Sets IndexRangeFirst. + /// + /// 3 + public int IndexRangeFirst + { + get + { + int temp = 0; + var pValue = Tizen.NUI.Object.GetProperty(SwigCPtr, Renderer.Property.IndexRangeFirst); + pValue.Get(out temp); + pValue.Dispose(); + return temp; + } + set + { + var temp = new Tizen.NUI.PropertyValue(value); + Tizen.NUI.Object.SetProperty(SwigCPtr, Renderer.Property.IndexRangeFirst, temp); + temp.Dispose(); + } + } + + /// + /// Gets and Sets IndexRangeCount. + /// + /// 3 + public int IndexRangeCount + { + get + { + int temp = 0; + var pValue = Tizen.NUI.Object.GetProperty(SwigCPtr, Renderer.Property.IndexRangeCount); + pValue.Get(out temp); + pValue.Dispose(); + return temp; + } + set + { + var temp = new Tizen.NUI.PropertyValue(value); + Tizen.NUI.Object.SetProperty(SwigCPtr, Renderer.Property.IndexRangeCount, temp); + temp.Dispose(); + } + } + + /// + /// Gets and Sets DepthWriteMode. + /// + /// 3 + public int DepthWriteMode + { + get + { + return (int)InternalDepthWriteMode; + } + set + { + InternalDepthWriteMode = (DepthWriteModeType)value; + } + } + + /// + /// Gets and Sets DepthWriteMode by DepthWriteModeType enum. + /// + private DepthWriteModeType InternalDepthWriteMode + { + get + { + return (DepthWriteModeType)Object.InternalGetPropertyInt(SwigCPtr, Renderer.Property.DepthWriteMode); + } + set + { + Object.InternalSetPropertyInt(SwigCPtr, Renderer.Property.DepthWriteMode, (int)value); + } + } + + /// + /// Gets and Sets DepthFunction. + /// + /// 3 + public int DepthFunction + { + get + { + return (int)InternalDepthFunction; + } + set + { + InternalDepthFunction = (DepthFunctionType)value; + } + } + + /// + /// Gets and Sets DepthFunction by DepthFunctionType enum. + /// + private DepthFunctionType InternalDepthFunction + { + get + { + return (DepthFunctionType)Object.InternalGetPropertyInt(SwigCPtr, Renderer.Property.DepthFunction); + } + set + { + Object.InternalSetPropertyInt(SwigCPtr, Renderer.Property.DepthFunction, (int)value); + } + } + + /// + /// Gets and Sets DepthTestMode. + /// + /// 3 + public int DepthTestMode + { + get + { + return (int)InternalDepthTestMode; + } + set + { + InternalDepthTestMode = (DepthTestModeType)value; + } + } + + /// + /// Gets and Sets DepthTestMode by DepthTestModeType enum. + /// + private DepthTestModeType InternalDepthTestMode + { + get + { + return (DepthTestModeType)Object.InternalGetPropertyInt(SwigCPtr, Renderer.Property.DepthTestMode); + } + set + { + Object.InternalSetPropertyInt(SwigCPtr, Renderer.Property.DepthTestMode, (int)value); + } + } + + /// + /// Gets and Sets RenderMode. + /// + /// 3 + public int RenderMode + { + get + { + return (int)InternalRenderMode; + } + set + { + InternalRenderMode = (RenderModeType)value; + } + } + + /// + /// Gets and Sets RenderMode by RenderModeType enum. + /// + private RenderModeType InternalRenderMode + { + get + { + return (RenderModeType)Object.InternalGetPropertyInt(SwigCPtr, Renderer.Property.RenderMode); + } + set + { + Object.InternalSetPropertyInt(SwigCPtr, Renderer.Property.RenderMode, (int)value); + } + } + + /// + /// Gets and Sets StencilFunction. + /// + /// 3 + public int StencilFunction + { + get + { + return (int)InternalStencilFunction; + } + set + { + InternalStencilFunction = (StencilFunctionType)value; + } + } + + /// + /// Gets and Sets StencilFunction by StencilFunctionType enum. + /// + private StencilFunctionType InternalStencilFunction + { + get + { + return (StencilFunctionType)Object.InternalGetPropertyInt(SwigCPtr, Renderer.Property.StencilFunction); + } + set + { + Object.InternalSetPropertyInt(SwigCPtr, Renderer.Property.StencilFunction, (int)value); + } + } + + /// + /// Gets and Sets StencilFunctionMask. + /// + /// 3 + public int StencilFunctionMask + { + get + { + int temp = 0; + var pValue = Tizen.NUI.Object.GetProperty(SwigCPtr, Renderer.Property.StencilFunctionMask); + pValue.Get(out temp); + pValue.Dispose(); + return temp; + } + set + { + var temp = new Tizen.NUI.PropertyValue(value); + Tizen.NUI.Object.SetProperty(SwigCPtr, Renderer.Property.StencilFunctionMask, temp); + temp.Dispose(); + } + } + + /// + /// Gets and Sets StencilFunctionReference. + /// + /// 3 + public int StencilFunctionReference + { + get + { + int temp = 0; + var pValue = Tizen.NUI.Object.GetProperty(SwigCPtr, Renderer.Property.StencilFunctionReference); + pValue.Get(out temp); + pValue.Dispose(); + return temp; + } + set + { + var temp = new Tizen.NUI.PropertyValue(value); + Tizen.NUI.Object.SetProperty(SwigCPtr, Renderer.Property.StencilFunctionReference, temp); + temp.Dispose(); + } + } + + /// + /// Gets and Sets StencilMask. + /// + /// 3 + public int StencilMask + { + get + { + int temp = 0; + var pValue = Tizen.NUI.Object.GetProperty(SwigCPtr, Renderer.Property.StencilMask); + pValue.Get(out temp); + pValue.Dispose(); + return temp; + } + set + { + var temp = new Tizen.NUI.PropertyValue(value); + Tizen.NUI.Object.SetProperty(SwigCPtr, Renderer.Property.StencilMask, temp); + temp.Dispose(); + } + } + + /// + /// Gets and Sets StencilOperationOnFail. + /// + /// 3 + public int StencilOperationOnFail + { + get + { + return (int)InternalStencilOperationOnFail; + } + set + { + InternalStencilOperationOnFail = (StencilOperationType)value; + } + } + + /// + /// Gets and Sets StencilOperationOnFail by StencilOperationType enum. + /// + private StencilOperationType InternalStencilOperationOnFail + { + get + { + return (StencilOperationType)Object.InternalGetPropertyInt(SwigCPtr, Renderer.Property.StencilOperationOnFail); + } + set + { + Object.InternalSetPropertyInt(SwigCPtr, Renderer.Property.StencilOperationOnFail, (int)value); + } + } + + /// + /// Gets and Sets StencilOperationOnZFail. + /// + /// 3 + public int StencilOperationOnZFail + { + get + { + return (int)InternalStencilOperationOnZFail; + } + set + { + InternalStencilOperationOnZFail = (StencilOperationType)value; + } + } + + + /// + /// Gets and Sets StencilOperationOnZFail by StencilOperationType enum. + /// + private StencilOperationType InternalStencilOperationOnZFail + { + get + { + return (StencilOperationType)Object.InternalGetPropertyInt(SwigCPtr, Renderer.Property.StencilOperationOnZFail); + } + set + { + Object.InternalSetPropertyInt(SwigCPtr, Renderer.Property.StencilOperationOnZFail, (int)value); + } + } + + /// + /// Gets and Sets StencilOperationOnZPass property. + /// + /// 3 + public int StencilOperationOnZPass + { + get + { + return (int)InternalStencilOperationOnZPass; + } + set + { + InternalStencilOperationOnZPass = (StencilOperationType)value; + } + } + + /// + /// Gets and Sets StencilOperationOnZPass property by StencilOperationType enum. + /// + private StencilOperationType InternalStencilOperationOnZPass + { + get + { + return (StencilOperationType)Object.InternalGetPropertyInt(SwigCPtr, Renderer.Property.StencilOperationOnZPass); + } + set + { + Object.InternalSetPropertyInt(SwigCPtr, Renderer.Property.StencilOperationOnZPass, (int)value); + } + } + + /// + /// Gets and Sets extents of partial update area. + /// + /// + /// Extents the area - the position and the size - used for the attached View's partial update area calculation. + /// This value be appended after calculate all update area, like visual offset. + /// Change value if you want to change View's partial update area. + /// Warning : Only 0u ~ 65535u integer values are allowed for each parameters. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public UIExtents UpdateArea + { + get + { + // TODO : Clean up below logics + using Extents temp = new Extents(); + using var pValue = Tizen.NUI.Object.GetProperty(SwigCPtr, Renderer.Property.UpdateAreaExtents); + pValue.Get(temp); + + if (temp == null) + { + return new UIExtents(0.0f); + } + UIExtents result = new UIExtents((float)temp.Start, (float)temp.End, (float)temp.Top, (float)temp.Bottom); + return result; + } + set + { + using var temp = new Tizen.NUI.PropertyValue((Extents)value); + Tizen.NUI.Object.SetProperty(SwigCPtr, Renderer.Property.UpdateAreaExtents, temp); + } + } + + /// + /// Sets the geometry to be used by this renderer. + /// + /// The geometry to be used by this renderer. + /// 3 + public void SetGeometry(Geometry geometry) + { + Interop.Renderer.SetGeometry(SwigCPtr, Geometry.getCPtr(CurrentGeometry = geometry)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Gets the geometry used by this renderer. + /// + /// The geometry used by the renderer. + /// 3 + public Geometry GetGeometry() + { + return CurrentGeometry; + } + + /// + /// Sets effective range of indices to draw from bound index buffer. + /// + /// The First element to draw. + /// The number of elements to draw. + /// 3 + public void SetIndexRange(int firstElement, int elementsCount) + { + Interop.Renderer.SetIndexRange(SwigCPtr, firstElement, elementsCount); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Sets the texture set to be used by this renderer. + /// + /// The texture set to be used by this renderer. + /// 3 + public void SetTextures(TextureSet textureSet) + { + Interop.Renderer.SetTextures(SwigCPtr, TextureSet.getCPtr(textureSet)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Gets the texture set used by this renderer. + /// + /// The texture set used by the renderer. + /// 3 + public TextureSet GetTextures() + { + global::System.IntPtr cPtr = Interop.Renderer.GetTextures(SwigCPtr); + TextureSet ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as TextureSet; + if (ret != null) + { + Interop.BaseHandle.DeleteBaseHandle(new global::System.Runtime.InteropServices.HandleRef(this, cPtr)); + } + else + { + ret = new TextureSet(cPtr, true); + } + NDalicPINVOKE.ThrowExceptionIfExists(); + return ret; + } + + /// + /// Sets the shader used by this renderer. + /// + /// The shader to be used by this renderer. + /// 3 + public void SetShader(Shader shader) + { + Interop.Renderer.SetShader(SwigCPtr, Shader.getCPtr(CurrentShader = shader)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Gets the shader used by this renderer. + /// + /// The shader used by the renderer. + /// 3 + public Shader GetShader() + { + return CurrentShader; + } + + internal Renderer(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) + { + } + + /// + /// you can override it to clean-up your own resources. + /// + /// DisposeTypes + [EditorBrowsable(EditorBrowsableState.Never)] + protected override void Dispose(DisposeTypes type) + { + if (Disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + + CurrentGeometry = null; + CurrentShader = null; + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + base.Dispose(type); + } + + /// This will not be public opened. + [EditorBrowsable(EditorBrowsableState.Never)] + protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) + { + Interop.Renderer.DeleteRenderer(swigCPtr); + } + + /// This will be opened API after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Ranges + { + /// This will be opened API after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int BackgroundEffect = Interop.Renderer.RangesBackgroundEffectGet(); + + /// This will be opened API after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int Background = Interop.Renderer.RangesBackgroundGet(); + + /// This will be opened API after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int Content = Interop.Renderer.RangesContentGet(); + + /// This will be opened API after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int Decoration = Interop.Renderer.RangesDecorationGet(); + + /// This will be opened API after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int ForegroundEffect = Interop.Renderer.RangesForegroundEffectGet(); + + + + [Obsolete("Do not use this, that is deprecated in API9 and will be removed in API11. Use BackgroundEffect instead.")] + [EditorBrowsable(EditorBrowsableState.Never)] + [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores", Justification = "")] + public static readonly int BACKGROUND_EFFECT = Interop.Renderer.RangesBackgroundEffectGet(); + + [Obsolete("Do not use this, that is deprecated in API13 and will be removed in API15. Use Background instead.")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int BACKGROUND = Interop.Renderer.RangesBackgroundGet(); + + [Obsolete("Do not use this, that is deprecated in API13 and will be removed in API15. Use Content instead.")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int CONTENT = Interop.Renderer.RangesContentGet(); + + [Obsolete("Do not use this, that is deprecated in API13 and will be removed in API15. Use Decoration instead.")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int DECORATION = Interop.Renderer.RangesDecorationGet(); + + [Obsolete("Do not use this, that is deprecated in API9 and will be removed in API11. Use ForegroundEffect instead.")] + [EditorBrowsable(EditorBrowsableState.Never)] + [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores", Justification = "")] + public static readonly int FOREGROUND_EFFECT = Interop.Renderer.RangesForegroundEffectGet(); + } + + /// + /// Enumeration for instances of properties belonging to the Renderer class. + /// + internal class Property + { + internal static readonly int DepthIndex = Interop.Renderer.DepthIndexGet(); + internal static readonly int FaceCullingMode = Interop.Renderer.FaceCullingModeGet(); + internal static readonly int BlendMode = Interop.Renderer.BlendModeGet(); + internal static readonly int BlendEquationRgb = Interop.Renderer.BlendEquationRgbGet(); + internal static readonly int BlendEquationAlpha = Interop.Renderer.BlendEquationAlphaGet(); + internal static readonly int BlendFactorSrcRgb = Interop.Renderer.BlendFactorSrcRgbGet(); + internal static readonly int BlendFactorDestRgb = Interop.Renderer.BlendFactorDestRgbGet(); + internal static readonly int BlendFactorSrcAlpha = Interop.Renderer.BlendFactorSrcAlphaGet(); + internal static readonly int BlendFactorDestAlpha = Interop.Renderer.BlendFactorDestAlphaGet(); + internal static readonly int BlendColor = Interop.Renderer.BlendColorGet(); + internal static readonly int BlendPreMultipliedAlpha = Interop.Renderer.BlendPreMultipliedAlphaGet(); + internal static readonly int IndexRangeFirst = Interop.Renderer.IndexRangeFirstGet(); + internal static readonly int IndexRangeCount = Interop.Renderer.IndexRangeCountGet(); + internal static readonly int DepthWriteMode = Interop.Renderer.DepthWriteModeGet(); + internal static readonly int DepthFunction = Interop.Renderer.DepthFunctionGet(); + internal static readonly int DepthTestMode = Interop.Renderer.DepthTestModeGet(); + internal static readonly int RenderMode = Interop.Renderer.RenderModeGet(); + internal static readonly int StencilFunction = Interop.Renderer.StencilFunctionGet(); + internal static readonly int StencilFunctionMask = Interop.Renderer.StencilFunctionMaskGet(); + internal static readonly int StencilFunctionReference = Interop.Renderer.StencilFunctionReferenceGet(); + internal static readonly int StencilMask = Interop.Renderer.StencilMaskGet(); + internal static readonly int StencilOperationOnFail = Interop.Renderer.StencilOperationOnFailGet(); + internal static readonly int StencilOperationOnZFail = Interop.Renderer.StencilOperationOnZFailGet(); + internal static readonly int StencilOperationOnZPass = Interop.Renderer.StencilOperationOnZPassGet(); + internal static readonly int MixColor = Interop.Renderer.MixColorGet(); + internal static readonly int MixColorRed = Interop.Renderer.MixColorRedGet(); + internal static readonly int MixColorGreen = Interop.Renderer.MixColorGreenGet(); + internal static readonly int MixColorBlue = Interop.Renderer.MixColorBlueGet(); + internal static readonly int MixColorOpacity = Interop.Renderer.MixColorOpacityGet(); + internal static readonly int RenderingBehavior = Interop.Renderer.RenderingBehaviorGet(); + internal static readonly int BlendEquation = Interop.Renderer.BlendEquationGet(); + internal static readonly int VertexRangeFirst = Interop.Renderer.IndexRangeFirstGet(); + internal static readonly int VertexRangeCount = Interop.Renderer.IndexRangeCountGet(); + internal static readonly int InstanceCount = Interop.Renderer.InstanceCountGet(); + internal static readonly int UpdateAreaExtents = Interop.Renderer.UpdateAreaExtentsGet(); + } + } +} diff --git a/src/Tizen.NUI/src/deprecated/Rendering/Sampler_Deprecated.cs b/src/Tizen.NUI/src/deprecated/Rendering/Sampler_Deprecated.cs new file mode 100755 index 000000000..ddcc35f15 --- /dev/null +++ b/src/Tizen.NUI/src/deprecated/Rendering/Sampler_Deprecated.cs @@ -0,0 +1,39 @@ +/* + * 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. + * + */ +using System.ComponentModel; + +namespace Tizen.NUI +{ + /// + /// Sampler is a handle to an object that can be used to provide the sampling parameters to sample textures. + /// + /// 3 + public partial class Sampler : BaseHandle + { + /// + /// Sets the filter modes for this sampler. + /// + /// The minification filter that will be used. + /// The magnification filter that will be used. + /// 3 + public void SetFilterMode(FilterModeType minFilter, FilterModeType magFilter) + { + Interop.Sampler.SetFilterMode(SwigCPtr, (int)minFilter, (int)magFilter); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } +} diff --git a/src/Tizen.NUI/src/deprecated/Rendering/Shader_Deprecated.cs b/src/Tizen.NUI/src/deprecated/Rendering/Shader_Deprecated.cs new file mode 100755 index 000000000..e50a402a7 --- /dev/null +++ b/src/Tizen.NUI/src/deprecated/Rendering/Shader_Deprecated.cs @@ -0,0 +1,78 @@ +/* + * 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. + * + */ +using System; +using System.ComponentModel; + +namespace Tizen.NUI +{ + /// + /// Shader allows custom vertex and color transformations in the GPU. + /// + /// 3 + public partial class Shader : Animatable + { + /// + /// Creates Shader object. + /// + /// The vertex shader code for the effect. + /// The fragment Shader code for the effect. + /// The hints to define the geometry of the rendered object. + /// 3 + public Shader(string vertexShader, string fragmentShader, Shader.Hint.Value hints) : this(Interop.Shader.New(vertexShader, fragmentShader, (int)hints), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal Shader(string vertexShader, string fragmentShader, Shader.Hint.Value hints, string shaderName) : this(Interop.Shader.New(vertexShader, fragmentShader, (int)hints, shaderName ?? ""), true) + { + Name = shaderName ?? ""; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// The Hint class is used to provide additional information to the shader. + /// + /// 3 + public sealed class Hint + { + /// + /// Enumeration for the hint value. + /// + /// 3 + public enum Value + { + /// + /// No hints. + /// + /// 3 + NONE = 0x00, + + /// + /// Might generate transparent alpha from opaque inputs + /// + /// 3 + OUTPUT_IS_TRANSPARENT = 0x01, + + /// + /// Might change position of vertices, this option disables any culling optimizations + /// + /// 3 + MODIFIES_GEOMETRY = 0x02 + } + } + } +} diff --git a/src/Tizen.NUI/src/deprecated/Rendering/TextureSet_Deprecated.cs b/src/Tizen.NUI/src/deprecated/Rendering/TextureSet_Deprecated.cs new file mode 100755 index 000000000..d89b6109f --- /dev/null +++ b/src/Tizen.NUI/src/deprecated/Rendering/TextureSet_Deprecated.cs @@ -0,0 +1,41 @@ +/* + * 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. + * + */ +using System.ComponentModel; +using System.Runtime.InteropServices; + +namespace Tizen.NUI +{ + /// + /// TextureSet is a handle to an object that specifies the set of images used as textures by a renderer.
+ /// The images have to be ordered in the same order they are declared in the shader. + ///
+ /// 3 + public partial class TextureSet : BaseHandle + { + /// + /// Gets the number of textures present in the TextureSet. + /// + /// The number of textures in the TextureSet. + /// 3 + public uint GetTextureCount() + { + uint ret = Interop.TextureSet.GetTextureCount(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } +} diff --git a/src/Tizen.NUI/src/deprecated/Rendering/TextureType_Deprecated.cs b/src/Tizen.NUI/src/deprecated/Rendering/TextureType_Deprecated.cs new file mode 100755 index 000000000..8ad423d1b --- /dev/null +++ b/src/Tizen.NUI/src/deprecated/Rendering/TextureType_Deprecated.cs @@ -0,0 +1,37 @@ +/* + * 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. + * + */ + +namespace Tizen.NUI +{ + /// + /// The TextureType enumeration defines the types of textures. + /// + /// 3 + public enum TextureType + { + /// + /// One 2D image + /// + /// 3 + TEXTURE_2D, + /// + /// Six 2D images arranged in a cube-shape + /// + /// 3 + TEXTURE_CUBE + } +} diff --git a/src/Tizen.NUI/src/deprecated/Rendering/Texture_Deprecated.cs b/src/Tizen.NUI/src/deprecated/Rendering/Texture_Deprecated.cs new file mode 100644 index 000000000..6030d5abb --- /dev/null +++ b/src/Tizen.NUI/src/deprecated/Rendering/Texture_Deprecated.cs @@ -0,0 +1,60 @@ +/* + * 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. + * + */ +using System; +using System.ComponentModel; + +namespace Tizen.NUI +{ + /// + /// Texture represents a texture object used as input or output by shaders. + /// + /// 3 + public partial class Texture : BaseHandle + { + /// + /// Creates a new Texture object. + /// + /// The type of the texture. + /// The format of the pixel data. + /// The width of the texture. + /// The height of the texture. + /// 3 + public Texture(Tizen.NUI.TextureType type, PixelFormat format, uint width, uint height) : this(Interop.Texture.New((int)type, (int)format, width, height), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Uploads data to the texture from a PixelData object. + /// + /// The pixelData object. + /// The layer of a cube map or array texture. + /// The level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + /// The horizontal offset of the rectangular area in the texture that will be updated. + /// The vertical offset of the rectangular area in the texture that will be updated. + /// The width of the rectangular area in the texture that will be updated. + /// height of the rectangular area in the texture that will be updated. + /// True if the PixelData object has compatible pixel format and fits within the texture, false otherwise. + /// 3 + public bool Upload(PixelData pixelData, uint layer, uint mipmap, uint xOffset, uint yOffset, uint width, uint height) + { + bool ret = Interop.Texture.Upload(SwigCPtr, PixelData.getCPtr(pixelData), layer, mipmap, xOffset, yOffset, width, height); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } +} diff --git a/src/Tizen.NUI/src/deprecated/Rendering/VertexBuffer_Deprecated.cs b/src/Tizen.NUI/src/deprecated/Rendering/VertexBuffer_Deprecated.cs new file mode 100755 index 000000000..ba9a30a03 --- /dev/null +++ b/src/Tizen.NUI/src/deprecated/Rendering/VertexBuffer_Deprecated.cs @@ -0,0 +1,44 @@ +/* + * 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. + * + */ + +using System; +using System.ComponentModel; +using System.Runtime.InteropServices; + +namespace Tizen.NUI +{ + /// + /// VertexBuffer is a handle to an object that contains a buffer of structured data.
+ /// VertexBuffers can be used to provide data to Geometry objects. + ///
+ /// 8 + public partial class VertexBuffer : BaseHandle + { + /// + /// Gets the number of elements in the buffer. + /// + /// Number of elements in the buffer. + /// 8 + public uint GetSize() + { + uint ret = Interop.VertexBuffer.GetSize(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } +} diff --git a/src/Tizen.NUI/src/internal/Rendering/RenderableUtility.cs b/src/Tizen.NUI/src/internal/Rendering/RenderableUtility.cs new file mode 100644 index 000000000..382659270 --- /dev/null +++ b/src/Tizen.NUI/src/internal/Rendering/RenderableUtility.cs @@ -0,0 +1,540 @@ +/* + * Copyright(c) 2024 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. + * + */ + +using System; +using System.ComponentModel; + +namespace Tizen.NUI +{ + /// + /// FadeTransitionItem is an object to set Fade transition of a View that will appear or disappear. + /// FadeTransitionItem object is required to be added to the TransitionSet to play. + /// + internal class RenderableUtility + { + public enum BlendEquationType + { + /// + /// The source and destination colors are added to each other. + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Add = 0x8006, + + /// + /// Use minimum value of the source and the destination. + /// + /// + /// It will be supported only if OpenGL es 3.0 or higher version using. + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Min = 0x8007, + + /// + /// Use maximum value of the source and the destination. + /// + /// + /// It will be supported only if OpenGL es 3.0 or higher version using. + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Max = 0x8008, + + /// + /// Subtracts the destination from the source. + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Subtract = 0x800A, + + /// + /// Subtracts the source from the destination. + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + ReverseSubtract = 0x800B, + + //Advanced Blend Equation + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Multiply = 0x9294, + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Screen = 0x9295, + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Overlay = 0x9296, + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Darken = 0x9297, + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Lighten = 0x9298, + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + ColorDodge = 0x9299, + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + ColorBurn = 0x929A, + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + HardLight = 0x929B, + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + SoftLight = 0x929C, + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Difference = 0x929E, + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Exclusion = 0x92A0, + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Hue = 0x92AD, + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Saturation = 0x92AE, + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Color = 0x92AF, + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Luminosity = 0x92B0, + } + + public static RenderableUtility.BlendEquationType ConvertBlendEquationTypeToUtilityProperty(Tizen.NUI.BlendEquation blendEquationType) + { + switch (blendEquationType) + { + case BlendEquation.Add: + { + return RenderableUtility.BlendEquationType.Add; + } + case BlendEquation.Min: + { + return RenderableUtility.BlendEquationType.Min; + } + case BlendEquation.Max: + { + return RenderableUtility.BlendEquationType.Max; + } + case BlendEquation.Subtract: + { + return RenderableUtility.BlendEquationType.Subtract; + } + case BlendEquation.ReverseSubtract: + { + return RenderableUtility.BlendEquationType.ReverseSubtract; + } + case BlendEquation.Multiply: + { + return RenderableUtility.BlendEquationType.Multiply; + } + case BlendEquation.Screen: + { + return RenderableUtility.BlendEquationType.Screen; + } + case BlendEquation.Overlay: + { + return RenderableUtility.BlendEquationType.Overlay; + } + case BlendEquation.Darken: + { + return RenderableUtility.BlendEquationType.Darken; + } + case BlendEquation.Lighten: + { + return RenderableUtility.BlendEquationType.Lighten; + } + case BlendEquation.ColorDodge: + { + return RenderableUtility.BlendEquationType.ColorDodge; + } + case BlendEquation.ColorBurn: + { + return RenderableUtility.BlendEquationType.ColorBurn; + } + case BlendEquation.HardLight: + { + return RenderableUtility.BlendEquationType.HardLight; + } + case BlendEquation.SoftLight: + { + return RenderableUtility.BlendEquationType.SoftLight; + } + case BlendEquation.Difference: + { + return RenderableUtility.BlendEquationType.Difference; + } + case BlendEquation.Exclusion: + { + return RenderableUtility.BlendEquationType.Exclusion; + } + case BlendEquation.Hue: + { + return RenderableUtility.BlendEquationType.Hue; + } + case BlendEquation.Saturation: + { + return RenderableUtility.BlendEquationType.Saturation; + } + case BlendEquation.Color: + { + return RenderableUtility.BlendEquationType.Color; + } + case BlendEquation.Luminosity: + { + return RenderableUtility.BlendEquationType.Luminosity; + } + } + return RenderableUtility.BlendEquationType.Add; + } + + public static Tizen.NUI.BlendEquation ConvertBlendEquationTypeFromUtilityProperty(RenderableUtility.BlendEquationType blendEquationType) + { + switch (blendEquationType) + { + case RenderableUtility.BlendEquationType.Add: + { + return BlendEquation.Add; + } + case RenderableUtility.BlendEquationType.Min: + { + return BlendEquation.Min; + } + case RenderableUtility.BlendEquationType.Max: + { + return BlendEquation.Max; + } + case RenderableUtility.BlendEquationType.Subtract: + { + return BlendEquation.Subtract; + } + case RenderableUtility.BlendEquationType.ReverseSubtract: + { + return BlendEquation.ReverseSubtract; + } + case RenderableUtility.BlendEquationType.Multiply: + { + return BlendEquation.Multiply; + } + case RenderableUtility.BlendEquationType.Screen: + { + return BlendEquation.Screen; + } + case RenderableUtility.BlendEquationType.Overlay: + { + return BlendEquation.Overlay; + } + case RenderableUtility.BlendEquationType.Darken: + { + return BlendEquation.Darken; + } + case RenderableUtility.BlendEquationType.Lighten: + { + return BlendEquation.Lighten; + } + case RenderableUtility.BlendEquationType.ColorDodge: + { + return BlendEquation.ColorDodge; + } + case RenderableUtility.BlendEquationType.ColorBurn: + { + return BlendEquation.ColorBurn; + } + case RenderableUtility.BlendEquationType.HardLight: + { + return BlendEquation.HardLight; + } + case RenderableUtility.BlendEquationType.SoftLight: + { + return BlendEquation.SoftLight; + } + case RenderableUtility.BlendEquationType.Difference: + { + return BlendEquation.Difference; + } + case RenderableUtility.BlendEquationType.Exclusion: + { + return BlendEquation.Exclusion; + } + case RenderableUtility.BlendEquationType.Hue: + { + return BlendEquation.Hue; + } + case RenderableUtility.BlendEquationType.Saturation: + { + return BlendEquation.Saturation; + } + case RenderableUtility.BlendEquationType.Color: + { + return BlendEquation.Color; + } + case RenderableUtility.BlendEquationType.Luminosity: + { + return BlendEquation.Luminosity; + } + } + return BlendEquation.Add; + } + + public enum BlendFactorType + { + /// + /// Match as GL_ZERO + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + Zero = 0, + + /// + /// Match as GL_ONE + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + One = 1, + + /// + /// Match as GL_SRC_COLOR + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + SourceColor = 0x0300, + + /// + /// Match as GL_ONE_MINUS_SRC_COLOR + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + OneMinusSourceColor = 0x0301, + + /// + /// Match as GL_SRC_ALPHA + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + SourceAlpha = 0x0302, + + /// + /// Match as GL_ONE_MINUS_SRC_ALPHA + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + OneMinusSourceAlpha = 0x0303, + + /// + /// Match as GL_DST_ALPHA + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + DestinationAlpha = 0x0304, + + /// + /// Match as GL_ONE_MINUS_DST_ALPHA + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + OneMinusDestinationAlpha = 0x0305, + + /// + /// Match as GL_DST_COLOR + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + DestinationColor = 0x0306, + + /// + /// Match as GL_ONE_MINUS_DST_COLOR + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + OneMinusDestinationColor = 0x0307, + + /// + /// Match as GL_SRC_ALPHA_SATURATE + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + SourceAlphaSaturate = 0x0308, + + /// + /// Match as GL_CONSTANT_COLOR + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + ConstantColor = 0x8001, + + /// + /// Match as GL_ONE_MINUS_CONSTANT_COLOR + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + OneMinusConstantColor = 0x8002, + + /// + /// Match as GL_CONSTANT_ALPHA + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + ConstantAlpha = 0x8003, + + /// + /// Match as GL_ONE_MINUS_CONSTANT_ALPHA + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + OneMinusConstantAlpha = 0x8004, + } + + public static RenderableUtility.BlendFactorType ConvertBlendFactorTypeToUtilityProperty(Tizen.NUI.BlendFactor blendFactorType) + { + switch (blendFactorType) + { + case Tizen.NUI.BlendFactor.Zero: + { + return RenderableUtility.BlendFactorType.Zero; + } + case Tizen.NUI.BlendFactor.One: + { + return RenderableUtility.BlendFactorType.One; + } + case Tizen.NUI.BlendFactor.SourceColor: + { + return RenderableUtility.BlendFactorType.SourceColor; + } + case Tizen.NUI.BlendFactor.OneMinusSourceColor: + { + return RenderableUtility.BlendFactorType.OneMinusSourceColor; + } + case Tizen.NUI.BlendFactor.SourceAlpha: + { + return RenderableUtility.BlendFactorType.SourceAlpha; + } + case Tizen.NUI.BlendFactor.OneMinusSourceAlpha: + { + return RenderableUtility.BlendFactorType.OneMinusSourceAlpha; + } + case Tizen.NUI.BlendFactor.DestinationAlpha: + { + return RenderableUtility.BlendFactorType.DestinationAlpha; + } + case Tizen.NUI.BlendFactor.OneMinusDestinationAlpha: + { + return RenderableUtility.BlendFactorType.OneMinusDestinationAlpha; + } + case Tizen.NUI.BlendFactor.DestinationColor: + { + return RenderableUtility.BlendFactorType.DestinationColor; + } + case Tizen.NUI.BlendFactor.OneMinusDestinationColor: + { + return RenderableUtility.BlendFactorType.OneMinusDestinationColor; + } + case Tizen.NUI.BlendFactor.SourceAlphaSaturate: + { + return RenderableUtility.BlendFactorType.SourceAlphaSaturate; + } + case Tizen.NUI.BlendFactor.ConstantColor: + { + return RenderableUtility.BlendFactorType.ConstantColor; + } + case Tizen.NUI.BlendFactor.OneMinusConstantColor: + { + return RenderableUtility.BlendFactorType.OneMinusConstantColor; + } + case Tizen.NUI.BlendFactor.ConstantAlpha: + { + return RenderableUtility.BlendFactorType.ConstantAlpha; + } + case Tizen.NUI.BlendFactor.OneMinusConstantAlpha: + { + return RenderableUtility.BlendFactorType.OneMinusConstantAlpha; + } + } + return RenderableUtility.BlendFactorType.Zero; + } + + public static BlendFactor ConvertBlendFactorTypeFromUtilityProperty(Tizen.NUI.RenderableUtility.BlendFactorType blendFactorType) + { + switch (blendFactorType) + { + case Tizen.NUI.RenderableUtility.BlendFactorType.Zero: + { + return BlendFactor.Zero; + } + case Tizen.NUI.RenderableUtility.BlendFactorType.One: + { + return BlendFactor.One; + } + case Tizen.NUI.RenderableUtility.BlendFactorType.SourceColor: + { + return BlendFactor.SourceColor; + } + case Tizen.NUI.RenderableUtility.BlendFactorType.OneMinusSourceColor: + { + return BlendFactor.OneMinusSourceColor; + } + case Tizen.NUI.RenderableUtility.BlendFactorType.SourceAlpha: + { + return BlendFactor.SourceAlpha; + } + case Tizen.NUI.RenderableUtility.BlendFactorType.OneMinusSourceAlpha: + { + return BlendFactor.OneMinusSourceAlpha; + } + case Tizen.NUI.RenderableUtility.BlendFactorType.DestinationAlpha: + { + return BlendFactor.DestinationAlpha; + } + case Tizen.NUI.RenderableUtility.BlendFactorType.OneMinusDestinationAlpha: + { + return BlendFactor.OneMinusDestinationAlpha; + } + case Tizen.NUI.RenderableUtility.BlendFactorType.DestinationColor: + { + return BlendFactor.DestinationColor; + } + case Tizen.NUI.RenderableUtility.BlendFactorType.OneMinusDestinationColor: + { + return BlendFactor.OneMinusDestinationColor; + } + case Tizen.NUI.RenderableUtility.BlendFactorType.SourceAlphaSaturate: + { + return BlendFactor.SourceAlphaSaturate; + } + case Tizen.NUI.RenderableUtility.BlendFactorType.ConstantColor: + { + return BlendFactor.ConstantColor; + } + case Tizen.NUI.RenderableUtility.BlendFactorType.OneMinusConstantColor: + { + return BlendFactor.OneMinusConstantColor; + } + case Tizen.NUI.RenderableUtility.BlendFactorType.ConstantAlpha: + { + return BlendFactor.ConstantAlpha; + } + case Tizen.NUI.RenderableUtility.BlendFactorType.OneMinusConstantAlpha: + { + return BlendFactor.OneMinusConstantAlpha; + } + } + return BlendFactor.Zero; + } + } +} diff --git a/src/Tizen.NUI/src/internal/Rendering/RendererProperty.cs b/src/Tizen.NUI/src/internal/Rendering/RendererProperty.cs new file mode 100644 index 000000000..362911b44 --- /dev/null +++ b/src/Tizen.NUI/src/internal/Rendering/RendererProperty.cs @@ -0,0 +1,53 @@ +/* + * Copyright(c) 2024 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. + * + */ + +using System; +using System.ComponentModel; + +namespace Tizen.NUI +{ + /// + /// Enumeration for instances of properties belonging to the Renderer class. + /// + internal class RendererProperty + { + internal static readonly int DepthIndex = Interop.Renderer.DepthIndexGet(); + internal static readonly int FaceCullingMode = Interop.Renderer.FaceCullingModeGet(); + internal static readonly int BlendMode = Interop.Renderer.BlendModeGet(); + internal static readonly int BlendEquationRgb = Interop.Renderer.BlendEquationRgbGet(); + internal static readonly int BlendEquationAlpha = Interop.Renderer.BlendEquationAlphaGet(); + internal static readonly int BlendFactorSrcRgb = Interop.Renderer.BlendFactorSrcRgbGet(); + internal static readonly int BlendFactorDestRgb = Interop.Renderer.BlendFactorDestRgbGet(); + internal static readonly int BlendFactorSrcAlpha = Interop.Renderer.BlendFactorSrcAlphaGet(); + internal static readonly int BlendFactorDestAlpha = Interop.Renderer.BlendFactorDestAlphaGet(); + internal static readonly int BlendColor = Interop.Renderer.BlendColorGet(); + internal static readonly int BlendPreMultipliedAlpha = Interop.Renderer.BlendPreMultipliedAlphaGet(); + internal static readonly int IndexRangeFirst = Interop.Renderer.IndexRangeFirstGet(); + internal static readonly int IndexRangeCount = Interop.Renderer.IndexRangeCountGet(); + internal static readonly int DepthWriteMode = Interop.Renderer.DepthWriteModeGet(); + internal static readonly int DepthFunction = Interop.Renderer.DepthFunctionGet(); + internal static readonly int DepthTestMode = Interop.Renderer.DepthTestModeGet(); + internal static readonly int RenderMode = Interop.Renderer.RenderModeGet(); + internal static readonly int StencilFunction = Interop.Renderer.StencilFunctionGet(); + internal static readonly int StencilFunctionMask = Interop.Renderer.StencilFunctionMaskGet(); + internal static readonly int StencilFunctionReference = Interop.Renderer.StencilFunctionReferenceGet(); + internal static readonly int StencilMask = Interop.Renderer.StencilMaskGet(); + internal static readonly int StencilOperationOnFail = Interop.Renderer.StencilOperationOnFailGet(); + internal static readonly int StencilOperationOnZFail = Interop.Renderer.StencilOperationOnZFailGet(); + internal static readonly int StencilOperationOnZPass = Interop.Renderer.StencilOperationOnZPassGet(); + } +} \ No newline at end of file diff --git a/src/Tizen.NUI/src/internal/Rendering/SamplerUtility.cs b/src/Tizen.NUI/src/internal/Rendering/SamplerUtility.cs new file mode 100644 index 000000000..55580eab4 --- /dev/null +++ b/src/Tizen.NUI/src/internal/Rendering/SamplerUtility.cs @@ -0,0 +1,82 @@ +/* + * Copyright(c) 2024 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. + * + */ + +using System; +using System.ComponentModel; + +namespace Tizen.NUI +{ + /// + /// FadeTransitionItem is an object to set Fade transition of a View that will appear or disappear. + /// FadeTransitionItem object is required to be added to the TransitionSet to play. + /// + internal class SamplerUtility + { + public enum PresetFilter + { + None = 0, + Default, + Nearest, + Linear, + NearestMipmapNearest, + LinearMipmapNearest, + NearestMipmapLinear, + LinearMipmapLinear + } + + public static PresetFilter GetPresetFilter(SamplerFilter samplerFilter, MipmapFilter mipmapFilter = MipmapFilter.None) + { + if(samplerFilter == SamplerFilter.Nearest) + { + switch(mipmapFilter) + { + case MipmapFilter.None: + { + return PresetFilter.Nearest; + } + case MipmapFilter.Nearest: + { + return PresetFilter.NearestMipmapNearest; + } + case MipmapFilter.Linear: + { + return PresetFilter.NearestMipmapLinear; + } + } + } + else if(samplerFilter == SamplerFilter.Linear) + { + switch(mipmapFilter) + { + case MipmapFilter.None: + { + return PresetFilter.Linear; + } + case MipmapFilter.Nearest: + { + return PresetFilter.LinearMipmapNearest; + } + case MipmapFilter.Linear: + { + return PresetFilter.LinearMipmapLinear; + } + } + } + return PresetFilter.None; + } + } +} diff --git a/src/Tizen.NUI/src/public/BaseComponents/View.cs b/src/Tizen.NUI/src/public/BaseComponents/View.cs index 9ce2bd8e8..e4abf63fc 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/View.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/View.cs @@ -5202,8 +5202,8 @@ namespace Tizen.NUI.BaseComponents /// /// Gets the number of renderers held by the view. /// - /// 3 - public uint RendererCount + [EditorBrowsable(EditorBrowsableState.Never)] + public uint RenderableCount { get { diff --git a/src/Tizen.NUI/src/public/BaseComponents/ViewPublicMethods.cs b/src/Tizen.NUI/src/public/BaseComponents/ViewPublicMethods.cs index 5c3da3e6d..b142d98b1 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ViewPublicMethods.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ViewPublicMethods.cs @@ -620,62 +620,62 @@ namespace Tizen.NUI.BaseComponents } /// - /// Adds a renderer to the view. + /// Adds a renderable to the view. /// - /// The renderer to add. - /// The index of the Renderer that was added to the view. - /// 3 - public uint AddRenderer(Renderer renderer) + /// The renderable to add. + /// The index of the Renderable that was added to the view. + [EditorBrowsable(EditorBrowsableState.Never)] + public uint AddRenderable(Renderable renderable) { - uint ret = Interop.Actor.AddRenderer(SwigCPtr, Renderer.getCPtr(renderer)); + uint ret = Interop.Actor.AddRenderer(SwigCPtr, Renderable.getCPtr(renderable)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } /// - /// Retrieves the renderer at the specified index. + /// Retrieves the renderable at the specified index. /// - /// The index of the renderer to retrieve. - /// A Renderer object at the specified index. + /// The index of the renderable to retrieve. + /// A Renderable object at the specified index. /// - /// The index must be between 0 and GetRendererCount()-1 + /// The index must be between 0 and GetRenderableCount()-1 /// - /// 3 - public Renderer GetRendererAt(uint index) + [EditorBrowsable(EditorBrowsableState.Never)] + public Renderable GetRenderableAt(uint index) { IntPtr cPtr = Interop.Actor.GetRendererAt(SwigCPtr, index); - Renderer ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Renderer; + Renderable ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Renderable; if (ret != null) { Interop.BaseHandle.DeleteBaseHandle(new HandleRef(this, cPtr)); } else { - ret = new Renderer(cPtr, true); + ret = new Renderable(cPtr, true); } NDalicPINVOKE.ThrowExceptionIfExists(); return ret; } /// - /// Removes the specified renderer from the view. + /// Removes the specified renderable from the view. /// - /// The renderer to remove. - /// 3 - public void RemoveRenderer(Renderer renderer) + /// The renderable to remove. + [EditorBrowsable(EditorBrowsableState.Never)] + public void RemoveRenderable(Renderable renderable) { - Interop.Actor.RemoveRenderer(SwigCPtr, Renderer.getCPtr(renderer)); + Interop.Actor.RemoveRenderer(SwigCPtr, Renderable.getCPtr(renderable)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// Removes a renderer at the specified index from the view. + /// Removes a renderable at the specified index from the view. /// - /// The index of the renderer to remove. - /// 3 - public void RemoveRenderer(uint index) + /// The index of the renderable to remove. + [EditorBrowsable(EditorBrowsableState.Never)] + public void RemoveRenderable(uint index) { Interop.Actor.RemoveRenderer(SwigCPtr, index); if (NDalicPINVOKE.SWIGPendingException.Pending) diff --git a/src/Tizen.NUI/src/public/Rendering/DepthIndexRange.cs b/src/Tizen.NUI/src/public/Rendering/DepthIndexRange.cs new file mode 100644 index 000000000..b56c88d29 --- /dev/null +++ b/src/Tizen.NUI/src/public/Rendering/DepthIndexRange.cs @@ -0,0 +1,71 @@ +// Copyright (c) 2025 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. + +using System; +using System.ComponentModel; +using System.Diagnostics.CodeAnalysis; + +namespace Tizen.NUI +{ + /// + /// DepthIndex is used to define order of Renderable in a View + /// A Renderable has larger number of DepthIndex will be rendered after than those have small number of DepthIndex. + /// + /// This will be opened API after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class DepthIndexRanges + { + /// + /// If DepthIndex of a Renderable is set below the BackgroundEffect, + /// The Renderable is rendered before the shadow of the View. + /// + /// This will be opened API after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int BackgroundEffect = Interop.Renderer.RangesBackgroundEffectGet(); + + /// + /// If DepthIndex of a Renderable is between BackgroundEffect and Background + /// The Renderable is rendered after shadow and before background of the View. + /// + /// This will be opened API after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int Background = Interop.Renderer.RangesBackgroundGet(); + + /// + /// If DepthIndex of a Renderable is between Background and Content + /// The Renderable is rendered after background and before content of the View. + /// For example, the Content of ImageView is image. + /// + /// This will be opened API after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int Content = Interop.Renderer.RangesContentGet(); + + /// + /// If DepthIndex of a Renderable is between Content and Decoration + /// + /// This will be opened API after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int Decoration = Interop.Renderer.RangesDecorationGet(); + + /// + /// If DepthIndex of a Renderable is between Content and Decoration + /// + /// This will be opened API after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int ForegroundEffect = Interop.Renderer.RangesForegroundEffectGet(); + + // TODO: Min, max + // TODO: Needs Decoration and ForegroundEffect? more accuratly. + } +} \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/Rendering/FilterModeType.cs b/src/Tizen.NUI/src/public/Rendering/FilterModeType.cs deleted file mode 100755 index e645b259f..000000000 --- a/src/Tizen.NUI/src/public/Rendering/FilterModeType.cs +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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. - * - */ - -namespace Tizen.NUI -{ - /// - /// Enumeration of the type of possible filter modes. - /// - /// 3 - public enum FilterModeType - { - /// - /// Use GL defaults (minification NEAREST_MIPMAP_LINEAR, magnification LINEAR). - /// - /// 3 - NONE = 0, - /// - /// Use Dali defaults (minification LINEAR, magnification LINEAR). - /// - /// 3 - DEFAULT, - /// - /// Filter nearest. - /// - /// 3 - NEAREST, - /// - /// Filter linear. - /// - /// 3 - LINEAR, - /// - /// Filter nearest mipmap nearest. - /// - /// 3 - NEAREST_MIPMAP_NEAREST, - /// - /// Filter linear mipmap nearest. - /// - /// 3 - LINEAR_MIPMAP_NEAREST, - /// - /// Filter nearest mipmap linear. - /// - /// 3 - NEAREST_MIPMAP_LINEAR, - /// - /// Filter linear mipmap linear. - /// - /// 3 - LINEAR_MIPMAP_LINEAR - } -} diff --git a/src/Tizen.NUI/src/public/Rendering/Geometry.cs b/src/Tizen.NUI/src/public/Rendering/Geometry.cs index 4c35f88eb..660621de4 100755 --- a/src/Tizen.NUI/src/public/Rendering/Geometry.cs +++ b/src/Tizen.NUI/src/public/Rendering/Geometry.cs @@ -1,5 +1,5 @@ /* - * Copyright(c) 2021 Samsung Electronics Co., Ltd. + * Copyright(c) 2025 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,9 +20,10 @@ namespace Tizen.NUI { /// /// Geometry is handle to an object that can be used to define a geometric elements. + /// The geometry is defined by VertexBuffer and IndexBuffer. /// /// 3 - public class Geometry : BaseHandle + public partial class Geometry : BaseHandle { /// /// Create an instance of Geometry. @@ -37,61 +38,23 @@ namespace Tizen.NUI { } - /// - /// Enumeration for the description of the type of geometry, - /// used to determine how the coordinates will be used. + /// , + /// Sets and gets PrimitiveType /// - /// Type of primitives this geometry contains. - /// 3 - public enum Type - { - /// - /// Individual points. - /// - POINTS, - - /// - /// Individual lines (made of 2 points each). - /// - LINES, - - /// - /// A strip of lines (made of 1 point each) which also joins the first and last point. - /// - LINE_LOOP, - - /// - /// A strip of lines (made of 1 point each). - /// - LINE_STRIP, - - /// - /// Individual triangles (made of 3 points each). - /// - TRIANGLES, - - /// - /// A fan of triangles around a centre point (after the first triangle, following triangles need only 1 point). - /// - TRIANGLE_FAN, - - /// - /// A strip of triangles (after the first triangle, following triangles need only 1 point). - /// - TRIANGLE_STRIP - } - - /// - /// Adds a PropertyBuffer to be used as source of geometry vertices. - /// - /// PropertyBuffer to be used as source of geometry vertices. - /// Index of the newly added buffer. - /// 3 - public uint AddVertexBuffer(PropertyBuffer vertexBuffer) + /// + /// The PremitiveType should be matched with Vertex and Index Buffer. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public PrimitiveType PrimitiveType { - uint ret = Interop.Geometry.AddVertexBuffer(SwigCPtr, PropertyBuffer.getCPtr(vertexBuffer)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + get + { + return GetPrimitiveType(); + } + set + { + SetPrimitiveType(value); + } } /// @@ -147,11 +110,11 @@ namespace Tizen.NUI /// /// Sets the type of primitives this geometry contains. /// - /// Array of indices. - /// 3 - public void SetType(Geometry.Type geometryType) + /// Array of indices. + [EditorBrowsable(EditorBrowsableState.Never)] + private void SetPrimitiveType(PrimitiveType primitiveType) { - Interop.Geometry.SetType(SwigCPtr, (int)geometryType); + Interop.Geometry.SetType(SwigCPtr, (int)primitiveType); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } @@ -159,10 +122,10 @@ namespace Tizen.NUI /// Gets the type of primitives this geometry contains. /// /// Type of primitives this geometry contains. - /// 3 - public new Geometry.Type GetType() + [EditorBrowsable(EditorBrowsableState.Never)] + private PrimitiveType GetPrimitiveType() { - Geometry.Type ret = (Geometry.Type)Interop.Geometry.GetType(SwigCPtr); + PrimitiveType ret = (PrimitiveType)Interop.Geometry.GetType(SwigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/public/Rendering/MipmapFilter.cs b/src/Tizen.NUI/src/public/Rendering/MipmapFilter.cs new file mode 100644 index 000000000..b4d11f59f --- /dev/null +++ b/src/Tizen.NUI/src/public/Rendering/MipmapFilter.cs @@ -0,0 +1,43 @@ +// Copyright (c) 2025 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. + +using System.ComponentModel; + +namespace Tizen.NUI +{ + /// + /// Specifies the mipmap filtering metho + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public enum MipmapFilter + { + /// + /// No mipmap usage + /// + [EditorBrowsable(EditorBrowsableState.Never)] + None, + + /// + /// Uses the nearest mipmap level + /// + [EditorBrowsable(EditorBrowsableState.Never)] + Nearest, + + /// + /// Uses liniear interpolation between mipmap levels + /// + [EditorBrowsable(EditorBrowsableState.Never)] + Linear + } +} \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/Rendering/PrimitiveType.cs b/src/Tizen.NUI/src/public/Rendering/PrimitiveType.cs new file mode 100644 index 000000000..873d70037 --- /dev/null +++ b/src/Tizen.NUI/src/public/Rendering/PrimitiveType.cs @@ -0,0 +1,68 @@ +// Copyright (c) 2025 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. + +using System.ComponentModel; + +namespace Tizen.NUI +{ + /// + /// Enumeration for the description of the type of primitive mesh, + /// used to determine how the coordinates will be used. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public enum PrimitiveType + { + /// + /// Individual points. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + Points, + + /// + /// Individual lines (made of 2 points each). + /// + [EditorBrowsable(EditorBrowsableState.Never)] + Lines, + + /// + /// A strip of lines (made of 1 point each) which also joins the first and last point. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + LineLoop, + + /// + /// A strip of lines (made of 1 point each). + /// + [EditorBrowsable(EditorBrowsableState.Never)] + LineStrip, + + /// + /// Individual triangles (made of 3 points each). + /// + [EditorBrowsable(EditorBrowsableState.Never)] + Triangles, + + /// + /// A fan of triangles around a centre point (after the first triangle, following triangles need only 1 point). + /// + [EditorBrowsable(EditorBrowsableState.Never)] + TriangleFan, + + /// + /// A strip of triangles (after the first triangle, following triangles need only 1 point). + /// + [EditorBrowsable(EditorBrowsableState.Never)] + TriangleStrip + } +} \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/Rendering/Renderable.cs b/src/Tizen.NUI/src/public/Rendering/Renderable.cs new file mode 100755 index 000000000..5c298f1df --- /dev/null +++ b/src/Tizen.NUI/src/public/Rendering/Renderable.cs @@ -0,0 +1,495 @@ +/* + * Copyright(c) 2025 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. + * + */ +using System; +using System.ComponentModel; +using System.Diagnostics.CodeAnalysis; +using System.Runtime.InteropServices; + +namespace Tizen.NUI +{ + /// + /// Renderable is a handle to an object used to show content by combining a Geometry, a TextureSet and a shader. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public partial class Renderable : Animatable + { + private Geometry geometry = null; + private Shader shader = null; + + /// + /// Create an instance of Renderable without Geometry or Shader. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public Renderable() : this(Interop.Renderer.New(), true) + { + NDalicPINVOKE.ThrowExceptionIfExists(); + } + + /// + /// Gets and Sets DepthIndex property. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public int DepthIndex + { + get + { + int temp = 0; + Tizen.NUI.PropertyValue pValue = Tizen.NUI.Object.GetProperty(SwigCPtr, RendererProperty.DepthIndex); + pValue.Get(out temp); + pValue.Dispose(); + return temp; + } + set + { + var temp = new Tizen.NUI.PropertyValue(value); + Tizen.NUI.Object.SetProperty(SwigCPtr, RendererProperty.DepthIndex, temp); + temp.Dispose(); + } + } + + /// + /// Gets and Sets FaceCullingMode to define which face is culled or not. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public FaceCullingMode FaceCullingMode + { + get => (FaceCullingMode)Object.InternalGetPropertyInt(SwigCPtr, RendererProperty.FaceCullingMode); + set => Object.InternalSetPropertyInt(SwigCPtr, RendererProperty.FaceCullingMode, (int)value); + } + + /// + /// Gets and Sets BlendMode. + /// BlendMode defines how source and destination colors are blended. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public BlendMode BlendMode + { + get => (BlendMode)Object.InternalGetPropertyInt(SwigCPtr, RendererProperty.BlendMode); + set => Object.InternalSetPropertyInt(SwigCPtr, RendererProperty.BlendMode, (int)value); + } + + /// + /// Gets and Sets BlendEquation method for RGB channel. + /// BlendEquation specifies the mathematical operation for blending. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public BlendEquation BlendEquationRgb + { + get => RenderableUtility.ConvertBlendEquationTypeFromUtilityProperty((RenderableUtility.BlendEquationType)Object.InternalGetPropertyInt(SwigCPtr, RendererProperty.BlendEquationRgb)); + set => Object.InternalSetPropertyInt(SwigCPtr, RendererProperty.BlendEquationRgb, (int)RenderableUtility.ConvertBlendEquationTypeToUtilityProperty(value)); + } + + /// + /// Gets and Sets BlendEquation method for Alpha channel. + /// BlendEquation specifies the mathematical operation for blending. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public BlendEquation BlendEquationAlpha + { + get => RenderableUtility.ConvertBlendEquationTypeFromUtilityProperty((RenderableUtility.BlendEquationType)Object.InternalGetPropertyInt(SwigCPtr, RendererProperty.BlendEquationAlpha)); + set => Object.InternalSetPropertyInt(SwigCPtr, RendererProperty.BlendEquationAlpha, (int)RenderableUtility.ConvertBlendEquationTypeToUtilityProperty(value)); + } + + /// + /// Gets and Sets BlendFactor for Rgb channel of Source. + /// BlendFactor determines the weight of source and destination colors. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public BlendFactor BlendFactorSrcRgb + { + get => RenderableUtility.ConvertBlendFactorTypeFromUtilityProperty((RenderableUtility.BlendFactorType)Object.InternalGetPropertyInt(SwigCPtr, RendererProperty.BlendFactorSrcRgb)); + set => Object.InternalSetPropertyInt(SwigCPtr, RendererProperty.BlendFactorSrcRgb, (int)RenderableUtility.ConvertBlendFactorTypeToUtilityProperty(value)); + } + + /// + /// Gets and Sets BlendFactor for Rgb channel of Destination. + /// BlendFactor determines the weight of source and destination colors. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public BlendFactor BlendFactorDestRgb + { + get => RenderableUtility.ConvertBlendFactorTypeFromUtilityProperty((RenderableUtility.BlendFactorType)Object.InternalGetPropertyInt(SwigCPtr, RendererProperty.BlendFactorDestRgb)); + set => Object.InternalSetPropertyInt(SwigCPtr, RendererProperty.BlendFactorDestRgb, (int)RenderableUtility.ConvertBlendFactorTypeToUtilityProperty(value)); + } + + /// + /// Gets and Sets BlendFactor for Alpha channel of Source. + /// BlendFactor determines the weight of source and destination colors. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public BlendFactor BlendFactorSrcAlpha + { + get => RenderableUtility.ConvertBlendFactorTypeFromUtilityProperty((RenderableUtility.BlendFactorType)Object.InternalGetPropertyInt(SwigCPtr, RendererProperty.BlendFactorSrcAlpha)); + set => Object.InternalSetPropertyInt(SwigCPtr, RendererProperty.BlendFactorSrcAlpha, (int)RenderableUtility.ConvertBlendFactorTypeToUtilityProperty(value)); + } + + /// + /// Gets and Sets BlendFactor for Alpha channel of Destination. + /// BlendFactor determines the weight of source and destination colors. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public BlendFactor BlendFactorDestAlpha + { + get => RenderableUtility.ConvertBlendFactorTypeFromUtilityProperty((RenderableUtility.BlendFactorType)Object.InternalGetPropertyInt(SwigCPtr, RendererProperty.BlendFactorDestAlpha)); + set => Object.InternalSetPropertyInt(SwigCPtr, RendererProperty.BlendFactorDestAlpha, (int)RenderableUtility.ConvertBlendFactorTypeToUtilityProperty(value)); + } + + /// + /// Gets and Sets BlendColor. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public Vector4 BlendColor + { + get + { + Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); + var pValue = Tizen.NUI.Object.GetProperty(SwigCPtr, RendererProperty.BlendColor); + pValue.Get(temp); + pValue.Dispose(); + return temp; + } + set + { + var temp = new Tizen.NUI.PropertyValue(value); + Tizen.NUI.Object.SetProperty(SwigCPtr, RendererProperty.BlendColor, temp); + temp.Dispose(); + } + } + + /// + /// Gets and Sets BlendPreMultipliedAlpha. + /// If it is true, it denotes the RGB color values are aleady multiplied by the alpha value. + /// It improves blending accuracy and avoidng artifacts in transparent areas. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public bool BlendPreMultipliedAlpha + { + get + { + bool temp = false; + var pValue = Tizen.NUI.Object.GetProperty(SwigCPtr, RendererProperty.BlendPreMultipliedAlpha); + pValue.Get(out temp); + pValue.Dispose(); + return temp; + } + set + { + var temp = new Tizen.NUI.PropertyValue(value); + Tizen.NUI.Object.SetProperty(SwigCPtr, RendererProperty.BlendPreMultipliedAlpha, temp); + temp.Dispose(); + } + } + + /// + /// Gets and Sets first index to define effective range of indices to draw from bound index buffer. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public int FirstIndex + { + get + { + int temp = 0; + var pValue = Tizen.NUI.Object.GetProperty(SwigCPtr, RendererProperty.IndexRangeFirst); + pValue.Get(out temp); + pValue.Dispose(); + return temp; + } + set + { + var temp = new Tizen.NUI.PropertyValue(value); + Tizen.NUI.Object.SetProperty(SwigCPtr, RendererProperty.IndexRangeFirst, temp); + temp.Dispose(); + } + } + + /// + /// Gets and Sets index count of effective range of indices to draw from bound index buffer. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public int IndexCount + { + get + { + int temp = 0; + var pValue = Tizen.NUI.Object.GetProperty(SwigCPtr, RendererProperty.IndexRangeCount); + pValue.Get(out temp); + pValue.Dispose(); + return temp; + } + set + { + var temp = new Tizen.NUI.PropertyValue(value); + Tizen.NUI.Object.SetProperty(SwigCPtr, RendererProperty.IndexRangeCount, temp); + temp.Dispose(); + } + } + + /// + /// Gets and Sets DepthWriteMode. + /// This property controls wheter depth buffer writing is enabled. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public DepthWriteMode DepthWriteMode + { + get => (DepthWriteMode)Object.InternalGetPropertyInt(SwigCPtr, RendererProperty.DepthWriteMode); + set => Object.InternalSetPropertyInt(SwigCPtr, RendererProperty.DepthWriteMode, (int)value); + } + + /// + /// Gets and Sets DepthFunction. + /// This property defines the comparison function for depth testing + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public DepthFunction DepthFunction + { + get => (DepthFunction)Object.InternalGetPropertyInt(SwigCPtr, RendererProperty.DepthFunction); + set => Object.InternalSetPropertyInt(SwigCPtr, RendererProperty.DepthFunction, (int)value); + } + + /// + /// Gets and Sets DepthTestMode. + /// This property specifies how depth testing is applied to fragments. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public DepthTestMode DepthTestMode + { + get => (DepthTestMode)Object.InternalGetPropertyInt(SwigCPtr, RendererProperty.DepthTestMode); + set => Object.InternalSetPropertyInt(SwigCPtr, RendererProperty.DepthTestMode, (int)value); + } + + /// + /// Gets and Sets RenderMode. + /// This property specifies what aspects of rendering are enabled. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public RenderMode RenderMode + { + get => (RenderMode)Object.InternalGetPropertyInt(SwigCPtr, RendererProperty.RenderMode); + set => Object.InternalSetPropertyInt(SwigCPtr, RendererProperty.RenderMode, (int)value); + } + + /// + /// Gets and Sets Stencil Function. + /// This property specifies the test function for stencil buffering + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public StencilFunction StencilFunction + { + get => (StencilFunction)Object.InternalGetPropertyInt(SwigCPtr, RendererProperty.StencilFunction); + set => Object.InternalSetPropertyInt(SwigCPtr, RendererProperty.StencilFunction, (int)value); + } + + /// + /// Gets and Sets StencilFunctionMask. + /// A bitmask applied to the stencil test function + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public int StencilFunctionMask + { + get + { + int temp = 0; + var pValue = Tizen.NUI.Object.GetProperty(SwigCPtr, RendererProperty.StencilFunctionMask); + pValue.Get(out temp); + pValue.Dispose(); + return temp; + } + set + { + var temp = new Tizen.NUI.PropertyValue(value); + Tizen.NUI.Object.SetProperty(SwigCPtr, RendererProperty.StencilFunctionMask, temp); + temp.Dispose(); + } + } + + /// + /// Gets and Sets StencilFunctionReference. + /// The reference value used in the stencil test. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public int StencilFunctionReference + { + get + { + int temp = 0; + var pValue = Tizen.NUI.Object.GetProperty(SwigCPtr, RendererProperty.StencilFunctionReference); + pValue.Get(out temp); + pValue.Dispose(); + return temp; + } + set + { + var temp = new Tizen.NUI.PropertyValue(value); + Tizen.NUI.Object.SetProperty(SwigCPtr, RendererProperty.StencilFunctionReference, temp); + temp.Dispose(); + } + } + + /// + /// Gets and Sets StencilMask. + /// This property controls which bits of the stencil buffer can be modified. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public int StencilMask + { + get + { + int temp = 0; + var pValue = Tizen.NUI.Object.GetProperty(SwigCPtr, RendererProperty.StencilMask); + pValue.Get(out temp); + pValue.Dispose(); + return temp; + } + set + { + var temp = new Tizen.NUI.PropertyValue(value); + Tizen.NUI.Object.SetProperty(SwigCPtr, RendererProperty.StencilMask, temp); + temp.Dispose(); + } + } + + /// + /// Gets and Sets StencilOperationOnFail. + /// Action when the stencil test fails. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public StencilOperation StencilOperationOnFail + { + get => (StencilOperation)Object.InternalGetPropertyInt(SwigCPtr, RendererProperty.StencilOperationOnFail); + set => Object.InternalSetPropertyInt(SwigCPtr, RendererProperty.StencilOperationOnFail, (int)value); + } + + /// + /// Gets and Sets StencilOperationOnZFail. + /// Action when the depth test fails but the stencil test passed. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public StencilOperation StencilOperationOnZFail + { + get => (StencilOperation)Object.InternalGetPropertyInt(SwigCPtr, RendererProperty.StencilOperationOnZFail); + set => Object.InternalSetPropertyInt(SwigCPtr, RendererProperty.StencilOperationOnZFail, (int)value); + } + + /// + /// Gets and Sets StencilOperationOnZPass property. + /// Action when both stencil and depth tests pass. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public StencilOperation StencilOperationOnZPass + { + get => (StencilOperation)Object.InternalGetPropertyInt(SwigCPtr, RendererProperty.StencilOperationOnZPass); + set => Object.InternalSetPropertyInt(SwigCPtr, RendererProperty.StencilOperationOnZPass, (int)value); + } + + /// + /// Gets and Sets Geometry of this Renderable. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public Geometry Geometry + { + get => geometry; + set => SetGeometry(value); + } + + /// + /// Gets and Sets Shader of this Renderable. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public Shader Shader + { + get => shader; + set => SetShader(value); + } + + /// + /// Gets and Sets Textures of this Renderable. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public TextureSet TextureSet + { + get => GetTextures(); + set => SetTextures(value); + } + + /// + /// Sets the geometry to be used by this renderer. + /// + /// The geometry to be used by this renderer. + [EditorBrowsable(EditorBrowsableState.Never)] + private void SetGeometry(Geometry geometry) + { + this.geometry = geometry; + Interop.Renderer.SetGeometry(SwigCPtr, Geometry.getCPtr(this.geometry)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Sets the shader used by this renderer. + /// + /// The shader to be used by this renderer. + [EditorBrowsable(EditorBrowsableState.Never)] + private void SetShader(Shader shader) + { + this.shader = shader; + Interop.Renderer.SetShader(SwigCPtr, Shader.getCPtr(this.shader)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Sets the texture set to be used by this renderer. + /// + /// The texture set to be used by this renderer. + [EditorBrowsable(EditorBrowsableState.Never)] + private void SetTextures(TextureSet textureSet) + { + Interop.Renderer.SetTextures(SwigCPtr, TextureSet.getCPtr(textureSet)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Gets the texture set used by this renderer. + /// + /// The texture set used by the renderer. + [EditorBrowsable(EditorBrowsableState.Never)] + private TextureSet GetTextures() + { + global::System.IntPtr cPtr = Interop.Renderer.GetTextures(SwigCPtr); + TextureSet ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as TextureSet; + if (ret != null) + { + Interop.BaseHandle.DeleteBaseHandle(new global::System.Runtime.InteropServices.HandleRef(this, cPtr)); + } + else + { + ret = new TextureSet(cPtr, true); + } + NDalicPINVOKE.ThrowExceptionIfExists(); + return ret; + } + + internal Renderable(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) + { + } + + /// This will not be public opened. + [EditorBrowsable(EditorBrowsableState.Never)] + protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) + { + Interop.Renderer.DeleteRenderer(swigCPtr); + } + } +} diff --git a/src/Tizen.NUI/src/public/Rendering/Renderer.cs b/src/Tizen.NUI/src/public/Rendering/Renderer.cs deleted file mode 100755 index c245b2e23..000000000 --- a/src/Tizen.NUI/src/public/Rendering/Renderer.cs +++ /dev/null @@ -1,977 +0,0 @@ -/* - * 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. - * - */ -using System; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Runtime.InteropServices; - -namespace Tizen.NUI -{ - /// - /// Renderer is a handle to an object used to show content by combining a Geometry, a TextureSet and a shader. - /// - /// 3 - public class Renderer : Animatable - { - private Geometry CurrentGeometry = null; - private Shader CurrentShader = null; - - /// - /// Create an instance of Renderer. - /// - /// 3 - public Renderer(Geometry geometry, Shader shader) : this(Interop.Renderer.New(Geometry.getCPtr(geometry), Shader.getCPtr(shader)), true) - { - CurrentGeometry = geometry; - CurrentShader = shader; - - NDalicPINVOKE.ThrowExceptionIfExists(); - } - - /// - /// Create an instance of Renderer without Geometry or Shader. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public Renderer() : this(Interop.Renderer.New(), true) - { - NDalicPINVOKE.ThrowExceptionIfExists(); - } - - /// - /// Gets and Sets DepthIndex property. - /// - /// 3 - public int DepthIndex - { - get - { - int temp = 0; - Tizen.NUI.PropertyValue pValue = Tizen.NUI.Object.GetProperty(SwigCPtr, Renderer.Property.DepthIndex); - pValue.Get(out temp); - pValue.Dispose(); - return temp; - } - set - { - var temp = new Tizen.NUI.PropertyValue(value); - Tizen.NUI.Object.SetProperty(SwigCPtr, Renderer.Property.DepthIndex, temp); - temp.Dispose(); - } - } - - /// - /// Gets and Sets FaceCullingMode. - /// - /// 3 - public int FaceCullingMode - { - get - { - return (int)InternalFaceCullingMode; - } - set - { - InternalFaceCullingMode = (FaceCullingModeType)value; - } - } - - /// - /// Gets and Sets FaceCullingMode by FaceCullingModeType enum. - /// - private FaceCullingModeType InternalFaceCullingMode - { - get - { - return (FaceCullingModeType)Object.InternalGetPropertyInt(SwigCPtr, Renderer.Property.FaceCullingMode); - } - set - { - Object.InternalSetPropertyInt(SwigCPtr, Renderer.Property.FaceCullingMode, (int)value); - } - } - - /// - /// Gets and Sets BlendMode. - /// - /// 3 - public int BlendMode - { - get - { - return (int)InternalBlendMode; - } - set - { - InternalBlendMode = (BlendModeType)value; - } - } - - /// - /// Gets and Sets BlendMode by BlendModeType enum. - /// - private BlendModeType InternalBlendMode - { - get - { - return (BlendModeType)Object.InternalGetPropertyInt(SwigCPtr, Renderer.Property.BlendMode); - } - set - { - Object.InternalSetPropertyInt(SwigCPtr, Renderer.Property.BlendMode, (int)value); - } - } - - /// - /// Gets and Sets BlendEquationRgb. - /// - /// 3 - public int BlendEquationRgb - { - get - { - return (int)InternalBlendEquationRgb; - } - set - { - InternalBlendEquationRgb = (BlendEquationType)value; - } - } - - /// - /// Gets and Sets BlendEquationRgb by BlendEquationType enum. - /// - private BlendEquationType InternalBlendEquationRgb - { - get - { - return (BlendEquationType)Object.InternalGetPropertyInt(SwigCPtr, Renderer.Property.BlendEquationRgb); - } - set - { - Object.InternalSetPropertyInt(SwigCPtr, Renderer.Property.BlendEquationRgb, (int)value); - } - } - - /// - /// Gets and Sets BlendEquationAlpha. - /// - /// 3 - public int BlendEquationAlpha - { - get - { - return (int)InternalBlendEquationAlpha; - } - set - { - InternalBlendEquationAlpha = (BlendEquationType)value; - } - } - - /// - /// Gets and Sets BlendEquationRgb by BlendEquationType enum. - /// - private BlendEquationType InternalBlendEquationAlpha - { - get - { - return (BlendEquationType)Object.InternalGetPropertyInt(SwigCPtr, Renderer.Property.BlendEquationAlpha); - } - set - { - Object.InternalSetPropertyInt(SwigCPtr, Renderer.Property.BlendEquationAlpha, (int)value); - } - } - - /// - /// Gets and Sets BlendFactorSrcRgb. - /// - /// 3 - public int BlendFactorSrcRgb - { - get - { - return (int)InternalBlendFactorSrcRgb; - } - set - { - InternalBlendFactorSrcRgb = (BlendFactorType)value; - } - } - - /// - /// Gets and Sets BlendFactorSrcRgb by BlendFactorType enum. - /// - private BlendFactorType InternalBlendFactorSrcRgb - { - get - { - return (BlendFactorType)Object.InternalGetPropertyInt(SwigCPtr, Renderer.Property.BlendFactorSrcRgb); - } - set - { - Object.InternalSetPropertyInt(SwigCPtr, Renderer.Property.BlendFactorSrcRgb, (int)value); - } - } - - /// - /// Gets and Sets BlendFactorDestRgb. - /// - /// 3 - public int BlendFactorDestRgb - { - get - { - return (int)InternalBlendFactorDestRgb; - } - set - { - InternalBlendFactorDestRgb = (BlendFactorType)value; - } - } - - /// - /// Gets and Sets BlendFactorDestRgb by BlendFactorType enum. - /// - private BlendFactorType InternalBlendFactorDestRgb - { - get - { - return (BlendFactorType)Object.InternalGetPropertyInt(SwigCPtr, Renderer.Property.BlendFactorDestRgb); - } - set - { - Object.InternalSetPropertyInt(SwigCPtr, Renderer.Property.BlendFactorDestRgb, (int)value); - } - } - - /// - /// Gets and Sets BlendFactorSrcAlpha. - /// - /// 3 - public int BlendFactorSrcAlpha - { - get - { - return (int)InternalBlendFactorSrcAlpha; - } - set - { - InternalBlendFactorSrcAlpha = (BlendFactorType)value; - } - } - - /// - /// Gets and Sets BlendFactorSrcAlpha by BlendFactorType enum. - /// - private BlendFactorType InternalBlendFactorSrcAlpha - { - get - { - return (BlendFactorType)Object.InternalGetPropertyInt(SwigCPtr, Renderer.Property.BlendFactorSrcAlpha); - } - set - { - Object.InternalSetPropertyInt(SwigCPtr, Renderer.Property.BlendFactorSrcAlpha, (int)value); - } - } - - /// - /// Gets and Sets BlendFactorDestAlpha. - /// - /// 3 - public int BlendFactorDestAlpha - { - get - { - return (int)InternalBlendFactorDestAlpha; - } - set - { - InternalBlendFactorDestAlpha = (BlendFactorType)value; - } - } - - /// - /// Gets and Sets BlendFactorDestAlpha by BlendFactorType enum. - /// - private BlendFactorType InternalBlendFactorDestAlpha - { - get - { - return (BlendFactorType)Object.InternalGetPropertyInt(SwigCPtr, Renderer.Property.BlendFactorDestAlpha); - } - set - { - Object.InternalSetPropertyInt(SwigCPtr, Renderer.Property.BlendFactorDestAlpha, (int)value); - } - } - - /// - /// Gets and Sets BlendColor. - /// - /// 3 - public Vector4 BlendColor - { - get - { - Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); - var pValue = Tizen.NUI.Object.GetProperty(SwigCPtr, Renderer.Property.BlendColor); - pValue.Get(temp); - pValue.Dispose(); - return temp; - } - set - { - var temp = new Tizen.NUI.PropertyValue(value); - Tizen.NUI.Object.SetProperty(SwigCPtr, Renderer.Property.BlendColor, temp); - temp.Dispose(); - } - } - - /// - /// Gets and Sets BlendPreMultipliedAlpha. - /// - /// 3 - public bool BlendPreMultipliedAlpha - { - get - { - bool temp = false; - var pValue = Tizen.NUI.Object.GetProperty(SwigCPtr, Renderer.Property.BlendPreMultipliedAlpha); - pValue.Get(out temp); - pValue.Dispose(); - return temp; - } - set - { - var temp = new Tizen.NUI.PropertyValue(value); - Tizen.NUI.Object.SetProperty(SwigCPtr, Renderer.Property.BlendPreMultipliedAlpha, temp); - temp.Dispose(); - } - } - - /// - /// Gets and Sets IndexRangeFirst. - /// - /// 3 - public int IndexRangeFirst - { - get - { - int temp = 0; - var pValue = Tizen.NUI.Object.GetProperty(SwigCPtr, Renderer.Property.IndexRangeFirst); - pValue.Get(out temp); - pValue.Dispose(); - return temp; - } - set - { - var temp = new Tizen.NUI.PropertyValue(value); - Tizen.NUI.Object.SetProperty(SwigCPtr, Renderer.Property.IndexRangeFirst, temp); - temp.Dispose(); - } - } - - /// - /// Gets and Sets IndexRangeCount. - /// - /// 3 - public int IndexRangeCount - { - get - { - int temp = 0; - var pValue = Tizen.NUI.Object.GetProperty(SwigCPtr, Renderer.Property.IndexRangeCount); - pValue.Get(out temp); - pValue.Dispose(); - return temp; - } - set - { - var temp = new Tizen.NUI.PropertyValue(value); - Tizen.NUI.Object.SetProperty(SwigCPtr, Renderer.Property.IndexRangeCount, temp); - temp.Dispose(); - } - } - - /// - /// Gets and Sets DepthWriteMode. - /// - /// 3 - public int DepthWriteMode - { - get - { - return (int)InternalDepthWriteMode; - } - set - { - InternalDepthWriteMode = (DepthWriteModeType)value; - } - } - - /// - /// Gets and Sets DepthWriteMode by DepthWriteModeType enum. - /// - private DepthWriteModeType InternalDepthWriteMode - { - get - { - return (DepthWriteModeType)Object.InternalGetPropertyInt(SwigCPtr, Renderer.Property.DepthWriteMode); - } - set - { - Object.InternalSetPropertyInt(SwigCPtr, Renderer.Property.DepthWriteMode, (int)value); - } - } - - /// - /// Gets and Sets DepthFunction. - /// - /// 3 - public int DepthFunction - { - get - { - return (int)InternalDepthFunction; - } - set - { - InternalDepthFunction = (DepthFunctionType)value; - } - } - - /// - /// Gets and Sets DepthFunction by DepthFunctionType enum. - /// - private DepthFunctionType InternalDepthFunction - { - get - { - return (DepthFunctionType)Object.InternalGetPropertyInt(SwigCPtr, Renderer.Property.DepthFunction); - } - set - { - Object.InternalSetPropertyInt(SwigCPtr, Renderer.Property.DepthFunction, (int)value); - } - } - - /// - /// Gets and Sets DepthTestMode. - /// - /// 3 - public int DepthTestMode - { - get - { - return (int)InternalDepthTestMode; - } - set - { - InternalDepthTestMode = (DepthTestModeType)value; - } - } - - /// - /// Gets and Sets DepthTestMode by DepthTestModeType enum. - /// - private DepthTestModeType InternalDepthTestMode - { - get - { - return (DepthTestModeType)Object.InternalGetPropertyInt(SwigCPtr, Renderer.Property.DepthTestMode); - } - set - { - Object.InternalSetPropertyInt(SwigCPtr, Renderer.Property.DepthTestMode, (int)value); - } - } - - /// - /// Gets and Sets RenderMode. - /// - /// 3 - public int RenderMode - { - get - { - return (int)InternalRenderMode; - } - set - { - InternalRenderMode = (RenderModeType)value; - } - } - - /// - /// Gets and Sets RenderMode by RenderModeType enum. - /// - private RenderModeType InternalRenderMode - { - get - { - return (RenderModeType)Object.InternalGetPropertyInt(SwigCPtr, Renderer.Property.RenderMode); - } - set - { - Object.InternalSetPropertyInt(SwigCPtr, Renderer.Property.RenderMode, (int)value); - } - } - - /// - /// Gets and Sets StencilFunction. - /// - /// 3 - public int StencilFunction - { - get - { - return (int)InternalStencilFunction; - } - set - { - InternalStencilFunction = (StencilFunctionType)value; - } - } - - /// - /// Gets and Sets StencilFunction by StencilFunctionType enum. - /// - private StencilFunctionType InternalStencilFunction - { - get - { - return (StencilFunctionType)Object.InternalGetPropertyInt(SwigCPtr, Renderer.Property.StencilFunction); - } - set - { - Object.InternalSetPropertyInt(SwigCPtr, Renderer.Property.StencilFunction, (int)value); - } - } - - /// - /// Gets and Sets StencilFunctionMask. - /// - /// 3 - public int StencilFunctionMask - { - get - { - int temp = 0; - var pValue = Tizen.NUI.Object.GetProperty(SwigCPtr, Renderer.Property.StencilFunctionMask); - pValue.Get(out temp); - pValue.Dispose(); - return temp; - } - set - { - var temp = new Tizen.NUI.PropertyValue(value); - Tizen.NUI.Object.SetProperty(SwigCPtr, Renderer.Property.StencilFunctionMask, temp); - temp.Dispose(); - } - } - - /// - /// Gets and Sets StencilFunctionReference. - /// - /// 3 - public int StencilFunctionReference - { - get - { - int temp = 0; - var pValue = Tizen.NUI.Object.GetProperty(SwigCPtr, Renderer.Property.StencilFunctionReference); - pValue.Get(out temp); - pValue.Dispose(); - return temp; - } - set - { - var temp = new Tizen.NUI.PropertyValue(value); - Tizen.NUI.Object.SetProperty(SwigCPtr, Renderer.Property.StencilFunctionReference, temp); - temp.Dispose(); - } - } - - /// - /// Gets and Sets StencilMask. - /// - /// 3 - public int StencilMask - { - get - { - int temp = 0; - var pValue = Tizen.NUI.Object.GetProperty(SwigCPtr, Renderer.Property.StencilMask); - pValue.Get(out temp); - pValue.Dispose(); - return temp; - } - set - { - var temp = new Tizen.NUI.PropertyValue(value); - Tizen.NUI.Object.SetProperty(SwigCPtr, Renderer.Property.StencilMask, temp); - temp.Dispose(); - } - } - - /// - /// Gets and Sets StencilOperationOnFail. - /// - /// 3 - public int StencilOperationOnFail - { - get - { - return (int)InternalStencilOperationOnFail; - } - set - { - InternalStencilOperationOnFail = (StencilOperationType)value; - } - } - - /// - /// Gets and Sets StencilOperationOnFail by StencilOperationType enum. - /// - private StencilOperationType InternalStencilOperationOnFail - { - get - { - return (StencilOperationType)Object.InternalGetPropertyInt(SwigCPtr, Renderer.Property.StencilOperationOnFail); - } - set - { - Object.InternalSetPropertyInt(SwigCPtr, Renderer.Property.StencilOperationOnFail, (int)value); - } - } - - /// - /// Gets and Sets StencilOperationOnZFail. - /// - /// 3 - public int StencilOperationOnZFail - { - get - { - return (int)InternalStencilOperationOnZFail; - } - set - { - InternalStencilOperationOnZFail = (StencilOperationType)value; - } - } - - - /// - /// Gets and Sets StencilOperationOnZFail by StencilOperationType enum. - /// - private StencilOperationType InternalStencilOperationOnZFail - { - get - { - return (StencilOperationType)Object.InternalGetPropertyInt(SwigCPtr, Renderer.Property.StencilOperationOnZFail); - } - set - { - Object.InternalSetPropertyInt(SwigCPtr, Renderer.Property.StencilOperationOnZFail, (int)value); - } - } - - /// - /// Gets and Sets StencilOperationOnZPass property. - /// - /// 3 - public int StencilOperationOnZPass - { - get - { - return (int)InternalStencilOperationOnZPass; - } - set - { - InternalStencilOperationOnZPass = (StencilOperationType)value; - } - } - - /// - /// Gets and Sets StencilOperationOnZPass property by StencilOperationType enum. - /// - private StencilOperationType InternalStencilOperationOnZPass - { - get - { - return (StencilOperationType)Object.InternalGetPropertyInt(SwigCPtr, Renderer.Property.StencilOperationOnZPass); - } - set - { - Object.InternalSetPropertyInt(SwigCPtr, Renderer.Property.StencilOperationOnZPass, (int)value); - } - } - - /// - /// Gets and Sets extents of partial update area. - /// - /// - /// Extents the area - the position and the size - used for the attached View's partial update area calculation. - /// This value be appended after calculate all update area, like visual offset. - /// Change value if you want to change View's partial update area. - /// Warning : Only 0u ~ 65535u integer values are allowed for each parameters. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public UIExtents UpdateArea - { - get - { - // TODO : Clean up below logics - using Extents temp = new Extents(); - using var pValue = Tizen.NUI.Object.GetProperty(SwigCPtr, Renderer.Property.UpdateAreaExtents); - pValue.Get(temp); - - if (temp == null) - { - return new UIExtents(0.0f); - } - UIExtents result = new UIExtents((float)temp.Start, (float)temp.End, (float)temp.Top, (float)temp.Bottom); - return result; - } - set - { - using var temp = new Tizen.NUI.PropertyValue((Extents)value); - Tizen.NUI.Object.SetProperty(SwigCPtr, Renderer.Property.UpdateAreaExtents, temp); - } - } - - /// - /// Sets the geometry to be used by this renderer. - /// - /// The geometry to be used by this renderer. - /// 3 - public void SetGeometry(Geometry geometry) - { - Interop.Renderer.SetGeometry(SwigCPtr, Geometry.getCPtr(CurrentGeometry = geometry)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Gets the geometry used by this renderer. - /// - /// The geometry used by the renderer. - /// 3 - public Geometry GetGeometry() - { - return CurrentGeometry; - } - - /// - /// Sets effective range of indices to draw from bound index buffer. - /// - /// The First element to draw. - /// The number of elements to draw. - /// 3 - public void SetIndexRange(int firstElement, int elementsCount) - { - Interop.Renderer.SetIndexRange(SwigCPtr, firstElement, elementsCount); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Sets the texture set to be used by this renderer. - /// - /// The texture set to be used by this renderer. - /// 3 - public void SetTextures(TextureSet textureSet) - { - Interop.Renderer.SetTextures(SwigCPtr, TextureSet.getCPtr(textureSet)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Gets the texture set used by this renderer. - /// - /// The texture set used by the renderer. - /// 3 - public TextureSet GetTextures() - { - global::System.IntPtr cPtr = Interop.Renderer.GetTextures(SwigCPtr); - TextureSet ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as TextureSet; - if (ret != null) - { - Interop.BaseHandle.DeleteBaseHandle(new global::System.Runtime.InteropServices.HandleRef(this, cPtr)); - } - else - { - ret = new TextureSet(cPtr, true); - } - NDalicPINVOKE.ThrowExceptionIfExists(); - return ret; - } - - /// - /// Sets the shader used by this renderer. - /// - /// The shader to be used by this renderer. - /// 3 - public void SetShader(Shader shader) - { - Interop.Renderer.SetShader(SwigCPtr, Shader.getCPtr(CurrentShader = shader)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Gets the shader used by this renderer. - /// - /// The shader used by the renderer. - /// 3 - public Shader GetShader() - { - return CurrentShader; - } - - internal Renderer(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) - { - } - - /// - /// you can override it to clean-up your own resources. - /// - /// DisposeTypes - [EditorBrowsable(EditorBrowsableState.Never)] - protected override void Dispose(DisposeTypes type) - { - if (Disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - CurrentGeometry = null; - CurrentShader = null; - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - base.Dispose(type); - } - - /// This will not be public opened. - [EditorBrowsable(EditorBrowsableState.Never)] - protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) - { - Interop.Renderer.DeleteRenderer(swigCPtr); - } - - /// This will be opened API after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public sealed class Ranges - { - /// This will be opened API after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly int BackgroundEffect = Interop.Renderer.RangesBackgroundEffectGet(); - - /// This will be opened API after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly int Background = Interop.Renderer.RangesBackgroundGet(); - - /// This will be opened API after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly int Content = Interop.Renderer.RangesContentGet(); - - /// This will be opened API after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly int Decoration = Interop.Renderer.RangesDecorationGet(); - - /// This will be opened API after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly int ForegroundEffect = Interop.Renderer.RangesForegroundEffectGet(); - - - - [Obsolete("Do not use this, that is deprecated in API9 and will be removed in API11. Use BackgroundEffect instead.")] - [EditorBrowsable(EditorBrowsableState.Never)] - [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores", Justification = "")] - public static readonly int BACKGROUND_EFFECT = Interop.Renderer.RangesBackgroundEffectGet(); - - [Obsolete("Do not use this, that is deprecated in API13 and will be removed in API15. Use Background instead.")] - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly int BACKGROUND = Interop.Renderer.RangesBackgroundGet(); - - [Obsolete("Do not use this, that is deprecated in API13 and will be removed in API15. Use Content instead.")] - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly int CONTENT = Interop.Renderer.RangesContentGet(); - - [Obsolete("Do not use this, that is deprecated in API13 and will be removed in API15. Use Decoration instead.")] - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly int DECORATION = Interop.Renderer.RangesDecorationGet(); - - [Obsolete("Do not use this, that is deprecated in API9 and will be removed in API11. Use ForegroundEffect instead.")] - [EditorBrowsable(EditorBrowsableState.Never)] - [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores", Justification = "")] - public static readonly int FOREGROUND_EFFECT = Interop.Renderer.RangesForegroundEffectGet(); - } - - /// - /// Enumeration for instances of properties belonging to the Renderer class. - /// - internal class Property - { - internal static readonly int DepthIndex = Interop.Renderer.DepthIndexGet(); - internal static readonly int FaceCullingMode = Interop.Renderer.FaceCullingModeGet(); - internal static readonly int BlendMode = Interop.Renderer.BlendModeGet(); - internal static readonly int BlendEquationRgb = Interop.Renderer.BlendEquationRgbGet(); - internal static readonly int BlendEquationAlpha = Interop.Renderer.BlendEquationAlphaGet(); - internal static readonly int BlendFactorSrcRgb = Interop.Renderer.BlendFactorSrcRgbGet(); - internal static readonly int BlendFactorDestRgb = Interop.Renderer.BlendFactorDestRgbGet(); - internal static readonly int BlendFactorSrcAlpha = Interop.Renderer.BlendFactorSrcAlphaGet(); - internal static readonly int BlendFactorDestAlpha = Interop.Renderer.BlendFactorDestAlphaGet(); - internal static readonly int BlendColor = Interop.Renderer.BlendColorGet(); - internal static readonly int BlendPreMultipliedAlpha = Interop.Renderer.BlendPreMultipliedAlphaGet(); - internal static readonly int IndexRangeFirst = Interop.Renderer.IndexRangeFirstGet(); - internal static readonly int IndexRangeCount = Interop.Renderer.IndexRangeCountGet(); - internal static readonly int DepthWriteMode = Interop.Renderer.DepthWriteModeGet(); - internal static readonly int DepthFunction = Interop.Renderer.DepthFunctionGet(); - internal static readonly int DepthTestMode = Interop.Renderer.DepthTestModeGet(); - internal static readonly int RenderMode = Interop.Renderer.RenderModeGet(); - internal static readonly int StencilFunction = Interop.Renderer.StencilFunctionGet(); - internal static readonly int StencilFunctionMask = Interop.Renderer.StencilFunctionMaskGet(); - internal static readonly int StencilFunctionReference = Interop.Renderer.StencilFunctionReferenceGet(); - internal static readonly int StencilMask = Interop.Renderer.StencilMaskGet(); - internal static readonly int StencilOperationOnFail = Interop.Renderer.StencilOperationOnFailGet(); - internal static readonly int StencilOperationOnZFail = Interop.Renderer.StencilOperationOnZFailGet(); - internal static readonly int StencilOperationOnZPass = Interop.Renderer.StencilOperationOnZPassGet(); - internal static readonly int MixColor = Interop.Renderer.MixColorGet(); - internal static readonly int MixColorRed = Interop.Renderer.MixColorRedGet(); - internal static readonly int MixColorGreen = Interop.Renderer.MixColorGreenGet(); - internal static readonly int MixColorBlue = Interop.Renderer.MixColorBlueGet(); - internal static readonly int MixColorOpacity = Interop.Renderer.MixColorOpacityGet(); - internal static readonly int RenderingBehavior = Interop.Renderer.RenderingBehaviorGet(); - internal static readonly int BlendEquation = Interop.Renderer.BlendEquationGet(); - internal static readonly int VertexRangeFirst = Interop.Renderer.IndexRangeFirstGet(); - internal static readonly int VertexRangeCount = Interop.Renderer.IndexRangeCountGet(); - internal static readonly int InstanceCount = Interop.Renderer.InstanceCountGet(); - internal static readonly int UpdateAreaExtents = Interop.Renderer.UpdateAreaExtentsGet(); - } - } -} diff --git a/src/Tizen.NUI/src/public/Rendering/RendererConstants.cs b/src/Tizen.NUI/src/public/Rendering/RendererConstants.cs index b1605b985..811a8b412 100755 --- a/src/Tizen.NUI/src/public/Rendering/RendererConstants.cs +++ b/src/Tizen.NUI/src/public/Rendering/RendererConstants.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Samsung Electronics Co., Ltd. +// Copyright (c) 2025 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. @@ -21,7 +21,7 @@ namespace Tizen.NUI /// /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public enum FaceCullingModeType + public enum FaceCullingMode { /// /// None of the faces should be culled @@ -57,7 +57,7 @@ namespace Tizen.NUI /// /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public enum BlendModeType + public enum BlendMode { /// /// Blending is disabled. @@ -100,14 +100,14 @@ namespace Tizen.NUI /// /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public enum BlendEquationType + public enum BlendEquation { /// /// The source and destination colors are added to each other. /// /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - Add = 0x8006, + Add = 0, /// /// Use minimum value of the source and the destination. @@ -117,7 +117,7 @@ namespace Tizen.NUI /// /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - Min = 0x8007, + Min, /// /// Use maximum value of the source and the destination. @@ -127,68 +127,68 @@ namespace Tizen.NUI /// /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - Max = 0x8008, + Max, /// /// Subtracts the destination from the source. /// /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - Subtract = 0x800A, + Subtract, /// /// Subtracts the source from the destination. /// /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - ReverseSubtract = 0x800B, + ReverseSubtract, //Advanced Blend Equation /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - Multiply = 0x9294, + Multiply, /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - Screen = 0x9295, + Screen, /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - Overlay = 0x9296, + Overlay, /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - Darken = 0x9297, + Darken, /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - Lighten = 0x9298, + Lighten, /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - ColorDodge = 0x9299, + ColorDodge, /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - ColorBurn = 0x929A, + ColorBurn, /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - HardLight = 0x929B, + HardLight, /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - SoftLight = 0x929C, + SoftLight, /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - Difference = 0x929E, + Difference, /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - Exclusion = 0x92A0, + Exclusion, /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - Hue = 0x92AD, + Hue, /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - Saturation = 0x92AE, + Saturation, /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - Color = 0x92AF, + Color, /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - Luminosity = 0x92B0, + Luminosity, } /// @@ -196,7 +196,7 @@ namespace Tizen.NUI /// /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public enum BlendFactorType + public enum BlendFactor { /// /// Match as GL_ZERO @@ -210,98 +210,98 @@ namespace Tizen.NUI /// /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - One = 1, + One, /// /// Match as GL_SRC_COLOR /// /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - SrcColor = 0x0300, + SourceColor, /// /// Match as GL_ONE_MINUS_SRC_COLOR /// /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - OneMinusSrcColor = 0x0301, + OneMinusSourceColor, /// /// Match as GL_SRC_ALPHA /// /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - SrcAlpha = 0x0302, + SourceAlpha, /// /// Match as GL_ONE_MINUS_SRC_ALPHA /// /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - OneMinusSrcAlpha = 0x0303, + OneMinusSourceAlpha, /// /// Match as GL_DST_ALPHA /// /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - DstAlpha = 0x0304, + DestinationAlpha, /// /// Match as GL_ONE_MINUS_DST_ALPHA /// /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - OneMinusDstAlpha = 0x0305, + OneMinusDestinationAlpha, /// /// Match as GL_DST_COLOR /// /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - DstColor = 0x0306, + DestinationColor, /// /// Match as GL_ONE_MINUS_DST_COLOR /// /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - OneMinusDstColor = 0x0307, + OneMinusDestinationColor, /// /// Match as GL_SRC_ALPHA_SATURATE /// /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - SrcAlphaSaturate = 0x0308, + SourceAlphaSaturate, /// /// Match as GL_CONSTANT_COLOR /// /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - ConstantColor = 0x8001, + ConstantColor, /// /// Match as GL_ONE_MINUS_CONSTANT_COLOR /// /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - OneMinusConstantColor = 0x8002, + OneMinusConstantColor, /// /// Match as GL_CONSTANT_ALPHA /// /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - ConstantAlpha = 0x8003, + ConstantAlpha, /// /// Match as GL_ONE_MINUS_CONSTANT_ALPHA /// /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - OneMinusConstantAlpha = 0x8004, + OneMinusConstantAlpha, } /// @@ -309,7 +309,7 @@ namespace Tizen.NUI /// /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public enum DepthWriteModeType + public enum DepthWriteMode { /// /// Renderer doesn't write to the depth buffer @@ -338,7 +338,7 @@ namespace Tizen.NUI /// /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public enum DepthFunctionType + public enum DepthFunction { /// /// Depth test never passes @@ -402,7 +402,7 @@ namespace Tizen.NUI /// /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public enum DepthTestModeType + public enum DepthTestMode { /// /// Renderer does not read from the depth buffer @@ -431,7 +431,7 @@ namespace Tizen.NUI /// /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public enum RenderModeType + public enum RenderMode { /// /// Do not write to either color or stencil buffer (But will potentially render to depth buffer). @@ -474,7 +474,7 @@ namespace Tizen.NUI /// /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public enum StencilFunctionType + public enum StencilFunction { /// /// Always fails @@ -538,7 +538,7 @@ namespace Tizen.NUI /// /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public enum StencilOperationType + public enum StencilOperation { /// /// Sets the stencil buffer value to 0 @@ -560,7 +560,7 @@ namespace Tizen.NUI /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] Replace, - + /// /// Increments the current stencil buffer value. Clamps to the maximum representable unsigned value /// @@ -598,4 +598,4 @@ namespace Tizen.NUI [EditorBrowsable(EditorBrowsableState.Never)] DecrementWrap, } -} +} \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/Rendering/Sampler.cs b/src/Tizen.NUI/src/public/Rendering/Sampler.cs index 9084d76aa..bf35ed651 100755 --- a/src/Tizen.NUI/src/public/Rendering/Sampler.cs +++ b/src/Tizen.NUI/src/public/Rendering/Sampler.cs @@ -1,5 +1,5 @@ /* - * Copyright(c) 2017 Samsung Electronics Co., Ltd. + * Copyright(c) 2025 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. @@ -22,8 +22,11 @@ namespace Tizen.NUI /// Sampler is a handle to an object that can be used to provide the sampling parameters to sample textures. /// /// 3 - public class Sampler : BaseHandle + public partial class Sampler : BaseHandle { + private SamplerFilter minificationFilter = SamplerFilter.Linear; + private SamplerFilter magnificationFilter = SamplerFilter.Linear; + private MipmapFilter mipmapFilter = MipmapFilter.None; /// /// Create an instance of Sampler. @@ -35,15 +38,54 @@ namespace Tizen.NUI } /// - /// Sets the filter modes for this sampler. + /// Determines how a texture is sampled when scaled down /// - /// The minification filter that will be used. - /// The magnification filter that will be used. - /// 3 - public void SetFilterMode(FilterModeType minFilter, FilterModeType magFilter) + [EditorBrowsable(EditorBrowsableState.Never)] + public SamplerFilter MinificationFilter { - Interop.Sampler.SetFilterMode(SwigCPtr, (int)minFilter, (int)magFilter); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + get => minificationFilter; + set + { + if (minificationFilter != value) + { + minificationFilter = value; + SetFilterMode(SamplerUtility.GetPresetFilter(minificationFilter, mipmapFilter), SamplerUtility.GetPresetFilter(magnificationFilter)); + } + } + } + + /// + /// Determines how a texture is sampled when scaled up + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public SamplerFilter MagnificationFilter + { + get => magnificationFilter; + set + { + if (magnificationFilter != value) + { + magnificationFilter = value; + SetFilterMode(SamplerUtility.GetPresetFilter(minificationFilter, mipmapFilter), SamplerUtility.GetPresetFilter(magnificationFilter)); + } + } + } + + /// + /// Specifies how mipmaps are used for texture sampling + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public MipmapFilter MipmapFilter + { + get => mipmapFilter; + set + { + if (mipmapFilter != value) + { + mipmapFilter = value; + SetFilterMode(SamplerUtility.GetPresetFilter(minificationFilter, mipmapFilter), SamplerUtility.GetPresetFilter(magnificationFilter)); + } + } } /// @@ -71,6 +113,17 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + /// + /// Sets the filter modes for this sampler. + /// + /// The minification filter that will be used. + /// The magnification filter that will be used. + private void SetFilterMode(SamplerUtility.PresetFilter minFilter, SamplerUtility.PresetFilter magFilter) + { + Interop.Sampler.SetFilterMode(SwigCPtr, (int)minFilter, (int)magFilter); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + internal Sampler(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) { } diff --git a/src/Tizen.NUI/src/public/Rendering/SamplerFilter.cs b/src/Tizen.NUI/src/public/Rendering/SamplerFilter.cs new file mode 100644 index 000000000..cb22e26c6 --- /dev/null +++ b/src/Tizen.NUI/src/public/Rendering/SamplerFilter.cs @@ -0,0 +1,37 @@ +// Copyright (c) 2025 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. + +using System.ComponentModel; + +namespace Tizen.NUI +{ + /// + /// Specifies the sampling filter method + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public enum SamplerFilter + { + /// + /// Uses the nearest texture sample + /// + /// 3 + Nearest, + + /// + /// Uses linear interpolation between texture samples + /// + /// 3 + Linear, + } +} \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/Rendering/Shader.cs b/src/Tizen.NUI/src/public/Rendering/Shader.cs index d55c18166..768cc4605 100755 --- a/src/Tizen.NUI/src/public/Rendering/Shader.cs +++ b/src/Tizen.NUI/src/public/Rendering/Shader.cs @@ -1,5 +1,5 @@ /* - * Copyright(c) 2021 Samsung Electronics Co., Ltd. + * Copyright(c) 2025 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. @@ -23,7 +23,7 @@ namespace Tizen.NUI /// Shader allows custom vertex and color transformations in the GPU. /// /// 3 - public class Shader : Animatable + public partial class Shader : Animatable { /// @@ -32,8 +32,8 @@ namespace Tizen.NUI /// The vertex shader code for the effect. /// The fragment Shader code for the effect. /// The hints to define the geometry of the rendered object. - /// 3 - public Shader(string vertexShader, string fragmentShader, Shader.Hint.Value hints) : this(vertexShader, fragmentShader, hints, "") + [EditorBrowsable(EditorBrowsableState.Never)] + public Shader(string vertexShader, string fragmentShader, ShaderHint hints) : this(vertexShader, fragmentShader, hints, "") { } @@ -43,7 +43,7 @@ namespace Tizen.NUI /// The vertex shader code for the effect. /// The fragment Shader code for the effect. /// 3 - public Shader(string vertexShader, string fragmentShader) : this(vertexShader, fragmentShader, Shader.Hint.Value.NONE, "") + public Shader(string vertexShader, string fragmentShader) : this(vertexShader, fragmentShader, ShaderHint.None, "") { } @@ -54,7 +54,7 @@ namespace Tizen.NUI /// The fragment Shader code for the effect. /// The name of this shader object. [EditorBrowsable(EditorBrowsableState.Never)] - public Shader(string vertexShader, string fragmentShader, string shaderName) : this(vertexShader, fragmentShader, Shader.Hint.Value.NONE, shaderName) + public Shader(string vertexShader, string fragmentShader, string shaderName) : this(vertexShader, fragmentShader, ShaderHint.None, shaderName) { } @@ -97,7 +97,7 @@ namespace Tizen.NUI [EditorBrowsable(EditorBrowsableState.Never)] public string Name { get; private set; } - internal Shader(string vertexShader, string fragmentShader, Shader.Hint.Value hints, string shaderName) : this(Interop.Shader.New(vertexShader, fragmentShader, (int)hints, shaderName ?? ""), true) + internal Shader(string vertexShader, string fragmentShader, ShaderHint hints, string shaderName) : this(Interop.Shader.New(vertexShader, fragmentShader, (int)hints, shaderName ?? ""), true) { Name = shaderName ?? ""; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -114,38 +114,6 @@ namespace Tizen.NUI Interop.Shader.DeleteShader(swigCPtr); } - /// - /// The Hint class is used to provide additional information to the shader. - /// - /// 3 - public sealed class Hint - { - /// - /// Enumeration for the hint value. - /// - /// 3 - public enum Value - { - /// - /// No hints. - /// - /// 3 - NONE = 0x00, - - /// - /// Might generate transparent alpha from opaque inputs - /// - /// 3 - OUTPUT_IS_TRANSPARENT = 0x01, - - /// - /// Might change position of vertices, this option disables any culling optimizations - /// - /// 3 - MODIFIES_GEOMETRY = 0x02 - } - } - /// /// Enumeration for instances of properties belonging to the Shader class. /// diff --git a/src/Tizen.NUI/src/public/Rendering/ShaderHint.cs b/src/Tizen.NUI/src/public/Rendering/ShaderHint.cs new file mode 100644 index 000000000..e3ca42f69 --- /dev/null +++ b/src/Tizen.NUI/src/public/Rendering/ShaderHint.cs @@ -0,0 +1,40 @@ +// Copyright (c) 2025 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. + +using System.ComponentModel; + +namespace Tizen.NUI +{ + /// + /// The Hint class is used to provide additional information to the shader. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public enum ShaderHint + { + /// + /// No hints. + /// + None = 0x00, + + /// + /// Might generate transparent alpha from opaque inputs + /// + TransparentOutput = 0x01, + + /// + /// Might change position of vertices, this option disables any culling optimizations + /// + ModifiesGeometry = 0x02 + } +} \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/Rendering/Texture.cs b/src/Tizen.NUI/src/public/Rendering/Texture.cs index 54b622a55..b7c880eb4 100755 --- a/src/Tizen.NUI/src/public/Rendering/Texture.cs +++ b/src/Tizen.NUI/src/public/Rendering/Texture.cs @@ -1,5 +1,5 @@ /* - * Copyright(c) 2017 Samsung Electronics Co., Ltd. + * Copyright(c) 2025 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. @@ -23,28 +23,26 @@ namespace Tizen.NUI /// Texture represents a texture object used as input or output by shaders. /// /// 3 - public class Texture : BaseHandle + public partial class Texture : BaseHandle { /// /// Creates a new Texture object. /// - /// The type of the texture. + /// The type of the texture. /// The format of the pixel data. /// The width of the texture. /// The height of the texture. - /// 3 - public Texture(TextureType type, PixelFormat format, uint width, uint height) : this(Interop.Texture.New((int)type, (int)format, width, height), true) + [EditorBrowsable(EditorBrowsableState.Never)] + public Texture(TextureShape textureShape, PixelFormat format, uint width, uint height) : this(Interop.Texture.New((int)textureShape, (int)format, width, height), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } [EditorBrowsable(EditorBrowsableState.Never)] public Texture(NativeImageInterface nativeImageInterface) : this(Interop.Texture.New(NativeImageInterface.getCPtr(nativeImageInterface)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } internal Texture(IntPtr tbmSurface) : this(Interop.Texture.NewTbmSurface(tbmSurface), true) @@ -73,17 +71,12 @@ namespace Tizen.NUI /// Uploads data to the texture from a PixelData object. /// /// The pixelData object. - /// The layer of a cube map or array texture. - /// The level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. - /// The horizontal offset of the rectangular area in the texture that will be updated. - /// The vertical offset of the rectangular area in the texture that will be updated. - /// The width of the rectangular area in the texture that will be updated. - /// height of the rectangular area in the texture that will be updated. + /// Properties used to upload PixelData. /// True if the PixelData object has compatible pixel format and fits within the texture, false otherwise. - /// 3 - public bool Upload(PixelData pixelData, uint layer, uint mipmap, uint xOffset, uint yOffset, uint width, uint height) + [EditorBrowsable(EditorBrowsableState.Never)] + public bool Upload(PixelData pixelData, TextureUploadProperties properties) { - bool ret = Interop.Texture.Upload(SwigCPtr, PixelData.getCPtr(pixelData), layer, mipmap, xOffset, yOffset, width, height); + bool ret = Interop.Texture.Upload(SwigCPtr, PixelData.getCPtr(pixelData), properties.layer, properties.mipmap, properties.xOffset, properties.yOffset, properties.width, properties.height); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/public/Rendering/TextureSet.cs b/src/Tizen.NUI/src/public/Rendering/TextureSet.cs index 664aa3af5..ef9b70d50 100755 --- a/src/Tizen.NUI/src/public/Rendering/TextureSet.cs +++ b/src/Tizen.NUI/src/public/Rendering/TextureSet.cs @@ -1,5 +1,5 @@ /* - * Copyright(c) 2019 Samsung Electronics Co., Ltd. + * Copyright(c) 2025 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. @@ -24,9 +24,8 @@ namespace Tizen.NUI /// The images have to be ordered in the same order they are declared in the shader. /// /// 3 - public class TextureSet : BaseHandle + public partial class TextureSet : BaseHandle { - /// /// Create an instance of TextureSet. /// @@ -40,6 +39,15 @@ namespace Tizen.NUI { } + /// + /// Gets texture count. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public uint TextureCount + { + get => RetrieveTextureCount(); + } + /// /// Sets the texture at position "index". /// @@ -112,8 +120,7 @@ namespace Tizen.NUI /// Gets the number of textures present in the TextureSet. /// /// The number of textures in the TextureSet. - /// 3 - public uint GetTextureCount() + private uint RetrieveTextureCount() { uint ret = Interop.TextureSet.GetTextureCount(SwigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/public/Rendering/TextureShape.cs b/src/Tizen.NUI/src/public/Rendering/TextureShape.cs new file mode 100644 index 000000000..5c5491065 --- /dev/null +++ b/src/Tizen.NUI/src/public/Rendering/TextureShape.cs @@ -0,0 +1,36 @@ +// Copyright (c) 2025 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. + +using System.ComponentModel; + +namespace Tizen.NUI +{ + /// + /// Defines shapes of the Texture. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public enum TextureShape + { + /// + /// One 2D image + /// + /// 3 + Texture2D, + /// + /// Six 2D images arranged in a cube-shape + /// + /// 3 + TextureCube + } +} \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/Rendering/TextureType.cs b/src/Tizen.NUI/src/public/Rendering/TextureType.cs deleted file mode 100755 index 8ad423d1b..000000000 --- a/src/Tizen.NUI/src/public/Rendering/TextureType.cs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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. - * - */ - -namespace Tizen.NUI -{ - /// - /// The TextureType enumeration defines the types of textures. - /// - /// 3 - public enum TextureType - { - /// - /// One 2D image - /// - /// 3 - TEXTURE_2D, - /// - /// Six 2D images arranged in a cube-shape - /// - /// 3 - TEXTURE_CUBE - } -} diff --git a/src/Tizen.NUI/src/public/Rendering/TextureUploadProperties.cs b/src/Tizen.NUI/src/public/Rendering/TextureUploadProperties.cs new file mode 100644 index 000000000..5d282b4ad --- /dev/null +++ b/src/Tizen.NUI/src/public/Rendering/TextureUploadProperties.cs @@ -0,0 +1,65 @@ +/* + * Copyright(c) 2025 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. + * + */ + +using System; +using System.ComponentModel; + +namespace Tizen.NUI +{ + /// + /// Structure to define properties for texture upload + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public struct TextureUploadProperties + { + /// + /// The layer of a cube map or array texture. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public uint layer; + + /// + /// The level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public uint mipmap; + + /// + /// The horizontal offset of the rectangular area in the texture that will be updated. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public uint xOffset; + + /// + /// The vertical offset of the rectangular area in the texture that will be updated. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public uint yOffset; + + /// + /// The width of the rectangular area in the texture that will be updated. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public uint width; + + /// + /// height of the rectangular area in the texture that will be updated. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public uint height; + } +} diff --git a/src/Tizen.NUI/src/public/Rendering/VertexBuffer.cs b/src/Tizen.NUI/src/public/Rendering/VertexBuffer.cs index ed16450f2..8d70b0383 100755 --- a/src/Tizen.NUI/src/public/Rendering/VertexBuffer.cs +++ b/src/Tizen.NUI/src/public/Rendering/VertexBuffer.cs @@ -1,5 +1,5 @@ /* - * Copyright(c) 2020 Samsung Electronics Co., Ltd. + * Copyright(c) 2025 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. @@ -26,9 +26,8 @@ namespace Tizen.NUI /// VertexBuffers can be used to provide data to Geometry objects. /// /// 8 - public class VertexBuffer : BaseHandle + public partial class VertexBuffer : BaseHandle { - /// /// The constructor to creates a VertexBuffer. /// @@ -44,6 +43,15 @@ namespace Tizen.NUI { } + /// + /// Gets the number of elements in the buffer. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public uint Size + { + get => RetrieveSize(); + } + /// /// Updates the whole buffer information.
/// This function expects an array of structures with the same format that was given in the construction. @@ -86,8 +94,7 @@ namespace Tizen.NUI /// Gets the number of elements in the buffer. ///
/// Number of elements in the buffer. - /// 8 - public uint GetSize() + private uint RetrieveSize() { uint ret = Interop.VertexBuffer.GetSize(SwigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending)