Design document-oriented personalized replacement tailoring deformation rendering method and system

By structurally parsing and binding inverse mapping rules to design files, the instability and computational overhead issues in personalized image replacement and cropping deformation rendering processes are resolved, achieving efficient and stable image processing results.

CN121392102BActive Publication Date: 2026-04-10XIAMEN FINGERPRINT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-24
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

In existing technologies, the personalized image replacement and cropping deformation rendering process lacks a unified deformation normalization path and incremental reuse mechanism, resulting in unstable results, high computational overhead, and insufficient real-time performance.

Method used

By performing structured analysis on the design files, the binding relationship between external materials and target layers is established, forming a single inverse mapping rule. Layer composition is performed using the rules of pre-multiplication of transparency and blending mode, and dirty rectangular areas are determined based on the layer dependency graph, generating reuse identifiers and texture fingerprints.

Benefits of technology

It achieves stability, efficiency, and repeatability in personalized replacement, cropping, deformation, and rendering, reduces computational overhead, and improves real-time performance and the reusability of results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121392102B_ABST
    Figure CN121392102B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of graphic image processing, and discloses a personalized replacement, cutting, deformation and rendering method and system for design files, which comprises the following steps: step 1, analyzing a design file, binding external materials with target layers according to a replacement mapping table, and obtaining adapted material textures; step 2, normalizing deformation, and forming a single inverse mapping rule; step 3, sampling and applying a mask according to the single inverse mapping rule, and obtaining a cut layer; step 4, setting a synthesis area for a cutting group, pre-multiplying transparency accumulation, and obtaining a local synthesis texture of the cutting group; step 5, pasting the texture back to a main canvas and combining the texture with non-group layers according to a mixing mode; step 6, propagating changes according to a layer dependency graph, determining a dirty rectangle area, and generating a reuse identifier and a texture fingerprint; and step 7, outputting the main canvas and exporting the texture and metadata. The application realizes stable, efficient and traceable reuse of integrated online rendering of personalized replacement, cutting and deformation for design files.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of graphic image processing, and particularly relates to a personalized replacement, cutting, deformation and rendering method and system for design files. BACKGROUND

[0002] Design files are widely used in scenarios such as graphic design, UI design, advertising materials and e-commerce templates, and usually save information such as layers, cutting groups, masks, blending and deformation in a layered structure, and rely on online rendering to complete preview and export. In the prior art, personalized image replacement is usually implemented by re-rendering at the bitmap level. On the one hand, the binding of external materials and target layers lacks unified checking rules, and there are multi-source binding conflicts or uncertain orders, resulting in unstable replacement results. On the other hand, deformation, cutting and synthesis are usually processed in different stages, and the combination order of perspective, affine, free deformation and grid deformation lacks a fixed normalization path, which is prone to problems such as non-reproducible coordinate mapping, multiple sampling superposition and mask boundary distortion. In addition, when the materials or parameters change locally, the traditional scheme usually relies on full-canvas redrawing, lacks an influence domain propagation and dirty rectangle area positioning mechanism based on layer dependency, and it is difficult to trigger recalculation in the smallest range; at the same time, it also lacks reuse identification management of deformation and sampling rules, resulting in that the same type of rendering task cannot reuse historical results, and the calculation overhead is large and the real-time performance is insufficient. SUMMARY

[0003] The application provides a personalized replacement, cutting and deformation rendering method and system for design files, which solves the technical problem that the personalized material replacement and cutting and deformation rendering process in the related art lacks a unified deformation normalization path and an incremental reuse mechanism.

[0004] The application provides a personalized replacement, cutting and deformation rendering method for design files, which comprises the following steps:

[0005] Step 1: obtaining a layer set, a cutting group set, a mask parameter, a blending mode, a deformation parameter and a target pixel area from a design file, establishing a one-to-one binding relationship between external materials and target layers based on a replacement mapping table, and generating an adapted material texture;

[0006] Step 2: for the replaced layer, normalizing the perspective deformation parameter, the affine deformation parameter, the grid parameter and the free deformation parameter according to the existence and value in a predetermined order to form a single inverse mapping rule from the target pixel position to the adapted material texture coordinate;

[0007] Step 3: obtaining the pixel value and transparency from the adapted material texture in the target pixel area according to the single inverse mapping rule, and applying the mask parameter to the pixel value and transparency according to the source-in synthesis rule to obtain a cut layer output;

[0008] Step 4, assign a local composite area to the clipping group, accumulate and superimpose the output of the clipped layers in the original layer order according to the rule of premultiplied alpha, and obtain the local composite texture of the clipping group;

[0009] Step 5, paste the local composite texture of the clipping group back to the corresponding position of the main canvas, and combine it with the non-group layer to perform merging on the main canvas according to the blending mode;

[0010] Step 6, propagate the changes of the material based on the layer dependency graph, determine the dirty rectangle area, and generate the reuse identifier and texture fingerprint according to the deformation parameter, the single inverse mapping rule and the output size;

[0011] Step 7, output the main canvas, and export the local composite texture of the clipping group and the metadata.

[0012] Further, the layer set, the clipping group set, the mask parameter, the blending mode, the deformation parameter and the target pixel area are obtained by parsing the design file, a one-to-one binding relationship between the external material and the target layer is established based on the replacement mapping table, and the adapted material texture is generated, including:

[0013] Step 11, structurally parse the design file to obtain the layer set, the clipping group set, the mask parameter, the blending mode, the deformation parameter and the target pixel area; check the consistency of the replacement mapping table and the layer set, and only keep the first binding of each target layer according to the order of the entries, and delete the remaining bindings;

[0014] Step 12, read the width and height of the target pixel area as the size reference, and fix the coordinate system of the target pixel area as the pixel coordinate system with the upper left corner as the origin, the horizontal direction to the right and the vertical direction downward;

[0015] Step 13, calculate the ratio of the target pixel area width to the external material width and the ratio of the target pixel area height to the external material height, and take the smaller value as the scaling ratio; the center displacement is composed of horizontal displacement and vertical displacement, the horizontal displacement is half of the difference between the target pixel area width and the scaled external material width, and the vertical displacement is half of the difference between the target pixel area height and the scaled external material height; when the scaled size exceeds the target pixel area, it is cut according to the center line, and when it does not exceed, it is filled with transparent pixels with premultiplied alpha, to generate the adapted material texture, and complete the association binding with the mask parameter, the blending mode, the deformation parameter and the target pixel area.

[0016] Further, for the replaced layer, normalize it in a predetermined order to form a single inverse mapping rule from the target pixel position to the adapted material texture coordinate, including:

[0017] Step 21, existence judgment is made on the perspective deformation parameters, affine deformation parameters, free-form deformation parameters and mesh parameters of the replaced layer, and the execution order is determined in the fixed order of perspective first, then affine, then free-form deformation and finally mesh, and the parameters not set are registered as not set;

