Search

CN-121982126-A - Texture flow control method and device and electronic equipment

CN121982126ACN 121982126 ACN121982126 ACN 121982126ACN-121982126-A

Abstract

The invention provides a texture flow control method, a texture flow control device and electronic equipment, wherein a first image layer and a second image layer are generated based on a target texture image, a path drawing operation which acts on the target texture image is responded, two curve paths are generated in the target texture image based on the path drawing operation, a texture flow direction is determined based on the two curve paths, a path mask image is generated, a display area in the path mask image is an image area between the two curve paths, displacement amounts which change along with time are respectively configured for the first image layer and the second image layer based on the texture flow direction and a preset time parameter, displacement processing is conducted on the first image layer and the second image layer based on the displacement amounts, the first image layer and the second image layer after the displacement processing are obtained, and mixed images of the path mask image and the first image layer and the second image layer after the displacement processing are obtained, wherein the texture flow change in the display area are obtained. The texture flow direction and the texture flow area are precisely controlled through two curve paths.

Inventors

  • LIU SIHONG

Assignees

  • 广州博冠信息科技有限公司

Dates

Publication Date
20260505
Application Date
20251204

Claims (15)

  1. 1. A texture flow control method, the method comprising: acquiring a target texture map, and generating a first layer and a second layer based on the target texture map, wherein textures of the first layer and the second layer are the same as those of the target texture map; generating two curve paths in the target texture map based on path drawing operations in response to the path drawing operations acting on the target texture map; Determining a texture flow direction based on the two curve paths and generating a path mask, wherein a display area in the path mask is an image area between the two curve paths, and the texture flow direction is used for indicating a flow direction corresponding to textures in the display area; Configuring displacement amounts which change along with time for the first layer and the second layer respectively based on the texture flow direction and a preset time parameter, and carrying out displacement processing on the first layer and the second layer based on the displacement amounts corresponding to the first layer and the second layer respectively to obtain the first layer and the second layer after the displacement processing, wherein the displacement amounts corresponding to the first layer are different from the displacement amounts corresponding to the second layer; And mixing the path mask, the first image layer and the second image layer after the displacement processing to obtain a mixed image, wherein the texture flow in the display area in the mixed image changes.
  2. 2. The method of claim 1, wherein the step of determining a texture flow direction and generating a path mask based on the two curved paths comprises: In the target texture map, determining an image area between the two curve paths as a display area, and determining an image area outside the display area as a mask area to generate a path mask map; and determining the texture flow direction according to a preset flow mode and the path trend of the two curve paths.
  3. 3. The method of claim 2, wherein the step of determining the texture flow direction from a preset flow pattern and the path profiles of the two curved paths comprises: And if the flow mode is a diameter-extending mode, determining the texture flow direction according to the tangential direction of the pixel point on each of the two curve paths.
  4. 4. The method of claim 2, wherein the step of determining the texture flow direction from a preset flow pattern and the path profiles of the two curved paths comprises: If the flow mode is a through-path mode, for each of the two curved paths, performing the following operations: Determining the shortest distance from the current pixel point to another curve path according to each pixel point on the current curve path, determining the normal direction of the current pixel point based on the shortest distance, and determining the texture flow direction based on the normal direction, wherein the other curve path is a curve path except the current curve path in the two curve paths.
  5. 5. The method of claim 4, wherein the step of determining the normal direction of the current pixel point based on the shortest distance comprises: And determining the pixel point corresponding to the shortest distance in the other curve path as a target pixel point, and determining the connecting line direction between the current pixel point and the target pixel point as the normal direction of the current pixel point.
  6. 6. The method of claim 5, wherein the step of determining a direction of a line connecting the current pixel point and the target pixel point as a normal direction of the current pixel point comprises: determining a drawing sequence between the current curve path and the other curve path; and determining the connecting line direction of the current pixel point to the target pixel point as the normal line direction of the current pixel point or determining the connecting line direction of the target pixel point to the current pixel point as the normal line direction of the current pixel point based on the drawing sequence.
  7. 7. The method according to claim 1, wherein the step of configuring the first layer and the second layer with time-dependent displacement amounts based on the texture flow direction and a preset time parameter, respectively, comprises: the displacement amount corresponding to the first layer and the displacement amount corresponding to the second layer are configured by the following formulas: D1 = direction × displacement × sin(time × speed); D2 = direction × displacement × sin(time × speed + π/4); Wherein D1 represents a displacement amount corresponding to the first layer, D2 represents a displacement amount corresponding to the second layer, direction represents a texture flow direction, displacement represents a movement step length, time represents a preset time parameter, and speed represents a movement speed.
  8. 8. The method of claim 1, wherein after the steps of determining a texture flow direction and generating a path mask based on the two curved paths, the method further comprises: determining, for each pixel point in the target texture map, a first distance between the pixel point and a first curve path of the two curve paths and a second distance between the pixel point and a second curve path of the two curve paths, and determining, based on the first distance and the second distance corresponding to the pixel point, a transparency corresponding to the pixel point; And integrating the transparency corresponding to each pixel point in the target texture map to obtain the mask transparency corresponding to the path mask map.
  9. 9. The method of claim 8, wherein the step of determining the transparency corresponding to the pixel based on the first distance and the second distance corresponding to the pixel comprises: And carrying out smooth transition processing on the first distance and the second distance corresponding to the pixel points to obtain the transparency corresponding to the pixel points.
  10. 10. The method of claim 9, wherein the step of performing smooth transition processing on the first distance and the second distance corresponding to the pixel point to obtain the transparency corresponding to the pixel point includes: performing smooth transition processing on the first distance corresponding to the pixel point to obtain first transparency, and performing smooth transition processing on the second distance corresponding to the pixel point to obtain second transparency; and determining the smaller value of the first transparency and the second transparency as the transparency of the pixel point.
  11. 11. The method of claim 8, wherein the step of blending the path mask, the shifted first layer, and the second layer to obtain a blended image comprises: determining the mixing weights corresponding to the first image layer and the second image layer respectively according to the mask transparency corresponding to the path mask; And mixing the first image layer and the second image layer after the displacement processing based on the mixing weight to obtain a mixed image.
  12. 12. The method of claim 1, wherein after the steps of determining a texture flow direction and generating a path mask based on the two curved paths, the method further comprises: and performing edge eclosion processing on the display area in the path mask to obtain an updated path mask.
  13. 13. A texture flow control device, the device comprising: The image layer generating module is used for acquiring a target texture image and generating a first image layer and a second image layer based on the target texture image, wherein the textures of the first image layer and the second image layer are the same as the target texture image; a path drawing module, configured to generate two curve paths in the target texture map based on a path drawing operation that acts on the target texture map; The mask generation module is used for determining a texture flow direction based on the two curve paths and generating a path mask, wherein a display area in the path mask is an image area between the two curve paths, and the texture flow direction is used for indicating a flow direction corresponding to textures in the display area; The image layer displacement module is used for respectively configuring displacement amounts which change along with time for the first image layer and the second image layer based on the texture flow direction and a preset time parameter, and carrying out displacement processing on the first image layer and the second image layer based on the displacement amounts respectively corresponding to the first image layer and the second image layer to obtain the first image layer and the second image layer after the displacement processing, wherein the displacement amounts corresponding to the first image layer and the second image layer are different; and the layer mixing module is used for mixing the path mask, the first layer after the displacement processing and the second layer to obtain a mixed image, wherein the texture flow in the display area in the mixed image is changed.
  14. 14. An electronic device comprising a processor and a memory, the memory storing machine executable instructions executable by the processor, the processor executing the machine executable instructions to implement the texture flow control method of any one of claims 1 to 12.
  15. 15. A computer readable storage medium storing computer executable instructions which, when invoked and executed by a processor, cause the processor to implement the texture flow control method of any one of claims 1 to 12.

