Window shielding body generation method, device, equipment, storage medium and product
Patent Information
- Application Number
- CN202510472112.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-14
- Publication Date
- 2026-10-23
AI Technical Summary
[0005]不同尺寸的2D窗口所对应的圆角率不同,导致不同尺寸的2D窗口需要制定不同尺寸的标准遮挡体,费时费力,且不同尺寸的2D窗口之间不能混用标准遮挡体
[0041]本发明实施例所提供的技术方案,通过根据窗口遮挡体的预设窗口尺寸和渲染画布信息,确定所述窗口遮挡体的窗口坐标信息,此时确定出窗口遮挡体在渲染画布中的摆放位置,以便后续对摆放位置确定的窗口遮挡体的形状进行调整;根据所述窗口坐标信息和预先设置的圆角率信息,确定与所述窗口遮挡体相关联的至少一个圆角区域的至少一个圆角坐标信息;根据所述至少一个圆角区域的至少一个圆角坐标信息,确定所述窗口遮挡体的圆角曲线信息;前述步骤利用预先设置的圆角率信息和窗口坐标信息可以针对窗口遮挡体的每个直角进行圆角化处理,并且由于画布或者显示窗口的宽度和高度不一致会导致同一圆角的水平圆角率和垂直圆角率大小不一致,本发明实施例为了使窗口遮挡体的圆角更加圆滑,从而使最终展示效果柔和、不生硬,可以利用椭圆调整算法对上述圆角进行椭圆化调整,确定出所述窗口遮挡体的圆角曲线信息;基于所述圆角曲线信息和所述窗口坐标信息,生成所述窗口遮挡体,从而可以在渲染画布或显示画面的尺寸发生变化时,动态生成与窗口形状相适配的窗口遮挡体,达到保障展示效果的技术效果。
Smart Images