[0018] Step 22, the target pixel position is converted into homogenous coordinates according to the inverse transformation of the perspective deformation parameters and is normalized with the third component, and when the perspective deformation parameters are not reversible or the denominator of the normalized component is zero, the target pixel position is kept unchanged according to the identity perspective transformation.

[0019] Step 23, the homogenous coordinates are converted into the position after affine normalization according to the inverse transformation of the affine deformation parameters, and when the affine deformation parameters are not reversible, the identity affine transformation is processed;

[0020] Step 24, when the free-form deformation parameters are set, the spline basis function is used, the basis function weight is calculated in ascending order of the control point index, and the control point displacement is sequentially superimposed; when the mesh parameters are set, the triangular element containing the position is located in the order of from top to bottom and then from left to right, the obtained texture coordinates are limited in the range of the adapted material texture in the boundary truncation manner, and a single inverse mapping rule from the target pixel position to the adapted material texture coordinates is formed.

[0021] Further, the pixel value and the transparency are obtained from the adapted material texture according to the single inverse mapping rule, and the mask parameters are applied to the pixel value and the transparency to obtain the cropped layer output, including:

[0022] Step 31, in the target pixel region, for each target pixel position, the adapted material texture coordinates are calculated according to the single inverse mapping rule, and the coordinates are limited in the effective range of the adapted material texture in the boundary truncation manner;

[0023] Step 32, the pixel value and the transparency are obtained by bilinear interpolation at the adapted material texture coordinates, four adjacent pixels are involved in the interpolation, the color channels are multiplied by the transparency respectively, and the pre-multiplied transparency representation is converted;

[0024] Step 33, the mask parameters are applied according to the source-in compositing rule in the target pixel region, when the mask parameters are from the vector mask, the mask rendering rule of the design file is rasterized with the target pixel region resolution according to the scan line, the non-zero wrap rule is used to determine the pixel coverage, and the coverage is used as the mask parameter; the pre-multiplied transparency color channels are multiplied by the mask parameters respectively, and the pre-multiplied transparency is multiplied by the mask parameters;

[0025] Step 34, the masked color and the masked transparency are taken as the cropped layer output, the cropped layer output is represented by the pre-multiplied transparency, and is saved together with the mask parameters, the blending mode and the target pixel region.

[0026] Further, a local composite area is assigned to the clipping group, and the accumulated superposition of the clipped layer output is accumulated according to the rule of premultiplied transparency in the original layer order to obtain the local composite texture of the clipping group, including:

[0027] Step 41, for each clipping group, the union of the target pixel area of the layers in the group is calculated, and the minimum axis-aligned bounding rectangle is taken as the local composite area, and a translation mapping from the main canvas coordinates to the local composite area coordinates is established;

[0028] Step 42, a cumulative buffer is set in the local composite area, and the cumulative color is initialized to zero value and the cumulative transparency is initialized to zero value as the only initial state of the layer-by-layer composition;

[0029] Step 43, the layer-by-layer composition is performed in the local composite area according to the original layer order, and the source-on-top composition rule of premultiplied transparency is used when the blending mode is normal mode; when the blending mode is not normal mode, the current cumulative color and the current layer color are first de-premultiplied, the mode-processed source color is obtained according to the pixel-by-pixel calculation rule, and then the cumulative color and the cumulative transparency are updated according to the source-on-top composition rule;

[0030] Step 44, the local composite texture of the clipping group is generated in the local composite area, and the local composite area, the cumulative color, the cumulative transparency and the clipping group identifier are saved together, and the translation mapping is saved together, which is used for global composition back to the main canvas outside the group.

[0031] Further, the local composite texture of the clipping group is pasted back to the corresponding position of the main canvas, and combined with the non-group layers, the merging is performed on the main canvas according to the blending mode, including:

[0032] Step 51, a processing sequence is generated according to the original global layer order of the design file, for each clipping group, the corresponding position of the main canvas for pasting is determined according to the positional relationship between the local composite area of the local composite texture of the clipping group and the main canvas, and the union bounding rectangle of all pasting positions and the target pixel area of all clipped layer outputs is taken as the main canvas processing range;

[0033] Step 52, the cumulative color and the cumulative transparency are initialized to zero value in the main canvas processing range, and the elements are composed element by element according to the processing sequence, the clipped layer output and the blending mode of the non-group layer are read when the element is the non-group layer, the local composite texture of the clipping group and the blending mode of the group are read when the element is the clipping group, the source-on-top composition rule of premultiplied transparency is used when the blending mode is normal mode, and the mode-processed source color is obtained according to the pixel-by-pixel calculation rule of the blending mode when the blending mode is not normal mode, and then the main canvas color and the transparency are updated according to the source-on-top composition rule;

[0034] Step 53, generate the main canvas output in the main canvas processing range, and save the main canvas output together with the pasting position of the local composite texture of each clipping group, the mixing mode of each clipping group, and the mixing mode of the non-group layer.

[0035] Further, determine the dirty rectangle region, generate the multiplexing identifier and the texture fingerprint, comprising:

[0036] Step 61, establish a layer dependency graph according to the original layer order of the design file and the clipping, mask, mixing and group containing relationship; parse the external event into a change set, record the change object, change type and timestamp; the change type includes material content change, mask parameter change, mixing mode change, deformation parameter change, single inverse mapping rule change and output size change;

[0037] Step 62, propagate each change from bottom to top along the layer dependency graph, and the target layer takes its target pixel region as the initial influence domain, and the clipping group takes its pasting position as the initial influence domain; take the pixel down and take the union bounding rectangle as the dirty rectangle region set, and overlap or adjacent merge, and sort from top to bottom and from left to right;

[0038] Step 63, generate the multiplexing identifier and the texture fingerprint for the object entering the recalculation, the multiplexing identifier is concatenated according to the field order of the deformation parameter, the discretization description of the single inverse mapping rule and the output size, the output size is wide first and high second, and the deterministic hash calculation is performed; the texture fingerprint is read according to the pixel data of the adapted material texture from left to right and from top to bottom, and the deterministic hash is determined after the byte sequence is composed according to the channel order and the quantization bit of each channel, and is registered to the multiplexing record table;

[0039] Step 64, generate the recalculation queue in units of dirty rectangle region; mark as multiplexing when the multiplexing identifier and the texture fingerprint are equal to the recording time of the multiplexing record table, otherwise mark as recalculation; sort the recalculation queue according to the dirty rectangle region vertical coordinate ascending order and the same vertical coordinate horizontal coordinate ascending order; merge the queue items of the same region and the same affected object, and output the dirty rectangle region, the recalculation queue and the multiplexing record table.