Description

Texture flow control method and device and electronic equipment Technical Field The present disclosure relates to the field of computer graphics processing technologies, and in particular, to a texture flow control method, a texture flow control device, and an electronic device. Background In the related art, the texture flow scheme needs to be realized by overlapping a plurality of resource diagrams, so that the memory occupation is high and the processing is time-consuming, and meanwhile, the texture flow direction control depends on complex parameter adjustment (such as rotation angle/gradual change mapping) and cannot accurately control the texture flow in an irregular area. Disclosure of Invention The disclosure aims to provide a texture flow control method, a texture flow control device and electronic equipment, so as to accurately control texture flow of an image area. The method comprises the steps of obtaining a target texture map, generating a first layer and a second layer based on the target texture map, responding to path drawing operation acting on the target texture map, generating two curve paths in the target texture map based on the path drawing operation, determining texture flow directions based on the two curve paths and generating a path mask, wherein a display area in the path mask is an image area between the two curve paths, the texture flow directions are used for indicating flow directions corresponding to textures in the display area, respectively configuring displacement amounts which change along time for the first layer and the second layer based on the texture flow directions and preset time parameters, respectively carrying out displacement processing on the first layer and the second layer based on the displacement amounts corresponding to the first layer and the second layer, obtaining the first layer and the second layer after the displacement processing, wherein the displacement amounts corresponding to the first layer and the second layer are different, carrying out mixed treatment on the first layer and the second layer after the displacement processing, and obtaining the mixed image in the mixed image area. The texture flow control device comprises a layer generation module, a path drawing module, a mask generation module, a first layer displacement module and a second layer displacement module, wherein the layer generation module is used for acquiring a target texture image, generating a first layer and a second layer based on the target texture image, the textures of the first layer and the second layer are identical to those of the target texture image, the path drawing module is used for responding to path drawing operation acting on the target texture image, generating two curve paths in the target texture image based on the path drawing operation, the mask generation module is used for determining texture flow directions based on the two curve paths and generating a path mask, a display area in the path mask is an image area between the two curve paths, the texture flow directions are used for indicating flow directions corresponding to the textures in the display area, the layer displacement module is used for respectively configuring displacement amounts which change along with time for the first layer and the second layer based on the texture flow directions and preset time parameters, the first layer and the second layer are respectively corresponding to the displacement amounts, the first layer and the second layer after the displacement processing is obtained, the first layer and the second layer after the displacement processing is carried out, the first layer and the second layer after the displacement processing is obtained, the first layer and the second layer after the displacement amounts corresponding to the first layer and the second layer are mixed and the second layer are used for processing the displacement amounts. In a third aspect, the present disclosure provides an electronic device comprising a processor and a memory storing machine executable instructions executable by the processor to implement the above-described texture flow control method. In a fourth aspect, the present disclosure provides a computer-readable storage medium storing computer-executable instructions that, when invoked and executed by a processor, cause the processor to implement the texture flow control method described above. The embodiment of the disclosure brings the following beneficial effects: The texture flow control method, the texture flow control device and the electronic equipment comprise the steps of firstly obtaining a target texture map, generating a first image layer and a second image layer based on the target texture map, further responding to path drawing operation acting on the target texture map, generating two curve paths in the target texture map based on the path drawing operation, determining the flow direction of the texture based on the two cu