Masking layer implementation method and device, computer equipment and storage medium
By establishing a mapping relationship between the target element and the masking layer identification in the document editing tool, calculating sub-graphic information and rendering the masking layer, the problem of being unable to mask some text or other content in the document in the existing technology is solved, and efficient and accurate masking rendering effect is achieved.
Patent Information
- Application Number
- CN202311304730.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-10
- Publication Date
- 2025-04-11
AI Technical Summary
In the prior art, some text or other content in the document editing tool cannot be blocked, and masking cannot be set for content other than text.
By establishing a mapping relationship between the target element and the mask identification in the editing window, the sub-graphic information corresponding to the mask identification is calculated, the container graphics information is formed, and the target element is rendered based on this information.
It realizes accurate rendering of the selected target elements in the document, improves the effect and accuracy of the mask settings, simplifies user operations, and improves the user experience of electronic documents.
Smart Images

Figure CN119808721A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer application technology, and in particular to a method, apparatus, computer equipment, storage medium and computer program product for implementing a mask. Background Art
[0002] Document editing tools, such as Microsoft's presentation software (PowerPoint, PPT), are office software that people often use in work and study. Users can edit documents based on the document editing tools and display the edited content to others. Similar document editing tools are also installed in the currently popular smart teaching whiteboards, which can allow teachers to edit and display teaching content.
[0003] Generally, when editing a document, in addition to text, the document may also involve tables, formulas, mind maps, pictures and other contents. Users usually have the need to mask at least part of the contents in the document. However, the prior art only has the function of masking the text editing box in the document, and the text controls used to form the text editing box are often designed in an integrated form, that is, the current text masking implementation is for all the text in the entire text editing box, and it is impossible to set a mask to block part of the text in the text editing box, and there is no technology for setting a mask for content other than text. It can be seen that the effect of setting a mask for a document in the prior art is not very good.
[0004] Therefore, there is an urgent need to provide a technical solution that can improve the effect of setting a mask in a document. Summary of the invention
[0005] Based on this, it is necessary to provide a mask implementation method, device, computer equipment, computer-readable storage medium and computer program product that can improve the mask setting effect in a document in response to the above technical problems.
[0006] In a first aspect, the present application provides a method for implementing a mask, comprising:
[0007] When at least one target element in the electronic document displayed in the editing window is selected, establishing at least one group of mapping relationships between the target element and the corresponding mask identifier;
[0008] Based on the mapping relationship, sub-graphic information of each target element corresponding to the same mask identifier is calculated, and the sub-graphic information corresponding to the same mask identifier is aggregated to form container graphic information corresponding to the same mask identifier; the container graphic information matches the position information of the target element corresponding to the same mask identifier relative to the editing window;
[0009] Based on the container graphic information corresponding to each of the mask identifiers, mask rendering is performed on at least one of the target elements.
[0010] In one embodiment, it also includes:
[0011] When it is detected that the target element is edited, updating the container graphic information of the mask mark corresponding to the target element;
[0012] The mask of the target element is re-rendered based on the updated container graphics information.
[0013] In one of the embodiments, when it is detected that the target element is edited, updating the container graphic information of the mask mark corresponding to the target element includes:
[0014] When the mask is in an activated state, in response to moving the position of the target element in the electronic document, and when the moving operation ends, the container graphic information of the mask mark corresponding to the target element is updated; when the mask is in an activated state, the target element blocked by the mask is displayed.
[0015] In one of the embodiments, when it is detected that the target element is edited, updating the container graphic information of the mask mark corresponding to the target element includes:
[0016] When the mask is in an activated state, in response to copying the target element and when the operation of pasting the copied target element to another position of the electronic document is completed, the container graphic information of the mask mark corresponding to the target element is updated; when the mask is in an activated state, the target element obscured by the mask is displayed.
[0017] In one of the embodiments, performing mask rendering on at least one of the target elements based on the container graphic information corresponding to each of the mask identifiers includes:
[0018] When it is detected that the target element is located in the viewing area of the editing window, mask rendering is performed on at least one of the target elements located in the viewing area based on the container graphic information corresponding to the mask identifier of the target element located in the viewing area.
[0019] In one of the embodiments, when at least one target element in the electronic document displayed in the editing window is selected, establishing at least one group of mapping relationships between the target element and the corresponding mask identifier includes:
[0020] When at least one element in the electronic document displayed in the editing window is selected, selecting a target element from the selected elements based on a preset target rule;
[0021] Determine at least one mask area to be rendered based on the filtered target element;
[0022] A mapping relationship between at least one group of the target elements and the corresponding mask identifiers of the mask area is established.
[0023] In one of the embodiments, performing mask rendering on at least one of the target elements based on the container graphic information corresponding to each of the mask identifiers includes:
[0024] Based on the container graphic information corresponding to each mask identifier, drawing path information for drawing the mask corresponding to the mask identifier is converted, and mask rendering is performed on at least one of the target elements based on the drawing path information.
[0025] In one of the embodiments, after performing mask rendering on at least one of the target elements based on the container graphic information corresponding to each of the mask identifiers, the method further includes:
[0026] When it is detected that any area where the mask is located is clicked or the cursor hovers for a preset time, the mask is updated from a maintained state to an activated state, and the target element covered by the mask is displayed.
[0027] In one of the embodiments, after performing mask rendering on at least one of the target elements based on the container graphic information corresponding to each of the mask identifiers, the method further includes:
[0028] When the electronic document enters the display mode, in response to the movement operation of the erasing tool, the mask area in the electronic document to which the erasing tool moves is erased, and the target element blocked by the erased mask area is displayed.
[0029] In a second aspect, the present application further provides a masking device, the device comprising:
[0030] A data association module, used for establishing a mapping relationship between at least one group of target elements and corresponding mask identifiers when at least one target element in the electronic document displayed in the editing window is selected;
[0031] A data processing module, configured to calculate, based on the mapping relationship, sub-graphic information of each target element corresponding to the same mask identifier, aggregate the sub-graphic information corresponding to the same mask identifier, and form container graphic information corresponding to the same mask identifier; the container graphic information matches the position information of the target element corresponding to the same mask identifier relative to the editing window;
[0032] The mask rendering module is used to perform mask rendering on at least one of the target elements based on the container graphic information corresponding to each of the mask identifiers.
[0033] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0034] When at least one target element in the electronic document displayed in the editing window is selected, establishing at least one group of mapping relationships between the target element and the corresponding mask identifier;
[0035] Based on the mapping relationship, sub-graphic information of each target element corresponding to the same mask identifier is calculated, and the sub-graphic information corresponding to the same mask identifier is aggregated to form container graphic information corresponding to the same mask identifier; the container graphic information matches the position information of the target element corresponding to the same mask identifier relative to the editing window;
[0036] Based on the container graphic information corresponding to each of the mask identifiers, mask rendering is performed on at least one of the target elements.
[0037] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0038] When at least one target element in the electronic document displayed in the editing window is selected, establishing at least one group of mapping relationships between the target element and the corresponding mask identifier;
[0039] Based on the mapping relationship, sub-graphic information of each target element corresponding to the same mask identifier is calculated, and the sub-graphic information corresponding to the same mask identifier is aggregated to form container graphic information corresponding to the same mask identifier; the container graphic information matches the position information of the target element corresponding to the same mask identifier relative to the editing window;
[0040] Based on the container graphic information corresponding to each of the mask identifiers, mask rendering is performed on at least one of the target elements.
[0041] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0042] When at least one target element in the electronic document displayed in the editing window is selected, establishing at least one group of mapping relationships between the target element and the corresponding mask identifier;
[0043] Based on the mapping relationship, sub-graphic information of each target element corresponding to the same mask identifier is calculated, and the sub-graphic information corresponding to the same mask identifier is aggregated to form container graphic information corresponding to the same mask identifier; the container graphic information matches the position information of the target element corresponding to the same mask identifier relative to the editing window;
[0044] Based on the container graphic information corresponding to each of the mask identifiers, mask rendering is performed on at least one of the target elements.
[0045] The above-mentioned mask implementation method, device, computer equipment, storage medium and computer program product establish a mapping relationship between the selected target element and the corresponding mask identifier, calculate the sub-graphic information of each target element corresponding to the same mask identifier based on the mapping relationship, and then aggregate the sub-graphic information corresponding to the same mask identifier to form container graphic information corresponding to the same mask identifier, and perform mask rendering on the corresponding target element based on the container graphic information; after calculating the sub-graphic information of different selected target elements respectively, the application aggregates the sub-graphic information corresponding to the same mask identifier into container graphic information, which can realize the mask rendering of the target element in a complex rich text editing scene, and the calculation amount of the sub-graphic information required for the mask rendering is very small, which is conducive to improving the calculation accuracy of the container graphic information, thereby facilitating the improvement of the rendering accuracy of the mask, and also improving the setting effect of the mask in the electronic document; and the smaller calculation amount is conducive to avoiding affecting the performance of the electronic document, thereby improving the user experience of the electronic document. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0047] Figure 1 A schematic diagram of a process for implementing a masking method in one embodiment;
[0048] Figure 2is a schematic diagram of a document editor in the first embodiment;
[0049] Figure 3 is a schematic diagram of a document editor in the second embodiment;
[0050] Figure 4 is a schematic diagram of a document editor in the third embodiment;
[0051] Figure 5 A schematic diagram of a process for establishing a mapping relationship in a mask implementation method provided in an embodiment;
[0052] Figure 6 is a schematic diagram of a document editor in a fourth embodiment;
[0053] Figure 7 is a schematic diagram of a document editor in the fifth embodiment;
[0054] Figure 8 A schematic flow chart of a method for implementing a mask in another embodiment;
[0055] Fig. 9 is a schematic diagram of a document editor in the sixth embodiment;
[0056] Fig.10 A schematic diagram of a calculation process of mask position information in one embodiment;
[0057] Fig.11 A schematic diagram of a calculation process of mask position information in another embodiment;
[0058] Fig.12 It is a structural block diagram of a device for implementing a mask in one embodiment;
[0059] Fig.13 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0060] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0061] Figure 1 FIG. 1 is a flow chart of a method for implementing a mask in an embodiment. In an embodiment, as shown in FIG. Figure 1As shown, a method for implementing a mask is provided. This embodiment takes the method applied to a terminal as an example, wherein the terminal may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, and IoT devices, and IoT devices may be, for example, smart TVs and other devices; it can be understood that the method can also be applied to a server, wherein the server can be an independent server or a server cluster composed of multiple servers, and can also be applied to a system including a terminal and a server, and implemented through the interaction between the terminal and the server.
[0062] In this embodiment, the masking method may include the following steps 101 to 103, wherein:
[0063] Figure 2 is a schematic diagram of a document editor in the first embodiment, Figure 3 This is a schematic diagram of the document editor in the second embodiment, please refer to Figure 1-Figure 3 , step 101, when at least one target element in the electronic document displayed in the editing window is selected, establishing a mapping relationship between at least one set of target elements and corresponding mask identifiers.
[0064] Specifically, in the mask implementation method provided by the present application, the electronic document displayed in the editing window is monitored through step 101, and when it is detected that at least one target element in the electronic document is selected, a mapping relationship between each selected target element and its corresponding mask identifier is established; wherein the target element is an element on which a mask can be set when necessary to use the mask to shield the corresponding target element; through step 101, the establishment of a mapping relationship between the selected target element in the electronic document and the corresponding mask identifier is implemented, so that each target element has its corresponding mask identifier, that is, each mask identifier has a corresponding one or more target elements.
[0065] It should be noted that the target element here can be at least one of all elements included in the electronic document, or can be all elements included in the electronic document, and this application does not make specific restrictions on this. Among them, one target element corresponds to one mask layer identifier, but one mask layer identifier can correspond to multiple target elements. It should also be added that, if Figure 2 As shown, the target element may be, for example, at least one of a text element, a picture element, a column element, and the like.
[0066] Step 102, based on the mapping relationship, calculate the sub-graphic information of each target element corresponding to the same mask identifier, aggregate the sub-graphic information corresponding to the same mask identifier, and form container graphic information corresponding to the same mask identifier; the container graphic information matches the position information of the target element corresponding to the same mask identifier relative to the editing window.
[0067] Specifically, in the mask implementation method provided by the present application, after establishing a mapping relationship between the selected target element in the electronic document and the mask identifier through step 101, step 102 is further executed. Through step 102, based on the obtained mapping relationship between the target element and the mask identifier, the sub-graphic information of each target element corresponding to the same mask identifier is calculated to obtain the position information of each target element corresponding to the same mask identifier relative to the editing window, and then the multiple sub-graphic information corresponding to the same mask identifier are aggregated to form container graphic information that matches the multiple target elements corresponding to the same mask identifier. Thus, the position information of the multiple target elements corresponding to the same mask identifier relative to the editing window is obtained, which is facilitating the subsequent rendering of the mask based on the position information of the container graphic information relative to the editing window, and can cover all target elements that have a mapping relationship with the mask identifier.
[0068] The above step 102 is a method for calculating the container graphic information corresponding to the same mask identifier. After calculating the sub-graphic information of the selected different target elements respectively, the sub-graphic information corresponding to the same mask identifier is aggregated into the container graphic information corresponding to the whole, which is conducive to realizing the calculation of the sub-graphic information related to the mask rendering for each target element in a complex rich text editing scene; in this method, the amount of calculation of the sub-graphic information required for the mask rendering is very small, which is conducive to improving the calculation accuracy of the container graphic information, thereby improving the rendering accuracy of the mask, and also improving the setting effect of the mask in the electronic document; and the small amount of calculation can avoid increasing the computing burden of the processor related to the electronic document, avoid affecting the overall performance of the electronic document, and thus improve the user's experience of the electronic document. That is, the mask finally rendered corresponding to a mask identifier can cover one or more target elements with which it has a mapping relationship.
[0069] Step 103: mask rendering is performed on at least one target element based on the container graphic information corresponding to each mask identifier.
[0070] Specifically, after obtaining the container graphic information corresponding to each mask layer identifier through step 102, step 103 can be further executed. Step 103 renders the mask corresponding to each mask layer identifier based on the container graphic information corresponding to each mask layer identifier obtained in step 102, so as to achieve that the selected target element in the electronic document can be rendered with the required mask.
[0071] Among them, Figure 2 and Figure 3 As shown, Figure 2 The elements in area 1, area 2, area 3, and area 4 in are the target elements, and after executing step 103, they are updated to Figure 3As shown, elements in area 1, area 2, area 3, and area 4 are rendered with a mask layer, and the mask layer shields the target elements in the corresponding area.
[0072] It should be noted that the present application does not specifically limit the color, pattern, etc. of the mask. Figure 3 In addition to the colors and patterns shown, it can also be pure white, mosaic style, etc.
[0073] It should also be added that the present application does not specifically limit the type of target elements. The target elements may be any type of elements such as text, columns, formulas, mind maps, pictures, tables, etc., and the present application does not limit the type and quantity of target elements corresponding to the same mask identifier. Therefore, through the mask implementation method provided by the present application, mask rendering can be achieved for any selected target element in the electronic document, which is conducive to increasing the types of elements covered by the mask, thereby helping to improve the user experience of the electronic document.
[0074] In the above-mentioned mask implementation method, the present application establishes a mapping relationship between the selected target element and the corresponding mask identifier, calculates the sub-graphic information of each target element corresponding to the same mask identifier based on the mapping relationship, and then aggregates the sub-graphic information corresponding to the same mask identifier to form the container graphic information corresponding to the same mask identifier, and performs mask rendering on the corresponding target element based on the container graphic information; after the present application calculates the sub-graphic information of the selected different target elements respectively, the sub-graphic information corresponding to the same mask identifier is aggregated into the container graphic information, which can realize the mask rendering of the target element in the complex rich text editing scene, and the calculation amount of the sub-graphic information required for the mask rendering is very small, which is conducive to improving the calculation accuracy of the container graphic information, thereby helping to improve the rendering accuracy of the mask, and also improving the setting effect of the mask in the electronic document; and the smaller calculation amount is conducive to avoiding affecting the performance of the electronic document, thereby improving the user experience of the electronic document.
[0075] Please combine Figure 2 , Figure 3 Reference Figure 1 In an exemplary embodiment, the masking method may further include step 104 and step 105 in addition to the above steps 101 to 103. Among them:
[0076] Step 104, when it is detected that the target element is edited, updating the container graphic information of the mask mark corresponding to the target element;
[0077] Step 105: re-render the mask of the target element based on the updated container graphics information.
[0078] Specifically, the present application also provides an optional implementation method, in which, when the terminal detects that the target element has been re-edited or moved relative to the original position, if the rendering position of the corresponding mask is not updated at this time, the target element with the updated content and / or position may not be covered by the mask. In order to solve this problem, step 104 can be executed. When it is detected that the target element has been edited, the container graphic information of the mask identifier corresponding to the target element is updated, that is, the corresponding sub-graphic information of the target element with the updated content and / or position is recalculated, and then the container graphic information of the mask identifier corresponding to the target element is updated according to the updated sub-graphic information. The updated container graphic information can provide the mask re-rendering information related to the mask identifier corresponding to the target element; then 105 is executed to achieve re-rendering of the mask corresponding to the target element based on the updated container graphic information.
[0079] The above-mentioned sub-graphic information is the position information of each target element relative to the editing window, and the container graphic information is the position information of the mask layer corresponding to each mask layer identifier relative to the editing window.
[0080] The monitoring of the target element being edited in the above step 104 can be selected as real-time monitoring, timed monitoring, etc. This application does not make any specific limitation on this, and the user can adjust the monitoring situation accordingly according to the design requirements.
[0081] The present application dynamically monitors the editing of the target element in the electronic document through step 104, and can timely update and render the mask of the target element with updated content and / or position through steps 104 and 105; that is, the target element can automatically render the corresponding mask based on its mask identifier with a mapping relationship when the content is updated and / or displaced, without the need for the user to manually re-select the target element with updated content and / or position for mask rendering, thereby simplifying the operating steps of the electronic document user, making the use of electronic documents simpler and more efficient, thereby helping to improve the user experience.
[0082] Based on this, the present application also provides an optional implementation method. If the mask rendered in the electronic document is pre-set, and its row direction is the same as the width of the electronic document, when it is detected that the target element is edited, the line break information of the edited target element can be further monitored. When it is detected that the number of rows of the target element increases or decreases, it means that the longitudinal size of the mask needs to be adjusted. At this time, it is only necessary to update the longitudinal position information of the mask drawing in the container graphic information corresponding to the target element, and the row position information does not need to be adjusted. This can reduce the number of updated content of the mask drawing information, which is beneficial to reduce the calculation steps of the container graphic information, thereby improving the efficiency of mask re-rendering and improving user experience.
[0083] Please combine Figure 2 , Figure 3 Reference Figure 1 In an exemplary embodiment, in the above step 104, when it is detected that the target element is edited, updating the container graphic information of the mask mark corresponding to the target element includes:
[0084] When the mask is in an activated state, in response to the position of the moving target element in the electronic document, and when the moving operation ends, the container graphic information of the mask mark corresponding to the target element is updated; when the mask is in an activated state, the target element blocked by the mask is displayed.
[0085] Specifically, the present application also provides an optional implementation method, when a target element in an electronic document is moved relative to the originally set position, the content of the above step 104 can be specifically embodied as follows: when the mask is in an activated state, that is, when the target element covered by the mask is in a display state, in response to the operation of moving the position of the target element in the electronic document, and when the moving operation is completed, the container graphic information of the mask identifier corresponding to the moved target element is updated, and the updated container graphic information can be provided to the mask corresponding to the moved target element for re-rendering information; and then 105 is executed to achieve re-rendering of the mask corresponding to the target element based on the updated container graphic information. That is, the target element can automatically re-render the corresponding mask for the displaced target element based on its mask identifier with a mapping relationship when displacement occurs, without the user having to re-select the target element with the updated position to render the mask for it, simplifying the operation steps of the electronic document user, making the use of the electronic document simpler and more efficient, thereby helping to improve the user experience.
[0086] It should be added that, for the movement of the target element, a corresponding moving button can be set in the editing window of the target element. When the cursor clicks or hovers for a preset time in the area where the target element is located, the moving button will become visible. The moving button can be clicked and long pressed by the cursor to move the target element to the target position through the moving button. After releasing the moving button, the movement of the target element can be completed. The target element after the moving operation will not lose its corresponding mask identification information, so the corresponding mask can be automatically redrawn through steps 104 and 105. Among them, the moving button can be in a hidden state when the corresponding target element is not clicked by the cursor or hovered for a preset time, which can ensure the simplicity of the electronic document page and is conducive to improving the user experience; but the present application is not limited to this, and the moving button corresponding to the target element can also be in a state that can be always seen by the user, etc.
[0087] Please combine Figure 2 , Figure 3 Reference Figure 1 In an exemplary embodiment, in the above step 104, when it is detected that the target element is edited, updating the container graphic information of the mask mark corresponding to the target element includes:
[0088] When the mask is in an activated state, in response to copying the target element and when the operation of pasting the copied target element to another position of the electronic document is completed, the container graphic information of the mask mark corresponding to the target element is updated; when the mask is in an activated state, the target element obscured by the mask is displayed.
[0089] Specifically, the present application also provides an optional implementation mode, that is, when a target element in an electronic document is copied and the copied target element is pasted to another position in the electronic document, the content of the above step 104 can be specifically performed as follows: when the mask is in an activated state, that is, when the target element covered by the mask is in a displayed state, in response to the operation of copying and pasting the target element to another position in the electronic document, it is obvious that the operation of copying and pasting the target element to another position is equivalent to setting the same target element at another position in the electronic document. Since the target element has a corresponding mask identifier, when the pasting operation ends, the container graphic information of the mask identifier corresponding to the target element pasted to another position of the electronic document can be automatically updated, and the updated container graphic information can be provided to the mask corresponding to the target element moved to another position of the electronic document for re-rendering; and then 105 is executed to achieve re-rendering of the mask corresponding to the target element pasted to another position based on the updated container graphic information. That is, based on the mask identifier with which it has a mapping relationship, the target element can automatically update and render the corresponding mask when it is copied and pasted to another location in the electronic document. There is no need for the user to reselect the mask for the copied target element, which simplifies the operating steps for electronic document users and makes the use of electronic documents simpler and more efficient, thereby helping to improve the user experience.
[0090] It should be added that, for the copy and paste operation of the target element, it is possible to select the target element with the mask by moving the cursor, and copy the target element corresponding to the mask by using the keyboard shortcut keys as in other text editors, and the target element will not lose its corresponding mask identification information after the paste operation, so the corresponding mask can be redrawn through steps 104 and 105. In addition, for the copy and paste operation of the target element, it is also possible to select the target element with the mask by moving the cursor, and then call out a temporary menu bar by clicking the cursor, and copy and paste the relevant target element by clicking the items in the temporary menu bar.
[0091] Through the above steps 104 and 105, the target element in the electronic document that has a mapping relationship with the mask identifier can automatically have its mask updated no matter it is moved to another location in the electronic document or copied and pasted to another location in the electronic document, without the user having to re-select the mask setting, thereby improving the user experience.
[0092] Figure 4 This is a schematic diagram of the document editor in the third embodiment. Please refer to Figure 1-Figure 4 In an exemplary embodiment, the above step 103, based on the container graphic information corresponding to each mask identifier, performs mask rendering on at least one target element, including:
[0093] When it is detected that the target element is located in the viewing area of the editing window, mask rendering is performed on at least one target element located in the viewing area based on the container graphic information corresponding to the mask identifier of the target element located in the viewing area.
[0094] Specifically, the present application also provides an optional implementation method, in which the content of the above-mentioned step 103 can be specifically performed as follows: monitoring the window area of the editing window. When it is detected that the target element is located in the window area of the editing window, it means that the target element can be seen by the user when it is not covered by the mask. At this time, based on the container graphic information corresponding to the mask identifier of the target element located in the window area, the mask rendering can be performed on at least one target element located in the window area, so that the target element located in the window area can be covered with the corresponding mask. Then, even if the target element outside the window area is selected, it will not fall into the window area that can be seen by the user. Therefore, whether to render the mask for it is irrelevant to the user; in this way, the mask rendering is performed on the target element selected and located in the window area of the editing window, and the remaining target elements are not masked, which reduces the number and / or area of masks that need to be rendered in the same time period, which is beneficial to reducing the process processing volume related to the electronic document, thereby facilitating improving the overall performance of the electronic document, thereby improving the user's experience of using the electronic document.
[0095] Figure 5 A flowchart of establishing a mapping relationship in a mask implementation method provided in an embodiment. Figure 1-Figure 3 Reference Figure 5 In an exemplary embodiment, when at least one target element in the electronic document displayed in the editing window is selected, the step 101 performs the establishment of a mapping relationship between at least one set of target elements and corresponding mask identifiers, which may specifically include steps 111 to 113, wherein:
[0096] Step 111, when at least one element in the electronic document displayed in the editing window is selected, a target element is screened from the selected elements based on a preset target rule;
[0097] Step 112, determining at least one mask region to be rendered based on the screened target element;
[0098] Step 113: Establish a mapping relationship between at least one group of target elements and the mask identifiers of the corresponding mask areas.
[0099] Specifically, since not all elements in an electronic document need to be rendered with a mask, for example, when the content of an electronic document includes a question, illustrations related to the question, and answers related to the question, the question and the illustrations related to the question do not need to be masked, and only the answers related to the question need to be masked. Therefore, there is a situation where all image elements in an electronic document do not need to be masked. Based on this, the present application provides an executable method for step 101, which is to select one or more elements in the electronic document displayed in the editing window through step 111, identify and filter the selected elements based on preset target rules, so as to filter out the selected elements that need to be masked by the device. The target elements of the layer are selected, and the elements that do not need to be set with a mask are eliminated; then step 112 is executed to determine one or more mask areas to be rendered based on the target elements selected in step 111, and then a mapping relationship between the mask identifiers of the selected target elements and the corresponding mask areas is established by executing step 103; through steps 111-113, the mapping relationship between the target elements in the selected elements in the electronic document and the corresponding mask identifiers is established, so that each target element has its corresponding mask identifier that can be set, so as to facilitate the subsequent mask rendering of the selected target elements, which is beneficial to improving the accuracy of the mask rendering.
[0100] Please combine Figure 2 , Figure 3 Reference Figure 1 In an exemplary embodiment, the above step 103, based on the container graphic information corresponding to each mask identifier, performs mask rendering on at least one target element, including:
[0101] Based on the container graphic information corresponding to each mask layer identifier, drawing path information of the mask layer corresponding to the mask layer identifier is converted, and mask rendering is performed on at least one target element based on the drawing path information.
[0102] Specifically, the present application also provides an optional implementation method, the content of the above step 103 can be specifically executed as follows: based on the container graphic information corresponding to each mask layer identifier, the container image information is converted into drawing path information for drawing the corresponding mask layer, and then the mask layer is drawn based on the drawing path information to achieve mask rendering for the corresponding target element. Among them, the drawing path information of the mask layer is the specific information used by the terminal when drawing the mask layer, which is used to achieve the terminal's drawing of the relevant mask layer. Therefore, through this step, the container graphic information corresponding to the mask layer can be converted into drawing path information that the terminal can recognize and execute.
[0103] Figure 6 This is a schematic diagram of the document editor in the fourth embodiment. Please continue to combine Figure 2 , Figure 3 Reference Figure 1 , Figure 6 In an exemplary embodiment, after performing step 103 to render at least one target element with a mask based on the container graphic information corresponding to each mask identifier, step 106 may be further included, wherein:
[0104] Step 106, when it is detected that any area where the mask is located is clicked or the cursor hovers for a preset time, the mask is updated from a maintained state to an activated state, and the target element blocked by the mask is displayed.
[0105] Specifically, the present application also provides an optional implementation method, in which, when the target element is covered by the mask, it can be monitored in step 106 whether the area where the mask is located is clicked by the cursor or hovered for a preset time. When it is detected that any area where the mask is located is clicked or the cursor hovers for a preset time, the mask is updated from the maintained state to the activated state, and the mask in the activated state will display the target element in its area; Figure 6 When the shown area 2 is clicked or the cursor hovers over it for a preset time, the target element of area 2 is in a display state, and the mask does not block the content of area 2; that is, when the mask is clicked or the cursor hovers over it for a preset time, the target element covered by the mask will be viewed by the user. The adjustment of the mask state can be achieved in this simple operation method, which is conducive to improving the user experience.
[0106] It should also be added that after the mask of the target element is re-rendered in step 105, when it is detected in step 106 that any area where the mask is located is clicked or the cursor hovers for a preset time, the mask is updated from the hold state to the active state and the target element obscured by the mask is displayed.
[0107] Figure 7 This is a schematic diagram of a document editor in the fifth embodiment. Figure 2 , Figure 3 Reference Figure 1 , Figure 7 In an exemplary embodiment, after performing step 103 to render at least one target element with a mask based on the container graphic information corresponding to each mask identifier, the method may further include step 107, wherein:
[0108] Step 107: When the electronic document enters the display mode, in response to the movement operation of the erasing tool, the mask area in the electronic document to which the erasing tool moves is erased, and the target element blocked by the erased mask area is displayed.
[0109] Specifically, the present application also provides an optional implementation method, in which, when the target element is in a state of being covered by a mask, when the electronic document enters the display mode, in step 107, in response to the movement operation of the erasing tool (such as an eraser) selected by the user, the mask area in the electronic document to which the erasing tool moves is erased, so as to display the target element that was originally obscured in the area where the mask is erased. In this simple operation method, selective adjustment of the mask state is achieved, which is conducive to improving the user experience.
[0110] It should be supplemented that, when using the erasing tool to erase the mask, the present application provides three optional implementation methods: first, after the erasing tool performs an erasing operation on a partial area of a mask, the entire mask is updated to an activated state, and all target elements in the area where the mask is located are displayed; second, after the erasing tool performs an erasing operation on an area of a preset proportion of a mask, the entire mask is updated to an activated state, and all target elements in the area where the mask is located are displayed; for example, after the erasing tool performs an erasing operation on an area of more than 80% of a mask, the entire mask is updated to an activated state; third, after the erasing tool performs an erasing operation on a partial area of a mask, only the area erased by the erasing tool is activated, and only the target elements in the area erased by the erasing tool are displayed.
[0111] It should also be added that after the mask of the target element is re-rendered through step 105, step 107 can be further executed. When the electronic document enters the display mode, in response to the movement operation of the erasing tool, the mask area in the electronic document to which the erasing tool is moved is erased, and the target element obscured by the erased mask area is displayed.
[0112] Figure 8 It is a flowchart of a method for realizing a mask in another embodiment. Fig. 9 is a schematic diagram of a document editor in the sixth embodiment, Fig.10 is a schematic diagram of a calculation process of mask position information in one embodiment, Fig.11This is a schematic diagram of the calculation process of the mask position information in another embodiment. Figure 1-Figure 7 Reference Figure 8-Figure 11 The present application also provides an optional implementation method, the process of the masking method can be steps 201-205, which can be applied in a document editor that needs to add a mask to an element. When the user needs to add a mask to content elements such as text, tables, formulas, mind maps, etc., this solution can be used. Among them:
[0113] The content of step 201 is to monitor the cursor moving the selected target element in the current edit box in the document editor; Fig. 9 As shown, in the document editor, move the cursor to select document elements, such as text, columns, pictures, formulas, etc., trigger the right-click menu, and select "Add Mask" in the menu to add a mask to the elements in the selection.
[0114] Please refer to Figure 2 , Figure 8 , the content of step 202 is to determine the mapping relationship between the mask identifier and the element based on each target element, and store the model data; specifically, according to the elements selected in 201, including text, pictures, columns, and formula elements, the mask control module of the editor will filter out the picture elements according to the defined rules (such as the preset target rules); wherein the preset target rules limit the target elements that can add masks to not include picture elements. Then, the mask area is split according to the element category, such as splitting into Figure 2 Region 1 to Region 4 are included in the column. For example, the column element contains two text editing containers, so the column is split into two mask regions, such as Figure 2 For elements in the same area, the unique identifier of the mask will be recorded on the model data of the element, that is, a mask identifier forms a mapping relationship with multiple elements in the area, and is stored in the storage unit by the mask control module.
[0115] Please refer to Figure 8 , the content of step 203 is to perform mask rendering on each of the target elements based on the model data; specifically, the mask drawing module reads the mapping relationship between the mask identifier and the element from the storage unit, calculates the position information of the document element relative to the editor, and completes the drawing of the mask; so as to cover the corresponding elements in the editor through the drawn mask.
[0116] The content of step 203 specifically includes steps 231 to 233, please refer to Figure 8 and Fig.10, step 231 performs the calculation of the mask position information, specifically, converting the stored element model data into the selection information domSelection on the editor, and calculating the graphic information of multiple (n) rectangular containers composed of text and inline elements in the selection based on the operation function (such as Range.getClientRects()), and then aggregating the graphic information of the aforementioned n rectangular containers into the graphic information of a polygonal mask container based on the aggregated rectangular container, and then calculating the path data (path) for drawing the mask, converting the graphic information into the path data for drawing the mask, and finally obtaining the mask path (maskPath) based on the calculated path data, and performing the rendering of the corresponding mask. Please refer to Figure 8 , Fig.10 and Fig.11 The content of step 232 is to reduce the calculation of the mask position information after editing the document. When editing a document, the position information of the mask needs to be updated in real time. Since the calculation of the mask position is relatively complicated, it will affect the user's document editing experience. The mask control module will monitor the input of the text. If the elements involved need to be rearranged, it will notify the drawing module to continue the above steps. Fig.10 Otherwise, the non-related blocks only need to adjust the longitudinal position (translation) information of the mask layer to reduce the amount of calculation. The specific relevant process of step 232 is as follows Fig.11 As shown, based on the maskPath of the target element before it is edited, after the target element is edited / moved, the elements involved are monitored and found, the nodes of the target element that need to be rearranged are determined, and then the new selection of the target element after being edited / moved is obtained. Based on the new selection, the new selection information domSelection of the target element after being edited / moved is determined, and then executed Fig.10 The calculation process in , get the new maskPath of the target element after editing / moving; if the target element has only vertical position information changes, you can choose to only perform vertical translation of non-related blocks, and then get the new maskPath of the target element after moving. Here, the target element has only vertical position information changes, which means that only the vertical position information of a certain target element has changed in the editor, and the horizontal position information remains unchanged. Please refer to Figure 4 , Figure 8 and Fig.10 , the content executed in step 233 is that the mask drawing module has made special optimizations. Since the document content may be very large, if the full amount is drawn directly, the performance will be very poor. Therefore, an incremental drawing solution is adopted here to only draw the mask content in the visible area. Specifically, the mask control module will monitor whether the current document element is in the window area. If it is in the window area, it will notify the mask rendering module, dynamically calculate the position information of the element and draw the mask content.
[0117] It should be added that the graphic information of the above-mentioned container is limited to the graphic information of a rectangular container, which is only an optional implementation method provided by the present application. The present application does not make any specific limitation on the shape of the sub-graphic corresponding to the sub-graphic information provided by the present application. The shape of the sub-graphic can be a rectangle as shown in the figure, or other more suitable shapes, such as a circle, triangle, trapezoid, pentagon, polygon, etc.
[0118] Please refer to Figure 6 and Figure 8 , the content of step 204 is that the mask can be selected, moved, deleted, copied and pasted in the editing window of the document. Specifically, step 204 is the operation of the mask in the editing window, which specifically includes steps 241-243. The content of step 241 is specifically the selection of the mask, such as Figure 6 As shown, when the mouse hovers or clicks the target mask, the current mask will become activated and display the elements under the mask; the content executed in step 242 is specifically the movement of the mask. Click and hold the button on the left side of the mask with the mouse, the mask will become visible, and release the mouse button at the target position to complete the movement of the mask position; the content executed in step 243 is specifically the copy and paste of the mask. Move the cursor to select the element with the mask. Like other text editors, the mask can be copied through the keyboard shortcut keys, and the text will not lose the mask information after the paste operation, and the mask will be redrawn.
[0119] Please refer to Figure 8 The content of step 205 is to trigger the entry into the document presentation mode, select the eraser tool to remove the mask rendering on the cursor moving area; click the teaching button in the main menu bar with the mouse to enter the document teaching mode, and click the eraser in the teaching tool below to erase the masked elements in the editing mode.
[0120] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0121] Based on the same inventive concept, the embodiment of the present application also provides a mask realization device for realizing the above-mentioned mask realization method. The implementation scheme for solving the setting of multiple different element masks provided by the device is similar to the implementation scheme recorded in the above-mentioned method, so the specific limitations in the one or more mask realization device embodiments provided below can refer to the limitations of the mask realization method above, and will not be repeated here.
[0122] Fig.12 This is a structural block diagram of a mask implementation device in an embodiment. Figure 1-Figure 3 Reference Fig.12 In an exemplary embodiment, as Fig.12 As shown, a mask layer implementation device 200 is provided, the device comprising: a data association module 81, a data processing module 82 and a mask layer rendering module 83, wherein:
[0123] The data association module 81 is used to establish a mapping relationship between at least one group of target elements and corresponding mask identifiers when at least one target element in the electronic document displayed in the editing window is selected;
[0124] The data processing module 82 is used to calculate the sub-graphic information of each target element corresponding to the same mask layer identifier based on the mapping relationship, aggregate the sub-graphic information corresponding to the same mask layer identifier, and form the container graphic information corresponding to the same mask layer identifier; the container graphic information is matched with the position information of the target element corresponding to the same mask layer identifier relative to the editing window;
[0125] The mask rendering module 83 is used to perform mask rendering on at least one target element based on the container graphic information corresponding to each mask identifier.
[0126] Specifically, the present application provides a mask implementation device 200, which includes a data association module 81, a data processing module 82 and a mask rendering module 83. The data association module 81 is used to monitor the electronic document displayed in the editing window, and when it is detected that at least one target element in the electronic document is selected, establish a mapping relationship between each selected target element and its corresponding mask identifier; wherein the target element is an element on which a mask can be set when necessary to use the mask to shield the corresponding target element; the data association module 81 is used to establish a mapping relationship between the selected target element in the electronic document and the corresponding mask identifier, so that each target element has its corresponding mask identifier, that is, each mask identifier has one or more corresponding target elements.
[0127] It should be noted that the target element here can be at least one of all elements included in the electronic document, or can be all elements included in the electronic document, and this application does not make specific restrictions on this. Among them, one target element corresponds to one mask layer identifier, but one mask layer identifier can correspond to multiple target elements. It should also be added that, if Figure 2 As shown, the target element may be, for example, at least one of a text element, a picture element, a column element, and the like.
[0128] The data processing module 82 is used to calculate the sub-graphic information of each target element corresponding to the same mask identifier based on the obtained mapping relationship between the target element and the mask identifier after the mapping relationship between the selected target element in the electronic document and the mask identifier is established through the data association module 81, so as to obtain the position information of each target element corresponding to the same mask identifier relative to the editing window, and then aggregate the multiple sub-graphic information corresponding to the same mask identifier to form container graphic information that matches the multiple target elements corresponding to the same mask identifier, thereby obtaining the common position information of the multiple target elements corresponding to the same mask identifier relative to the editing window, which is facilitating the subsequent rendering of the mask based on the position information of the container graphic information relative to the editing window, so as to cover all target elements that have a mapping relationship with the mask identifier.
[0129] In the above data processing module 82, for the calculation method of the container graphic information corresponding to the same mask identifier, after calculating the sub-graphic information of the selected different target elements respectively, the sub-graphic information corresponding to the same mask identifier is aggregated into the container graphic information corresponding to the whole, which is conducive to realizing the calculation of the sub-graphic information related to the mask rendering for each target element in the complex rich text editing scene; in this method, the amount of calculation of the sub-graphic information required for the mask rendering is very small, which is conducive to improving the calculation accuracy of the container graphic information, thereby improving the rendering accuracy of the mask, and also improving the setting effect of the mask in the electronic document; and the small amount of calculation can avoid increasing the computing burden of the processor related to the electronic document, avoid affecting the overall use performance of the electronic document, thereby improving the user's experience of the electronic document. That is, the mask finally rendered corresponding to a mask identifier can cover one or more target elements with which it has a mapping relationship.
[0130] After obtaining the container graphic information corresponding to each mask identifier through the data processing module 82, the mask rendering module 83 renders the mask corresponding to each mask identifier based on the obtained container graphic information corresponding to each mask identifier, so that the selected target element in the electronic document can be rendered with the required mask.
[0131] Among them, Figure 2 and Figure 3 As shown, Figure 2 The elements in regions 1, 2, 3, and 4 are target elements. After the mask rendering module 83 performs mask rendering on the target elements, the target elements are updated to Figure 3 As shown, the elements in area 1, area 2, area 3, and area 4 are rendered with a mask layer, and the mask layer blocks the target elements in the corresponding area.
[0132] It should be noted that the present application does not specifically limit the color, pattern, etc. of the mask. Figure 3 In addition to the colors and patterns shown, it can also be pure white, mosaic style, etc.
[0133] It should also be added that the present application does not specifically limit the type of target elements. The target elements may be any type of elements such as text, columns, formulas, mind maps, pictures, tables, etc., and the present application does not limit the type and quantity of target elements corresponding to the same mask identifier. Therefore, through the mask implementation method provided by the present application, mask rendering can be achieved for any selected target element in the electronic document, which is conducive to increasing the types of elements covered by the mask, thereby helping to improve the user experience of the electronic document.
[0134] In an exemplary embodiment, the data processing module 82 is further used to update the container graphic information of the mask mark corresponding to the target element when it is detected that the target element is edited; the mask rendering module 83 is further used to re-render the mask of the target element based on the updated container graphic information. Figure 1-Figure 3 , and the above Figure 1-Figure 3 Description.
[0135] In an exemplary embodiment, the data processing module 82 updates the container graphic information of the mask layer corresponding to the target element when it detects that the target element is edited, specifically including: when the mask layer is in an activated state, in response to the position of the moving target element in the electronic document, and when the moving operation is completed, updating the container graphic information of the mask layer corresponding to the target element; when the mask layer is in an activated state, displaying the target element covered by the mask layer. For details, please refer to Figure 1-Figure 3 , and the above Figure 1-Figure 3 Description.
[0136] In an exemplary embodiment, the data processing module 82 updates the container graphic information of the mask layer corresponding to the target element when it detects that the target element is edited, specifically including: when the mask layer is in an activated state, in response to copying the target element and when the operation of pasting the copied target element to another position of the electronic document is completed, the container graphic information of the mask layer corresponding to the target element is updated; when the mask layer is in an activated state, the target element covered by the mask layer is displayed. For details, please refer to Figure 1-Figure 3 , and the above Figure 1-Figure 3 Description.
[0137] In an exemplary embodiment, the mask rendering module 83 performs mask rendering on at least one target element based on the container graphic information corresponding to each mask identifier, specifically including: when it is detected that the target element is located in the window area of the editing window, based on the container graphic information corresponding to the mask identifier of the target element located in the window area, performing mask rendering on at least one target element located in the window area. Figure 1-Figure 4 , and the above Figure 1-Figure 4 Description.
[0138] In an exemplary embodiment, the data association module 81 establishes a mapping relationship between at least one group of target elements and corresponding mask identifiers when at least one target element in the electronic document displayed in the editing window is selected, specifically including: when at least one element in the electronic document displayed in the editing window is selected, filtering the target element from the selected elements based on a preset target rule; determining at least one mask area to be rendered based on the filtered target element; and establishing a mapping relationship between at least one group of target elements and the mask identifiers of the corresponding mask areas. For details, please refer to Figure 1-Figure 3 and Figure 5 , and the above Figure 1-Figure 3 and Figure 5 Description.
[0139] In an exemplary embodiment, the mask rendering module 83 performs mask rendering on at least one target element based on the container graphic information corresponding to each mask identifier, specifically including: based on the container graphic information corresponding to each mask identifier, converting drawing path information of the mask corresponding to the mask identifier, and performing mask rendering on at least one target element based on the drawing path information. Figure 1-Figure 3 , and the above Figure 1-Figure 3 Description.
[0140] In an exemplary embodiment, after the above-mentioned mask rendering module 83 performs mask rendering on at least one target element based on the container graphic information corresponding to each mask identifier, the mask implementation device 200 further includes a mask removal module, which is used to update the mask from the maintained state to the activated state and display the target element blocked by the mask when it is detected that any area where the mask is located is clicked or the cursor hovers for a preset time. Figure 1-Figure 3 , Figure 6 , and the above Figure 1-Figure 3 , Figure 6 Description.
[0141] In an exemplary embodiment, after the above-mentioned mask rendering module 83 performs mask rendering on at least one target element based on the container graphic information corresponding to each mask identifier, the mask implementation device 200 further includes a mask removal module, which is used to erase the mask area where the erasing tool moves in the electronic document in response to the movement operation of the erasing tool when the electronic document enters the display mode, and display the target element blocked by the erased mask area. For details, please refer to Figure 1-Figure 3 and Figure 7 , and the above Figure 1-Figure 3 and Figure 7 Description.
[0142] Each module in the above-mentioned mask realization device can be implemented in whole or in part by software, hardware and a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module above.
[0143] Fig.13 FIG. 1 is an internal structure diagram of a computer device in an embodiment. In an exemplary embodiment, a computer device is provided. The computer device may be a terminal. The internal structure diagram thereof may be as shown in FIG. Fig.13As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a mask implementation method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0144] Those skilled in the art will understand that Fig.13 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0145] Based on the same inventive concept, the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the aforementioned mask implementation method is implemented. The mask implementation method is any one of the mask implementation methods mentioned in the embodiments of the present application. Relevant embodiments can be found above.
[0146] Based on the same inventive concept, the present application also provides a computer program product, including a computer program, which implements the aforementioned mask implementation method when executed by a processor. The mask implementation method is any one of the mask implementation methods mentioned in the embodiments of the present application. Relevant embodiments can be found above.
[0147] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0148] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0149] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0150] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for realizing a mask, characterized in that: include: When at least one target element in the electronic document displayed in the editing window is selected, establishing at least one group of mapping relationships between the target element and the corresponding mask identifier; Based on the mapping relationship, calculating the sub-graphic information of each target element corresponding to the same mask layer identifier, aggregating the sub-graphic information corresponding to the same mask layer identifier, and forming container graphic information corresponding to the same mask layer identifier; The container graphic information matches the position information of the target element corresponding to the same mask identifier relative to the editing window; Based on the container graphic information corresponding to each of the mask identifiers, mask rendering is performed on at least one of the target elements.
2. The method for realizing a mask according to claim 1, characterized in that: Also includes: When it is detected that the target element is edited, updating the container graphic information of the mask mark corresponding to the target element; The mask of the target element is re-rendered based on the updated container graphics information.
3. The method for realizing the masking layer according to claim 2, characterized in that: When it is detected that the target element is edited, updating the container graphic information of the mask mark corresponding to the target element includes: When the mask is in an activated state, in response to moving the position of the target element in the electronic document, and when the moving operation ends, the container graphic information of the mask mark corresponding to the target element is updated; when the mask is in an activated state, the target element blocked by the mask is displayed.
4. The method for realizing a mask according to claim 2, characterized in that: When it is detected that the target element is edited, updating the container graphic information of the mask mark corresponding to the target element includes: When the mask is in an activated state, in response to copying the target element and when the operation of pasting the copied target element to another position of the electronic document is completed, the container graphic information of the mask mark corresponding to the target element is updated; when the mask is in an activated state, the target element obscured by the mask is displayed.
5. The method for realizing a mask according to claim 1, characterized in that: The performing mask rendering on at least one of the target elements based on the container graphic information corresponding to each of the mask identifiers includes: When it is detected that the target element is located in the viewing area of the editing window, mask rendering is performed on at least one of the target elements located in the viewing area based on the container graphic information corresponding to the mask identifier of the target element located in the viewing area.
6. The method for realizing a mask according to claim 1, characterized in that: When at least one target element in the electronic document displayed in the editing window is selected, establishing at least one group of mapping relationships between the target elements and corresponding mask identifiers, including: When at least one element in the electronic document displayed in the editing window is selected, selecting a target element from the selected elements based on a preset target rule; Determine at least one mask area to be rendered based on the filtered target element; A mapping relationship between at least one group of the target elements and the corresponding mask identifiers of the mask area is established.
7. The method for realizing a mask according to claim 1, characterized in that: The performing mask rendering on at least one of the target elements based on the container graphic information corresponding to each of the mask identifiers includes: Based on the container graphic information corresponding to each mask identifier, drawing path information for drawing the mask corresponding to the mask identifier is converted, and mask rendering is performed on at least one of the target elements based on the drawing path information.
8. The method for realizing a mask according to claim 1, characterized in that: After performing mask rendering on at least one of the target elements based on the container graphic information corresponding to each of the mask identifiers, the method further includes: When it is detected that any area where the mask is located is clicked or the cursor hovers for a preset time, the mask is updated from a maintained state to an activated state, and the target element covered by the mask is displayed.
9. The method for realizing a mask according to claim 1, characterized in that: After performing mask rendering on at least one of the target elements based on the container graphic information corresponding to each of the mask identifiers, the method further includes: When the electronic document enters the display mode, in response to the movement operation of the erasing tool, the mask area in the electronic document to which the erasing tool moves is erased, and the target element blocked by the erased mask area is displayed.
10. A device for realizing a mask, characterized in that: The device comprises: A data association module is used to establish a mapping relationship between at least one group of target elements and corresponding mask identifiers when at least one target element in the electronic document displayed in the editing window is selected; a data processing module is used to calculate sub-graphic information of each target element corresponding to the same mask identifier based on the mapping relationship, aggregate the sub-graphic information corresponding to the same mask identifier, and form container graphic information corresponding to the same mask identifier; the container graphic information matches the position information of the target element corresponding to the same mask identifier relative to the editing window; The mask rendering module is used to perform mask rendering on at least one of the target elements based on the container graphic information corresponding to each of the mask identifiers.
11. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 9 are implemented.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.
13. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.