[0040] Further, when the number of rectangle regions in the dirty rectangle region set exceeds the upper limit, sort according to the area ascending order; when there are intersecting rectangle pairs and rectangle pairs with adjacent common edges, select the pair with the minimum area increment of the union bounding rectangle to merge, and the merging result takes the minimum axis-aligned bounding rectangle of the union of the two rectangles, and the boundary coordinates after merging are rounded down to pixel integers; when there are no above-mentioned rectangle pairs and still exceed the upper limit, continue to merge according to the center point distance ascending order until the number of rectangles is not greater than the upper limit.

[0041] Further, output the main canvas, and export the clipping group local composite texture and metadata, comprising:

[0042] Step 71, outputting the main canvas color and the main canvas transparency in the main canvas processing range from top to bottom and from left to right, adopting pre-multiplied transparency representation; determining the byte sequence of the head, color and transparency, and performing a deterministic hash calculation to generate a check digest, and registering the output path and the check digest;

[0043] Step 72, deriving the local composite texture and the translation mapping of each clipping group, recording the width and height of the local composite area, the row-priority byte sequence of color and transparency and the mapping parameters, performing a deterministic hash calculation to generate a check digest, and registering the clipping group identifier and the check digest;

[0044] Step 73, registering and exporting the metadata related to multiplexing, the metadata including the multiplexing identifier and the texture fingerprint, the field order being object identifier, multiplexing identifier, texture fingerprint, output size, generating an export directory, and outputting the main canvas.

[0045] The beneficial effects of the present application are as follows: the present application binds the design file structure analysis and the replacement mapping table one by one, eliminates multi-source conflicts; by unifying the pixel coordinate system and taking the smaller scaling ratio, center line cutting and transparent filling, the format and scale are kept consistent; by the order of perspective first, affine second, free deformation third and grid last, a single inverse mapping is formed, reducing resampling and coordinate ambiguity; by the pre-multiplied transparency and the mixed mode deterministic operator, the mask boundary and the color are consistent; by the hierarchical synthesis of the clipping group local synthesis and the main canvas pasting, the global calculation is reduced; by the layer dependency graph and the dirty rectangle positioning, only the affected area is recalculated; by the multiplexing identifier and the texture fingerprint, cross-task multiplexing is realized; by the deterministic export and the check digest, the result is traceable. Overall, the stability, efficiency and reviewability of personalized replacement, cutting, deformation and rendering are improved. BRIEF DESCRIPTION OF DRAWINGS

[0046] Figure 1 is a flowchart of the design file-oriented personalized replacement cutting deformation rendering method of the present application. DETAILED DESCRIPTION

[0047] The subject matter described herein will now be discussed with reference to example implementations. It should be understood that the discussion of these implementations is merely meant to provide a better understanding of the subject matter described herein and can be changed in function and arrangement without departing from the scope of the present specification. Various processes or components can be omitted, substituted, or added according to various examples. Additionally, features described with respect to some examples can be combined in other examples.

[0048] As shown in Figure 1 the design file-oriented personalized replacement cutting deformation rendering method includes the following steps:

[0049] Step 1, a layer set, a clipping group set, a mask parameter, a blending mode, a deformation parameter and a target pixel region are parsed from a design file, external materials are one-to-one bound with target layers based on a replacement mapping table, and adapted material textures are generated;

[0050] Step 2, for the replaced layer, a single inverse mapping rule from a target pixel position to an adapted material texture coordinate is formed according to the existence and value of perspective deformation parameters, affine deformation parameters, mesh parameters and free deformation parameters in a predetermined order;

[0051] Step 3, pixel values and transparencies are obtained from the adapted material texture in the target pixel region according to the single inverse mapping rule, and the mask parameter is applied to the pixel values and transparencies according to the source-in synthesis rule, to obtain a clipped layer output;

[0052] Step 4, a local synthesis region is assigned to the clipping group, and the clipped layer output is accumulated and superimposed according to the premultiplied transparency rule in the original layer order, to obtain a clipping group local synthesis texture;

[0053] Step 5, the clipping group local synthesis texture is pasted back to the corresponding position of the main canvas, and combined with non-group layers, and merged on the main canvas according to the blending mode;

[0054] Step 6, based on the layer dependency graph, the change of the material is propagated, the dirty rectangle region is determined, and the reuse identifier and texture fingerprint are generated according to the deformation parameter, the single inverse mapping rule and the output size;

[0055] Step 7, the main canvas is output, and the clipping group local synthesis texture and metadata are exported.

[0056] In an embodiment of the present application, a layer set, a clipping group set, a mask parameter, a blending mode, a deformation parameter and a target pixel region are parsed from a design file, external materials are one-to-one bound with target layers based on a replacement mapping table, and adapted material textures are generated, comprising:

[0057] Step 11, the design file is structurally parsed to obtain a layer set, a clipping group set, a mask parameter, a blending mode, a deformation parameter and a target pixel region; consistency checking is performed on the replacement mapping table and the layer set, only the first binding of each target layer is reserved according to the order of entries, and the remaining bindings are deleted; the target layer not appearing in the replacement mapping table is marked as unbound and does not enter the subsequent adaptation process. In the present application, the design file refers to a layered file containing layer relationship, clipping group, mask, blending mode and deformation information; the clipping group refers to a set of clipping relationship within the group defined according to the design file; the mask parameter refers to a pixel-by-pixel weight aligned with the layer, with a value range of zero to one; the blending mode refers to a layer composition mode identifier pre-recorded in the design file for each layer, each blending mode corresponds to a fixed set of pixel-by-pixel color operation rules, which is used to specify the synthesis method between the source color of the layer and the accumulated color below it. The deformation parameter refers to a parameter set related to perspective, affine, grid and free deformation; the target pixel region refers to the output pixel range of the target layer; the replacement mapping table refers to a one-to-one binding rule of the target layer and the external material.

[0058] Step 12, read the width and height of the target pixel region as the size reference, fix the coordinate system of the target pixel region as the pixel coordinate system with the upper left corner as the origin, horizontal right and vertical down; this coordinate system is used as the only reference for subsequent scaling, positioning, cutting and filling in this embodiment, without any change to the original coordinate direction and unit.

