Computer-implemented method of generating glyph representations for use in rendering processing
By generating alternative glyph representations and efficiently encoding foreground and background visual parameters using indexes, the storage and computational costs of text rendering on uneven backgrounds are solved, improving text readability and rendering efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-28
- Publication Date
- 2026-03-13
AI Technical Summary
When rendering text on uneven backgrounds, existing techniques may degrade the performance of glyph atlases, leading to decreased text readability and increased computational and memory costs.
By generating additional glyph representations, storing foreground and background visual parameter values using a first index and a second index respectively, and employing quantization and visual effect calculations, the storage bits are reduced to efficiently encode foreground and background information.
It achieves reduced storage and computational costs and improved rendering efficiency without compromising text readability, making it particularly suitable for medical imaging applications.
Smart Images

Figure CN121661176A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a computer-implemented method for generating glyph representations used in rendering processes, and a computer-implemented method for rendering glyphs using such glyph representations. The invention also relates to a set of machine-readable instructions for implementing the method, a machine-readable medium including such instructions, and apparatus for implementing the method. Background Technology
[0002] In computer-implemented rendering, such as text rendering, glyph atlases are typically used to achieve better performance. A glyph atlas can be a 2D storage buffer that stores pre-rendered glyphs, from which the output text can be rendered glyph by glyph from the 2D storage buffer. Summary of the Invention
[0003] In some examples, it may be desirable to utilize applied visual effects to render output such as output text. For instance, when text is rendered against an uneven background, such as if the text color and background have similar hues or brightness, the readability of the text may be affected. This often occurs in medical imaging applications, where text is overlaid on medical images. In such applications, effects can be applied to the text to improve readability. For example, a shadow effect can be used to render the text, causing the uneven background to be covered by shadows while the text is rendered on top of the shadows with its usual foreground color and style. However, while such effects can improve text readability in some applications, rendering with such effects may reduce the advantages of using glyph atlases, as the computational and / or memory costs of using pre-rendered glyphs may be lower.
[0004] According to a first aspect of the present invention, a computer-implemented method for generating additional glyph representations used in rendering processing based on source glyph representations is provided. The method includes: determining a first plurality of positions in the additional glyph representation corresponding to corresponding plurality of source positions in the source glyph representation, and setting a corresponding first index of the first plurality of positions based on values associated with the corresponding source positions; for each given position in the additional plurality of positions in the additional glyph representation, setting a corresponding second index based on a relationship between the given position and the source positions in the source glyph representation, wherein the additional plurality of positions includes the first plurality of positions and the second plurality of positions; and storing the first index and the second index in association with the corresponding positions.
[0005] Setting the corresponding first index of the first plurality of locations based on the value associated with the corresponding source location may include: applying quantization processing to the value associated with the corresponding source location.
[0006] The relationship may include a geometric relationship between a given location and one or more source locations. The geometric relationship may include a distance metric.
[0007] Setting a second index can include performing visual effects calculations based on the relationship between a given position and one or more source positions in the source glyph representation.
[0008] Visual effects calculations may include shadow effect calculations and / or blur effect calculations.
[0009] The first and second indices can be stored in a separate glyph representation with a number of bits per position that is less than or equal to the number of bits per position in the source glyph representation used to store the value associated with the corresponding source position.
[0010] The value associated with the corresponding source location can be a visual parameter value such as a grayscale value or a color value.
[0011] According to a second aspect of the invention, a computer-implemented method for rendering glyphs is provided, comprising using a glyph representation generated by the method according to a first aspect of the invention: performing a background rendering process, including using a second index of the glyph representation to determine background visual parameter values for a plurality of locations in a background region corresponding to a plurality of other locations in the glyph representation; and performing a foreground rendering process, including using a first index of the glyph representation to determine foreground visual parameter values for a plurality of locations in a foreground region corresponding to a first plurality of locations in the glyph representation.
[0012] Determining background visual parameter values at multiple locations in the background region can be based on a predetermined mapping between a second index and background visual parameter values; and / or determining foreground visual parameter values at multiple locations in the foreground region can be based on a predetermined mapping between a first index and foreground visual parameter values.
[0013] The method for rendering glyphs can be applied to medical rendering processes. The method may include: selecting a predetermined mapping between a second index and background visual parameter values and / or a predetermined mapping between a first index and foreground visual parameter values based on the attributes of medical rendering processes.
[0014] According to a third aspect of the invention, a machine-readable medium is provided, comprising one or more glyph representations generated by the method according to a first aspect of the invention.
[0015] According to a fourth aspect of the invention, a set of machine-readable instructions is provided that, when executed by a processor, cause the method described according to the first or second aspect of the invention to be performed.
[0016] According to a fifth aspect of the invention, a machine-readable medium is provided, the machine-readable medium comprising a set of machine-readable instructions as described in a fourth aspect of the invention.
[0017] According to a sixth aspect of the invention, an apparatus is provided, the apparatus comprising: a processor; and a storage device including one or more glyph representations generated by the method according to a first aspect of the invention and / or a set of machine-readable instructions according to a fourth aspect of the invention. Attached Figure Description
[0018] The invention will now be described by way of example only with reference to the following figures, in which:
[0019] Figure 1 This is a flowchart illustrating a computer-implemented method for generating additional glyph representations used in the rendering process based on source glyph representations;
[0020] Figure 2 It shows the use of by Figure 1 The flowchart illustrates a computer implementation of a method for rendering glyphs using glyph representations generated by the shown method.
[0021] Figure 3 This is a schematic diagram illustrating various aspects of an example method for generating glyph representations; and
[0022] Figure 4 This is a schematic diagram illustrating an apparatus for performing the example methods described herein. Detailed Implementation
[0023] Figure 1 This is a flowchart illustrating an example computer-implemented method 100 for generating additional glyph representations used in the rendering process based on the source glyph representation.
[0024] A source glyph representation can be a representation of a specific glyph in a glyph set, which can be called a source glyph set. A source glyph set can include one or more other source glyph representations. For example, a source glyph set can include multiple corresponding representations of different Latin or Arabic characters of a specific style and size. Each specific character of a specific style and size, such as the Arial font or an 11-point Latin letter "A," can be called a glyph. A representation of a specific glyph in a source glyph set can be called a source glyph representation. Each source glyph representation in a source glyph set can represent a corresponding glyph to which anti-aliasing has been applied.
[0025] A source glyph representation comprises multiple source locations, such as a set of pixels, where each location has one or more values associated with it. These values may be referred to herein as source values. Source values can be visual parameter values such as grayscale values or color values. For example, in some examples, a source glyph representation may be a grayscale representation of a glyph and may include multiple pixels, each having an associated grayscale value. In other examples, a source glyph representation may be a color representation of a glyph and may include multiple pixels, each having one or more associated color values, such as corresponding R, G, and B values per pixel.
[0026] Depending on the resolution of the source glyph representation and the size of the glyph being represented, the multiple source locations in the source glyph can be any other appropriately sized grid of pixels. The pixel grid can be a regular or irregular shape. In some examples, the multiple pixels representing the source glyph representation can be referred to as the "black box" of the source glyph representation.
[0027] The additional glyph representation generated by method 100 can be a representation of a glyph to which a visual effect has been applied, which is represented by the source glyph representation. For example, the additional glyph representation can represent a glyph to which a background effect, such as a shadow effect, has been applied, such as a blurred shadow effect. The additional glyph representations can form part of an additional glyph set that includes one or more other additional glyph representations. For example, each additional glyph representation in the additional glyph set can correspond to a source glyph representation in the source glyph set to which a visual effect has been applied.
[0028] The method at box 102 includes determining a first plurality of positions in an additional glyph representation that correspond to a plurality of source positions in the source glyph representation.
[0029] The first plurality of positions can be, for example, a plurality of pixels in an additional glyph representation that are identified as corresponding to the pixels of the black box in the source glyph representation. These can be considered as foreground pixels in the additional glyph representation because they are pixels representing foreground text information corresponding to the original source glyph. The additional glyph representation also includes a second plurality of positions in addition to those identified as corresponding to the source positions. The second plurality of positions can provide, for example, margins around the pixels corresponding to the source pixels, and can be used to accommodate visual effects such as shadow effects. The number and position of the second plurality of pixels relative to the first plurality of pixels can depend on the desired visual effect to be represented, as described below by way of example.
[0030] At box 102, the method further includes: setting a first index for the first plurality of locations based on the value associated with the corresponding source location.
[0031] As described above, the value associated with the corresponding source location, i.e., the source value, can be the corresponding grayscale value of each pixel in the black box represented by the source glyph. These values can be stored in the source glyph representation in multiple bits, for example, 4 bits or 8 bits per pixel.
[0032] Setting the corresponding first index for the first plurality of positions may include applying quantization processing to the source value. Quantization processing may, for example, include defining a quantization interval for the source value and determining, for each given position in the first plurality of positions, which quantization interval corresponds to the associated source value. The value of the first index can be used to label each quantization interval. In this way, the value of the first index for each given pixel can be determined by determining the quantization interval corresponding to the associated source value. An example of this is described in more detail below.
[0033] At box 104, the method includes: for each given location among a plurality of other locations, setting a corresponding second index based on the relationship between the given location and a given source location in the source glyph representation. The plurality of other locations includes a first plurality of locations, such as pixels corresponding to the black box of the source glyph representation, and a second plurality of locations, which, as described above, may be a second set of pixels outside the black box of the source glyph representation, providing margins for representing shadows or other visual effects.
[0034] The relationship used to set a second index for a given location among a plurality of other locations can be, for example, a geometric relationship between the given location and a first plurality of locations corresponding to a given source location. The geometric relationship can be, for example, a distance metric such as Euclidean distance or Manhattan distance. Setting a second index for a given location based on this relationship can include determining the value of the second index based on this relationship.
[0035] For example, a second index can be set based on the distance between a given pixel and one or more foreground pixels in a region of another glyph representation corresponding to the black box represented by the source glyph representation. As an example, the second index of a given pixel could be set to represent the distance between the given pixel and foreground pixels, such as the Manhattan distance in pixels.
[0036] In some examples, a second index for a given pixel can be set based on the correspondence between a given pixel and more than one foreground pixel. For example, each pixel within a predetermined region surrounding a given pixel can contribute to setting the second index at that given pixel.
[0037] As will be described in more detail below, a second index can be used to allow rendering visual effects such as background effects in an additional glyph representation. For example, a background shadow effect can be provided, which may attenuate in intensity as the distance from the foreground pixel increases. In other examples, a sharp outline or an opaque background box can be provided by using a second index.
[0038] In some examples, visual effect calculations such as shadow effect calculations and / or blur effect calculations can be performed to determine the second index. As an example, setting the second index of a given pixel may include determining a visual parameter value for the pixel, such as a shadow effect grayscale or similar value, based on the relationship between the pixel and one or more source pixels. In some such examples, the visual parameter value used to set the second index may additionally be set based on the corresponding visual parameter values of one or more source pixels. The second index can then be selected from the determined visual parameter values, for example, by applying quantization processing in a manner similar to that described above with respect to the first index. Examples of this will be described in more detail below. In some such examples, where the second index is set based on the relationship between a given pixel and more than one foreground pixel, the value of the second index can be obtained by combining (e.g., alpha blending) the contributions from each of the foreground pixels.
[0039] At box 106, the method includes storing the first index and the second index in association with their respective locations.
[0040] The additional glyph representation may include multiple storage bits for each position, for example, 8 bits per pixel. For each position, a first number of bits may be used to store a first index, and a second number of bits may be used to store a second index.
[0041] The number of bits used to store each of the first and second indices can depend on the method by which the first and second indices are configured. For example, the inventors have observed that many anti-aliased glyphs can be represented using very few grayscale values, and therefore the grayscale values can be represented by a small number of first index values in a quantized or compressed form without significant information loss. For example, while each pixel represented by the source glyph may include a grayscale value represented by 8 bits (allowing for the representation of 256 different grayscale values), only a few different grayscale values may exist in the source values. Therefore, the 8-bit source values can be quantized to allow them to be represented by the first index, which occupies fewer bits, without significant information loss.
[0042] Similarly, index values used to encode visual effects such as blurring can be represented using a small number of quantized values without diminishing the visual impact compared to if the aforementioned index values were represented by more bits. Therefore, these values can be encoded with a relatively small number of bits via a second index. Thus, foreground and background information can be efficiently encoded, with some of the available bits per pixel used to store a first index representing the foreground information, and the remaining bits used to store a second index representing the background information.
[0043] This allows the generated glyph representation to represent both foreground and background information, and to do so in a memory-efficient manner. For example, the source glyph representation may include 8 bits per pixel, and the first and second indices can be determined such that they together occupy less than or equal to 8 bits per pixel. Therefore, the additional glyph representation can occupy only a minimal amount of additional storage compared to the source glyph representation, where the additional storage is due to the additional pixels in the additional glyph representation representing the margins around the source pixels.
[0044] Figure 2 It shows the use of by Figure 1 The flowchart of an example computer implementation of method 200 is shown, which uses the glyph representation generated by method 100 to render the glyph.
[0045] Method 200 includes performing background rendering processing at box 202. The background rendering processing includes determining background visual parameter values at multiple locations within a background region using a second index of the glyph representation generated by method 100. These multiple locations in the background region correspond to additional locations in the glyph representation. These multiple locations in the background region may, for example, be multiple pixels in the rendering of the background of the glyph representation. For example, the background region may include a set of pixels used to render a background shadow effect for the glyph, with the foreground of the glyph rendered over the background shadow effect in a second rendering pass, as described below. In one example, the background region may include an area of a medical image on which text is to be rendered using a background effect.
[0046] Determining the background visual parameter values may involve applying a pre-defined mapping between a second index and the background visual parameter values. For example, a lookup table can provide a mapping between the value of the second index and the background visual parameter values. The second index can be mapped to any visual parameter value suitable for providing the desired background effect. The background visual parameter value determined based on the second index may, for example, be a grayscale value.
[0047] At box 202, the second index can be mapped to a grayscale value representing a shadow effect or any other desired effect. For example, where the second index represents the distance between a given pixel and one or more foreground pixels, a mapping between second indices can be provided to generate a decaying shadow effect. For instance, a value indicating a second index very close to a foreground pixel can be mapped to a low (i.e., dark) grayscale value, while a value indicating a second index further away from a foreground pixel can be mapped to a higher (i.e., brighter) grayscale value. The mapping can be, for example, linear to provide a linearly decaying shadow effect, or it can be non-linear to provide a shadow effect that decays in any arbitrary manner.
[0048] In other examples, any desired background effect can be provided by appropriately mapping the value of the second index to the visual parameter value. For example, instead of a decaying shadow effect, a mapping can be provided to make the generated background effect a sharp outline, an opaque rectangle, or any other background effect.
[0049] At box 204, method 200 includes performing foreground rendering processing. The foreground rendering processing includes determining foreground visual parameter values for a plurality of locations in the foreground region using a first index of the glyph representation determined by method 100. The plurality of locations in the foreground region correspond to a first plurality of locations in the glyph representation determined by method 100.
[0050] Foreground rendering allows the foreground of a glyph represented by a glyph to be rendered over the background effect rendered at box 202. For example, at box 204, the black box of the glyph can be rendered over the shadow effect rendered by the background rendering pass of box 202.
[0051] In this way, since the glyph representation generated by method 100 encodes both the foreground and background information of the glyph, it can be used in method 200 to render both the background visual effects and the foreground of the glyph. For example, the same glyph representation can be used to render both the foreground and shadow effects of the glyph.
[0052] Because glyph representations encode both foreground and background visual information, visual information does not need to be dynamically calculated during rendering. Furthermore, it may not be necessary to render the glyphs to an intermediate storage buffer for calculating visual information, as is the case in some existing methods, which render text in an intermediate buffer and dynamically calculate shadow effects in separate render passes. This reduces computational and memory costs.
[0053] The foreground rendering process can have any of the features described above with reference to the background rendering process. In particular, the background rendering process may include determining a foreground visual parameter value for each of a plurality of locations in the foreground region based on a predetermined mapping between a first index and visual parameter values such as grayscale values. This may involve using a lookup table that maps the value of the first index to the visual parameter values. The first index can be mapped to any suitable visual parameter value for rendering the glyph representation of the foreground. For example, in the case where determining the first index in method 100 relates to a pixel grayscale value of a black box representing the source glyph, the foreground rendering process may involve mapping the first index back to the quantized grayscale value representing the black box. In other examples, the first index may be mapped to different visual parameter values to provide the desired visual effect for the rendered foreground. The mapping between the first index and the visual parameter value may be different from or the same as the mapping between the second index and the visual parameter value.
[0054] Using a predefined mapping between the first and second indices and their corresponding visual parameter values allows for the pre-calculation of the benefits of the first and second indices, while allowing for different rendering results by swapping the mappings as needed. For example, different background visual effects can be provided by swapping the mapping between the second index and the visual parameter values, for instance, by swapping the lookup tables. Thus, for example, different shadow effects can be provided by using different lookup tables without needing to execute different shadow effect algorithms. Similarly, different foreground rendering effects can be achieved by swapping the lookup tables used to map the first index to the visual parameter values.
[0055] Using such predefined mappings for rendering can offer particular advantages in the context of medical rendering. For example, text can be rendered using visual effects that can be optimized to provide better readability for text rendered over medical images. This approach allows this to be done in a computationally efficient manner, minimizing the impact on runtime performance. Furthermore, appropriate visual effects for rendering text can be selected based on the current medical rendering task, or visual effects can be easily switched based on the current medical rendering task. For example, workflow maps, user preferences, image metadata (e.g., DICOM data), dangling protocols, or device DPI attributes can be used to select predefined mappings that provide appropriate visual effects for the medical rendering task at hand.
[0056] Furthermore, because visual effect information is not dynamically calculated during rendering but is pre-computed and encoded in a second index, the overall rendering result can be produced in a more device-independent manner. For example, if shadow effect algorithms are dynamically calculated during rendering, the resulting visual impression may differ between devices due to factors such as how different devices handle arithmetic rounding operations. This can be particularly valuable in applications where deterministic rendering is required for quality reasons, such as in medical rendering applications. For instance, since the results of medical rendering operations may often be reviewed by several experts, any differences in visual impression should be minimized or avoided to help minimize confusion.
[0057] Go to Figure 3 , showing the results according to Figure 1 The diagram illustrates various aspects of the example methods for generating glyph representations.
[0058] Figure 3 The glyph representation 302 is schematically shown; in this example, glyph representation 302 is referred to as the target glyph representation. The target glyph representation 302 has a height H. dst and width W dst Each is measured in pixels. In this example, H dst =9, and W dst =11.
[0059] The target glyph representation 302 includes a source region 304, which has an H of 5 pixels. src Height and 4 pixels W src The width of the target glyph representation 302. Pixels 305 within the source region 304 can be referred to as foreground pixels 305 because they correspond to the source pixels of the source glyph representation (not shown) that are used to generate the target glyph representation 302. Surrounding the source region 304 are additional pixels 309 within the target glyph representation 302. These additional pixels 309 provide margins for the pixels surrounding the source region 304, allowing background effects such as blurred shadows to be represented by the target glyph representation 302.
[0060] The positioning of the additional pixels 309 surrounding the source region 304 is determined by the shadow neighborhood 306. The shadow neighborhood 306 can be viewed as determining the size and shape of the shadow generated by a given foreground pixel. The shadow neighborhood 306 is defined by a given shape and size, which in this example can be chosen arbitrarily depending on the desired shadow effect to be achieved. The shadow neighborhood 306 has a width W. S and height H S Each is measured in pixels. In this example, W S =7, and H S =4.
[0061] The glyph represents the width W of 302. dst The corresponding width W of the source region 304 and the shadow neighborhood 306 src and W S The relationship is: W dst =W src +W S Similarly, the glyph represents the height H of 302. dst The corresponding height H of source region 304 and shadow neighborhood 306 src and H S The relationship is: H dst =H src +H S Anchor point 307 and anchor point offset are defined for the shadow neighborhood 306. It determines the position of the shadow neighborhood 306 relative to the given target pixel 308 being encoded.
[0062] To generate the target glyph representation 302, perform the following steps:
[0063] Use bits per pixel (B) dst Initialize the target glyph representation storage buffer. B dst It can be, for example, 4, 8, or 16. In some examples, B dst It can be equal to the number of bits per pixel in the source character representation (B). src For example, both the source glyph representation and the target glyph representation 302 can include 8 bits per pixel.
[0064] For a character with coordinate P in glyph representation 302 dst 308 for each given pixel:
[0065] The shadow neighborhood and its anchor point 307 are located at Place.
[0066] Determine the relationship between a given pixel 308 and one or more pixels in the foreground pixel 305 that are located within the shadow neighborhood 306. Figure 3 The foreground pixel 310 within the shadow neighborhood 306 is shown, and in this example, the relationship between a given pixel 308 being encoded and the foreground pixel 310 is determined. This relationship can be a geometric relationship such as a distance metric, for example, the Euclidean or Manhattan distance between the given pixel 308 and the foreground pixel 310. This determined relationship is used to set index I. s .
[0067] Given that the relationship is the distance between pixel 308 and foreground pixel 310, I s The value can be set to be proportional to a given distance.
[0068] In some examples, the index I of pixel 308 s It can be set independently of the source value of the foreground pixel within the shadow neighborhood 306. For example, index I s It can be set based solely on the geometric relationship between a given pixel 308 and the foreground pixel within the shadow neighborhood 306.
[0069] In other examples, I s The value can also be set based on the visual parameter value (e.g., grayscale value) of the source pixel corresponding to the foreground pixel 310. For example, a factor proportional to the distance between 308 and 310 can be multiplied by the grayscale value of the source pixel corresponding to the foreground pixel 310 to provide the resulting grayscale value. This resulting grayscale value can be used to set index I from a set of index values. s .
[0070] In such an example, the number of quantization intervals N f Defined in range Within this range, the quantization intervals can be distributed in any way, such as regularly or irregularly. In a simplified example, for an 8-bit grayscale value ranging from 0 to 255, four quantization intervals can be defined, such as interval 0: 0-45, interval 1: 46-85, interval 2: 86-200, and interval 3: 201-255. The quantization interval into which the resulting grayscale value falls is determined, and the index I is assigned... s Set the label for this quantization interval, for example, 0, 1, 2, or 3 in the example above where four quantization intervals are defined. This example is shown in Table 1. In this example, the resulting grayscale value of 89 will fall into the quantization interval labeled 2, thus obtaining I. s =2.
[0071] Table 1
[0072]
[0073]
[0074] In the example where there is more than one foreground pixel 305 within the shadow neighborhood 306, index I can be determined based on the relationship between a given pixel 308 and each of the foreground pixels 305 within the shadow neighborhood 306. s For example, a grayscale value representing the corresponding shadow contribution of each of the foreground pixels 305 within the shadow neighborhood 306 to pixel 308 can be calculated as described above, and these grayscale values can be combined, for example, by alpha mixing, to determine the overall grayscale value of pixel 308. This overall grayscale value can then be used, for example, to select index I from the set of index values through quantization processing as described above. s .
[0075] In this way, index I s This can be used to encode the shadow effect value for a given pixel 308. This shadow effect value, which will be described in more detail below, can be used when rendering a background of a glyph represented by glyph representation 302.
[0076] To set index I f This determines whether a given pixel 308 is within the source region 304. If the given pixel 308 is within the source region 304, then the index I is set using the source value (e.g., grayscale value) of the source pixel corresponding to the given pixel 308. f .
[0077] In one example, multiple quantization intervals are defined, and the quantization interval into which the source value falls is determined. Index I f The label is set to the quantization interval. For example, the definition of the quantization interval can be determined based on the grayscale values present in the source value. For example, in the case where only a few grayscale values exist in the source value, which is often the case of glyphic black-box text, then a small number of appropriately selected quantization intervals can be used to quantize the data by index I. f This represents the source value without significant loss of visual information. In this way, the source value of the source pixel corresponding to a given pixel 308 can be represented by index I. f The value is represented in a quantized or compressed manner.
[0078] The definition of a quantization interval, such as the number of intervals within each range of grayscale values, can be used to set an index I. s The above example is used to set index I s The quantization intervals may be the same or different. In some examples, the quantization intervals are determined by index I. s The representation of shadow effect values may, on the other hand, benefit from allowing the representation of a larger number of grayscale values. For example, while the black-box text of a glyph can be represented by only 3 or 4 grayscale values, it may be advantageous to use a larger number of grayscale values to represent the shadow effect in order to provide a visually smooth effect. In such an example, compared to the value used to store index I... f Compared to the number of bits, more bits can be used to store index I. s .
[0079] If it is determined that pixel 308 is not within the source region 304 (such as for...), Figure 3 (as shown in the example), then index I can be set. f To indicate this. For example, index I f It can be set to a null value or a value of 0.
[0080] Index I s Stored in B associated with a given pixel 308 s In the bit, and index If Stored in the index I not used for storage associated with a given pixel 308 s B f In the middle. The target glyph represents B. dst The total number of bits per pixel is such that (B f +B s )≤B dst In the example, the index I of pixel 308 is... s and I f It is stored as a single pixel value V.
[0081] This process can be performed to encode each of one or more glyphs in the corresponding target glyph representation. The target glyph representations can be stored in a single glyph atlas by positioning the individual target glyph representations relative to each other in an appropriate manner using any suitable binning algorithm.
[0082] In the example, in order to use Figure 3 The target glyph represents the 302 rendered glyph, and the following steps are performed.
[0083] In the first rendering pass, the background of the glyph is rendered; in this example, a shadow effect is provided. In this first rendering pass, for each pixel in the rendering of the glyph, the pixel value V of the corresponding pixel 308 in the target glyph representation 302 is read. Based on the value V, index I... s Decoding is then performed. This can be done by shifting bits and using a bitmask so that only the representation of index I is retained. s B s Bit.
[0084] Then use index I s To use lookup table T s Obtain the grayscale value V′ of the shadow effect of the pixel in the rendering. s That is, V′ s =T s [I s ]. Lookup table T s The size is For example, if used to store index I s The number of digits B s If the value is 2, then index I s It can take up to 4 different values. s Each of these distinct values can be accessed via lookup table T s The rows in the index are mapped to grayscale values for the shadow effect. Index I s The grayscale value to which the value is mapped can be any suitable value used to provide the desired shadow effect. For example, to provide a linearly decaying shadow effect, at index I... sWhen the increase in value represents the increase in distance from the foreground pixel, a linear mapping can be defined such that index I... s The increase in value is mapped to an increase in gray value (i.e., a lighter shade of gray value).
[0085] As mentioned above, although the shadow neighborhood 306 can be viewed as determining the size and shape of the shadow generated by a given foreground pixel, it depends on the second index I. s The mapping between the value and the grayscale value means that the size and shape of the shadow may not perfectly correspond to the shadow neighborhood 306. For example, if due to the second index I s The mapping between the value and the grayscale value causes the outermost pixel in the rendered background area to be completely transparent, so the rendered shadow may appear smaller than the shadow neighborhood 306.
[0086] In another example, where the second index is set by determining the quantization range into which the calculated shadow effect grayscale value falls, a lookup table can map the second index to grayscale values associated with the quantization range used to set the second index value. For example, in the example in Table 2, a lookup table can be used to map each value of the second index to the lowest grayscale value of the corresponding quantization range, as shown in Table 2.
[0087] Table 2
[0088] <![CDATA[I s ]]> grayscale value 0 0 1 46 2 86 3 201
[0089] In other examples, index I can be used s The value V′ can be mapped to any suitable grayscale value or other visual parameter value. Furthermore, by swapping the mapping, the provided visual effect can be altered. The grayscale value V′ can be used... s Use it as input to apply any additional shading or additional effects to obtain the final pixel values of the background pixels in the glyph rendering.
[0090] In the second rendering pass, the foreground of the glyph is rendered. The second rendering pass is similar to the first rendering pass because, for each pixel in the glyph rendering, the pixel value V corresponding to pixel 308 in the glyph representation 302 is read. Based on the value V, index I... f Decoding can be performed similarly to the above for index I. s The description involves performing bit shifting and bitmasking operations on the value V until only the representation of index I is retained. f position B f until.
[0091] Then, use the lookup table T f For index I f Perform mapping to obtain the foreground grayscale value V′ of the pixel in the rendering. s That is, V′ f =Tf [I f ]. Lookup table T f The size is Similar to looking up table T s Described. Lookup table T s and T f The relative size depends on the index I. s Number of bits B used for encoding s With index I f Number of bits B used for encoding f The relative size compared. Derived from lookup table T f The provided mapping can be used with lookup table T s The provided mappings may be the same or different. This is achieved by swapping the index I... f Lookup table T mapped to grayscale values f It can provide different foreground rendering effects. (The text then abruptly shifts to discussing the grayscale value V′ for shadow effects.) s Similarly, grayscale value V′ can be used. f Used as input to apply any additional shading or effects to obtain the final pixel value of the pixel in the render. Grayscale value V′ s and V′ f These values can be combined in any suitable manner to provide the final pixel values used for rendering. For example, the values described above can be blended using alpha blending or any suitable processing.
[0092] Lookup table T s and T f It can be defined to provide index I s and I f Any suitable mapping from the value of index I to the value of the visual parameter. In some examples, this could be done for index I. s and I f One or two of them define multiple lookup tables, allowing the swapping of the lookup tables in use, for example, depending on the rendering task being performed. For instance, as described above, by swapping the lookup tables used to index I... s Lookup table T mapped to grayscale values s Different background visual effects can be provided. As an example, as mentioned above, in medical rendering applications, lookup table T can be selected based on the attributes of the medical rendering task being performed (such as workflow mapping, user preferences, image metadata (e.g., DICOM data), suspending protocol, or device DPI attributes). s .
[0093] Figure 4This is a schematic diagram illustrating an example system 401, wherein an example device 404 can use the methods described herein. System 401 includes device 404 and visualization unit 414. In the example, system 401 may include a... Figure 4 The components shown are fewer or no components. Figure 4 Components additional to the components shown. For example, system 401 may include a computer network such as the Internet.
[0094] Device 404 includes one or more processors 406 and one or more memory in the form of storage devices 408. Device 404 may include, for example, a GPU. In this example, device 404 is arranged to perform a method for generating glyph representations according to the above example and a method for rendering glyphs using such glyph representations according to the above example.
[0095] Storage device 408 may include a machine-readable medium containing a set of machine-readable instructions that, when executed by processor 406, cause device 404 to perform the example methods described herein. A program may be stored on a computer-readable medium that can be read by device 404 to execute the program.
[0096] The device 404 may be arranged to directly or indirectly receive or otherwise acquire the source glyph representation 410, and generate a target glyph representation 412 to be stored on the storage device 408 based on the source glyph representation 410. The source glyph representation 410 may form part of a source glyph atlas (not shown) that includes multiple source glyph representations. Similarly, the target glyph representation 412 may form part of a target glyph atlas (not shown) that includes multiple target glyph representations.
[0097] Apparatus 404 may also be configured to directly or indirectly receive or otherwise acquire one or more corresponding lookup tables 405 for mapping the values of the first and second indices in the target glyph representation 412 to visual parameter values, such as grayscale values. Lookup table 405 may include one or more lookup tables for the first index and one or more lookup tables for the second index. For example, multiple lookup tables may be provided for mapping the second index to grayscale values to allow for the generation of different visual parameter effects. Apparatus 404 may be configured to select one of these lookup tables for use during rendering based on the rendering context. Alternatively or additionally, apparatus 404 may be configured to calculate and generate one or more lookup tables, for example, based on source values of the source glyph representation 410 and / or one or more visual effects.
[0098] The device 404 can also be arranged to use the target glyph representation 412 to generate a glyph rendering that includes both background and foreground visual information. For example, the device 404 can be configured to use the target glyph representation 412 and one or more other target glyph representations in the glyph atlas to generate a text rendering that includes a background shadow effect. The device 404 can be arranged to transmit visual parameter information representing the rendering, such as grayscale values of color values, to the visualization unit 414. The transmission can be direct or indirect, such as via a wired connection, a wireless connection, or via the Internet.
[0099] The visualization unit 414 may include visualization software for displaying renderings produced by the device 404. For example, text 416 rendered by the device 404 may be displayed by the visualization unit 414. The visualization unit 414 may include a display screen and one or more graphics hardware or software components. In some examples, the visualization unit 414 may be a mobile device or include a mobile device. In some examples, the visualization unit 414 may include a virtual reality or augmented reality device. In some examples, the visualization unit 414 may display stereoscopic images.
[0100] In some examples, system 401 is a system for rendering medical images, in which rendered text 416 is displayed on the medical images. In such examples, device 404 may also be arranged to generate rendering of a medical dataset, such as volumetric rendering of a volumetric dataset, and to transmit information representing the medical image to visualization unit 414. In some such examples, system 401 may also include a scanner (not shown) for generating a medical dataset, which may be, for example, a volumetric dataset representing a portion of a patient. The scanner may be a computed tomography (CT) scanner, magnetic resonance imaging (MRI) scanner, positron emission tomography (PET) scanner, ultrasound scanner, etc. In such examples, the scanner may be connected to device 404, for example, via a wired or wireless connection, and may be arranged to provide the medical dataset to device 404 for rendering.
[0101] While in some of the examples above, the target glyph representation includes a single first index representing foreground information and a single second index representing background information, in other examples, each pixel may have more than one first index and / or more than one second index. For example, when the source glyph representation is a color representation, each pixel in the source glyph representation may include more than one color value; for example, each pixel may store corresponding R, G, and B values. In such an example, three first indices may be stored in association with each pixel in another glyph representation, where the first index at that location represents the R, G, and B color values, respectively. Each of these values may be generated and stored in association with the pixel in the manner described above. When rendering using the glyph representation, each of the first indices may be used to determine the corresponding visual parameter value (e.g., R, G, or B color value) for a given pixel based on a predetermined mapping (such as by using a lookup table). Similarly, in the target glyph representation, each pixel may have more than one second index, where each of these values may also be generated and stored in association with the pixel in the manner described above. This can, for example, provide a background effect encoded in a manner that also represents color rather than grayscale, visual information.
[0102] The above embodiments should be understood as illustrative examples of the present invention. Other embodiments are conceivable. It should be understood that any feature described with respect to any embodiment can be used alone or in combination with other described features, and can also be used in combination with one or more features of any other embodiment or any combination of any other embodiment. Furthermore, equivalents and modifications not described above may be employed without departing from the scope of the present invention, the scope of which is defined in the appended claims.
Claims
1. A computer-implemented method (100) for generating additional glyph representations (302, 412) used in rendering processing based on a source glyph representation (410), the method (100) comprising: Determine (102) a first plurality of positions (305) in the other glyph representation (302, 412) that correspond to the corresponding plurality of source positions in the source glyph representation (410), and set the corresponding first index of the first plurality of positions (305) based on the value associated with the corresponding source position; For each given position (308) of the other plurality of positions in the additional glyph representations (302, 412), a corresponding second index is set (104) based on the relationship between the given position (308) and the source position in the source glyph representation (410), wherein the other plurality of positions includes the first plurality of positions (305) and the second plurality of positions (309); and The first index and the second index are stored in association with the corresponding positions (308).
2. The method according to claim 1, wherein, Setting (104) the corresponding first index of the first plurality of locations (305) based on the value associated with the corresponding source location includes: Quantization is applied to the values associated with the corresponding source locations.
3. The method according to claim 1 or claim 2, wherein, The relationship includes a geometric relationship between the given position (308) and one or more source positions in the source glyph representation.
4. The method according to claim 3, wherein, The geometric relationship includes a distance metric.
5. The method according to any one of claims 1 to 4, wherein, Setting (104) the second index includes: performing visual effect calculations based on the relationship between the given position and one or more source positions in the source glyph representation.
6. The method according to claim 5, wherein, The visual effect calculation includes shadow effect calculation and / or blur effect calculation.
7. The method according to claims 1 to 6, wherein, The first index and the second index are stored with the number of bits per position in the additional glyph representation (302, 412), the number of bits per position being less than or equal to the number of bits per position in the source glyph representation (410) used to store the value associated with the corresponding source position.
8. The method according to any one of claims 1 to 7, wherein, The values associated with the corresponding source location are visual parameter values such as grayscale or color values.
9. A computer-implemented method (200) for rendering glyphs, comprising using glyph representations (302, 412) generated by the method (100) according to any one of claims 1 to 8: Performing (202) background rendering processing includes using the second index of the glyph representation (302, 412) to determine background visual parameter values for multiple locations in a background region corresponding to the additional multiple locations in the glyph representation (302, 412); and Perform (204) foreground rendering processing, including using the first index of the glyph representation (302, 412) to determine foreground visual parameter values for a plurality of locations in the foreground region corresponding to the first plurality of locations (305) in the glyph representation (302, 412).
10. The method according to claim 9: in, Determining background visual parameter values at multiple locations within the background region is based on a predetermined mapping (405) between the second index and the background visual parameter values; and / or Wherein, the determination of the foreground visual parameter values of multiple locations in the foreground region is based on a predetermined mapping (405) between the first index and the foreground visual parameter values.
11. The method according to claim 10, wherein, The method is applied to medical rendering processing, and wherein the method includes: Based on the attributes of the medical rendering process, the predetermined mapping (405) between the second index and the background visual parameter value and / or the predetermined mapping (405) between the first index and the foreground visual parameter value are selected.
12. A machine-readable medium comprising one or more glyph representations (412) generated by the method (100, 200) according to any one of claims 1 to 8.
13. A set of machine-readable instructions that, when executed by a processor (406), cause the method (100) according to any one of claims 1 to 11 to be performed.
14. A machine-readable medium comprising a set of machine-readable instructions as claimed in claim 13.
15. An apparatus (404) comprising: Processor (406); as well as Storage device (408) comprising one or more glyph representations (412) generated by the method (100) according to any one of claims 1 to 8 and / or a set of machine-readable instructions according to claim 13.