Figure CN122966912A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a method, apparatus, device, storage medium and product for generating a window occlusion. Background Technology
[0002] In a scene where 3D objects are displayed, in order to allow viewers to browse the 3D scene through a 2D window, an occlusion body that fits the shape of the 2D window is usually generated in advance.
[0003] Currently, the main method for generating occluders that fit the shape of a 2D window is to use a standard model to pre-generate a large number of standard occluders, and when an occluder that fits the shape of a 2D window is needed, select an occluder of a suitable shape from the pre-generated large number of standard occluders.
[0004] When implementing this technical solution based on the above method, the inventors discovered the following problems:
[0005] Different 2D window sizes require different corner radius ratios, necessitating the creation of different standard occluders for each size. This process is time-consuming and labor-intensive, and standard occluders cannot be used interchangeably between 2D windows of different sizes. As the size of 2D windows dynamically increases, standard occluders with low corner radius ratios become unsuitable, resulting in uneven corner connections and a harsh display effect. Summary of the Invention
[0006] This invention provides a method, apparatus, device, storage medium, and product for generating window occlusions, so as to achieve dynamic generation of window occlusions that adapt to the shape of the window, thereby ensuring the technical effect of display.
[0007] In a first aspect, embodiments of the present invention provide a method for generating a window occluder, the method comprising:
[0008] The window coordinate information of the window occluder is determined based on the preset window size and rendering canvas information of the window occluder;
[0009] Based on the window coordinate information and the pre-set corner radius information, determine at least one corner radius coordinate information for at least one corner radius region associated with the window occluder;
[0010] Based on at least one rounded corner coordinate information of the at least one rounded corner region, determine the rounded corner curve information of the window occluder;
[0011] The window occlusion body is generated based on the rounded corner curve information and the window coordinate information.
[0012] Furthermore, determining the window coordinate information of the window occluder based on the preset window size and rendering canvas information of the window occluder includes:
[0013] The coordinate range of the window occlusion is determined based on the preset window size of the window occlusion and the canvas size in the rendering canvas information; wherein, the rendering canvas is the canvas that carries the object to be rendered;
[0014] Based on the coordinate range, the window coordinate information of the window occluder is determined.
[0015] Furthermore, determining the rounded corner curve information of the window occluder based on at least one rounded corner coordinate information of the at least one rounded corner region includes:
[0016] For the at least one rounded corner region, the first texture coordinates of at least one pixel point located in the rounded corner region are determined by interpolation processing of at least one rounded corner coordinate information within the rounded corner region;
[0017] Based on the first texture coordinates and the ellipse adjustment algorithm, the rounded corner curve information of the window occluder is determined.
[0018] Furthermore, the method also includes:
[0019] Acquire at least one screen vertex data within the target display area, and determine the second texture coordinates corresponding to the at least one screen vertex data;
[0020] The visibility type of the screen vertex data is determined based on the second texture coordinates and the window coordinate information of the window occluder.
[0021] The screen vertex data is rendered based on the visual type of the at least one screen vertex data to display the screen vertex data within the window occlusion.
[0022] Furthermore, determining the visibility type of the screen vertex data based on the second texture coordinates and the window coordinate information of the window occluder includes:
[0023] When the second texture coordinates are located within the area corresponding to the window coordinate information, the visibility type of the screen vertex data is determined based on the second texture coordinates and at least one rounded corner coordinate information of the window occluder.
[0024] Furthermore, the method also includes:
[0025] In response to an event that the visual type of the screen vertex data is visual, the visual type of the screen vertex data is determined based on the second texture coordinates and the ellipse adjustment algorithm.
[0026] Furthermore, rendering the screen vertex data based on the visual type of the at least one screen vertex data includes:
[0027] The rendering depth information of the at least one screen vertex data is determined based on the visibility type of the at least one screen vertex data.
[0028] The screen vertex data is rendered into the window occlusion body based on the rendering depth information for display.
[0029] Furthermore, the rendering depth information within the window occlusion body is different from the rendering depth information within the non-window occlusion body.
[0030] Secondly, embodiments of the present invention also provide a window obstruction generation apparatus, the apparatus comprising:
[0031] The window information determination module is used to determine the window coordinate information of the window occluder based on the preset window size and rendering canvas information of the window occluder;
[0032] The rounded corner coordinate determination module is used to determine at least one rounded corner coordinate information of at least one rounded corner region associated with the window occluder based on the window coordinate information and the pre-set rounded corner ratio information.
[0033] A rounded corner curve determination module is used to determine the rounded corner curve information of the window occluder based on at least one rounded corner coordinate information of the at least one rounded corner region;
[0034] The window occlusion generation module is used to generate the window occlusion based on the rounded corner curve information and the window coordinate information.
[0035] Thirdly, embodiments of the present invention provide an electronic device, the electronic device comprising:
[0036] One or more processors;
[0037] Memory, used to store one or more programs;
[0038] When the one or more programs are executed by the one or more processors, the one or more processors implement the window occlusion generation method provided in any embodiment of the present invention.
[0039] Fourthly, embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for generating a window occluder as provided in any embodiment of the present invention.
[0040] Fifthly, embodiments of the present invention also provide a computer program product, including a computer program, characterized in that, when the computer program is executed by a processor, it implements the window occlusion generation method as described in any embodiment of the present invention.
[0041] The technical solution provided in this embodiment of the invention determines the window coordinate information of the window occluder based on the preset window size and rendering canvas information, thus determining the placement position of the window occluder on the rendering canvas for subsequent adjustment of its shape. Based on the window coordinate information and preset fillet ratio information, at least one fillet coordinate information of at least one rounded corner region associated with the window occluder is determined. Based on the fillet coordinate information of the at least one rounded corner region, the fillet curve information of the window occluder is determined. These steps utilize the preset fillet ratio information and window coordinate information to target the window... Each right angle of the window occluder is rounded. Since the width and height of the canvas or display window are inconsistent, the horizontal and vertical roundness of the same corner may differ. In this embodiment of the invention, to make the rounded corners of the window occluder smoother and the final display effect softer and less harsh, an elliptical adjustment algorithm can be used to ellipse the rounded corners, determining the rounded corner curve information of the window occluder. Based on the rounded corner curve information and the window coordinate information, the window occluder is generated. This allows for the dynamic generation of a window occluder that adapts to the window shape when the size of the rendering canvas or display changes, thus ensuring the display effect. Attached Figure Description
[0042] To more clearly illustrate the technical solutions of exemplary embodiments of the present invention, the accompanying drawings used in describing the embodiments are briefly introduced below. Obviously, the accompanying drawings described are only a portion of the drawings of the embodiments to be described in this invention, and not all of the drawings. For those skilled in the art, other drawings can be obtained from these drawings without any creative effort.
[0043] Figure 1 A flowchart illustrating a method for generating a window occluder according to an embodiment of the present invention;
[0044] Figure 2 A flowchart illustrating a method for generating a window occluder according to an embodiment of the present invention;
[0045] Figure 3 This is a schematic diagram of the structure of a window blocking body generation device provided in an embodiment of the present invention;
[0046] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0047] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, the accompanying drawings show only the parts relevant to the present invention, and not all of the structures.
[0048] Figure 1 This is a flowchart of a method for generating a window occluder according to an embodiment of the present invention. This embodiment is applicable to scenarios where a window occluder is dynamically generated to fit the shape of the window. The method for generating a window occluder provided in this embodiment can be executed by a device, which can be implemented in the form of software and / or hardware. The hardware can be a server, and the server can be a mobile terminal or a PC, etc.
[0049] like Figure 1 As shown, the method specifically includes the following steps:
[0050] S110. Determine the window coordinate information of the window occluder based on the preset window size and rendering canvas information of the window occluder.
[0051] In this context, a window occluder refers to an object that obscures the view within a window. A window occluder can be used to block unwanted elements outside the window while displaying the view within. A preset window size refers to a pre-set display window size. For example, a preset window size can be a display window size pre-set based on the view to be displayed. A rendering canvas can be understood as a single drawable texture or a collection of textures. A rendering canvas can be used to store and display image data during the rendering process. The entire screen can also be considered a special rendering canvas. Rendering canvas information refers to relevant information about the rendering canvas from which the window occluder is separated. For example, rendering canvas information can be, but is not limited to, canvas size or canvas vertex coordinates. Window coordinate information refers to the coordinates of the edges of the displayed window or the window occluder when the window occluder and the rendering canvas are in the same coordinate system. Window coordinate information can include, but is not limited to, the coordinates of the window vertices.
[0052] In this embodiment, to place a window occluder of a preset window size into the rendering canvas, the window occluder is positioned within the coordinate system of the rendering canvas. At this point, the center of the window occluder overlaps with the center of the rendering canvas, and the rendering canvas completely contains the window occluder. The size of the rendering canvas is determined using the canvas vertex coordinates. Based on the size of the rendering canvas and the preset window size of the window occluder, the size difference between the window occluder and the rendering canvas is determined. Based on the size difference and the canvas vertex coordinates, the coordinate information of the window vertices of the window occluder is determined. Thus, the window coordinate information of the window occluder is determined using the window shape and the coordinate information of the window vertices. At this time, the display window shape of the window occluder is rectangular.
[0053] Based on the above technical solution, "determining the window coordinate information of the window occluder according to the preset window size and rendering canvas information of the window occluder" may include: determining the coordinate range of the window occluder according to the preset window size of the window occluder and the canvas size in the rendering canvas information; wherein, the rendering canvas is the canvas that carries the object to be rendered; and determining the window coordinate information of the window occluder based on the coordinate range.
[0054] The preset window size can include a preset window width and a preset window height. The canvas size can include a canvas width and a canvas height. The coordinate range can refer to the selectable range of texture coordinates corresponding to the vertices of the window occlusion. The object to be rendered can refer to the object to be displayed on the rendering canvas. For example, the object to be rendered can be, but is not limited to, the image to be displayed.
[0055] In this embodiment, the maximum horizontal coordinate (U) of the window occluder is determined by dividing the preset window width of the window occluder by the canvas width in the rendering canvas information. max or s max The maximum vertical coordinate (V) of the window occluder is determined by dividing the preset window height by the canvas height in the rendering canvas information. min or t min The coordinates of the top-right vertex of the window occluder are determined using its maximum horizontal and vertical coordinates. The coordinate range of the window occluder is determined using its preset window size, maximum horizontal and vertical coordinates. The coordinates of the bottom-left vertex of the window occluder are determined using the lower limits of its horizontal and vertical coordinates within this range. Similarly, the coordinate range of the window occluder can be used to determine the coordinates of the other two vertices, thus allowing the window's coordinate information to be determined using the window shape and the coordinates of its vertices.
[0056] S120. Based on the window coordinate information and the pre-set fillet ratio information, determine at least one fillet coordinate information of at least one fillet region associated with the window occluder.
[0057] The rounded corner area can refer to the area near the four vertices of the display window containing the right-angled sides that are to be converted into rounded corners. The rounded corner coordinate information can refer to the coordinates of the center of the circle corresponding to the rounded corner.
[0058] In this embodiment, the side length of each side of the display window can be determined using the window vertex coordinates or a preset window size. The corner radius is determined using pre-set fillet ratio information and the corresponding side lengths of the two sides containing the fillet. The edge coordinates corresponding to the fillet are determined using the window vertex coordinates and the fillet radius. At least one rounded corner region associated with the window occluder is determined using the window vertex coordinates and edge coordinates, thereby allowing the vertex of the rounded corner region within the display window to be identified as the corresponding rounded corner coordinates.
[0059] S130. Determine the rounded corner curve information of the window occluder based on at least one rounded corner coordinate information of at least one rounded corner region.
[0060] The rounded corner curve information can refer to the coordinate information of the pixels on the rounded corner. The rounded corner coordinate information can also include the edge coordinate information.
[0061] In this embodiment, given the center coordinates, radius, and edge coordinates of the rounded corner, the center coordinates and radius can be used to determine the candidate rounded corner curve information, and the edge coordinates can be used to extract the candidate rounded corner curve information to determine the rounded corner curve information of the window occluder.
[0062] Based on the above technical solution, "determining the rounded corner curve information of the window occluder according to at least one rounded corner coordinate information of at least one rounded corner region" may include: for at least one rounded corner region, determining the first texture coordinates of at least one pixel point located in the rounded corner region by interpolation processing of at least one rounded corner coordinate information in the rounded corner region; and determining the rounded corner curve information of the window occluder based on the first texture coordinates and an ellipse adjustment algorithm.
[0063] The rounded corner coordinate information may also include the coordinate information of some pixels on the rounded corner curve.
[0064] In this embodiment, for at least one rounded corner region, all pixels on the rounded corner are determined by interpolating the coordinate information of at least one rounded corner within the region, thereby determining the first texture coordinates of all pixels on the rounded corner within the region. Since inconsistent width and height of the canvas or display window can lead to inconsistent horizontal and vertical rounded corner ratios for the same rounded corner, an elliptic adjustment algorithm can be used to ellipse the rounded corners to make them smoother and the display effect softer and less harsh. This determines the rounded corner curve information of the window occlusion.
[0065] S140. Generate a window occlusion body based on the rounded corner curve information and window coordinate information.
[0066] Based on the occlusion nature of the window occluder, different window occluders can be determined. If the occlusion nature of the window occluder is to cover and obstruct, then the window occluder must cover the area outside the display window. In this case, the window occluder has a gap in the middle to highlight the display window. If the occlusion nature of the window occluder is to penetrate the display, then the window occluder must cover the area where the display window is located.
[0067] In this embodiment, a window occlusion body is taken as an example. The window coordinate information of each rounded corner region is replaced with the rounded corner curve information of that region to generate the window occlusion body. At this time, the window occlusion body is a rounded rectangle.
[0068] The technical solution provided in this invention determines the window coordinates of the window occluder based on the preset window size and rendering canvas information, thus determining the placement position of the window occluder on the rendering canvas for subsequent adjustment of its shape. Based on the window coordinates and preset fillet ratios, at least one fillet coordinate is determined for at least one fillet region associated with the window occluder. Based on the fillet coordinates of at least one fillet region, the fillet curve information of the window occluder is determined. These steps utilize the preset fillet ratios and window coordinates to target the window... Each right angle of the occluder is rounded. Since the width and height of the canvas or display window are inconsistent, the horizontal and vertical roundness of the same corner may differ. In this embodiment of the invention, to make the rounded corners of the window occluder smoother and the final display effect softer and less harsh, an elliptical adjustment algorithm can be used to ellipse the rounded corners, determining the rounded corner curve information of the window occluder. Based on the rounded corner curve information and window coordinate information, a window occluder is generated. This allows for the dynamic generation of a window occluder that adapts to the window shape when the size of the rendering canvas or display changes, thus ensuring the technical effect of maintaining the display effect.
[0069] Figure 2This is a flowchart illustrating a method for generating a window occluder according to an embodiment of the present invention. Based on the foregoing embodiments, the process of using the window occluder can be further elaborated. Specific implementation details can be found in the detailed description of this embodiment. Technical terms that are the same as or corresponding to those in the above embodiments are not repeated in this embodiment. Figure 2 As shown, the method includes:
[0070] S210. Determine the window coordinate information of the window occluder based on the preset window size and rendering canvas information of the window occluder.
[0071] S220. Based on the window coordinate information and the pre-set fillet ratio information, determine at least one fillet coordinate information of at least one fillet region associated with the window occluder.
[0072] S230. Determine the rounded corner curve information of the window occluder based on at least one rounded corner coordinate information of at least one rounded corner region.
[0073] S240. Generate a window occlusion body based on the rounded corner curve information and window coordinate information.
[0074] S250. Obtain at least one screen vertex data within the target display area, and determine the second texture coordinates corresponding to at least one screen vertex data.
[0075] The target display area can be understood as the area of the screen where the image is displayed. For example, the target display area can cover the entire screen, i.e., full screen. Screen vertex data can refer to the two-dimensional coordinates of the vertices of the target display area on the screen.
[0076] In this embodiment, at least one screen vertex data within the target display area is acquired. Each two-dimensional coordinate value in the screen vertex data is incremented by 1, and the sum is multiplied by 0.5 to obtain the second texture coordinate corresponding to each two-dimensional coordinate.
[0077] S260. Determine the visibility type of the screen vertex data based on the second texture coordinates and the window coordinate information of the window occluder.
[0078] The visibility type characterizes whether screen vertex data is occluded by a window occluder. For example, visibility types include visible and invisible. If the visibility type of the screen vertex data is visible, then the screen vertex is not occluded. If the visibility type of the screen vertex data is invisible, then the screen vertex is occluded.
[0079] In this embodiment, the position is compared using the second texture coordinates and the window coordinates of the window occluder to determine the position comparison result, and the visual type of the screen vertex data is determined using the position comparison result.
[0080] Based on the above technical solution, "determining the visual type of screen vertex data according to the second texture coordinates and the window coordinate information of the window occluder" may include: when the second texture coordinates are located in the area corresponding to the window coordinate information, determining the visual type of screen vertex data according to the second texture coordinates and at least one rounded corner coordinate information of the window occluder.
[0081] In this embodiment, the area where the display window is located is determined using the window coordinate information of the window occluder, i.e., the area corresponding to the window coordinate information. If the second texture coordinate is outside the area corresponding to the window coordinate information, the visibility type of the screen vertex data is determined to be invisible. When the second texture coordinate is within the area corresponding to the window coordinate information, the visible screen range is determined based on the rounded corner coordinate information of the window occluder. The visibility type of the screen vertex data corresponding to the second texture coordinate within the visible screen range is determined to be visible, while the visibility type of the screen vertex data corresponding to the second texture coordinate outside the visible screen range is determined to be invisible.
[0082] Based on the above technical solution, the method further includes: in response to an event that the visual type of the screen vertex data is visual, determining the visual type of the screen vertex data according to the second texture coordinates and the ellipse adjustment algorithm.
[0083] In this embodiment, in response to an event that the visibility type of the screen vertex data is visible, when the second texture coordinates are located within the area corresponding to the window coordinate information, the rounded corner curve information of the window occluder is determined using at least one rounded corner coordinate information of the window occluder, and the visibility type of the screen vertex data corresponding to the second texture coordinates located within the area corresponding to the window coordinate information is determined to be visible, while the visibility type of the screen vertex data corresponding to the second texture coordinates located outside the area corresponding to the window coordinate information is determined to be invisible.
[0084] S270. Render the screen vertex data based on the visual type of at least one screen vertex data to display the screen vertex data within the window occlusion.
[0085] In this embodiment, the depth value of screen vertices with a visible type is adjusted to a first depth value to render the visible portion. The depth value of screen vertices with an invisible type is adjusted to a second depth value, which is different from the first depth value, to render the invisible portion, thereby achieving rendering of the entire screen. This ensures the display effect when a window occlusion body adapted to the window shape is dynamically generated for display.
[0086] Based on the above technical solution, "rendering screen vertex data based on the visual type of at least one screen vertex data" may include: determining the rendering depth information of at least one screen vertex data according to the visual type of at least one screen vertex data; and rendering the screen vertex data into the window occlusion body for display based on the rendering depth information.
[0087] The rendering depth information within the window occlusion body differs from that within the non-window occlusion body. Rendering depth information can refer to the depth value at the time of rendering adjustments. The rendering depth information within the window occlusion body is equivalent to the aforementioned first depth value. The rendering depth information within the non-window occlusion body is equivalent to the aforementioned second depth value.
[0088] In this embodiment, based on pre-set rendering depth information within the window occlusion body, rendering depth information outside the window occlusion body, the correspondence between rendering depth information within the window occlusion body and the visual type, and the correspondence between rendering depth information outside the window occlusion body and the visual type, the rendering depth information corresponding to the visible screen vertex data is determined as the rendering depth information within the window occlusion body, and the rendering depth information corresponding to the invisible screen vertex data is determined as the rendering depth information outside the window occlusion body. Therefore, the screen vertex data can be rendered into the window occlusion body for display using the rendering depth information corresponding to each screen vertex data.
[0089] The technical solution provided by this invention obtains at least one screen vertex data within a target display area and determines the second texture coordinates corresponding to the at least one screen vertex data. Based on the second texture coordinates and the window coordinate information of the window occluder, the visual type of the screen vertex data is determined. This allows for a comparison of the positional relationship between the second texture coordinates corresponding to the screen vertex data and the window coordinate information of the window occluder to determine the visual type of the screen vertex data. Furthermore, the accurately determined visual type of the at least one screen vertex data can be used to render the screen vertex data of that visual type, thereby displaying the screen vertex data within the window occluder. It is evident that the more accurate the window occluder is generated, the more accurate the screen vertex data displayed on the screen will be; that is, dynamically generating a window occluder that adapts to the window shape achieves the technical effect of ensuring display quality.
[0090] The following are embodiments of the window obstruction generation apparatus provided in this invention. This apparatus belongs to the same inventive concept as the window obstruction generation methods in the above embodiments. For details not described in detail in the embodiments of the window obstruction generation apparatus, please refer to the embodiments of the window obstruction generation methods described above.
[0091] Figure 3This is a schematic diagram of a window occlusion generation device provided in an embodiment of the present invention. The device specifically includes: a window information determination module 310, a rounded corner coordinate determination module 320, a rounded corner curve determination module 330, and a window occlusion generation module 340.
[0092] The window information determination module 310 is used to determine the window coordinate information of the window occluder based on the preset window size and rendering canvas information of the window occluder; the rounded corner coordinate determination module 320 is used to determine at least one rounded corner coordinate information of at least one rounded corner area associated with the window occluder based on the window coordinate information and the preset rounded corner ratio information; the rounded corner curve determination module 330 is used to determine the rounded corner curve information of the window occluder based on at least one rounded corner coordinate information of at least one rounded corner area; and the window occluder generation module 340 is used to generate the window occluder based on the rounded corner curve information and the window coordinate information.
[0093] The technical solution provided in this invention determines the window coordinates of the window occluder based on the preset window size and rendering canvas information, thus determining the placement position of the window occluder on the rendering canvas for subsequent adjustment of its shape. Based on the window coordinates and preset fillet ratios, at least one fillet coordinate is determined for at least one fillet region associated with the window occluder. Based on the fillet coordinates of at least one fillet region, the fillet curve information of the window occluder is determined. These steps utilize the preset fillet ratios and window coordinates to target the window... Each right angle of the occluder is rounded. Since the width and height of the canvas or display window are inconsistent, the horizontal and vertical roundness of the same corner may differ. In this embodiment of the invention, to make the rounded corners of the window occluder smoother and the final display effect softer and less harsh, an elliptical adjustment algorithm can be used to ellipse the rounded corners, determining the rounded corner curve information of the window occluder. Based on the rounded corner curve information and window coordinate information, a window occluder is generated. This allows for the dynamic generation of a window occluder that adapts to the window shape when the size of the rendering canvas or display changes, thus ensuring the technical effect of maintaining the display effect.
[0094] Based on the above technical solution, the window information determination module 310 is specifically used to: determine the coordinate range of the window occlusion body according to the preset window size of the window occlusion body and the canvas size in the rendering canvas information; wherein, the rendering canvas is the canvas that carries the object to be rendered; and determine the window coordinate information of the window occlusion body based on the coordinate range.
[0095] Based on the above technical solution, the rounded corner curve determination module 330 is specifically used for: for at least one rounded corner region, determining the first texture coordinates of at least one pixel point located in the rounded corner region by interpolating at least one rounded corner coordinate information within the rounded corner region; and determining the rounded corner curve information of the window occluder based on the first texture coordinates and the ellipse adjustment algorithm.
[0096] Based on the above technical solution, the device also includes:
[0097] The second texture coordinate determination module is used to acquire at least one screen vertex data within the target display area and determine the second texture coordinates corresponding to at least one screen vertex data.
[0098] The visibility type determination module is used to determine the visibility type of screen vertex data based on the second texture coordinates and the window coordinate information of the window occluder.
[0099] The screen rendering module is used to render screen vertex data based on the visual type of at least one screen vertex data in order to display the screen vertex data within the window occlusion.
[0100] Based on the above technical solution, the visual type determination module may include:
[0101] The first visibility type determination submodule is used to determine the visibility type of screen vertex data based on the second texture coordinates and at least one rounded corner coordinate of the window occluder when the second texture coordinates are located within the area corresponding to the window coordinate information.
[0102] Based on the above technical solution, the device also includes:
[0103] The second visibility type determination submodule is used to determine the visibility type of screen vertex data based on the second texture coordinates and the ellipse adjustment algorithm in response to an event that the visibility type of the screen vertex data is visible.
[0104] Based on the above technical solution, the screen rendering module is specifically used to: determine the rendering depth information of at least one screen vertex data according to the visual type of at least one screen vertex data; and render the screen vertex data into the window occlusion body for display based on the rendering depth information.
[0105] Based on the above technical solution, the rendering depth information within the window occlusion body is different from the rendering depth information within the non-window occlusion body.
[0106] The window occlusion generation device provided in this embodiment of the invention can execute the window occlusion generation method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of executing the window occlusion generation method.
[0107] It is worth noting that in the embodiments of the above-mentioned window occlusion generation device, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the scope of protection of the present invention.
[0108] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Figure 4 A block diagram is shown of an exemplary electronic device 12 suitable for implementing embodiments of the present invention. Figure 4 The electronic device 12 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of the present invention.
[0109] like Figure 4 As shown, the electronic device 12 is represented in the form of a general-purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, system memory 28, and bus 18 connecting different system components (including system memory 28 and processing unit 16).
[0110] Bus 18 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. For example, these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.
[0111] Electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by electronic device 12, including volatile and non-volatile media, removable and non-removable media.
[0112] System memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be used to read and write non-removable, non-volatile magnetic media (… Figure 4 Not shown; usually referred to as a "hard drive"). Although Figure 4Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 via one or more data media interfaces. System memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of the present invention.
[0113] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 42 typically perform the functions and / or methods described in the embodiments of the present invention.
[0114] Electronic device 12 can also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), and with one or more devices that enable a user to interact with electronic device 12, and / or with any device that enables electronic device 12 to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be performed via input / output (I / O) interface 22. Furthermore, electronic device 12 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 20. As shown, network adapter 20 communicates with other modules of electronic device 12 via bus 18. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0115] Processing unit 16 executes various functional applications and data processing by running programs stored in system memory 28, such as implementing the window occlusion generation method steps provided in Embodiment 1 of this invention, which includes:
[0116] The window coordinate information of the window occluder is determined based on the preset window size and rendering canvas information of the window occluder;
[0117] Based on the window coordinate information and the pre-set fillet ratio information, determine at least one fillet coordinate information for at least one fillet region associated with the window occluder;
[0118] Determine the rounded corner curve information of the window occluder based on at least one rounded corner coordinate information of at least one rounded corner region;
[0119] Based on the rounded corner curve information and window coordinate information, a window occlusion body is generated.
[0120] Of course, those skilled in the art will understand that the processor can also implement the technical solution of the window occlusion generation method provided in any embodiment of the present invention.
[0121] This embodiment provides a computer-readable storage medium storing a computer program thereon. When executed by a processor, the program implements the window occlusion generation method steps provided in the foregoing embodiments of the present invention. The method includes:
[0122] The window coordinate information of the window occluder is determined based on the preset window size and rendering canvas information of the window occluder;
[0123] Based on the window coordinate information and the pre-set fillet ratio information, determine at least one fillet coordinate information for at least one fillet region associated with the window occluder;
[0124] Determine the rounded corner curve information of the window occluder based on at least one rounded corner coordinate information of at least one rounded corner region;
[0125] Based on the rounded corner curve information and window coordinate information, a window occlusion body is generated.
[0126] The computer storage medium of this invention can be any combination of one or more computer-readable media. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0127] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of sending, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.
[0128] The program code contained on a computer-readable medium may be transmitted using any suitable medium, including—but not limited to—wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0129] Computer program code for performing the operations of embodiments of the present invention can be written in one or more programming languages or a combination thereof. Programming languages include object-oriented programming languages—such as Java, Smalltalk, and C++—as well as conventional procedural programming languages—such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0130] Note that the above description is merely a preferred embodiment of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of the present invention, the scope of which is determined by the scope of the appended claims.
Claims
1. A method for generating a window occlusion, characterized in that, include: The window coordinate information of the window occluder is determined based on the preset window size and rendering canvas information of the window occluder; Based on the window coordinate information and the pre-set corner radius information, determine at least one corner radius coordinate information for at least one corner radius region associated with the window occluder; Based on at least one rounded corner coordinate information of the at least one rounded corner region, determine the rounded corner curve information of the window occluder; The window occlusion body is generated based on the rounded corner curve information and the window coordinate information.
2. The method according to claim 1, characterized in that, The step of determining the window coordinate information of the window occluder based on the preset window size and rendering canvas information of the window occluder includes: The coordinate range of the window occlusion is determined based on the preset window size of the window occlusion and the canvas size in the rendering canvas information; wherein, the rendering canvas is the canvas that carries the object to be rendered; Based on the coordinate range, the window coordinate information of the window occluder is determined.
3. The method according to claim 1, characterized in that, Determining the rounded corner curve information of the window occluder based on at least one rounded corner coordinate information of the at least one rounded corner region includes: For the at least one rounded corner region, the first texture coordinates of at least one pixel point located in the rounded corner region are determined by interpolation processing of at least one rounded corner coordinate information within the rounded corner region; Based on the first texture coordinates and the ellipse adjustment algorithm, the rounded corner curve information of the window occluder is determined.
4. The method according to claim 1, characterized in that, The method further includes: Acquire at least one screen vertex data within the target display area, and determine the second texture coordinates corresponding to the at least one screen vertex data; The visibility type of the screen vertex data is determined based on the second texture coordinates and the window coordinate information of the window occluder. The screen vertex data is rendered based on the visual type of the at least one screen vertex data to display the screen vertex data within the window occlusion.
5. The method according to claim 4, characterized in that, The step of determining the visibility type of the screen vertex data based on the second texture coordinates and the window coordinate information of the window occluder includes: When the second texture coordinates are located within the area corresponding to the window coordinate information, the visibility type of the screen vertex data is determined based on the second texture coordinates and at least one rounded corner coordinate information of the window occluder.
6. The method according to claim 5, characterized in that, The method further includes: In response to an event that the visual type of the screen vertex data is visual, the visual type of the screen vertex data is determined based on the second texture coordinates and the ellipse adjustment algorithm.
7. The method according to claim 4, characterized in that, The rendering of the screen vertex data based on the visual type of the at least one screen vertex data includes: The rendering depth information of the at least one screen vertex data is determined based on the visibility type of the at least one screen vertex data. The screen vertex data is rendered into the window occlusion body based on the rendering depth information for display.
8. The method according to claim 1, characterized in that, The rendering depth information within the window occlusion body is different from the rendering depth information within the non-window occlusion body.
9. A device for generating a window shading body, characterized in that, include: The window information determination module is used to determine the window coordinate information of the window occluder based on the preset window size and rendering canvas information of the window occluder; The rounded corner coordinate determination module is used to determine at least one rounded corner coordinate information of at least one rounded corner region associated with the window occluder based on the window coordinate information and the pre-set rounded corner ratio information. A rounded corner curve determination module is used to determine the rounded corner curve information of the window occluder based on at least one rounded corner coordinate information of the at least one rounded corner region; The window occlusion generation module is used to generate the window occlusion based on the rounded corner curve information and the window coordinate information.
10. An electronic device, characterized in that, The electronic device includes: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method for generating a window occluder as described in any one of claims 1-8.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by the processor, the program implements the method for generating window occluders as described in any one of claims 1-8.
12. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the method for generating a window occluder as described in any one of claims 1-8.