[0059] Step 13, calculate the ratio of the target pixel region width to the external material width and the ratio of the target pixel region height to the external material height, and take the smaller value as the scaling ratio; the scaling uses bilinear interpolation, and the scaled pixel coordinates are rounded down to pixel integers to ensure alignment with the pixel grid; the center displacement is composed of horizontal displacement and vertical displacement, the horizontal displacement is half of the difference between the target pixel region width and the scaled external material width, and the vertical displacement is half of the difference between the target pixel region height and the scaled external material height; when the scaled size exceeds the target pixel region, it is cut according to the center line, and when it does not exceed, it is filled with pre-multiplied transparent pixels in the center, i.e. the transparency channel takes zero value and the color channel takes zero value, to generate an adapted material texture, and complete the association binding with the mask parameter, the blending mode, the deformation parameter and the target pixel region. The adapted material texture refers to the material texture after deterministic scaling, positioning and cutting or filling within the target pixel region scale; the pre-multiplied transparency refers to the storage representation of the color channel multiplied by the transparency channel pixel by pixel.

[0060] The embodiment realizes the space consistency of the replacement assembly by unifying the pixel coordinate system and the size reference; realizes the format stability and the single sampling by scaling the smaller value and cutting according to the center line or filling the transparent pixel with the premultiplied transparency; and finally forms the assembly result which can be reviewed and reused by binding the first reserved and the adapted material texture with the mask parameter, the mixing mode, the deformation parameter and the target pixel area.

[0061] In one embodiment of the present application, for the replaced layer, the existence and value of the perspective deformation parameter, the affine deformation parameter, the mesh parameter and the free deformation parameter are normalized according to the established order to form a single inverse mapping rule from the target pixel position to the adapted material texture coordinate, including:

[0062] Step 21, the existence of the perspective deformation parameter, the affine deformation parameter, the free deformation parameter and the mesh parameter of the replaced layer is determined, and the execution order is determined in the fixed order of perspective first, affine second, free deformation third and mesh last. The parameters not set are registered as not set and do not participate in the calculation. The replaced layer in this step refers to the target layer which has established a one-to-one binding relationship with the external material; the existence determination refers to entering the subsequent calculation only when the corresponding parameter has been set in the design file and has a valid value; and the fixed order is used to eliminate the process branching caused by different parameter combinations and ensure the uniqueness of the coordinate transformation path.

[0063] Step 22, the target pixel position is converted into the same coordinate according to the inverse transformation of the perspective deformation parameter and is normalized by the third component. When the perspective deformation parameter is not reversible or the normalization denominator is zero, the constant perspective transformation is processed to keep the target pixel position unchanged. In this step, the same coordinate refers to the three-element representation of adding the third component as 1 based on the pixel coordinate, and the normalization refers to the two-dimensional coordinate recovered by division with the third component; the constant perspective transformation refers to the perspective transformation rollback strategy which does not change the input coordinate, and is used for the deterministic processing when the perspective inverse transformation is not available or the numerical value is unstable.

[0064] Step 23, the same coordinate is converted into the affine normalized position according to the inverse transformation of the affine deformation parameter. When the affine deformation parameter is not reversible, the constant affine transformation is processed. Among them, the affine normalized position refers to the intermediate position after removing the linear effects such as translation, rotation and scaling in each direction; and the constant affine transformation refers to the affine rollback strategy which keeps the input position unchanged, and is used for the deterministic processing when the affine inverse transformation is not available.

[0065] Step 24, when the free deformation parameter is set, the spline base function is used, the base function weight is calculated in ascending order of control point index, and the control point displacement is sequentially superimposed; when the grid parameter is set, the triangular element containing the position is located in the order of from top to bottom and then from left to right, the index of the smallest element is taken when falling on the common side or the common vertex, the texture coordinates are linearly interpolated according to the three-vertex barycentric coefficients; the obtained texture coordinates are limited in the range of the adapted material texture in the boundary truncation mode, and a single inverse mapping rule from the target pixel position to the adapted material texture coordinate is formed.

[0066] Wherein, the spline base function refers to a base function family used for the free deformation control grid, the weight of which is determined by the relationship between the current position and the control point; the ascending order of the control point index refers to sequentially participating in superposition in ascending order of the fixed index number of the control point; the triangular element refers to the triangular face element obtained by grid division; the barycentric coefficient refers to three non-negative and sum-to-one coefficients, which are used for linear interpolation of vertex texture coordinates in the triangular element; the boundary truncation mode refers to truncating the exceeding component to the boundary value when the texture coordinate exceeds the range of the adapted material texture, without using mirror or circular extension. Through the above sequential processing, a single inverse mapping rule is uniformly output for direct calling of subsequent single sampling and in-source synthesis.

[0067] The embodiment realizes the uniqueness of the coordinate path by fixing the execution order, realizes the numerical stability and value determination by the identity backtracking and boundary truncation, and finally forms the single inverse mapping rule from the target pixel position to the adapted material texture coordinate by the spline base function and the barycentric coefficient linear interpolation, so as to ensure the stability, reviewable and reusable of the online replacement, cutting, deformation and rendering link.

[0068] In one embodiment of the present application, the pixel value and transparency are obtained from the adapted material texture according to the single inverse mapping rule in the target pixel region, and the mask parameter is applied to the pixel value and transparency according to the in-source synthesis rule to obtain the cut layer output, including:

[0069] Step 31, in the target pixel region, for each target pixel position, the adapted material texture coordinate is calculated according to the single inverse mapping rule, and the coordinate is limited in the effective range of the adapted material texture in the boundary truncation mode. The single inverse mapping rule in this step is the unique mapping from the target pixel position to the adapted material texture coordinate.

[0070] Step 32, the pixel value and transparency are obtained by bilinear interpolation at the adapted material texture coordinate, four adjacent pixels participate in the interpolation, the horizontal weight is determined by the horizontal decimal part, the vertical weight is determined by the vertical decimal part, and the calculation is performed in the horizontal direction first and then in the vertical direction; the color channel is multiplied by the transparency respectively to convert into the premultiplied transparency representation. The bilinear interpolation in this step is a deterministic interpolation of weighted summation in two directions on a two-dimensional grid.

[0071] Step 33: Apply masking parameters to the target pixel area according to the source-in-source compositing rules. When the masking parameters are sourced from a vector mask, perform scanline rasterization at the target pixel area resolution according to the masking rendering rules in the design file. Use a non-zero wrapping rule to determine the pixel coverage, and use the coverage as the masking parameter. Multiply each channel of the pre-multiplied transparency color by the masking parameter, and multiply the pre-multiplied transparency by the masking parameter. In this step, the source-in-source compositing rule is to perform pixel-by-pixel multiplication of the pre-multiplied transparency color and transparency using the masking parameters within the same layer; scanline rasterization is to convert the vector outline into pixel coverage along the scanline; the non-zero wrapping rule is a deterministic rule that determines whether a pixel falls into the outline based on a non-zero wrapping number.

[0072] Step 34: The masked color and its opacity are output as the cropped layer. The cropped layer output uses pre-multiplied opacity and is saved along with the masking parameters, blending mode, and target pixel area. The data object output in this step is used for subsequent local compositing within the cropping group and global compositing outside the group, maintaining consistency between the name and the call.

