Drawing program, drawing device, control method, and recording medium
By generating textures for multiple length patterns and switching textures based on reference line deformation, the method addresses computational load issues in digital illustration animations, ensuring stable and efficient texture representation.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- LIVE2D
- Filing Date
- 2023-01-13
- Publication Date
- 2026-06-23
AI Technical Summary
Existing methods for generating animations with texture representation in digital illustrations face issues of increased computational load and potential processing delays due to the need for continuous adjustments in texture-forming elements as reference lines deform, leading to unstable viewing experiences.
A method that generates textures with pre-placed texture-forming elements for multiple length patterns, allowing for seamless texture representation by selecting and switching textures based on the deformation of reference lines, reducing computational requirements.
This approach enables the drawing of line segments with desired texture representation while avoiding increased computational load, ensuring stable and efficient animation rendering.
Smart Images

Figure 0007879280000007 
Figure 0007879280000008 
Figure 0007879280000009
Abstract
Description
[Technical Field]
[0001] The present invention relates to a drawing program, a drawing apparatus, a drawing method, and a recording medium, and more particularly to a line segment drawing technique that includes texture representation. [Background technology]
[0002] One method of creating electronic illustrations using information processing devices such as tablets (digital illustration or computer illustration). Digital illustration applications are configured to allow various textures to be applied to line segments (reference lines or outlines) input by pointing devices such as styluses or mice, in order to achieve drawing expressions similar to those of hand-drawn illustrations. Such textures include, for example, expressions that mimic brushstrokes, similar to those created with writing instruments such as pencils or paintbrushes.
[0003] In vector-based digital illustrations, the texture of a line segment representing a brush stroke is achieved by placing a number of texture-forming elements (unit elements for forming texture, which have a unique image pattern corresponding to the texture to be expressed; so-called sprites) relative to the length of the reference line. In other words, a line segment representing a brush stroke was represented by multiple layers of texture-forming elements with image patterns defined for the brush in question, arranged according to the shape and length of the line segment.
[0004] However, texture representation using this method may not be suitable for applications such as generating animations by deforming 2D images related to the created illustration. More specifically, in methods where texture-forming elements are placed according to the shape and length of the deformed line segment, the continuity of the placement pattern between the texture-forming elements placed for the line segment before deformation cannot be guaranteed, and a uniform representation may not be achieved. For example, when a reference line changes (stretches) as shown in Figures 14A to 14D, if texture-forming elements are placed according to the length, changes in placement density and flickering may occur during the transition of that change, as shown in Figures 15A to 15D. As a result, animations that connect 2D images before and after deformation may exhibit representations that hinder stable viewing.
[0005] Patent Document 1 discloses a line segment drawing method that ensures uniform texture representation even when the reference line is deformed. [Prior art documents] [Patent Documents]
[0006] [Patent Document 1] Patent No. 6663066 [Overview of the project] [Problems that the invention aims to solve]
[0007] However, in the drawing method described in Patent Document 1, the placement position of texture-forming elements is determined according to the length of the reference line, the size and transparency of the texture-forming elements are set, and the texture-forming elements are placed on the reference line for drawing. As a result, the amount of computation increases as the length of the reference line increases. In other words, when generating animation while deforming a 2D image in real time, the amount of computation can become excessive, potentially causing processing delays and hindering a satisfactory viewing experience.
[0008] The present invention has been made in view of the above-mentioned problems, and aims to provide a drawing program, drawing apparatus, drawing method, and recording medium that can draw line segments with desired texture expression while avoiding an increase in computational load. [Means for solving the problem]
[0009] To achieve the aforementioned objectives, the present invention provides a drawing program that causes a computer to draw line segments with texture representation to perform an acquisition process to acquire a plurality of textures, each having a different length and exhibiting a common texture representation, including a reference texture having a reference length; a selection process to select at least one of the plurality of textures acquired by the acquisition process according to the length of the line segment to be drawn; a drawing process to draw the line segment by arranging the texture selected by the selection process; and a process to accept a change in the length of the line segment, wherein when a change in the length of the line segment is accepted, in the selection process, a second texture corresponding to the changed length of the line segment is selected in place of the first texture that was selected before the change, and if the second texture is a texture having a length that is a predetermined integer multiple of the reference length, a predetermined integer number of the reference textures are selected in place of the second texture. [Effects of the Invention]
[0010] With this configuration, the present invention makes it possible to draw line segments with desired texture representation while avoiding an increase in computational load.
[0011] Other features and advantages of the present invention will become apparent from the following description with reference to the accompanying drawings. In the accompanying drawings, the same or similar components are given the same reference numeral. [Brief explanation of the drawing]
[0012] The attached drawings are included in the specification and constitute part thereof, illustrating embodiments of the present invention and are used together with the description to explain the principles of the present invention. [Figure 1] Block diagram illustrating the hardware configuration of PC100 according to embodiments and modifications of the present invention [Figure 2A] Diagram for explaining the drawing of line segments with texture-based texture expression [Figure 2B] Diagram for explaining the drawing of line segments with texture-based texture expression [Figure 3] Diagram illustrating texture formation elements (particles) [Figure 4] Diagram for explaining the distribution pattern of particles of the reference texture according to embodiments and modifications of the present invention [Figure 5] Diagram illustrating the reference texture and the connection texture according to embodiments and modifications of the present invention [Figure 6A] Diagram for explaining the reference texture according to embodiments and modifications of the present invention [Figure 6B] Diagram for explaining the connection texture according to embodiments and modifications of the present invention [Figure 7A] Diagram for explaining the association of particles according to embodiments and modifications of the present invention [Figure 7B] Another diagram for explaining the association of particles according to embodiments and modifications of the present invention [Figure 7C] Yet another diagram for explaining the association of particles according to embodiments and modifications of the present invention [Figure 7D] Diagram illustrating particles of the first classification according to embodiments and modifications of the present invention [Figure 7E] Diagram illustrating the first particles of the second classification according to embodiments and modifications of the present invention [Figure 7F] Diagram illustrating the second particles of the second classification according to embodiments and modifications of the present invention [Figure 8] Diagram for explaining the arrangement frequency of particles of the extended intermediate texture according to embodiments and modifications of the present invention [[ID=4,7]] [Figure 9A] Diagram for explaining the shortened intermediate texture according to embodiments and modifications of the present invention [Figure 9B] Diagram for explaining the shortened intermediate texture according to embodiments and modifications of the present invention [Figure 9C] Figure illustrating a shortened intermediate texture according to embodiments and modified examples of the present invention. [Figure 10] Figure illustrating the particle arrangement frequency of shortened intermediate texture according to embodiments and modifications of the present invention. [Figure 11] Another figure illustrating a shortened intermediate texture according to embodiments and modifications of the present invention. [Figure 12] A flowchart illustrating the generation process for generating line segment drawing textures, which is performed in PC100 according to embodiments and modifications of the present invention. [Figure 13] A flowchart illustrating a drawing process that draws line segments using a line segment drawing texture, which is performed in PC100 according to embodiments and modifications of the present invention. [Figure 14A] A diagram illustrating the drawing of line segments with texture representation using conventional techniques. [Figure 14B] A diagram illustrating the drawing of line segments with texture representation using conventional techniques. [Figure 14C] A diagram illustrating the drawing of line segments with texture representation using conventional techniques. [Figure 14D] A diagram illustrating the drawing of line segments with texture representation using conventional techniques. [Figure 15A] A diagram illustrating the change in appearance when drawing line segments with texture representation using conventional technology. [Figure 15B] A diagram illustrating the change in appearance when drawing line segments with texture representation using conventional technology. [Figure 15C] A diagram illustrating the change in appearance when drawing line segments with texture representation using conventional technology. [Figure 15D] A diagram illustrating the change in appearance when drawing line segments with texture representation using conventional technology. [Modes for carrying out the invention]
[0013] [Embodiment] The embodiments will be described in detail below with reference to the attached drawings. Note that the following embodiments do not limit the invention as defined in the claims, and not all combinations of features described in the embodiments are essential to the invention. Two or more of the features described in the embodiments may be combined in any way. Furthermore, identical or similar configurations will be given the same reference numeral, and redundant descriptions will be omitted.
[0014] One embodiment described below illustrates an example of applying the present invention to a PC, which is an example of a drawing device capable of generating textures that represent texture and drawing line segments with texture representation using said textures. However, the present invention is applicable to any device capable of generating textures that represent texture or drawing line segments with texture representation using said textures.
[0015] 《PC100 Configuration》 Figure 1 is a block diagram showing the hardware configuration of PC100 according to an embodiment of the present invention.
[0016] The control unit 101 is a control device such as a CPU, and controls the operation of each block in the PC 100. Specifically, the control unit 101 reads programs related to the operating system stored in the storage device 102, programs related to illustration editing applications including drawing line segments with texture representation, and other such programs, expands them into memory 103, and executes them to control the operation of each block.
[0017] The storage device 102 is, for example, a non-volatile memory such as a rewritable ROM, or an information storage device such as an HDD that is detachably connected to the PC 100. The storage device 102 may also include a recording medium such as a disk that stores a program having functions provided by an illustration editing application, which can be accessed via a predetermined read / write interface such as an optical drive. The storage device 102 stores not only the program described above, but also information such as parameters necessary for the operation of each block, and various data used for presenting drawing objects.
[0018] Memory 103 is a volatile memory such as RAM. Memory 103 is used not only as an expansion area for expanding programs read from storage device 102, but also as a storage area for storing intermediate data output during the operation of each block. Alternatively, memory 103 can also be used as an area for storing intermediate calculation results or calculation results during the execution of arbitrary processing.
[0019] The drawing unit 104 is a drawing device such as a GPU. The drawing unit 104 generates a screen (image) that is displayed in the display area of the display unit 110. In this embodiment, the drawing unit 104 generates a screen to be displayed on the display unit 110 by drawing an object that is unfolded on a two-dimensional plane, has a variable length, and includes line segments (straight and curved lines) with texture representation. The screen generated by the drawing unit 104 in relation to the illustration editing application is controlled (display updated) by the display control unit 105 to be displayed on the display unit 110.
[0020] The display unit 110 may be a display device such as an LCD. In this embodiment, the display unit 110 is described as a component of the PC 100, but the implementation of the present invention is not limited to this. The display unit 110 does not need to have the same housing configuration as the PC 100, and may be an external display device that is detachably connected to the PC 100.
[0021] The operation input unit 106 is a user interface of the PC 100, such as a mouse, keyboard, pen tablet, or game controller. When the operation input unit 106 detects an operation input made to any of these interfaces, it outputs a control signal corresponding to that operation input to the control unit 101. Alternatively, the operation input unit 106 notifies the control unit 101 of the occurrence of an event corresponding to that operation input.
[0022] Drawing line segments with texture representation The following describes a method for drawing line segments with texture representations such as brush strokes in the illustration editing application of this embodiment.
[0023] As described above, in conventional illustration editing applications, texture representation was formed by arranging multiple texture-forming elements along a reference line that defines the shape of a line segment. For example, the texture representation of a brush is formed by arranging texture-forming elements, which are provided in accordance with the frequency of placement of texture-forming elements per unit length determined according to the density of the "paint" of the brush, within a two-dimensional area defined by the line width set for the brush and the reference line. That is, the longer the reference line, the larger the size of the two-dimensional area becomes, and the more texture-forming elements are placed in the area. Furthermore, in the method described in Patent Document 1, in order to avoid flickering of the appearance due to deformation of the reference line, the placement position, size, and transparency of each texture-forming element are sequentially determined, and the longer the reference line, the more computational work required to draw the line segment.
[0024] In the PC100 of this embodiment, a method is employed in which textures (raster images) with texture-forming elements pre-placed for a predetermined texture expression are generated for multiple length patterns, and textures of the corresponding length are placed on the reference line according to the deformation state of the reference line (especially the length in the longitudinal direction) to draw line segments. That is, since the texture-forming elements are already placed on the texture, when drawing line segments, it is not necessary to determine the placement position, size, and transparency of each texture-forming element according to the state of the reference line, thus reducing the amount of computation required for line segment drawing compared to the method described in Patent Document 1.
[0025] <Generating Textures> First, we will explain the generation of textures of multiple length patterns that exhibit a common texture representation, which are used for drawing line segments. In this embodiment, the generation of these textures is provided as a function of the illustration editing application.
[0026] As described above, in the method of drawing line segments by applying a texture corresponding to the length of the reference line from among the textures generated for multiple length patterns, it is necessary that a variety of length patterns of textures be generated for a single texture representation. That is, since the length of the reference line is expected to vary considerably, in order to suitably represent texture using textures, it is necessary that a variety of patterns of textures be generated with a certain degree of length resolution.
[0027] If a texture with the same length as the reference line is generated, applying that texture directly to the reference line will allow the line segment to be drawn with the texture representation shown by that texture. On the other hand, if a texture with the same length as the reference line is not generated, the line segment will be drawn by, for example, stretching / shortening the texture with the closest length and applying it to the reference line. In this case, the stretching / shortening rate of the texture is determined according to the difference between the length of the texture and the length of the reference line, but if this ratio deviates extremely far from 1, the texture representation of the texture will not be guaranteed in the drawn line segment.
[0028] For example, consider a scenario where, with respect to a baseline of length L0, the closest length is selected from the length patterns for which textures have been generated, and the texture having that length is stretched to L0 and applied to the baseline. As shown in Figure 2A, if the closest length is L1, which is slightly shorter than L0, then stretching a texture 201 having length L1 and applying it to the baseline will result in a line segment that, to some extent, preserves the texture representation of the texture 201. On the other hand, as shown in Figure 2B, if the closest length is L2, which is extremely short (about half the length in the figure), then stretching a texture 202 having length L2 to L1 and applying it to the baseline will result in a line segment that does not preserve the texture representation of the texture 202.
[0029] Thus, in order to render line segments whose length may change with a specific texture representation using textures, it is necessary, as a prerequisite, that multiple types of length pattern textures be generated with a length resolution sufficient to ensure that the texture representation is maintained even when the texture is stretched or compressed.
[0030] However, in illustration editing applications, the length of line segments is arbitrarily set according to the purpose of the illustration, so it is not practical to prepare textures for infinite lengths. Furthermore, considering the prerequisite that textures must be generated with a length resolution sufficient to ensure texture representation even when scaled, the number of length patterns for which textures can be generated becomes enormous.
[0031] In particular, in scenarios where the length of a line segment changes continuously, such as in animation, it is necessary to select a texture appropriate to the length and apply it to the line segment for rendering. That is, in such scenarios, it is necessary to load the textures for each length pattern into memory in advance. However, if the number of length patterns is enormous, the memory usage will be strained by the loaded textures, which can reduce the calculation accuracy and efficiency of other processes.
[0032] Therefore, textures generated for drawing line segments with texture representation must be generated within a limited range of lengths. In other words, textures generated for drawing line segments should be generated only for certain length patterns, and line segments of lengths not included in those length patterns should be generated in a way that allows them to be represented by combining textures of those length patterns.
[0033] Furthermore, in the case of animations or other methods where the length of a line segment changes continuously, it is required that uniform texture representation be ensured regardless of length when comparing textures of multiple length patterns. That is, in the case of selecting a texture to apply according to the length of a reference line, if the length of the line segment changes continuously, the display will transition by switching to textures of different lengths in stages. Therefore, if there is a discrepancy in the distribution of texture-forming elements (hereinafter sometimes simply referred to as particles) between the switched textures, the aforementioned flickering of the appearance may occur due to changes in the density of particle placement, etc.
[0034] Therefore, textures generated for drawing line segments with texture representation (hereinafter sometimes referred to as line segment drawing textures) must ensure continuity in the distribution of particles on the line segment before and after switching texture patterns in accordance with gradual changes in the length of the line segment. In other words, line segment drawing textures with multiple length patterns must maintain a constant particle placement frequency and keep the relative positional change of particles exhibiting the same appearance constant, even when switching sequentially to textures of different lengths.
[0035] Furthermore, as mentioned above, since line segments of arbitrary length are drawn by combinations of limited length patterns, it is necessary that the particle distribution remains uniform even when multiple textures are placed side by side along the longitudinal direction of the line segment, resulting in a homogeneous texture representation. In other words, when textures are placed adjacent to each other, the particles must be distributed in the boundary region in the same way as in the other regions, ensuring a seamless texture representation.
[0036] The following describes specific methods for generating line segment drawing textures with multiple length patterns for a single texture representation.
[0037] (Base texture) First, conditional information is obtained that defines the rules for generating the texture representation shown by each line segment drawing texture (the conditions for particle placement).
[0038] The texture of pencils and brushes cannot be expressed by uniformly coloring the two-dimensional area on which the line segment with that texture is drawn with a single color at a fixed density (especially the shading and blurring). Therefore, as mentioned above, it is formed by distributing particles with a specific pixel pattern somewhat irregularly. For example, by arranging particles with varying density (or hue, lightness, opacity, etc.) based on random numbers or the like (or in a specific pattern), a non-uniform, heterogeneous texture expression, such as the brushstrokes of a pencil or brush, can be formed. On the other hand, if particles are arranged completely irregularly throughout the entire line segment, consistency in the particle distribution may not be guaranteed, such as the density of particles being sparse in some areas, and the texture expression may not be formed satisfactorily throughout the entire line segment.
[0039] In other words, in order to generate a line drawing texture that exhibits a common texture representation, it is necessary to define the placement conditions so that, although particles are arranged irregularly locally to include heterogeneous representation, these particles exhibit a certain distribution pattern globally. In one embodiment, the particle distribution pattern may be defined as the frequency of particle placement per unit length (number of placements per unit length ≈ density). Alternatively, the average or variance of changes in the hue, lightness, opacity, etc., of the particles can also be used as the particle distribution pattern.
[0040] Therefore, the condition information defines the particle placement frequency per unit length that should be guaranteed when generating texture representations for line segment drawing. In this embodiment, a texture with a specified length in the longitudinal direction (hereinafter referred to as the reference length) is generated based on the condition information, and line segment drawing textures of other length patterns are generated based on this texture. That is, one of the line segment drawing textures to be generated is a texture with the reference length (hereinafter referred to as the reference texture), which is generated by determining the placement position of particles according to the condition information, and then placing and drawing the particles at those placement positions.
[0041] The condition information may be generated, for example, by the user setting various parameters related to particle type and particle placement for a line segment drawing texture to be generated. Generally, when drawing line segments with texture representation, multiple types of particles are placed in the drawing area. Each particle is selected according to the texture representation to be created. For example, in the case of a pencil, by using eight patterns of particles (raster images) as shown in Figure 3, it is possible to represent a somewhat heterogeneous texture. More specifically, by scaling, adjusting the opacity, and rotating one of the eight particle patterns, it is possible to create a texture representation in which the regularity of particle placement is not easily perceived. One type of particle may be used, but it is preferable to use multiple types of particles because the regularity becomes easier to perceive. Therefore, in this embodiment, the condition information includes information on the particle placement frequency per unit length, as well as information on the types of particles placed in the texture.
[0042] The following describes an example of generating a reference texture in detail with reference to Figure 4. In the example shown in Figure 4, the condition information defines a placement frequency such that 32 particles are placed in a drawing area whose longitudinal direction is the reference length. More specifically, the condition information defines that for the line width used to generate the texture, 32 particles (specifically, a two-dimensional distribution of 8 particles in the longitudinal direction and 4 particles in the width (short direction)) are placed in a region 401 having a reference length in the longitudinal direction. Note that in the example in Figure 4, to facilitate understanding of the invention, the particle type is shown as one type (circle).
[0043] The determination of particle placement during the generation of the base texture is achieved, for example, by dividing region 401 into a grid based on conditional information and randomly determining the center coordinates of the particles to be placed in each grid. In the example in Figure 4, 36 grids (9 divisions in the longitudinal direction (=8+1) × 4 divisions in the width direction) are defined for region 401. The grids lined up at the edges in the width direction (top and bottom edges) are defined with margins because, depending on the position of the center coordinates of the particles to be placed, the image of the particles may be drawn outside the grid.
[0044] In this illustration editing application, if the length of a line segment is longer than any of the line segment drawing textures, the line segment is drawn by placing multiple textures adjacent to each other. Therefore, each line segment drawing texture is configured such that when placed adjacent to each other, the particles distributed at its ends (boundaries) are not discontinuous. Accordingly, the reference texture needs to be configured so that when multiple reference textures are placed adjacent to each other, a common particle pattern recursively appears in units of reference length.
[0045] In other words, among the grids defined in region 401, the grid group 402 in the leftmost column and the grid group 403 in the rightmost column share the same particle placement positions. Furthermore, since grid group 402 and grid group 403 are configured such that only half of the region 401 is contained within it, the number of grids contained within region 401 is effectively the same as the placement frequency per standard length defined in the condition information, which is 32.
[0046] In this way, by defining the same number of grids in region 401 as the placement frequency defined in the condition information, and placing one raster image of a particle in each grid, a constant placement frequency is maintained for the entire region 401, resulting in a globally homogeneous texture representation. On the other hand, since the placement position of particles within each grid is determined randomly, the distribution of particles becomes irregular, and as a result, a locally heterogeneous texture representation can be formed.
[0047] The information regarding the particle placement positions determined for the reference texture is stored as information about the particle distribution pattern in the reference texture (hereinafter referred to as reference distribution information). In the example in Figure 4, only one type of particle was used for explanation, but if multiple types of particles are included, it goes without saying that the distribution information will include information that identifies the type of particle placed at each placement position.
[0048] (Generating textures other than the standard length) Once a base texture is generated in this way, textures of other lengths for line drawing are generated based on that base texture.
[0049] As described above, the reference texture is configured to show a common particle distribution pattern at its longitudinal edges, so by placing them adjacent to each other, it is possible to draw longer line segments that exhibit a predetermined texture representation. That is, line segments of length that are integer multiples of the reference length can be drawn using only the reference texture while ensuring globally uniform texture representation. Here, the shortest line segment length that can be drawn using only the reference texture is the reference length, and the next line segment length that can be drawn using only the reference texture is twice the reference length (hereinafter referred to as twice the length). Therefore, the illustration editing application of this embodiment generates line segment drawing textures for each length determined by subdividing the length range up to twice the length with a predetermined length resolution.
[0050] In other words, the reference texture can render line segments of the reference length, integer multiples of the reference length, or lengths with only a small difference from these, while ensuring a suitable texture representation. However, for line segments of lengths that do not fall into these categories, namely, line segments from 0 to the reference length, and line segments from the reference length to twice the length, the reference texture cannot render them while ensuring a suitable texture representation. Therefore, the illustration editing application of this embodiment generates line segment rendering textures of progressively different lengths for lengths from 0 to the reference length and for lengths from the reference length to twice the length.
[0051] The length patterns for generating line segment drawing textures are defined as the lengths corresponding to each step when the length range up to twice the length is divided into 32 or 64 steps, etc. (Step 0 is excluded because there is no need to place a line segment drawing texture for length 0). In the example shown below, the base length is set to 64 pixels, and the range up to twice that length, 128 pixels, is evenly divided into 32 steps. For each step excluding length 0 and the base length, a line segment drawing texture is generated based on the base texture.
[0052] In the following examples, the length resolution is arbitrarily set to 32 levels for convenience. However, as described above, the length resolution can be set to be finer or coarser according to the setting of how smoothly the switching of the texture for line segment drawing is presented in relation to the change in the length of the line segment. Needless to say, equal division is not an essential element, and the lengths for generating the texture for line segment drawing may be sparsely defined for some length ranges and densely defined for other length ranges.
[0053] The method for generating the texture for line segment drawing differs according to the length of the texture to be generated (hereinafter referred to as the output length). Therefore, the following will explain each of the longer side than the reference length (elongation expression from the reference length) and the shorter side than the reference length (shrinkage expression from the reference length).
[0054] (1) Texture generation related to elongation expression The texture for line segment drawing with an output length longer than the reference length, that is, a line segment drawing texture having a length that is S times the reference length (1 < S ≤ 2), is generated so as to have the same particle arrangement pattern as when two reference textures are adjacent at the time of being twice as long. That is, the texture for line segment drawing related to the elongation expression is generated based on the reference texture 501 as shown in FIG. 5 and the texture twice as long (hereinafter referred to as the connected texture) 502 generated by connecting two of the reference textures 501 in the longitudinal direction and the particle distribution pattern. More specifically, the texture with a length that is S times the reference length (1 < S ≤ 2) is generated by determining the particle arrangement positions in the texture based on the reference distribution information related to the reference texture and the information indicating the particle distribution pattern related to the connected texture (hereinafter referred to as the connected distribution information).
[0055] Here, the connected texture 502 is a texture for drawing a line segment corresponding to S = 2 (the 32nd stage). In this embodiment, the connected texture 502 will be described as being generated as one of the textures for drawing a line segment. However, since the connected texture 502 is formed by connecting two reference textures 501 and will be replaced by the two reference textures 501 even when drawing a line segment as described later, the generation of the connected texture 502 is not essential for the implementation of the present invention.
[0056] Since the texture related to the extended expression is a texture applied when the line segment to be applied is sequentially extended from the reference length to twice the length, it is necessary to ensure the texture expression indicated by the reference texture 501 during the process of the extension. Also, when switching the applied texture, it is necessary to ensure similarity in the distribution pattern of the particles so that no flicker in appearance occurs. That is, the texture related to the extended expression must be configured to show a certain similarity between textures in terms of the local arrangement positions of the particles while keeping the arrangement frequency of the particles constant globally. That is, the texture applied in the process of sequentially extending the line segment from the reference length to twice the length is generated by controlling the arrangement positions of the particles according to the output length so that the distribution pattern of the particles indicated by the reference distribution information gradually approaches the distribution pattern of the particles indicated by the connected distribution information.
[0057] Hereinafter, a method for determining the arrangement positions of particles related to the generation of a texture for drawing a line segment with an output length of S times the reference length (1 < S < 2) (hereinafter referred to as an intermediate extended texture) will be described with reference to FIGS. 6A and 6B. In the example of the figure, for ease of understanding of the invention, it is assumed that there are two patterns, A and B, of the particles constituting the texture for drawing a line segment, and in the figure, each particle is represented in a distinguishable manner by setting its appearance as the character "A" or "B". For example, when the particles are distributed as shown in FIG. 6A in the reference texture 601, since the connected texture 602 related to twice the length is generated by connecting two reference length textures 601 in the longitudinal direction, the particles are distributed as shown in FIG. 6B.
[0058] In generating the extended intermediate texture, the first step is to associate the particles distributed in the reference texture 601 with the particles distributed in the linked texture 602. Here, association means that particles that have the same relative position in the texture and exhibit the same pattern between the reference texture 601 and the linked texture 602 are associated as the same particle.
[0059] In other words, a particle that has been matched is a particle that is maintained at a constant relative position regardless of the change in length in the longitudinal direction when the reference texture 601 is stretched and transformed into the linked texture 602. To put it another way, a particle that has been matched is a particle that does not disappear during the process of stretching the line segment to twice the length of the reference length, but remains in a region where the relative position is common, and is also a particle that is placed in the same relative position in the stretched intermediate texture. That is to say, a particle that has been matched is a particle that is always placed in a region where the relative position is common regardless of the length, even at output lengths longer than the reference length.
[0060] Here, the region with a common relative position may be defined based on the grid defined when the reference texture 601 was generated, as shown in Figures 7A to 7C. Let's consider the case where the reference texture 601 is generated by defining essentially 10 grids (5 divisions in the longitudinal direction × 2 divisions in the width direction) within the region 701 related to the texture, as shown in Figure 7A, and placing either A or B particles in each grid. In this case, if the region 701 related to the reference texture 601 is stretched by a factor of 2 in the longitudinal direction, each grid is also stretched by a factor of 2 in the longitudinal direction, resulting in Figure 7B. Since the region 711 in Figure 7B is the same size as the region related to the linked texture 602, the region indicated by each grid that has been stretched by a factor of 2 in the longitudinal direction identifies the region in the linked texture 602 that corresponds to each grid of the reference texture 601. Figure 7C shows the grid of Figure 7B superimposed on the linked texture 602. Therefore, the grid region of the reference texture 601 and the grid region of the linked texture 602, which are identified by grid coordinates (M,N) using the grid row number M and column number N, are regions that share a common relative position.
[0061] In Figure 7A, a particle 703 of pattern B is placed in the grid region 702, which is specified by the grid coordinates (4,1), and in Figure 7C, a particle 713 of pattern B is also placed in the grid region 712, which is specified by the same grid coordinates. Therefore, particles 703 and 713 placed in the grid region of grid coordinates (4,1) can be associated between the reference texture 601 and the linked texture 602.
[0062] On the other hand, in Figure 7A, the grid region 704 identified by the grid coordinates (3,1) contains particles 705 of pattern A, but in Figure 7C, the grid region 714 identified by the same grid coordinates does not contain particles of pattern A. Therefore, the particle 705 located in the grid region at grid coordinates (3,1) cannot be associated with the reference texture 601 and the linked texture 602. In other words, the particle 705 cannot be associated with the linked texture 602 because there are no particles of the same pattern with small relative positional changes.
[0063] Through this mapping, each particle distributed in the reference texture 601 and the linked texture 602 is first classified into two categories: a first category of particles that can be mapped, and a second category of particles that cannot be mapped. In other words, particles of the first category are those shown in black in Figure 7D, whose placement is maintained in a region of a constant relative position regardless of the length of the stretched intermediate texture. On the other hand, particles of the second category are those whose placement in a region of a constant relative position changes depending on the length of the stretched intermediate texture. More specifically, particles of the second category include the first particle shown in black in Figure 7E, which is present in the reference texture 601 but disappears from the region of common relative position as the length of the stretched intermediate texture increases, and the second particle shown in black in Figure 7F, which is not present in the reference texture 601 but appears as the length of the stretched intermediate texture increases.
[0064] Furthermore, since linked texture 602 is generated by linking base texture 601, the particles in the grid region at the edges of base texture 601 are always classified into the first category. As a result, the stretched intermediate texture, like base texture 601, will not have discontinuities in the particles at the boundaries even if it is placed adjacent to other textures on a line segment when drawing a line segment longer than twice its length.
[0065] Based on the classification results of the particles distributed in the base texture 601 and the linked texture 602, the placement position of each particle is determined for each length stage related to the stretching representation, and the stretched intermediate texture is generated. In other words, when the particle distribution pattern at the base length (base distribution information) and the particle distribution pattern at twice the length (linked distribution information) are determined, if particles are randomly placed in the stretched intermediate texture that shows the stretching process, the continuity of the particle distribution pattern cannot be guaranteed, which may cause flickering in appearance. For this reason, only the particles distributed in the base texture 601 and the linked texture 602 are used to generate the stretched intermediate texture, and in determining the placement position of each particle, these particles are classified according to their characteristics, and the determination method is made different for each classification according to the texture length as follows.
[0066] For the first classification of particles, there are particles associated with both the base texture 601 and the linked texture 602. Therefore, the position of the particle in the stretched intermediate texture is determined based on the relative position of the particle in the base texture 601 and the relative position of the particle in the linked texture 602.
[0067] As described above, the particles of the first classification are particles distributed in the same pattern and in a region where their relative positions in each texture are common. Therefore, the relative positions of these particles may not strictly differ between the reference texture 601 and the linked texture 602. For example, if we define the X-coordinate (absolute coordinate) of the leftmost edge of each texture as X=0, and the X-coordinate (absolute coordinate) of particle [i] in the reference texture 601 is X iWhen it is, in the concatenated texture 602, the X coordinate (absolute coordinate) of the associated particle [i] is not necessarily 2X i but rather, 2X i close to 2X i ’ may be the case. Therefore, the placement position of the particle [i] in the stretched intermediate texture is such that as the output length increases, the relative X coordinate approaches X i from X i ’ and is determined. That is, as the output length increases, the placement position of the particle [i] is determined to sequentially move from the relative coordinate in the reference texture 601 to the relative coordinate position in the concatenated texture 602. Specifically, the X coordinate (absolute coordinate) X out of the placement position of the particle [i] in the stretched intermediate texture of the output length L out is It may be derived as JPEG0007879280000001.jpg28154. Here, L ref is the reference length, and L dub indicates twice the length.
[0068] Regarding the particles of the first classification arranged at the ends of the stretched intermediate texture, it is assumed that the determination of the placement position is controlled so that they are placed at the same relative position in both the reference texture 601 and the concatenated texture 602. That is, for the particles of the first classification at the ends, since the relative position is controlled to be the same in the stretched intermediate texture of any length, the process of moving the relative position of the particles according to the output length does not occur.
[0069] On the other hand, for the particles of the second classification, they exist in one of the reference texture 601 and the concatenated texture 602, but there are no corresponding particles in the other texture. Therefore, in the process of the stretched expression, there is no need to move the placement position to different relative positions like the particles of the first classification. Thus, for the first particles included only in the reference texture 601 among the second classification, the placement position in the stretched intermediate texture is determined so as to maintain the relative position of the particle in the reference texture 601. That is, in the reference texture 601, the X coordinate (absolute coordinate) is Xa iThe output length L of particle [i] out X coordinate (absolute coordinate) of the placement position in the stretched intermediate texture Xa out teeth, It can be derived as JPEG0007879280000002.jpg2873.
[0070] Furthermore, for the second particle included only in linked texture 602 of the second classification, its placement position in the stretched intermediate texture is determined so as to maintain the relative position of the particle in linked texture 602. That is, for particle [i] whose X coordinate (absolute coordinate) is Xbi in linked texture 602, the output length L out X coordinate (absolute coordinate) Xb of the placement position in the stretched intermediate texture out teeth, It can be derived as JPEG0007879280000003.jpg2774.
[0071] Furthermore, for the particles of the second classification, their placement size is determined in order to show in the extended intermediate texture how they disappear or appear depending on the output length. Specifically, for the first particles, a visible placement size is determined for output lengths close to the standard length, and an invisible placement size (0) is determined for output lengths close to twice the standard length. Similarly, for the second particles, an invisible placement size (0) is determined for output lengths close to the standard length, and a visible placement size is determined for output lengths close to twice the standard length. In other words, the placement size of the first particles becomes smaller (disappears) as the output length increases, and larger (becomes visible) as the output length decreases. Similarly, the placement size of the second particles becomes larger (becomes visible) as the output length increases, and smaller (disappears) as the output length decreases.
[0072] The output length and placement size of each particle can be determined according to the particle placement frequency defined for the reference texture 601. In other words, by maintaining the particle placement frequency per unit length related to the reference texture 601, a uniform texture representation can be ensured in the stretched intermediate texture.
[0073] Here, maintaining the particle placement frequency means, as shown in Figure 8, that when a grid of the same size as the one used when generating the reference texture 601 is defined, the area occupied by the particles placed within each grid region is adjusted to be equivalent to the area of one particle in the reference texture 601. In other words, depending on the output length, multiple particle placement positions may be included within a single grid region. In this case, the placement size of each particle is adjusted to 1 (default size) or less so that the sum of the sizes of all particles is 1. To put it another way, in this embodiment where a placement frequency of one particle per grid region is defined, if the particle placement positions determined for the output length are included in the same grid region, the placement frequency cannot be guaranteed. Therefore, the placement frequency is maintained by adjusting the particle size to include 0.
[0074] Figure 8 shows an example where, within a region 801 having an output length in the longitudinal direction, it is possible to define substantially 14 grids of the same size as those defined when generating the reference texture shown in Figure 7 (specifically, a two-dimensional distribution of 7 in the longitudinal direction and 2 in the width direction). Since the grid region 802 contains two particles 803 and 804, the placement size of these two particles is determined according to their classification. For example, if one of the particles is a particle of the first classification, its placement size will remain 1 regardless of the output length in the stretched representation, and the placement size of the other particle will be determined to be 0. Alternatively, if both particles are particles of the second classification, the placement size of the first particle will be determined according to (output length - reference length), and the placement size of the second particle will be determined according to (double length - output length).
[0075] In FIG. 8, an output length in which an integer number of grids of the same size as those defined at the time of generating the reference texture can be defined in the longitudinal direction is illustrated. Needless to say, the implementation of the present invention is not limited to this. Depending on the output length, since it is not possible to define an integer number of grids in the longitudinal direction, the arrangement frequency of the particles may not necessarily be the same as that of the reference texture. In this case, the arrangement frequency of the particles related to the intermediate extended texture may be controlled so that the difference from the arrangement frequency of the particles related to the reference texture is less than a predetermined threshold value. Here, the threshold value is set to such an extent that no difference in appearance can be visually recognized between the intermediate extended texture and the reference texture.
[0076] Also, in the present embodiment, in generating the intermediate extended texture, it is described as using a method of adjusting the arrangement size of the particles in order to maintain the arrangement frequency of the particles. However, the implementation of the present invention is not limited to this. For example, the arrangement frequency of the particles in the intermediate extended texture may be maintained by adjusting the opacity of the particles. Alternatively, it may be maintained by adjusting both the arrangement size and the opacity of the particles.
[0077] (2) Texture generation related to shortened expression On the other hand, for a line drawing texture (hereinafter referred to as an intermediate shortened texture) having an output length shorter than the reference length, that is, a line segment having a length that is S times the reference length (0 < S < 1), there is no texture that should be a specific standard for the arrangement position of the particles like the concatenated texture. Therefore, in determining the arrangement position of the particles in the intermediate shortened texture related to the shortened expression, a texture obtained by shortening the reference texture so that the longitudinal direction becomes the output length (hereinafter simply referred to as a shortened texture) is generated, and the distribution pattern of the particles in the shortened texture is referred to. That is, in the illustration editing application, the arrangement position of the particles in the intermediate shortened texture with the output length is determined based on the reference distribution information related to the reference texture and the shortened distribution information indicating the distribution pattern of the particles in the shortened texture generated for the output length.
[0078] Figure 9A illustrates a standard texture 901 and a shortened texture 902 obtained by shortening the standard texture 901 to half its length. As shown, in the shortened texture 902, the particles are compressed overall in the longitudinal direction, so the same texture representation as the standard texture 901 cannot be guaranteed. On the other hand, if the particle shape is made the same as that of the standard texture 901, the particle density may become higher than that of the standard texture 901, as shown in Figure 9B. In other words, if all the particles in the shortened texture 902 are made to be the same shape and size as the particles in the standard texture 901, the particle placement frequency will change, so in order to generate a shortened intermediate texture, it is necessary to adjust the particle placement size, similar to the stretched representation.
[0079] The adjustment of the placement size may be done in the same way as that done for the particles of the second classification in the expanded intermediate texture. For example, as shown in Figure 10, when a grid of the same size as the one used when generating the reference texture 901 is defined in the region related to the shortened texture 902, the sum of the sizes of all particles placed in each grid region should be 1.
[0080] Here, if multiple particles are placed in a grid region, for example, a priority can be set according to the distance from the center of each grid region (the closer to the center, the higher the priority), and the size of the particles can be determined based on that priority (the particles with higher priority will be larger than those with lower priority). This setting of priority is merely an example, and other methods can be used. The reason why such prioritization of particles is necessary is because the shortened texture is generated by deforming the base texture. That is, the base distribution information and shortened distribution information referenced in the generation of the shortened intermediate texture are both determined based on the same single base texture, so all particles can be associated with the base texture and the shortened texture, and therefore fall under the first classification in the stretched representation.
[0081] Furthermore, similar to the base texture, stretched intermediate texture, and linked texture, it is necessary to control the placement position and size of particles at the edges so that when they are placed adjacent to each other, the particles do not become discontinuous at the boundary. Therefore, for the grid regions corresponding to the edges, the placement position of the relevant particles is fixed to maintain the particle distribution pattern at the edges in the base texture 901, and the placement size of other particles included in the grid region where these particles are placed is forcibly set to 0. A shortened intermediate texture with half the length, generated by determining the placement position and size of the particles in this way, is illustrated in Figure 9C.
[0082] Furthermore, in the 1 / 2 length shortened intermediate texture shown in Figure 9C, there was sufficient length in the longitudinal direction of the area where the particles were placed, so the particle placement size at the edges could be the same as that of the base texture 901. However, depending on the output length, the longitudinal length of the particles may exceed the output length. Therefore, for output lengths that are less than or equal to the longitudinal length of the particles, the particles may be compressed in the longitudinal direction as shown in Figure 11 to prevent the texture expression from changing due to particle overlap.
[0083] Furthermore, in this embodiment, the method for generating a shortened intermediate texture is described as adjusting the particle placement size to maintain the particle placement frequency, but the implementation of the present invention is not limited to this. For example, similar to the stretched intermediate texture, the particle placement frequency in the shortened intermediate texture may be maintained by adjusting the opacity of the particles. Alternatively, it may be maintained by adjusting both the particle placement size and opacity.
[0084] By arranging the particles of each pattern at the determined placement positions and sizes, it is possible to generate textures with a common texture representation for multiple output lengths up to twice the length. As will be explained in detail later, the generated line-drawing textures (base texture, linked texture, extended intermediate texture, and shortened intermediate texture) can be used to show a uniform texture representation for line segments of lengths from 0 to twice the length. Furthermore, since each of the line-drawing textures is configured to be placed adjacent to each other, it is possible to show a uniform texture representation for line segments longer than twice the length by using multiple line-drawing textures.
[0085] In this embodiment, line segment drawing textures are generated for each of the 32 equally divided length steps up to twice the length, and when drawing line segments of varying length, these textures are sequentially switched and applied according to the line segment length. As will be described in detail later, when drawing line segments of length less than twice the length for which no line segment drawing texture has been generated, for example, the longest line segment drawing texture with a length shorter than the length in question is stretched to the length of the line segment and used. Then, when the line segment extends to the next length step, the texture is switched to the texture for that length step.
[0086] Therefore, it is preferable that the line segment drawing texture is configured so that the user does not perceive a change in the applied texture on the drawn line segment. Accordingly, information regarding the arrangement of particles is determined so that a certain degree of similarity in the particle distribution pattern is ensured between the line segment drawing texture of one length stage (first length) and the line segment drawing texture of the next longer length stage (second length).
[0087] More specifically, the texture of the first length (hereinafter referred to as the first texture) is stretched and applied as needed to line segments with a length greater than or equal to the first length but less than the second length. Therefore, when a line segment extends from the first length to the second length, a switch occurs from the first texture to the texture of the second length (hereinafter referred to as the second texture).
[0088] According to the line segment drawing texture generation method described above, the placement size of each particle is adjusted according to the output length so that the particle placement frequency remains constant regardless of the output length, and the placement position is also adjusted according to the output length based on the distribution pattern in the reference texture or linked texture so that the relative position within the texture area is maintained. Therefore, the extent to which there is a difference in the particle distribution pattern between the first texture and the second texture, that is, how easily the user perceives the switch when switching from the first texture to the second texture, depends on the difference in the lengths of the corresponding textures (the length of the first and the length of the second).
[0089] Furthermore, when the first texture is stretched to approximately the same length as the second texture, the shape of the particles in the first texture changes. Therefore, the perceived ease of switching from the first texture to the second texture varies depending on the degree of stretching applied immediately before switching to the second texture. In other words, the extent to which the first texture is stretched before switching to the second texture also depends on the magnitude of the length difference between the corresponding textures.
[0090] In other words, in order to generate a line-drawing texture that guarantees a consistent texture representation while making the transition less noticeable to the user, it is preferable to configure the first texture and the second texture so that their similarity when they are of equal length is above a certain threshold. To put it another way, if the texture representation (appearance) formed by the distributed particles when the first texture is stretched to the second length is similar to that of the second texture, then the user will not perceive the transition of the line-drawing texture during the process of stretching and shrinking the line segment, and will get the impression that a seamless texture representation is guaranteed.
[0091] The following is a generalized description of the case where each of N (in this embodiment, N = 32) types of textures generated as line segment drawing textures is generated as T[m] (m is an integer where 0 ≦ m < N). In this case, the line segment drawing textures are N types excluding the 0-fold of N + 1 textures that change stepwise up to Se (an integer value; in this embodiment, Se = 2) times the reference length. Numerical values from 0 to N - 1 are assigned as m to these in ascending order of length, and one texture can be specified as T[m] based on the numerical value (number) m. At this time, if the longitudinal length of T[m] is S[m] times the reference length, the relationship between m and S[m] can be expressed as JPEG0007879280000004.jpg2573 (when dividing up to Se times evenly to determine the length). At this time, if the number corresponding to the first length is m and the number corresponding to the second length is m + 1, then T[m] has a length of S[m] times the reference length, and T[m + 1] has a length of S[m + 1] times the reference length. Therefore, the difference in the longitudinal lengths between the texture T[m] of the first length and the texture T[m + 1] of the second length is JPEG0007879280000005.jpg25153. Here, L ref is the reference length. That is, the larger the number of length patterns of the line segment drawing textures, that is, the number of divisions N of the length from 0 to Se times, the harder it is for the user to perceive the change when switching to the next longer line segment drawing texture. This is because the smaller the difference between S[m] and S[m + 1], the narrower the length range (the intermediate length between S[m] and S[m + 1]) to which T[m] is stretched and applied, and the fewer the display opportunities for textures whose particle shapes have changed (elongated in the longitudinal direction).
[0092] Preferably, by configuring to switch to a different line segment drawing texture every time the length of the line segment changes by 1 pixel, it is possible to present a stretching and shrinking expression with a more uniform texture without displaying the stretched texture. The number N of such length patterns can be derived as JPEG0007879280000006.jpg1855.
[0093] In this way, by appropriately selecting the base length and the number of line segment drawing textures to be generated, it is possible to generate a set of line segment drawing textures that ensure uniform texture representation, just as when drawing line segments by appropriately placing particles. Therefore, the number of length patterns is not limited to the 32 mentioned above, but can be set to any value such as 64 or 128, depending on the required quality of the line segment drawing texture (how inconspicuous the difference is when switching) and the base length.
[0094] <Drawing line segments using textures> Next, we will outline the process of drawing line segments with the corresponding texture representation using the line segment drawing textures of multiple length patterns generated in this manner. In this embodiment, the drawing of such line segments is provided as a function of the illustration editing application. The process of drawing line segments using textures can be classified into the following three types depending on the length of the line segment.
[0095] (1) Line segments of less than twice the length For line segments shorter than twice the length of the line segment, drawing is performed by applying one of the generated line segment drawing textures. The texture selected in this case is either the texture with the length of the line segment if one exists, or the texture with the longest length among those shorter than the line segment if no texture with the length of the line segment exists.
[0096] For example, standard length L ref Therefore, if the length of the line segment is 1 / 2 (0.5 = 2 × 8 / 32) times the length, texture T[7], which is assigned to 7 (= 8-1), is used for rendering. Similarly, T[7] is used until the length of the line segment exceeds 1 / 2 of the length of texture 7 and reaches the length of texture 8 (2 × (8 + 1) / 32 ≈ 0.56 times the length). In this case, T[7] is stretched according to the length of the line segment and applied. When the length of the line segment reaches the length of texture 8, the applied texture is switched from T[7] to T[8].
[0097] (2) Line segment twice the length For line segments twice as long, the 32nd texture T
[31] among the generated line segment drawing textures has the same length. Here, since T
[31] is a concatenated texture, there is no visual difference from placing two reference textures adjacent to each other. Also, since there is no texture longer than T
[31] among the line segment drawing textures, it is not possible to switch to a longer texture if the line segment is further extended. For this reason, although the concatenated texture T
[31] is selected based on the length of the line segment, the two reference textures T
[15] are selected in its place.
[0098] In other words, if the length of the line segment is twice as long, the line segment can be drawn using a single texture T
[31] , but it is replaced with two reference textures T
[15] for drawing. That is, since the concatenated texture T
[31] is originally generated by concatenating two reference textures T
[15] , even if T
[30] is replaced with two T
[15] at the length where the switch from T
[30] to T
[31] occurs, the user cannot perceive this replacement.
[0099] (3) Line segments with a length greater than twice the length On the other hand, for line segments longer than twice the original length, applying only one of the generated line segment drawing textures is insufficient to achieve a suitable texture representation. When a line segment doubles in length, the texture applied to it changes from one (T
[31] ) to two (T
[15] × 2). Therefore, for line segments longer than twice the original length, texture representation is achieved by switching each of these replaced textures to a longer texture and applying it.
[0100] For example, if the length of a line segment is three times the standard length, two textures T
[23] with a length of 1.5 are applied adjacent to each other to render a line segment with texture representation. That is, as the line segment is sequentially extended, the two standard textures that were replaced and applied when the line segment was twice the length are sequentially switched to longer textures according to the length of the line segment. When the line segment reaches four times the standard length, both textures are switched to two-times-long textures T
[31] (linked textures), and as with the rendering of the twice-length line segment, these are each replaced by two standard textures T
[15] . Therefore, when the line segment extends beyond four times the standard length, each sequentially replaced texture is switched to a texture of a different length.
[0101] In other words, the number of line segment drawing textures applied is 2 times the base length of the line segment. N It doubles each time it doubles (2 N (It is replaced by a reference texture). Therefore, the number of textures used to draw a line segment is derived from the number of times N can be bit-shifted to the right until it becomes 0 when the value obtained by dividing the length of the line segment by the reference length is cast to an integer type and the integer value is represented in binary (2 N ) can be done.
[0102] In this way, the illustration editing application of this embodiment makes it possible, in principle, to draw line segments of infinite length while maintaining a uniform texture representation, using a limited number of line segment drawing textures.
[0103] In this embodiment, to facilitate understanding of the invention, when drawing a line segment by applying multiple line segment drawing textures, these textures are described as representing the same length. That is, multiple textures of one type are applied to the drawing of a line segment at one time. This makes it possible to make the particle distribution uniform throughout the entire line segment. However, the implementation of the present invention is not limited to this, and for example, line segment drawing textures of different lengths may be combined and applied according to the length of the line segment.
[0104] 《Generation Process》 The following describes the process for generating line segment drawing textures in the illustration editing application of this embodiment, using the flowchart in Figure 12. The process corresponding to the flowchart can be realized by the control unit 101 reading the corresponding processing program stored in the storage device 102, for example, loading it into memory 103 and executing it. This generation process will be described as starting, for example, when condition information related to the generation rules of a reference texture is input.
[0105] In S1201, the control unit 101 generates a reference texture based on the input condition information and obtains reference distribution information for the generated reference texture. Here, the condition information includes information on the particle pattern to be placed on the reference texture, information on the particle placement frequency per unit length, and reference length information. Based on this condition information, the control unit 101 obtains reference distribution information by determining the particle placement positions for each pattern so as to satisfy the particle placement frequency.
[0106] In S1202, the control unit 101 determines the output length for each of the line drawing textures generated in addition to the reference texture. The output length for each texture is determined by setting the maximum length to the reference length multiplied by a predetermined integer value, and dividing the length range from 0 to the maximum length equally into a predetermined number of divisions. In the example described above, the predetermined integer value is 2 and the number of divisions is 32. Here, the predetermined integer value and the number of divisions may be predetermined, or they may be determined based on user input, for example.
[0107] In S1203, the control unit 101 determines the particle placement position for each of the line segment drawing textures to be generated based on the reference distribution information. The control unit 101 also determines the particle placement size as needed. More specifically, the control unit 101 determines the particle placement position using different methods for output lengths longer than the reference length (output length related to extended representation) and output lengths shorter than the reference length (output length related to shortened representation) among the output lengths determined in S1202.
[0108] Regarding the output length related to the extended representation, the control unit 101 first generates a concatenated texture by concatenating reference textures and obtains the concatenation distribution information of the generated concatenated texture. Then, based on the reference distribution information and the concatenation distribution information, the control unit 101 associates the particles distributed in the reference texture with the particles distributed in the concatenated texture and classifies the particles. Subsequently, for each output length, the control unit 101 determines the placement position of each particle according to the classification. Furthermore, for particles of the second classification, the control unit 101 also determines the placement size based on the reference distribution information, the concatenation distribution information, the particle classification information, and the particle placement frequency information.
[0109] Furthermore, regarding the output length related to the abbreviated representation, the control unit 101 obtains abbreviated distribution information corresponding to each output length by converting the reference distribution information according to each output length. The control unit 101 then determines the placement position of each particle based on the abbreviated distribution information. The control unit 101 also determines the placement size based on the abbreviated distribution information, particle priority, and particle placement frequency information.
[0110] In S1204, the drawing unit 104, under the control of the control unit 101, generates line segment drawing textures (extended intermediate textures and shortened intermediate textures) for each output length based on the information of the placement position and placement size of each particle determined in S1203. That is, the drawing unit 104 generates line segment drawing textures for each output length by placing particles of the corresponding pattern at the determined placement positions. The generated textures are stored in the storage device 102 in association with the output length.
[0111] 《Drawing Process》 Next, the drawing process for drawing line segments with texture representation in the illustration editing application of this embodiment will be explained using the flowchart in Figure 13. The process corresponding to the flowchart can be realized by the control unit 101 reading the corresponding processing program stored in the storage device 102, for example, expanding it into memory 103 and executing it. This drawing process will be described as starting when, for example, an input related to changing the length of the line segment is received, and being executed repeatedly for the duration of that input. Prior to the execution of this drawing process, it will be assumed that line segment drawing textures of each length related to the texture representation of the object to be drawn are expanded into memory 103 or the GPU memory of the drawing unit 104. Furthermore, in the following description, it will be assumed that these line segment drawing textures are generated for a length range up to twice the standard length.
[0112] In S1301, the control unit 101 obtains the length of the line segment to be drawn. The length of the line segment is derived based on the vector information of the reference line input to define the line segment.
[0113] In S1302, the control unit 101 determines whether the length of the line segment obtained in S1301 is less than twice the length of the reference texture, twice the length, or greater than twice the length. If the control unit 101 determines that the length of the line segment is less than twice the length, it moves the process to S1303; if it determines that it is twice the length, it moves the process to S1305; and if it determines that it is greater than twice the length, it moves the process to S1307.
[0114] In S1303, the control unit 101 selects one line segment drawing texture corresponding to the length of the line segment. More specifically, the control unit 101 selects one of the line segment drawing textures related to the texture representation of the object to be drawn, which has the longest length that is less than or equal to the length of the line segment.
[0115] In S1304, the drawing unit 104, under the control of the control unit 101, applies the line segment drawing texture selected in S1303 to a reference line to draw the line segment. At this time, if the length of the line segment drawing texture and the length of the line segment are different, the drawing unit 104 stretches the line segment drawing texture to the length of the line segment before applying it. The drawn line segment is included in the screen related to the illustration editing application and displayed on the display unit 110 by the display control unit 105.
[0116] On the other hand, if it is determined in S1302 that the length of the line segment is twice as long, the control unit 101 selects a line segment drawing texture corresponding to the length of the line segment in S1305. At this time, the line segment drawing texture corresponding to the length of the line segment is a concatenated texture, but when the control unit 101 selects a concatenated texture, it replaces it with two reference length textures.
[0117] In S1306, the drawing unit 104, under the control of the control unit 101, applies the line segment drawing texture (two reference textures) selected in S1305 to the reference line to draw the line segment. The drawn line segment is similarly included in the screen related to the illustration editing application and displayed on the display unit 110 by the display control unit 105.
[0118] In S1307, the control unit 101 determines the number of line segment drawing textures to be used (hereinafter referred to as the number of textures) based on the length of the line segment.
[0119] In S1308, the control unit 101 derives the length of the section to which one line segment drawing texture is applied (section length) by dividing the length of the line segment by the number of textures.
[0120] In S1309, the control unit 101 selects one line segment drawing texture corresponding to the section length. More specifically, the control unit 101 selects one line segment drawing texture related to the texture representation of the object to be drawn, which has the longest length less than or equal to the section length.
[0121] In S1310, the drawing unit 104, under the control of the control unit 101, applies the line segment drawing textures selected in S1308 to the reference line, arranging them according to the number of textures, to draw the line segment. At this time, if the length of the line segment drawing texture and the section length are different, the drawing unit 104 extends each line segment drawing texture to the section length before applying it. The drawn line segment is similarly included in the screen related to the illustration editing application and displayed on the display unit 110 by the display control unit 105.
[0122] In this embodiment, the drawing of line segments with texture representation was described using a line segment drawing texture in an illustration editing application, but the implementation of the present invention is not limited to this. The drawing of line segments with texture representation may be performed in any application that can utilize the line segment drawing texture generated by the generation process. In other words, the present invention relating to line segment drawing can be performed in any information processing device that acquires and stores the line segment drawing texture generated by the generation process, and it is not essential that it be performed in the application that generates the line segment drawing texture or in the information processing device that generates it.
[0123] As described above, the drawing program of this embodiment makes it possible to draw line segments with desired texture representation while avoiding an increase in computational load. For example, any curve composed of two or more control points can be configured to show a uniform texture representation throughout by drawing a line segment drawing texture corresponding to the length between two consecutive control points (segments) on the curve based on the drawing process. In this case, since each line segment drawing texture is configured to have a common particle distribution pattern at its ends, it is possible to show a drawing representation in which particles are naturally connected at the connection points of consecutive segments. Furthermore, even when the length of each segment is changed, it is sequentially replaced with a corresponding number of reference textures each time the length reaches an integer multiple of the reference length, so as a result, line segments that can smoothly expand and contract from length 0 to infinite length and show a uniform texture representation can be shown with a small amount of computation.
[0124] In this embodiment, the concatenated texture is described as being generated by concatenating two reference textures, but the implementation of the present invention is not limited to this. From the viewpoint of minimizing the number of textures generated, as described above, it is preferable that the length of the concatenated texture that serves as the basis for generating the extended intermediate texture is twice the reference length, but it goes without saying that the length of the concatenated texture may be any length that is a predetermined integer multiple of the reference length, and an integer value of 3 or more may be used as the predetermined integer.
[0125] For example, if the given integer is "3", a concatenated texture is generated by concatenating three base textures, and a line segment drawing texture is generated for lengths ranging from 0 to 3 times the base length. Then, in the drawing process using this line segment drawing texture, the length of the line segment is 3 times the base length. N Each time the length doubles, the section to which the concatenated texture is applied should be replaced with three reference textures instead.
[0126] [Example 1] In the embodiments described above, when there is no line segment drawing texture with the same length as the line segment to be drawn, that is, when the length of the line segment is an intermediate length between the first length and the second length in the length pattern, it was explained that a texture shorter than the length of the line segment is stretched and applied. However, the implementation of the present invention is not limited to this, and for line segments of intermediate length, a texture of intermediate length may be generated and applied by averaging or weighted addition of line segment drawing textures having multiple lengths.
[0127] [Differentiation 2] Furthermore, in the embodiments described above, when generating an extended intermediate texture, the first classification of particles is performed when particles of the same pattern are distributed in a grid region with common grid coordinates. However, the present invention is not limited to this. The first classification of particles may be performed when, for any particle in the reference texture, particles of the same pattern are distributed within a predetermined distance from a point on a linked texture that shares relative coordinates with that particle.
[0128] [Other embodiments] The invention is not limited to the embodiments described above, and various modifications and changes are possible within the scope of the gist of the invention.
Claims
1. A computer that draws line segments with texture representation, A retrieval process that obtains multiple textures, each having a different length and exhibiting a common texture representation, including a reference texture having a standard length. A selection process to select at least one of the plurality of textures obtained by the acquisition process, according to the length of the line segment to be drawn, A drawing process that places the texture selected by the selection process and draws the line segment, A process for accepting changes to the length of the aforementioned line segment, A drawing program that executes, When a change in the length of the line segment is accepted, in the selection process, In place of the first texture that was selected before the change, a second texture corresponding to the length of the line segment after the change is selected. If the second texture is a texture having a length that is a predetermined integer multiple of the reference length, then a predetermined integer number of the reference textures are selected in place of the second texture. A drawing program characterized by the following features.
2. The drawing program according to claim 1, characterized in that the plurality of textures are textures in which the common texture representation is formed by distributed texture-forming elements.
3. The drawing program according to claim 2, characterized in that the distribution of the texture-forming elements is common at least at the edges of the plurality of textures.
4. The drawing program according to claim 2, characterized in that the drawing program is configured such that the similarity of the distribution of the texture-forming elements when the texture having a first length and the texture having a second length, which is the next longest among the plurality of textures, are made to equal length by stretching / reducing processing exceeds a threshold.
5. The drawing program according to claim 2, characterized in that a texture having a length obtained by a predetermined integer multiple of the reference length shows the same distribution of texture-forming elements as when the reference texture is linked together by a predetermined integer number of times.
6. The drawing program according to claim 1, characterized in that the plurality of textures are configured to have progressively different lengths within a range up to a predetermined integer multiple of the reference length.
7. The selection process includes a process for determining the number of textures to be placed on the line segment according to the length of the line segment. When a change in the length of the line segment is accepted, the selection process selects the second texture for the determined number of first textures. The drawing program according to feature 1.
8. A drawing device for drawing line segments with texture representation, Acquisition means for acquiring multiple textures, each having a different length and exhibiting a common texture representation, including a reference texture having a reference length, A selection means that selects at least one of the plurality of textures obtained by the acquisition means according to the length of the line segment to be drawn, A drawing means for drawing the line segment by arranging the texture selected by the selection means, Means for accepting changes to the length of the aforementioned line segment, It has, The selection means, when a change in the length of the line segment is accepted, In place of the first texture that was selected before the change, a second texture corresponding to the length of the line segment after the change is selected. If the second texture is a texture having a length that is a predetermined integer multiple of the reference length, then select the predetermined integer number of the reference textures instead of the second texture. A drawing device characterized by the following features.
9. A method for controlling a drawing device that draws line segments with texture representation, An acquisition process to obtain multiple textures, each having a different length and exhibiting a common texture representation, including a reference texture having a standard length, A selection step in which, depending on the length of the line segment to be drawn, at least one of the plurality of textures obtained in the acquisition step is selected, A drawing step in which the texture selected in the selection step is placed and the line segment is drawn, A process for accepting changes to the length of the aforementioned line segment, It has, In the selection step, if a change in the length of the line segment is accepted, In place of the first texture that was selected before the change, a second texture corresponding to the length of the line segment after the change is selected. If the second texture is a texture having a length that is a predetermined integer multiple of the reference length, then a predetermined integer number of the reference textures are selected in place of the second texture. A control method characterized by the following:
10. A computer-readable recording medium having a drawing program according to any one of claims 1 to 7 recorded on it.