[0073] This embodiment achieves unique sampling coordinates and determined values ​​by mapping with a single inverse mapping rule and using boundary truncation; it achieves single sampling in the texture domain and maintains consistent composition by using bilinear interpolation and premultiplication of transparency; and it obtains a structured cropped layer output by using vector mask scanline rasterization and source-in-source composition rules, which is then seamlessly integrated with subsequent composition.

[0074] In one embodiment of the present invention, a local compositing region is allocated to the cropping group, and the cropped layer outputs are accumulated and superimposed according to the original layer order using a pre-multiplication transparency rule to obtain a local compositing texture of the cropping group, including:

[0075] Step 41: For each cropping group, find the union of the target pixel regions of the layers within the group, and take its smallest axis-aligned bounding rectangle as the local compositing region. Establish a translation mapping from the main canvas coordinates to the local compositing region coordinates. In this step, the smallest axis-aligned bounding rectangle refers to the smallest rectangle that encloses the union of the target pixel regions without rotation in the horizontal and vertical directions; the translation mapping refers to mapping the pixel position in the main canvas coordinate system to the pixel position in the local compositing region with an integer pixel displacement, with the coordinate unit being pixels.

[0076] Step 42: Set up an accumulation buffer within the local compositing area, initializing the accumulated color and accumulated opacity to zero, serving as the sole initial state for layer-by-layer compositing. In this step, zero refers to a pre-multiplied opacity representation where the color channel is zero and the opacity is zero; the accumulation buffer is used to sequentially receive color and opacity updates from subsequent layers within the same coordinate domain.

[0077] Step 43, in the local synthesis region, the cut-out layer output is synthesized layer by layer in the original layer order, and when the blending mode is the normal mode, the pre-multiplied source-on-top synthesis rule is used, wherein the mode corresponding to the case that the blending mode is normal is defined as the normal mode; when the blending mode is not the normal mode and exists in the preset blending mode table, the current accumulated color and the current layer color are first de-pre-multiplied, the mode-processed source color is obtained according to the pixel-by-pixel calculation rule of the blending mode, and then the accumulated color and the accumulated transparency are updated according to the source-on-top synthesis rule. In this step, the source-on-top synthesis rule refers to the pre-multiplied transparency composition with the current layer as the source and the accumulated buffer as the bottom; the pixel-by-pixel calculation rule refers to the deterministic channel operation corresponding to the blending mode.

[0078] Step 44, the cut-out group local synthesis texture is generated in the local synthesis region, the local synthesis region, the accumulated color, the accumulated transparency and the cut-out group identifier are saved together, and the translation mapping is saved together, for global synthesis of out-of-group and pasting back to the main canvas. The cut-out group local synthesis texture refers to the color and transparency result set formed by the accumulated buffer in the local synthesis region, and the translation mapping is recorded in pairs for positioning.

[0079] The embodiment realizes the determination and coordinate consistency of the local synthesis region through the minimum axis-aligned bounding rectangle and the translation mapping, realizes the unified composition of different blending modes through the source-on-top synthesis of pre-multiplied transparency and the de-pre-multiplied fallback, and finally realizes the determined pasting back to the main canvas and subsequent reuse by carrying the cut-out group identifier and the translation mapping.

[0080] In an embodiment of the present application, the cut-out group local synthesis texture is pasted back to the corresponding position of the main canvas, and combined with the non-group layer, the merging is performed on the main canvas according to the blending mode, including:

[0081] Step 51, a processing sequence is generated according to the original global layer order of the design file; for each cut-out group, the corresponding position of the main canvas for pasting back is determined according to the positional relationship between the local synthesis region of the cut-out group local synthesis texture recorded in the prequel and the main canvas, and the pasting back position is a rectangle in the coordinate system of the main canvas; the union bounding rectangle of all pasting back positions and the target pixel region of all cut-out layer outputs is taken as the main canvas processing range, and the coordinate unit is pixel.

[0082] Step 52, initialize the accumulated color and accumulated transparency to zero in the main canvas processing range, and perform element-by-element composition according to the processing sequence; when the element is a non-group layer, read the cropped layer output and the blending mode thereof; when the element is a cropped group, read the cropped group local composition texture at the pasteback position and the blending mode of the group; when the blending mode is a normal mode, use the source-on-top composition rule with premultiplied transparency; when the blending mode is not a normal mode, first obtain the mode-processed source color according to the pixel-by-pixel calculation rule of the blending mode, and then update the main canvas color and transparency according to the source-on-top composition rule.

[0083] Step 53, generate the main canvas output in the main canvas processing range, and save the main canvas output, the pasteback positions of the local composition textures of the cropped groups, the blending modes of the cropped groups, and the blending mode of the non-group layer; the above records and names remain consistent with the previous steps, and are used for direct reference in subsequent incremental rendering and reuse determination.

[0084] The embodiment realizes spatial consistency of global composition through unified definition of the processing sequence and the main canvas processing range; realizes consistent composition across groups and non-group layers through layered execution of the source-on-top composition with premultiplied transparency and the pixel-by-pixel calculation rule of the blending mode; and finally realizes traceability and reusability of the main canvas result through joint saving with the pasteback positions and the blending modes.

[0085] In an embodiment of the present application, based on the layer dependency graph, the change of the material is propagated, the dirty rectangle region is determined, and the reuse identifier and the texture fingerprint are generated according to the deformation parameter, the single inverse mapping rule and the output size, including:

[0086] Step 61, establish a layer dependency graph according to the original layer order of the design file and the clipping, masking, blending and group containing relationship; parse external events into a change set, and record the change object, change type and timestamp; the change type includes material content change, mask parameter change, blending mode change, deformation parameter change, single inverse mapping rule change and output size change. The layer dependency graph refers to a directed graph with layer sets and cropped group sets as nodes, and with clipping relationships, masking relationships, blending relationships and group containing relationships as directed edges; the change set refers to a structured entry recorded in the order of object identifier, change type and timestamp.

[0087] Step 62, propagate each change from bottom to top along the layer dependency graph, the target layer takes its target pixel area as the initial influence domain, and the clipping group takes its pasting position as the initial influence domain; the pasting position is obtained by the inverse mapping of the translation mapping between the main canvas and the local composition area acting on the local composition area of the clipping group local composition texture; take the pixel down rounding and the union bounding rectangle as the dirty rectangle area set, overlap or adjacent merge, and sort from top to bottom and left to right. The union bounding rectangle refers to the minimum axis-aligned rectangle that envelopes the union without rotating the coordinate axis, adjacent to the public boundary, and the dirty rectangle area as the minimum recalculation unit for incremental rendering and scheduling.

[0088] Step 63, generate multiplexing identifier and texture fingerprint for the object entering the recalculation, the multiplexing identifier is concatenated in the field order of deformation parameter, discretization description of single inverse mapping rule, and output size, floating point fixed decimal place, matrix row first, output size width first and height second, and determined by hash calculation; the texture fingerprint is read from left to right and top to bottom, and the pixel data of the adapted material texture is determined by hash after being concatenated in the channel order and the quantization bit array of each channel, and is registered in the multiplexing record table. The deterministic hash refers to the unique digest generated by the input byte sequence under the fixed algorithm and fixed parameters; the discretization description refers to the byte record of the continuous parameter represented with the preset decimal place accuracy.

[0089] Step 64, generate a recalculation queue in units of dirty rectangle area; mark as multiplexing when the multiplexing identifier and the texture fingerprint are equal to the recalculation record table record, otherwise mark as recalculation; sort the recalculation queue in ascending order of dirty rectangle area vertical coordinate and ascending order of horizontal coordinate under the same vertical coordinate; merge the queue items of the same area and the same affected object; output the dirty rectangle area, the recalculation queue and the multiplexing record table. The affected object refers to the target layer or the clipping group propagated by the change.

[0090] The embodiment realizes fast convergence of the influence domain through deterministic propagation of the layer dependency graph, realizes incremental positioning and batch scheduling through pixelized merging and sorting of the dirty rectangle area set, and finally realizes reviewable, reusable and minimum recalculation of online rendering through the cooperation of the multiplexing identifier and the texture fingerprint and the recalculation queue.

[0091] When the number of rectangles in the dirty rectangle set exceeds the upper limit, the rectangles in the set are sorted in ascending order of area; on the premise that the rectangle pair with intersection and the rectangle pair adjacent to the common side exist, the pair with the minimum area increment of the external rectangle of the union is selected for merging, wherein the area increment is the area of the external rectangle of the union after merging minus the sum of the areas of the two rectangles; the merging result is the minimum axis-aligned external rectangle of the union of the two rectangles, and the boundary coordinates after merging are rounded down to pixel integers. If the above-mentioned rectangle pair does not exist and the number of rectangles in the set still exceeds the upper limit, a pair is selected in ascending order of the distance between the centers of the rectangles for the same merging; the above-mentioned process is repeated until the number of rectangles in the set is not greater than the upper limit. Adjacent to the common side means that the two rectangles have a common boundary with a length greater than zero; the distance between the centers of the rectangles means the Euclidean distance between the geometric centers of the two rectangles, and the unit is pixel. The above-mentioned sorting, selection and rounding rules remain unchanged throughout the process to ensure the uniqueness and reviewability of the merging result.

[0092] The embodiment reduces the expansion of merging through area ascending order and minimum area increment merging, maintains the continuity of the region by preferentially merging the overlapping and common side adjacent rectangles, and ensures convergence within the upper limit of the number through the center point distance backtracking, thereby finally improving the scheduling efficiency and stability of the incremental rendering.

[0093] In an embodiment of the present application, the main canvas is output, and the local composite texture and metadata of the clipping group are derived, including:

[0094] Step 71: output the main canvas color and the main canvas transparency in the main canvas processing range from top to bottom and from left to right, using premultiplied transparency representation; perform deterministic hash calculation on the byte sequence of the header, color and transparency to generate a check digest, and register the output path and the check digest. The header refers to fixed-length fields such as pixel format and size; deterministic hash calculation refers to generating a unique digest for the input byte sequence under fixed algorithm and fixed parameters.

[0095] Step 72: derive the local composite texture and translation mapping of each clipping group, record the width and height of the local composite region, the row-priority byte sequence of the color and transparency, and the mapping parameters, perform deterministic hash calculation to generate a check digest, and register the clipping group identifier and the check digest. The row-priority byte sequence refers to the pixel data serialized in the order of top-down and left-to-right within the row.

[0096] Step 73, register and export the metadata related to the multiplexing, the metadata including the multiplexing identification and the texture fingerprint, the field order being object identification, multiplexing identification, texture fingerprint, output size, generate an export directory, and output the main canvas. The multiplexing identification refers to an identification obtained by a fixed order of the deformation parameter, the discretized description of the single inverse mapping rule and the output size and determined by a hash function; the texture fingerprint refers to an abstract obtained by reading the byte sequence of the channel and the bit depth of the adapted material texture by a determined hash function; and the export directory refers to a unified registration of the main canvas output, the local synthesis texture and the translation mapping of the clipping group, the metadata related to the multiplexing and the respective check abstract.

[0097] The embodiment realizes the consistency and checkability of the main canvas output by fixed pixel traversal and premultiplied alpha encoding; realizes the pasting positioning and data backtracking by the pair export of the local synthesis texture and the translation mapping of the clipping group; and improves the incremental multiplexing efficiency and cross-link traceability of the application by the unified registration of the multiplexing identification, the texture fingerprint and the export directory.

[0098] The application provides a personalized replacement clipping deformation rendering system for a design file, comprising:

[0099] The analysis binding module is used for analyzing the design file to obtain a layer set, a clipping group set, a mask parameter, a blending mode, a deformation parameter and a target pixel region, establishing a one-to-one binding relationship between the external material and the target layer based on a replacement mapping table, and generating an adapted material texture;

[0100] The inverse mapping generation module is used for normalizing the replaced layer according to the existence and value of the perspective deformation parameter, the affine deformation parameter, the grid parameter and the free deformation parameter in a predetermined order to form a single inverse mapping rule from the target pixel position to the adapted material texture coordinate;

[0101] The sampling mask module is used for obtaining the pixel value and the transparency from the adapted material texture in the target pixel region according to the single inverse mapping rule, and applying the mask parameter to the pixel value and the transparency according to the source-in synthesis rule to obtain the clipped layer output;

[0102] The group-in synthesis module is used for allocating a local synthesis region to the clipping group, and accumulating and superimposing the clipped layer output by the rule of premultiplied transparency in the original layer order to obtain the clipping group local synthesis texture;

[0103] The pasting synthesis module is used for pasting the clipping group local synthesis texture to the corresponding position of the main canvas, and combining the non-group layer to perform merging on the main canvas according to the blending mode;

[0104] An increment multiplexing module is configured to propagate the change of the material based on the layer dependency graph, determine a dirty rectangle region, and generate a multiplexing identifier and a texture fingerprint according to the deformation parameter, a single inverse mapping rule and an output size;

[0105] A result exporting module is configured to output the main canvas, and export the cropped group local composite texture and metadata.

[0106] It should be noted that the interval and the threshold size are set for the convenience of comparison, wherein the size of the threshold depends on the number of sample data and the base number set by the person skilled in the art for each group of sample data, as long as the proportional relationship of the parameter and the quantized value is not affected. And the above formula is a calculation of the value without dimension. The formula is obtained by software simulation of a large amount of data to obtain a formula of the nearest real situation. The preset parameters in the formula are set by the person skilled in the art according to the actual situation.

[0107] The embodiments of the present application are described above, but the present application is not limited to the above specific embodiments. The above specific embodiments are only illustrative, not restrictive. Those skilled in the art can make many forms under the inspiration of the present embodiment, which are all within the protection of the present embodiment.

Claims

1. A method for personalized replacement cut deforming rendering towards a design file, characterized in that, The method comprises the following steps: Step 1, obtaining a layer set, a clipping group set, a mask parameter, a blending mode, a deformation parameter and a target pixel region from a design file, establishing a one-to-one binding relationship between external materials and target layers based on a replacement mapping table, and generating an adapted material texture; Step 2, for the replaced layer, according to the existence and value of the perspective deformation parameter, the affine deformation parameter, the grid parameter and the free deformation parameter, normalizing in a predetermined order to form a single inverse mapping rule from the target pixel position to the adapted material texture coordinate, comprising: Step 21, determining the existence of the perspective deformation parameter, the affine deformation parameter, the free deformation parameter and the grid parameter of the replaced layer, determining the execution order in the fixed order of perspective first, then affine, then free deformation and finally grid, and registering the parameters not set as not set; Step 22, converting the target pixel position into a same order coordinate according to the inverse transformation of the perspective deformation parameter and normalizing the third component, when the perspective deformation parameter is irreversible or the normalizing denominator is zero, processing according to the identity perspective transformation, keeping the target pixel position unchanged; Step 23, converting the same order coordinate into an affine normalized position according to the inverse transformation of the affine deformation parameter, when the affine deformation parameter is irreversible, processing according to the identity affine transformation; Step 24, when the free deformation parameter is set, using the spline basis function, calculating the basis function weight in ascending order of control point index and sequentially superimposing the control point displacement; when the grid parameter is set, positioning the triangular element containing the position in the order of from top to bottom and then from left to right, limiting the obtained texture coordinate in the range of the adapted material texture in a boundary truncation manner, and forming a single inverse mapping rule from the target pixel position to the adapted material texture coordinate; Step 3, obtaining the pixel value and transparency from the adapted material texture according to the single inverse mapping rule in the target pixel region, and applying the mask parameter to the pixel value and transparency according to the source-in compositing rule to obtain the clipped layer output; Step 4, assigning a local compositing region to the clipping group, and accumulating and superimposing the clipped layer output in the original layer order using the premultiplied transparency rule to obtain the clipping group local compositing texture; Step 5, pasting the clipping group local compositing texture back to the corresponding position of the main canvas, and combining the non-group layer to perform merging on the main canvas according to the blending mode; Step 6, propagating the change of the material based on the layer dependency graph, determining the dirty rectangle region, and generating the reuse identifier and the texture fingerprint according to the deformation parameter, the single inverse mapping rule and the output size; Step 7, outputting the main canvas, and exporting the clipping group local compositing texture and the metadata.

2. The design file oriented personalized replacement cut deformation rendering method according to claim 1, characterized in that, Obtaining a layer set, a clipping group set, a mask parameter, a blending mode, a deformation parameter and a target pixel region from a design file, establishing a one-to-one binding relationship between external materials and target layers based on a replacement mapping table, and generating an adapted material texture, comprising: Step 11, structurally analyzing the design file to obtain a layer set, a clipping group set, a mask parameter, a blending mode, a deformation parameter and a target pixel region; checking the consistency of the replacement mapping table and the layer set, retaining only the first binding of each target layer according to the order of the entries, and deleting the remaining bindings; Step 12, read the width and height of the target pixel region as size reference, fix the coordinate system of the target pixel region as the pixel coordinate system with the upper left corner as the origin, horizontal right and vertical down; Step 13, calculate the ratio of the width of the target pixel region to the external material width and the ratio of the height of the target pixel region to the external material height, take the smaller value as the scaling ratio; the center displacement is composed of horizontal displacement and vertical displacement, the horizontal displacement is half of the difference between the width of the target pixel region and the scaled external material width, and the vertical displacement is half of the difference between the height of the target pixel region and the scaled external material height; when the scaled size exceeds the target pixel region, cut along the center line, when it does not exceed, fill the center with transparent pixels with pre-multiplied transparency, generate the adapted material texture, and complete the binding with the mask parameter, blending mode, deformation parameter and target pixel region.

3. The design file oriented personalized replacement cut-and-slice morphing rendering method according to claim 1, wherein, According to the single inverse mapping rule, obtain the pixel value and transparency from the adapted material texture, and apply the mask parameter to the pixel value and transparency to obtain the cropped layer output, including: Step 31, in the target pixel region, calculate the adapted material texture coordinates according to the single inverse mapping rule for each target pixel position, and limit the coordinates in the effective range of the adapted material texture in a boundary truncation manner; Step 32, obtain the pixel value and transparency at the adapted material texture coordinates by bilinear interpolation, four adjacent pixels participate in the interpolation, multiply the color channels by the transparency respectively, and convert to pre-multiplied transparency representation; Step 33, apply the mask parameter according to the source-in compositing rule in the target pixel region, when the mask parameter source is a vector mask, scan line rasterization is performed according to the mask rendering rule of the design file with the target pixel region resolution, the non-zero wrap rule is used to determine the pixel coverage rate, and the coverage rate is used as the mask parameter; multiply the pre-multiplied transparency by the mask parameter; Step 34, take the masked color and the masked transparency as the cropped layer output, the cropped layer output is represented by pre-multiplied transparency, and is saved together with the mask parameter, blending mode and target pixel region.

4. The design file oriented personalized replacement cut-and-slice morphing rendering method according to claim 1, characterized in that, Assign a local compositing area to the cropped component, accumulate and superimpose the cropped layer output according to the pre-multiplied transparency rule in the original layer order to obtain the local compositing texture of the cropped component, including: Step 41, for each cropped component, find the union of the target pixel regions of the layers in the group, take the minimum axis-aligned bounding rectangle as the local compositing area, and establish a translation mapping from the main canvas coordinates to the local compositing area coordinates; Step 42, set an accumulation buffer in the local compositing area, initialize the accumulated color to zero value and the accumulated transparency to zero value as the only initial state of layer-by-layer compositing; Step 43, in the partial synthesis area, the cut layer output is synthesized layer by layer in the original layer order, and when the blending mode is normal mode, the pre-multiplied source-on-top synthesis rule is adopted; when the blending mode is not normal mode, the current accumulated color and the current layer color are first de-pre-multiplied, the mode-processed source color is obtained according to the pixel-by-pixel calculation rule, and then the accumulated color and the accumulated transparency are updated according to the source-on-top synthesis rule; Step 44, a cut group partial synthesis texture is generated in the partial synthesis area, and the partial synthesis area, the accumulated color, the accumulated transparency and the cut group identifier are saved together, and are saved together with the translation mapping, which is used for group-out global synthesis to be pasted back to the main canvas.

5. The design file oriented personalized replacement cut-and-slice morphing rendering method according to claim 1, wherein, The cut group partial synthesis texture is pasted back to the corresponding position of the main canvas, and combined with the non-group layer, the main canvas is merged according to the blending mode, including: Step 51, a processing sequence is generated according to the original global layer order of the design file, for each cut group, the pasting position of the main canvas is determined according to the position relationship between the partial synthesis area of the cut group partial synthesis texture and the main canvas, and the union of all pasting positions and the target pixel area of all cut layer outputs is taken as the main canvas processing range; Step 52, in the main canvas processing range, the accumulated color and the accumulated transparency are initialized to zero, and are synthesized element by element according to the processing sequence, when the element is a non-group layer, the cut layer output and the blending mode thereof are read, when the element is a cut group, the cut group partial synthesis texture and the blending mode of the group are read, when the blending mode is normal mode, the pre-multiplied source-on-top synthesis rule is adopted, and when the blending mode is not normal mode, the mode-processed source color is obtained according to the pixel-by-pixel calculation rule of the blending mode, and then the main canvas color and transparency are updated according to the source-on-top synthesis rule; Step 53, a main canvas output is generated in the main canvas processing range, and the main canvas output, the pasting position of each cut group partial synthesis texture, the blending mode of each cut group and the blending mode of the non-group layer are saved together.

6. The design file oriented personalized replacement cut-and-slice morphing rendering method according to claim 1, wherein, The dirty rectangle area is determined, and the reuse identifier and the texture fingerprint are generated, including: Step 61, a layer dependency graph is established according to the original layer order of the design file and the cut, mask, blending and group containing relationship; external events are parsed into a change set, and the change object, change type and timestamp are recorded; the change type includes material content change, mask parameter change, blending mode change, deformation parameter change, single inverse mapping rule change and output size change; Step 62, each change is propagated from bottom to top along the layer dependency graph, and the target layer takes its target pixel area as the initial influence domain, and the cut group takes its pasting position as the initial influence domain; the pixel is rounded down and the union is taken as the dirty rectangle area set, which is overlapped or adjacent, and is sorted from top to bottom and from left to right; Step 63, generate multiplex identification and texture fingerprint for the object entering the recalculation, the multiplex identification is concatenated in the order of the field of the deformation parameter, the discretized description of the single inverse mapping rule, and the output size, the output size is wide first and high second, and the deterministic hash calculation is performed; the texture fingerprint is read from left to right and from top to bottom, the pixel data of the adapted material texture is determined by the deterministic hash of the byte sequence composed of the channel order and the quantization bit of each channel, and is registered to the multiplex record table; Step 64, generate a recalculation queue in units of dirty rectangular regions; if the multiplex identification and the texture fingerprint are equal to the record time of the multiplex record table, mark as multiplexing, otherwise mark as recalculation; sort the recalculation queue in ascending order of the vertical coordinate of the dirty rectangular region and in ascending order of the horizontal coordinate under the same vertical coordinate; merge the queue items of the same region and the same affected object, output the dirty rectangular region, the recalculation queue and the multiplex record table.

7. The design file oriented personalized replacement cut-and-slice morphing rendering method according to claim 6, characterized in that, When the number of rectangles in the dirty rectangular region set exceeds the upper limit, sort in ascending order of area; when there are intersecting rectangle pairs and rectangle pairs adjacent to the common edge, select the pair with the smallest area increment of the union rectangle, and take the minimum axis-aligned bounding rectangle of the union of the two rectangles as the merging result, and the boundary coordinates are rounded down to pixel integers; if there is no above-mentioned rectangle pair and still exceeds the upper limit, continue to merge in ascending order of the distance between the center points of the rectangles until the number of rectangles is not greater than the upper limit.

8. The design file oriented personalized replacement cut-and-slice morphing rendering method according to claim 1, wherein, Output the main canvas, and export the cropped group local composite texture and metadata, including: Step 71, output the main canvas color and the main canvas transparency in the main canvas processing range from top to bottom and from left to right, using premultiplied transparency representation; perform deterministic hash calculation on the byte sequence of the head, color and transparency to generate a check digest, and register the output path and the check digest; Step 72, export the cropped group local composite texture and the translation mapping for each cropped group, record the width and height of the local composite region, the row-priority byte sequence of the color and transparency, and the mapping parameters, perform deterministic hash calculation to generate a check digest, and register the cropped group identifier and the check digest; Step 73, register and export the metadata related to multiplexing, the metadata includes multiplex identification and texture fingerprint, the field order is object identification, multiplex identification, texture fingerprint, output size, generate export directory, output main canvas.

9. A design document oriented personalized replacement cut morphing rendering system characterized by, The design file-oriented personalized replacement cropping deformation rendering method comprises: A parsing module is used for parsing the layer set, the cropped group set, the mask parameter, the blending mode, the deformation parameter and the target pixel region from the design file, establishing a one-to-one binding relationship between the external material and the target layer based on the replacement mapping table, and generating an adapted material texture; An inverse mapping generation module is used for normalizing the replaced layer according to the existence and value of the perspective deformation parameter, the affine deformation parameter, the grid parameter and the free-form deformation parameter in a predetermined order to form a single inverse mapping rule from the target pixel position to the coordinate of the adapted material texture; A sampling mask module is used for obtaining pixel values and transparency from the adapted material texture in the target pixel region according to the single inverse mapping rule, and applying the mask parameter to the pixel values and transparency according to the source-in composite rule to obtain the cropped layer output. A group-in synthesis module is configured to assign a local synthesis region to a clipping group, and to accumulate and superimpose the output of the clipped layers in the original layer order according to a rule of premultiplied transparency, to obtain a local synthesis texture of the clipping group; A paste-back synthesis module is configured to paste the local synthesis texture of the clipping group back to a corresponding position of the main canvas, and to combine the non-group layers to perform merging on the main canvas according to a blending mode; An incremental reuse module is configured to propagate changes of the material based on a layer dependency graph, to determine a dirty rectangle region, and to generate a reuse identifier and a texture fingerprint according to a deformation parameter, a single inverse mapping rule and an output size; A result export module is configured to output the main canvas, and to export the local synthesis texture of the clipping group and metadata.

Citation Information

Patent Citations

  • Multimedia processing device supporting multi-layer special effect and animation mixing

    CN112184856A

  • Picture object texture replacement method and device, computer equipment and storage medium

    CN114241076A