WO2015165228A1 - 一种文字纹理管理方法及设备 - Google Patents

一种文字纹理管理方法及设备 Download PDF

Info

Publication number
WO2015165228A1
WO2015165228A1 PCT/CN2014/089672 CN2014089672W WO2015165228A1 WO 2015165228 A1 WO2015165228 A1 WO 2015165228A1 CN 2014089672 W CN2014089672 W CN 2014089672W WO 2015165228 A1 WO2015165228 A1 WO 2015165228A1
Authority
WO
WIPO (PCT)
Prior art keywords
texture
text
type
stored
upper limit
Prior art date
Application number
PCT/CN2014/089672
Other languages
English (en)
French (fr)
Inventor
林燕腾
Original Assignee
高德信息技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 高德信息技术有限公司 filed Critical 高德信息技术有限公司
Publication of WO2015165228A1 publication Critical patent/WO2015165228A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering

Definitions

  • the present invention relates to the field of electronic map technology, and in particular, to a text texture management method and device applicable to an electronic map.
  • the text is generated by the corresponding text texture is a relatively time-consuming operation, in OPENGL (Open Graphics Library, a professional graphics program interface) or DIRECTX (Direct EXTENSION, referred to as DX, a multimedia programming interface)
  • OPENGL Open Graphics Library, a professional graphics program interface
  • DIRECTX Direct EXTENSION, referred to as DX, a multimedia programming interface
  • the generated text texture needs to be saved correspondingly for use in the next rendering, and the rendering rate is increased.
  • the number of text textures saved during the electronic map rendering process is also large, resulting in the storage space occupied by the text texture in the device. Climbing;
  • the available storage space of the device is usually limited, when the text texture generated during the rendering process is saved, it needs to be managed in a certain way.
  • the industry generally adopts the following manner to manage the text texture saved in the device: setting an upper limit value for the total number of fonts involved in the electronic map rendering process, and storing the font size for each font size
  • the number of text textures is also set to a corresponding upper limit value; when the font size involved exceeds its corresponding upper limit value, all the corresponding font numbers in the device are deleted.
  • Text texture then, in the case where the upper limit of the font size is determined and the upper limit of the text texture corresponding to each font size is also determined, the upper limit of the storage space occupied by the total text texture in the device can be determined accordingly.
  • the total number of font sizes is limited to 4, and a text texture with a maximum of 200 sheets can be stored under each font size.
  • the maximum storage space occupied by the text texture in the device is 800 textures; further, it is assumed that 16 is stored in the current device. , 18, 22, and 24 characters of 4 font sizes.
  • the less commonly used font size in the device can be deleted, such as deleting all text textures corresponding to the font size 16, and
  • the text texture corresponding to the font size 26 is stored to realize the corresponding management of the text texture without exceeding the upper limit of the total number of font sizes.
  • the embodiment of the invention provides a text texture management method and device, which is used to solve the problem that the existing text storage texture management can not reasonably utilize the storage space of each device and the excessive texture addition and deletion operations result in low rendering efficiency. .
  • the embodiment of the invention provides a text texture management method, including:
  • the upper limit value of the number of textures corresponding to each texture type is based on the texture used to store each text.
  • the hardware resources of the device are pre-configured; and the more hardware resources of the device, the higher the upper limit of the number of textures corresponding to the texture type corresponding to the larger texture size.
  • the hardware resource of the device includes at least a pixel value of the device and/or a display access value of the device;
  • the pixel value of the device or the display access value of the device is larger, and the upper limit of the number of textures corresponding to the texture type corresponding to the corresponding texture size is higher.
  • the method further includes:
  • a frequency of use under the corresponding texture type is lower than After the thresholded stored text texture is deleted, the text texture to be stored is stored under the corresponding texture type.
  • each text texture stored under the texture type is stored in the form of a texture list.
  • the text texture to be stored is stored to the corresponding texture type, including:
  • the text texture to be stored is stored in the texture list of the corresponding texture type.
  • the method further includes:
  • determining the number of the text textures stored in the corresponding texture type is equal to the upper limit value of the texture number corresponding to the corresponding texture type, and using a frequency under the corresponding texture type
  • the method at the same time as or after the deletion of the stored text texture below the set threshold also includes:
  • the text information of the character corresponding to the stored text texture is deleted from the text information list matching the font size of the character corresponding to the stored text texture.
  • the texture type corresponds to at least one font size
  • the sum of the upper limit values of the number of pieces of text information of each character information list matching each font size corresponding to the texture type is not greater than the upper limit value of the number of textures corresponding to the texture type.
  • an embodiment of the present invention further provides a text texture management device, including:
  • a relationship configuration unit configured to pre-configure a correspondence between the texture size and the texture type, and a correspondence between the texture type and the upper limit value of the texture number, wherein the upper limit value of the texture number corresponding to each texture type is used for storing
  • the hardware resources of the device of each text texture are pre-configured, and the more hardware resources of the device, the higher the upper limit of the number of textures corresponding to the texture type corresponding to the larger texture size;
  • a type determining unit configured to determine, according to any texture text to be stored in the electronic map rendering process, according to the texture size of the text texture to be stored and the corresponding relationship between the texture size and the texture type pre-configured by the relationship configuration unit. a texture type corresponding to the text texture to be stored;
  • a texture storage unit configured to determine, according to a correspondence between a texture type and a texture number upper limit value that are pre-configured according to the relationship configuration unit, that the number of text textures stored in the corresponding texture type is smaller than the corresponding texture
  • the text texture to be stored is stored under the corresponding texture type.
  • the hardware resource of the device includes at least a pixel value of the device and/or a display access value of the device;
  • the pixel value of the device or the display access value of the device is larger, and the upper limit of the number of textures corresponding to the texture type corresponding to the corresponding texture size is higher.
  • the texture storage unit is further configured to: if it is determined that the number of the text textures stored in the corresponding texture type is equal to the upper limit value of the texture number corresponding to the corresponding texture type, After the stored text texture whose usage frequency is lower than the set threshold is deleted, the text texture to be stored is stored under the corresponding texture type.
  • the texture storage unit is specifically configured to store, for any texture type, each text texture stored under the texture type in a form of a texture list;
  • the texture storage unit is specifically configured to: if it is determined that the number of the text textures stored in the corresponding texture type is equal to the upper limit value of the texture number corresponding to the corresponding texture type, After sorting the last stored text texture in the texture list of the corresponding texture type, the text texture to be stored is stored in the texture list of the corresponding texture type.
  • the text texture management device further includes an information storage unit:
  • the information storage unit is configured to store text information of the text corresponding to the text texture to be stored to and after the storage of the text texture to be stored to the corresponding texture type
  • the text texture corresponds to the font size of the text that matches the list of text messages.
  • the text texture management device further includes an information deletion unit:
  • the information deleting unit is configured to determine, in the texture storage unit, that the number of the text textures stored in the corresponding texture type is equal to the upper limit value of the texture number corresponding to the corresponding texture type, and the corresponding The stored text texture under the texture type below the set threshold is deleted or after, the stored text information is matched from the font information of the font corresponding to the stored text texture.
  • the text information of the text corresponding to the text texture is deleted.
  • the texture type corresponds to at least one font size
  • the sum of the upper limit values of the number of pieces of text information of each character information list matching each font size corresponding to the texture type is not greater than the upper limit value of the number of textures corresponding to the texture type.
  • An embodiment of the present invention provides a text texture management method and device.
  • the text to be stored may be determined according to a correspondence between a pre-configured texture size and a texture type.
  • Corresponding texture type and when it is determined that the number of text textures stored under the texture type corresponding to the text texture to be stored is less than the corresponding upper limit of the number of textures, storing the texture to be stored to the Store the texture type corresponding to the text texture
  • the upper limit value of the texture number corresponding to each texture type is pre-configured according to hardware resources of the device, and the more hardware resources of the device, the larger the corresponding texture size, the number of textures corresponding to the texture type The greater the limit.
  • each text texture can be classified according to the texture size, and each text texture is stored according to each texture type obtained after the classification, and can be used according to the texture for storing each text.
  • the hardware resource of the device configures the upper limit of the number of textures corresponding to each texture type. The more hardware resources of the device and the larger the corresponding texture size, the larger the upper limit of the number of texture types.
  • the purpose of rationally utilizing the storage space of the device can be achieved.
  • FIG. 1 is a schematic flowchart diagram of a text texture management method according to Embodiment 1 of the present invention
  • FIG. 2 is a schematic structural diagram of a text texture management device according to Embodiment 2 of the present invention.
  • the embodiment of the invention provides a text texture management method and device, and the method includes: for any text texture to be stored generated in an electronic map rendering process, according to the texture size of the text texture to be stored and the pre-configured texture Corresponding relationship between the size and the texture type, determining a texture type corresponding to the text texture to be stored; and determining, according to a correspondence between the pre-configured texture type and the upper limit value of the texture number, the text stored in the corresponding texture type
  • the number of textures is smaller than the upper limit value of the number of textures corresponding to the corresponding texture type
  • the text texture to be stored is stored under the corresponding texture type; wherein the number of textures corresponding to each texture type is The limit value is pre-configured according to the hardware resources of the device for storing each text texture; and, the hardware of the device The more resources, the higher the upper limit of the number of textures corresponding to the texture type with the corresponding texture size.
  • each text texture can be classified according to the texture size, and each text texture is stored according to each texture type obtained after the classification, and can be used according to the texture for storing each text.
  • the hardware resource of the device configures the upper limit of the number of textures corresponding to each texture type. The more hardware resources of the device and the larger the corresponding texture size, the larger the upper limit of the number of texture types.
  • the purpose of rationally utilizing the storage space of the device can be achieved.
  • Embodiment 1 is a diagrammatic representation of Embodiment 1:
  • a first embodiment of the present invention provides a text texture management method. As shown in FIG. 1 , it is a schematic flowchart of a text texture management method according to the first embodiment of the present invention.
  • the text texture management method may include the following steps:
  • Step 101 Determine, according to the texture size of the text texture to be stored and the corresponding relationship between the pre-configured texture size and the texture type, corresponding to the text texture to be stored in the electronic map rendering process. Texture type.
  • the electronic map may generally refer to a Chinese electronic map unless otherwise specified; correspondingly, the text texture to be stored generated during the electronic map rendering process may generally refer to The new text texture corresponding to the new Chinese character generated when the new Chinese character is rendered is not described in detail in the embodiment of the present invention.
  • the correspondence between the texture size and the texture type may be pre-configured in the following manner:
  • the size range (or set of values) corresponding to the texture size of the text texture that may be generated is divided into N Subintervals (or subsets), and each subinterval (or subcollection) is referred to as a corresponding texture type, which may typically be a positive integer greater than one. That is, for any texture type, the texture type may correspond to a corresponding size value sub-interval (or sub-set), wherein any size sub-interval (or sub-set) may correspond to one or more Corresponding texture sizes.
  • the text texture obtained by rendering the text for any text can usually be a square image of equal length and width, and the texture of each text texture.
  • the size can usually be expressed as the product of the length and width of the texture image and is often in the form of 2 n x 2 n (the n can be a positive integer greater than or equal to 1, and the length or width of the texture image is in pixels);
  • the resulting texture size is usually a collection of non-contiguous size values, and accordingly, according to the texture size of the text texture that may be generated during the electronic map rendering process.
  • the size, the size range (or set of values) corresponding to the texture size of the text texture that may be generated is divided into N sub-intervals (or sub-sets), and each sub-interval (or sub-set) is referred to as a corresponding texture.
  • Types which can include:
  • the length (or width) corresponding to the texture image of the text texture that may be generated (including M specific fetches)
  • M can generally be a positive integer greater than one, is divided into N subsets, and each subset is referred to as a corresponding texture type.
  • the number N of the divided sub-sets may be the same as the M, which is not limited in the embodiment of the present invention.
  • the texture type may correspond to one texture size for any texture type.
  • the possible generated text may be according to the length (or width) of the texture image of the text texture that may be generated.
  • the long (or wide) corresponding set of values ⁇ 8, 16, 32, 64 ⁇ of the textured picture of the texture is divided into the following four sub-sets:
  • each sub-collection can be referred to as a texture type, and thus, the correspondence between the four texture types as shown in Table 1 and the corresponding texture size can be obtained:
  • the hardware rendering engine such as OPENGL or DIRECTX
  • rendering each character for any two different font sizes, if the two different font sizes belong to the same font size (font size) Level means that the font size is grouped according to a certain continuous length, such as a group of 8 font numbers, each group is called a different font size level, then the text under any two different font sizes (whether the text is a scorpion or a syllabus) Other fonts)
  • the texture textures generated by the text textures can be identical to each other.
  • a total of 1 to 64 font sizes exist, and it is assumed that the 64 font sizes can be divided into corresponding four font size levels according to a certain level division manner, such as a first font size level (including each font size less than or equal to 8), and a second Font size level (including each font size greater than or equal to 9 and less than or equal to 16), third font size level (including each font size greater than or equal to 17 and less than or equal to 32), and fourth font size level (including each font size greater than or equal to 33 and less than or equal to 64) );then,
  • the font size belonging to the first font size level the texture size of the text texture generated by each character under the two font sizes may be 8x8; if the two different font sizes If the font size is greater than or equal to 9 and less than or equal to 16, the texture size of the text texture generated by each character under the two font sizes may be 16x16; if the two different font sizes are If the font size is greater than or equal to 17 and less than or equal to 32, the font size of the text texture generated by each character under the two font sizes may be 32x32; if the two different words If the number is greater than or equal to 33 and less than or equal to 64, the font size belonging to the fourth font size, the texture size of the text texture generated by each character under the two font sizes may be 64x64; correspondingly, the following in conclusion:
  • the texture size may correspond to at least one font size belonging to the same font size level.
  • the texture type usually has a corresponding relationship with at least one font size while corresponding to at least one texture size, as shown in Table 2 (assuming coexistence 1) ⁇ 64 font size, and the corresponding relationship between the texture size and the texture type is as shown in Table 1.
  • the correspondence between the pre-configured texture size and the texture type may be extended to the corresponding relationship between the pre-configured font size or the font size level and the texture type, which is not described in the embodiment of the present invention. .
  • the texture size of the text texture generated by each character under the font size is generally the same for the same font size.
  • the texture of the text texture generated by the characters under the font size 8 may be 8x8, which is not described in the embodiment of the present invention.
  • any text texture to be stored generated in the electronic map rendering process may be according to the texture size of the text texture to be stored and the pre-configured texture size and Corresponding relationship of the texture type, determining a texture type corresponding to the texture size of the text texture to be stored, and using the determined texture type as the texture type corresponding to the text texture to be stored, which is not described in the embodiment of the present invention.
  • the texture size of the text texture to be stored is 8x8, the to-be-stored may be determined.
  • the texture type corresponding to the text texture is texture type 1.
  • the corresponding relationship between the texture size and the texture type may also be corresponding according to actual conditions.
  • the embodiment of the present invention does not limit this.
  • Step 102 Determine, according to the correspondence between the pre-configured texture type and the upper limit value of the texture number, the number of the text textures stored in the corresponding texture type is smaller than the number of textures corresponding to the corresponding texture type. And storing the text texture to be stored under the corresponding texture type; wherein, the upper limit value of the texture number corresponding to each texture type is pre-configured according to hardware resources of the device for storing each text texture Moreover, the more hardware resources of the device, the higher the upper limit of the number of textures corresponding to the texture type corresponding to the larger texture size.
  • the texture corresponding to each texture type needs to be flexibly configured according to the hardware resources of the device for storing each text texture.
  • the upper limit value is used to achieve the purpose of the higher the hardware resources of the device, and the higher the corresponding texture size, the higher the upper limit value of the texture number.
  • Texture type Texture size Number of textures Occupied storage space (bytes) Texture type 1 8x8 1000 64K Texture type 2 16x16 1000 256K Texture type 3 32x32 1000 1M Texture type 4 64x64 1000 4M
  • the texture sizes of the text textures that may be generated during the rendering of the electronic map are assumed to be 8x8, 16x16, 32x32, and 64x64, and the correspondence between the configured texture types and texture sizes is as shown in Table 1 or Table 2.
  • the corresponding texture size of 64x64 and 32x32 texture types occupies a relatively large storage space. Therefore, when configuring the upper limit value of the texture number corresponding to the texture type, the corresponding texture can be controlled.
  • Texture class size 64x64 and 32x32 The upper limit of the number of textures corresponding to the type.
  • the hardware resources of the device may include at least a pixel value (PPI value) of the device and/or a display access value of the device, and correspondingly, configuring the upper limit value of the texture number corresponding to the texture type.
  • PPI value pixel value
  • the hardware resources of the device may include at least a pixel value (PPI value) of the device and/or a display access value of the device, and correspondingly, configuring the upper limit value of the texture number corresponding to the texture type.
  • the upper limit value of the texture number corresponding to the texture type corresponding to the larger texture size may be higher; On the contrary, it can be configured with a correspondingly smaller upper limit of the number of textures;
  • the upper limit of the number of textures corresponding to the texture type corresponding to the larger texture size may be higher; It is configured with a corresponding upper limit of the number of textures.
  • the correspondence between the obtained texture types and the corresponding upper limit value of the texture number may be as shown in Table 4; wherein, when the hardware resources of the device If the value is greater than the set threshold, that is, when the texture size is 64x64 and the texture type of 32x32 corresponds to the texture number, the upper limit values n 64 and n 32 may be larger than the corresponding texture type of 16x16 and/or 8x8 respectively.
  • the upper limit of the number of textures corresponds to the texture type of 64x64 and 32x32 is n 64 and n
  • the upper limit value of the number of textures corresponding to the texture type of the corresponding texture size is 16x16 and/or 8x8, which is not described in detail in the embodiment of the present invention.
  • Texture type Texture size Corresponding font size Number of textures Texture type 1 8x8 1 ⁇ 8 n 8 Texture type 2 16x16 9 to 16 n 16 Texture type 3 32x32 17 ⁇ 32 n 32 Texture type 4 64x64 33 ⁇ 64 n 64
  • the configured texture type and the corresponding texture number are The corresponding relationship between the limits may be adjusted according to the actual situation, which is not limited in the embodiment of the present invention.
  • any text texture to be stored it may be managed as follows:
  • the upper limit of the number of textures if yes, storing the texture of the text to be stored under the texture type corresponding to the text texture to be stored.
  • each text texture stored under the texture type may be stored in a form of a texture list (also referred to as a texture linked list), that is, for Any texture type, the texture type may correspond to a corresponding texture list one by one (specifically, as shown in Table 5); and, for any texture list, the text texture in the texture list is in an electronic map
  • the node activity management mechanism can be used to manage the stored text textures accordingly, and the high-activity text texture is resident in the front end of the texture list, and the text texture with low activity is slowly moved to the end of the texture list. The end is moved out of the list to achieve the maximum preservation of the text texture used by the high frequency, and the text texture used by the low frequency is recovered in time, thereby improving the effect of the text texture management effect.
  • Texture type Texture size Texture list Corresponding font size Number of textures Texture type 1 8x8 T 1 1 ⁇ 8 n 8 Texture type 2 16x16 T 2 9 to 16 n 16 Texture type 3 32x32 T 3 17 ⁇ 32 n 32 Texture type 4 64x64 T 4 33 ⁇ 64 n 64
  • the method may further include:
  • the text texture to be stored is After the stored text texture whose usage frequency is lower than the set threshold is deleted, the text texture to be stored is stored under the texture type corresponding to the text texture to be stored.
  • each text texture stored under the texture type may be stored in the form of a texture list (which may also be referred to as a texture linked list);
  • a texture list which may also be referred to as a texture linked list
  • the higher the frequency of use of the text texture in the texture list in the electronic map the higher the position of the text texture in the texture list is, so, if the text to be stored is determined
  • the number of the text textures stored in the texture type corresponding to the texture is equal to the upper limit value of the texture number corresponding to the texture type corresponding to the text texture to be stored, and may be sorted in the texture list of the corresponding texture type.
  • the texture to be stored is stored in the texture list of the corresponding texture type, which is not described in detail in the embodiment of the present invention.
  • the texture type since the texture type usually has a corresponding correspondence with at least one font size, when the text texture under the texture type is stored in the form of a texture list, the The text textures of all the font sizes in the texture type may share the same texture list, which is not described in detail in the embodiments of the present invention.
  • a corresponding text when rendering each character, for any text, in addition to generating a text texture corresponding to the text, a corresponding text may be generated.
  • Text information such as font information, font size, and specific text content of the text, for use in subsequent display on the electronic map, and therefore, while storing the texture to be stored to the corresponding texture type Or afterwards, the method may further comprise:
  • the text information of each text may also be adopted in the form of a text information list (also referred to as a text information linked list).
  • a text information list also referred to as a text information linked list
  • the corresponding storage is not described in detail in the embodiment of the present invention.
  • the text information list can generally correspond to a font size one by one, that is, in the embodiment of the present invention, any font number has a corresponding text information list corresponding thereto.
  • the character information of each font size can be represented as C1, C2, ..., C64, etc., which are not described in detail in the embodiment of the present invention.
  • the frequency of use of the text or text texture corresponding to the text information in the text information list is higher in the electronic map, and the text information is in the The position in the text message list can also be ranked higher.
  • the node activity management mechanism can also be used to manage the stored text information, and the high-activity text information is resident in the front end of the text information list, and the text information with low activity is slowly moved to the text. At the end of the information list, until the list is removed, the text information of the high-frequency use is maximized, and the text information used at the low frequency is recovered in time, thereby improving the effect of the text information management.
  • the storage space size of each text information is not directly allocated, but the size of the storage space corresponding to the corresponding text texture is accepted, that is, the upper limit of the number of textures. Determines the maximum number of text information for all font sizes under its corresponding texture type. In other words, for any texture type, the sum of the upper limit values of the number of pieces of text information of each text information list matching each font size corresponding to the texture type may not be greater than the upper limit of the number of textures corresponding to the texture type. value.
  • the upper limit of the total number of storable text information of the 1st to 8th words is n8, and the upper limit of the total number of storable text information of the 9th to 16th characters is N16, and so on.
  • the number m of text information of each font size under each texture type is not fixed, and may be determined by the frequency of use of each font size in the actual rendering process of the electronic map, and conforms to the following formula (wherein the subscript of m) Indicates the corresponding font size):
  • the number of the text textures stored in the corresponding texture type is equal to the upper limit value of the texture number corresponding to the corresponding texture type, and Simultaneously or after deleting a stored text texture under the corresponding texture type, the method may further include:
  • the text information of the character corresponding to the stored text texture is deleted from the text information list matching the font size of the character corresponding to the stored text texture.
  • the text texture management method described in the embodiment of the present invention is briefly described below by a specific example: assuming that the new text to be rendered is "text", the corresponding font size is 24, and the corresponding text texture is x1, corresponding The text texture has a texture size of 32x32 and the corresponding text information is y1; when storing it, the following steps can be performed:
  • each text texture can be classified according to the texture size, and each text texture is performed according to each texture type obtained after the classification.
  • the upper limit value of the texture number corresponding to each texture type may be configured according to the hardware resource of the device for storing each text texture, wherein the more hardware resources of the device and the corresponding texture size are larger.
  • the upper limit of the number of types of textures is larger. Therefore, the purpose of rationally utilizing the storage space of the device can be achieved on the basis of avoiding excessive number of texture additions and deletions in the current text texture management.
  • the corresponding list or linked list may be adopted.
  • the higher the frequency of use of the text texture or text information in the list in the electronic map, the text texture or text information in the list The higher the position ranking, the better the convenience and speed of storage space management can be achieved on the basis of maximizing the preservation of text texture or text information used in high frequency, text texture or text information recovered in low frequency. And thereby speed up the efficiency of the rendering process.
  • Embodiment 2 is a diagrammatic representation of Embodiment 1:
  • the second embodiment of the present invention provides a text texture management device, as shown in FIG. 2 , which is a schematic structural diagram of a text texture management device according to the second embodiment of the present invention.
  • the text texture management device may include a relationship configuration unit 11 . , a type determining unit 12 and a texture storage unit 13, wherein:
  • the relationship configuration unit 11 may be configured to pre-configure the correspondence between the texture size and the texture type and the correspondence between the texture type and the upper limit value of the texture number, wherein the upper limit value of the texture number corresponding to each texture type is used for storage.
  • the hardware resources of the device of each text texture are pre-configured, and the more hardware resources of the device, the higher the upper limit of the number of textures corresponding to the texture type corresponding to the larger texture size; for example, the device
  • the hardware resource includes at least a pixel value of the device and/or a display access value of the device. The pixel value of the device or the display access value of the device is larger, and the corresponding texture size is larger.
  • the upper limit of the number of textures corresponding to the texture type is higher;
  • the type determining unit 12 may be configured to respond to any of the to-be-stored text textures generated in the electronic map rendering process, according to the texture size of the text texture to be stored and the texture size and the texture type pre-configured by the relationship configuration unit 11. a relationship, determining a texture type corresponding to the text texture to be stored;
  • the texture storage unit 13 is configured to determine, according to the correspondence between the texture type and the texture number upper limit value that are pre-configured according to the relationship configuration unit 11, the number of the text textures stored in the corresponding texture type is smaller than the When the upper limit of the number of textures corresponding to the corresponding texture type, the text texture to be stored is stored under the corresponding texture type.
  • the texture storage unit 13 is further configured to: if it is determined that the number of the text textures stored in the corresponding texture type is equal to the upper limit value of the texture number corresponding to the corresponding texture type, Then, after the stored text texture whose usage frequency is lower than the set threshold is deleted, the text texture to be stored is stored under the corresponding texture type.
  • the texture storage unit 13 may be specifically configured to store each text texture stored under the texture type in the form of a texture list (or a texture linked list); and, for any texture list, The higher the frequency of use of the text texture in the texture list, the higher the position of the text texture in the texture list. That is to say, the node activity management mechanism can be used to manage the stored text textures accordingly, and the high-activity text texture is resident in the front end of the texture list, and the text texture with low activity is slowly moved to the end of the texture list. The end is moved out of the list to achieve the maximum preservation of the text texture used by the high frequency, and the text texture used by the low frequency is recovered in time, thereby improving the effect of the text texture management effect.
  • the texture storage unit 13 is specifically configured to: if it is determined that the number of the text textures stored in the corresponding texture type is equal to the upper limit value of the texture number corresponding to the corresponding texture type, After sorting the last stored text texture in the texture list of the corresponding texture type, the text texture to be stored is stored in the texture list of the corresponding texture type.
  • the text texture management device may further include the information storage unit 14:
  • the information storage unit 14 may be configured to store text information of the text corresponding to the text texture to be stored to and after the storage of the text texture to be stored to the corresponding texture type.
  • the text texture corresponds to the font size of the text that matches the list of text messages.
  • the information storage unit 14 may perform corresponding text information of each text in the form of a text information list (also referred to as a text information linked list). And storing, for any text information list, the text information list can generally correspond to a font size one by one, that is, in the embodiment of the present invention, any font size has a corresponding text information list corresponding thereto. Furthermore, for any text message list, the text The higher the frequency of use of the text or text texture corresponding to the text information in the information list in the electronic map, the higher the position of the text information in the text information list.
  • the node activity management mechanism can also be used to manage the stored text information, and the high-activity text information is resident in the front end of the text information list, and the text information with low activity is slowly moved to the text. At the end of the information list, until the list is removed, the text information of the high-frequency use is maximized, and the text information used at the low frequency is recovered in time, thereby improving the effect of the text information management.
  • the size of the storage space of each text information is limited by the size of the storage space of the corresponding text texture, that is, the upper limit of the number of textures determines the corresponding texture type.
  • the maximum number of text messages for all font sizes In other words, for any texture type, the sum of the upper limit values of the number of pieces of text information of each text information list matching each font size corresponding to the texture type may not be greater than the upper limit of the number of textures corresponding to the texture type. value.
  • the number of the text information of each font size in each texture type is not fixed, and may be determined by the frequency of use of each font size in the actual rendering process of the electronic map, which is not described in detail in the embodiments of the present invention.
  • the text texture management device may further include an information deleting unit 15:
  • the information deleting unit 15 may be configured to determine, in the texture storage unit 13 that the number of text textures stored under the corresponding texture type is equal to an upper limit value of the texture number corresponding to the corresponding texture type, and At the same time as or after the deletion of the stored text texture whose usage frequency is lower than the set threshold under the corresponding texture type, the text information list matching the font size of the text corresponding to the stored text texture is The text information of the text corresponding to the text texture is deleted.
  • the embodiment of the present invention provides a text texture management device.
  • each text texture can be classified according to the texture size, and each text texture is performed according to each texture type obtained after the classification.
  • the upper limit value of the texture number corresponding to each texture type may be configured according to the hardware resource of the device for storing each text texture, wherein the more hardware resources of the device and the corresponding texture size are larger.
  • the upper limit of the number of types of textures is larger. Therefore, the purpose of rationally utilizing the storage space of the device can be achieved on the basis of avoiding excessive number of texture additions and deletions in the current text texture management.
  • text texture or text information may be stored through a corresponding list or linked list, and for any list, the text texture or text information in the list is in the electronic
  • the purpose of improving the convenience and speed of storage space management and speeding up the operation efficiency of the rendering process is achieved.
  • embodiments of the present invention can be provided as a method, apparatus (device), or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
  • a computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Graphics (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Processing Or Creating Images (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

本发明公开了一种文字纹理管理方法及设备,根据预置的纹理尺寸与纹理类型的对应关系,确定任一待存储文字纹理对应的纹理类型,并在确定该对应的纹理类型下存储的纹理的个数小于相应的上限值时,将该待存储文字纹理存储至该对应的纹理类型下;其中,各纹理类型的纹理个数上限值是根据设备的硬件资源配置的且设备的硬件资源越多、对应的纹理尺寸越大的纹理类型的纹理个数上限值越高。在本方案中,由于可根据纹理尺寸对纹理进行分类并根据各纹理类型对各纹理进行存储,且设备的硬件资源越多、对应的纹理尺寸越大的纹理类型的纹理个数上限值越高,因此,可在避免目前纹理管理中存在的纹理增删次数过多的基础上,达到合理利用设备存储空间的目的。

Description

一种文字纹理管理方法及设备
本申请要求在2014年4月29日提交中国专利局、申请号为201410178599.8、发明名称为“一种文字纹理管理方法及设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及电子地图技术领域,尤其涉及一种可适用于电子地图的文字纹理管理方法及设备。
背景技术
目前,电子地图中常会涉及到POI(Point Of Interest,兴趣点)名称、道路名称等文字信息的显示,在对文字信息进行显示之前,通常需对涉及到的文字进行相应地渲染,即,将涉及到的各文字生成对应的文字纹理。
具体地,由于将文字生成相应的文字纹理是比较耗时的操作,因而,在OPENGL(Open Graphics Library,一种专业的图形程序接口)或DIRECTX(Direct EXTENSION,简称DX,一种多媒体编程接口)等硬件渲染的引擎中,一般情况下,均需将生成的文字纹理进行相应的保存,以供下次渲染时直接使用、提高渲染的速率。但是,由于中文文字的字库较为庞大并且由于电子地图的POI以及道路信息量较为丰富,使得电子地图渲染过程中保存下来的文字纹理的数量也较为庞大,导致文字纹理在设备中占用的存储空间不断攀升;另外,由于设备的可用存储空间通常是有限的,因此,在对渲染过程中产生的文字纹理进行保存时,需要采用一定的方式对其进行相应管理。
具体地,目前,业界通常采用如下方式对设备中保存的文字纹理进行相应管理:对电子地图渲染过程中涉及到的文字的字号总数设置一上限值,并且,对每种字号下所存储的文字纹理的数量也设置一相应的上限值;当涉及到的字号超出其对应的上限值时,删除设备中的不常用的字号所对应的所有 文字纹理;那么,在字号上限确定以及每种字号对应的文字纹理上限也确定的情况下,设备中的总的文字纹理所占用的存储空间上限也能够相应的确定下来。
例如,假设字号总数上限为4,每种字号下可存储上限为200张的文字纹理,则设备中的文字纹理所占用的最大存储空间为800张纹理;进一步地,假设当前设备中存储了16、18、22以及24共4种字号的文字,当电子地图渲染过程中出现了新的字号26时,可删除设备中的较不常用的字号,如删除字号16对应的所有文字纹理,并将字号26对应的文字纹理存储起来,以在不超过字号总数上限的前提下,实现文字纹理的相应管理。
但是,由于不同电子地图设备的存储空间通常并不一样,因此,在根据设定的字号总数上限进行文字纹理的管理时,并不能合理地利用各设备的存储空间;并且,当电子地图中涉及的字号较多、超过字号的总数上限时,由于需要经常删除某个字号下的所有文字纹理并生成新字号对应的文字纹理,因此,使得文字纹理的增删操作较多,还会进一步降低电子地图的渲染效率。
发明内容
本发明实施例提供了一种文字纹理管理方法及设备,用以解决目前存在的对文字纹理进行管理时、无法合理地利用各设备的存储空间以及纹理增删操作过多导致渲染效率较低的问题。
本发明实施例提供了一种文字纹理管理方法,包括:
针对电子地图渲染过程中产生的任一待存储文字纹理,根据所述待存储文字纹理的纹理尺寸以及预先配置的纹理尺寸与纹理类型的对应关系,确定所述待存储文字纹理对应的纹理类型;并
在根据预先配置的纹理类型与纹理个数上限值的对应关系,确定所述对应的纹理类型下存储的文字纹理的个数小于所述对应的纹理类型所对应的纹理个数上限值时,将所述待存储文字纹理存储至所述对应的纹理类型下;
其中,各纹理类型对应的纹理个数上限值是根据用于存储各文字纹理的 设备的硬件资源预先配置的;并且,所述设备的硬件资源越多,对应的纹理尺寸越大的纹理类型所对应的纹理个数上限值越高。
进一步地,所述设备的硬件资源至少包括所述设备的像素取值和/或所述设备的显存取值;
其中,所述设备的像素取值或所述设备的显存取值越大,对应的纹理尺寸越大的纹理类型所对应的纹理个数上限值越高。
进一步地,所述方法还包括:
若确定所述对应的纹理类型下存储的文字纹理的个数等于所述对应的纹理类型所对应的纹理个数上限值,则在将所述对应的纹理类型下的一使用频率低于设定阈值的已存储文字纹理删除后,将所述待存储文字纹理存储至所述对应的纹理类型下。
进一步地,针对任一纹理类型,采用纹理列表的形式对存储至所述纹理类型下的各文字纹理进行存储;并且,
针对任一纹理列表,所述纹理列表中的文字纹理的使用频率越高,所述文字纹理在所述纹理列表中的位置排序越靠前。
进一步地,在将所述对应的纹理类型下的一使用频率低于设定阈值的已存储文字纹理删除后,将所述待存储文字纹理存储至所述对应的纹理类型下,包括:
在将所述对应的纹理类型的纹理列表中排序最后的一已存储文字纹理删除后,将所述待存储文字纹理存储至所述对应的纹理类型的纹理列表中。
进一步地,在将所述待存储文字纹理存储至所述对应的纹理类型下的同时或之后,所述方法还包括:
将所述待存储文字纹理对应的文字的文字信息存储至与所述待存储文字纹理对应的文字的字号相匹配的文字信息列表中。
进一步地,在确定所述对应的纹理类型下存储的文字纹理的个数等于所述对应的纹理类型所对应的纹理个数上限值,且在将所述对应的纹理类型下的一使用频率低于设定阈值的已存储文字纹理删除的同时或之后,所述方法 还包括:
从与所述已存储文字纹理对应的文字的字号相匹配的文字信息列表中,将所述已存储文字纹理对应的文字的文字信息进行删除。
进一步地,针对任一纹理类型,所述纹理类型对应至少一个字号;且
与所述纹理类型对应的各字号相匹配的各文字信息列表的文字信息个数上限值之和不大于所述纹理类型对应的纹理个数上限值。
进一步地,本发明实施例还提供了一种文字纹理管理设备,包括:
关系配置单元,用于预先配置纹理尺寸与纹理类型的对应关系,以及,纹理类型与纹理个数上限值的对应关系,其中,各纹理类型对应的纹理个数上限值是根据用于存储各文字纹理的设备的硬件资源预先配置的,并且,所述设备的硬件资源越多,对应的纹理尺寸越大的纹理类型所对应的纹理个数上限值越高;
类型确定单元,用于针对电子地图渲染过程中产生的任一待存储文字纹理,根据所述待存储文字纹理的纹理尺寸以及所述关系配置单元预先配置的纹理尺寸与纹理类型的对应关系,确定所述待存储文字纹理对应的纹理类型;
纹理存储单元,用于在根据所述关系配置单元预先配置的纹理类型与纹理个数上限值的对应关系,确定所述对应的纹理类型下存储的文字纹理的个数小于所述对应的纹理类型所对应的纹理个数上限值时,将所述待存储文字纹理存储至所述对应的纹理类型下。
进一步地,所述设备的硬件资源至少包括所述设备的像素取值和/或所述设备的显存取值;
其中,所述设备的像素取值或所述设备的显存取值越大,对应的纹理尺寸越大的纹理类型所对应的纹理个数上限值越高。
进一步地,所述纹理存储单元,还用于若确定所述对应的纹理类型下存储的文字纹理的个数等于所述对应的纹理类型所对应的纹理个数上限值,则在将所述对应的纹理类型下的一使用频率低于设定阈值的已存储文字纹理删除后,将所述待存储文字纹理存储至所述对应的纹理类型下。
进一步地,所述纹理存储单元,具体用于针对任一纹理类型,采用纹理列表的形式对存储至所述纹理类型下的各文字纹理进行存储;并且,
针对任一纹理列表,所述纹理列表中的文字纹理的使用频率越高,所述文字纹理在所述纹理列表中的位置排序越靠前。
进一步地,所述纹理存储单元,具体用于若确定所述对应的纹理类型下存储的文字纹理的个数等于所述对应的纹理类型所对应的纹理个数上限值,则在将所述对应的纹理类型的纹理列表中排序最后的一已存储文字纹理删除后,将所述待存储文字纹理存储至所述对应的纹理类型的纹理列表中。
进一步地,所述文字纹理管理设备还包括信息存储单元:
所述信息存储单元,用于在将所述待存储文字纹理存储至所述对应的纹理类型下的同时或之后,将所述待存储文字纹理对应的文字的文字信息存储至与所述待存储文字纹理对应的文字的字号相匹配的文字信息列表中。
进一步地,所述文字纹理管理设备还包括信息删除单元:
所述信息删除单元,用于在纹理存储单元确定所述对应的纹理类型下存储的文字纹理的个数等于所述对应的纹理类型所对应的纹理个数上限值,且在将所述对应的纹理类型下的一使用频率低于设定阈值的已存储文字纹理删除的同时或之后,从与所述已存储文字纹理对应的文字的字号相匹配的文字信息列表中,将所述已存储文字纹理对应的文字的文字信息进行删除。
进一步地,针对任一纹理类型,所述纹理类型对应至少一个字号;且
与所述纹理类型对应的各字号相匹配的各文字信息列表的文字信息个数上限值之和不大于所述纹理类型对应的纹理个数上限值。
本发明有益效果如下:
本发明实施例提供了一种文字纹理管理方法及设备,针对电子地图渲染过程中产生的任一待存储文字纹理,可根据预先配置的纹理尺寸与纹理类型的对应关系,确定所述待存储文字纹理对应的纹理类型,并在确定所述待存储文字纹理对应的纹理类型下存储的文字纹理的个数小于相应的纹理个数上限值时,将所述待存储文字纹理存储至所述待存储文字纹理对应的纹理类型 下;其中,各纹理类型对应的纹理个数上限值是根据设备的硬件资源预先配置的,并且,设备的硬件资源越多、对应的纹理尺寸越大的纹理类型所对应的纹理个数上限值越大。在本发明实施例所述技术方案中,由于可根据纹理尺寸对各文字纹理进行分类并根据分类后所得到的各纹理类型对各文字纹理进行相应存储,并且,可根据用于存储各文字纹理的设备的硬件资源对各纹理类型对应的纹理个数上限值进行配置,其中,设备的硬件资源越多、对应的纹理尺寸越大的纹理类型的纹理个数上限值越大,因此,可在避免目前文字纹理管理中存在的纹理增删次数过多的基础上,达到合理利用设备存储空间的目的。
附图说明
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简要介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域的普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1所示为本发明实施例一中所述文字纹理管理方法的流程示意图;
图2所示为本发明实施例二中所述文字纹理管理设备的结构示意图。
具体实施方式
本发明实施例提供了一种文字纹理管理方法及设备,所述方法包括:针对电子地图渲染过程中产生的任一待存储文字纹理,根据所述待存储文字纹理的纹理尺寸以及预先配置的纹理尺寸与纹理类型的对应关系,确定所述待存储文字纹理对应的纹理类型;并在根据预先配置的纹理类型与纹理个数上限值的对应关系,确定所述对应的纹理类型下存储的文字纹理的个数小于所述对应的纹理类型所对应的纹理个数上限值时,将所述待存储文字纹理存储至所述对应的纹理类型下;其中,各纹理类型对应的纹理个数上限值是根据用于存储各文字纹理的设备的硬件资源预先配置的;并且,所述设备的硬件 资源越多,对应的纹理尺寸越大的纹理类型所对应的纹理个数上限值越高。
在本发明实施例所述技术方案中,由于可根据纹理尺寸对各文字纹理进行分类并根据分类后所得到的各纹理类型对各文字纹理进行相应存储,并且,可根据用于存储各文字纹理的设备的硬件资源对各纹理类型对应的纹理个数上限值进行配置,其中,设备的硬件资源越多、对应的纹理尺寸越大的纹理类型的纹理个数上限值越大,因此,可在避免目前文字纹理管理中存在的纹理增删次数过多的基础上,达到合理利用设备存储空间的目的。
为了使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明作进一步地详细描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。
实施例一:
本发明实施例一提供了一种文字纹理管理方法,如图1所示,其为本发明实施例一中所述文字纹理管理方法的流程示意图,所述文字纹理管理方法可包括以下步骤:
步骤101:针对电子地图渲染过程中产生的任一待存储文字纹理,根据所述待存储文字纹理的纹理尺寸以及预先配置的纹理尺寸与纹理类型的对应关系,确定所述待存储文字纹理对应的纹理类型。
具体地,在本发明所述实施例中,如无特殊说明,所述电子地图通常可指的是中文电子地图;相应地,电子地图渲染过程中产生的待存储文字纹理通常可指的是,对新的中文文字进行渲染时所产生的与所述新的中文文字相对应的新的文字纹理,本发明实施例对此不作赘述。
进一步地,在本发明所述实施例中,通常可采用以下方式,预先配置纹理尺寸与纹理类型的对应关系:
按照电子地图渲染过程中可能生成的文字纹理的纹理尺寸大小,将可能生成的文字纹理的纹理尺寸对应的尺寸取值范围(或取值集合)划分为N个 子区间(或子集合),并将每个子区间(或子集合)称作一相应的纹理类型,所述N通常可为大于1的正整数。也就是说,针对任一纹理类型,所述纹理类型可对应一相应的尺寸取值子区间(或子集合),其中,任一尺寸取值子区间(或子集合)内可对应一个或多个相应的纹理尺寸。
具体地,由于在现有OPENGL或DIRECTX等硬件渲染的引擎中,针对任一文字,对所述文字进行渲染所得到的文字纹理通常可为长、宽相等的正方形图片,并且,各文字纹理的纹理尺寸通常可表示为纹理图片的长宽之积且常为2n x2n的形式(所述n可为大于等于1的正整数,并且,纹理图片的长或宽的单位为像素);也就是说,在现有OPENGL或DIRECTX等硬件渲染的引擎中,所得到的纹理尺寸通常是不连续的尺寸取值的集合,因此,相应地,按照电子地图渲染过程中可能生成的文字纹理的纹理尺寸大小,将可能生成的文字纹理的纹理尺寸对应的尺寸取值范围(或取值集合)划分为N个子区间(或子集合),并将每个子区间(或子集合)称作一相应的纹理类型,可包括:
按照电子地图渲染过程中可能生成的文字纹理的纹理图片的长(或宽)的大小,将可能生成的文字纹理的纹理图片的长(或宽)对应的取值集合(包括M个具体的取值,所述M通常可为大于1的正整数)划分为N个子集合,并将每个子集合称作一相应的纹理类型。
优选地,为了实现纹理类型的方便划分,划分后的子集合的个数N可与所述M相同,本发明实施例对此不作任何限定。此时,针对任一纹理类型,所述纹理类型可与一个纹理尺寸相对应。
例如,假设电子地图渲染过程中可能生成的文字纹理的纹理尺寸为8x8、16x16、32x32以及64x64,则可按照可能生成的文字纹理的纹理图片的长(或宽)的大小,将可能生成的文字纹理的纹理图片的长(或宽)对应的取值集合{8,16,32,64}划分为如下4个子集合:
子集合1:纹理图片的长(或宽)=8;具体对应纹理尺寸8x8;
子集合2:纹理图片的长(或宽)=16;具体对应纹理尺寸16x16;
子集合3:纹理图片的长(或宽)=32;具体对应纹理尺寸32x32;
子集合4:纹理图片的长(或宽)=64;具体对应纹理尺寸64x64。
相应地,可将每个子集合称作一纹理类型,因此,可得到如表1所示的四个纹理类型与相应的纹理尺寸的对应关系:
纹理类型 对应纹理尺寸
纹理类型1 长(或宽)=8,具体对应纹理尺寸8x8
纹理类型2 长(或宽)=16,具体对应纹理尺寸16x16
纹理类型3 长(或宽)=32,具体对应纹理尺寸32x32
纹理类型4 长(或宽)=64,具体对应纹理尺寸64x64
表1
进一步地,由于在现有OPENGL或DIRECTX等硬件渲染的引擎中,在对各文字进行渲染时,对于任意两个不同的字号来说,若该两个不同字号属于设定的同一字号级别(字号级别是指,字号按一定的连续长度分组,如8个字号一组,每一组称为不同的字号级别),则该任意两个不同字号下的各文字(不管该文字为楷体还是宋体还是其他字体)所生成的文字纹理的纹理尺寸可相互相同。例如,
假设共存在1~64个字号,且假设所述64个字号可按照一定的级别划分方式,划分成相应的4个字号级别,如第一字号级别(包括小于等于8的各字号)、第二字号级别(包括大于等于9且小于等于16的各字号)、第三字号级别(包括大于等于17且小于等于32的各字号)以及第四字号级别(包括大于等于33且小于等于64的各字号);则,
若该两个不同字号均为小于等于8的、属于第一字号级别的字号,则,该两个字号下的各文字所生成的文字纹理的纹理尺寸均可为8x8;若该两个不同字号均为大于等于9且小于等于16的、属于第二字号级别的字号,则,该两个字号下的各文字所生成的文字纹理的纹理尺寸均可为16x16;若该两个不同字号均为大于等于17且小于等于32的、属于第三字号级别的字号,则,该两个字号下的各文字所生成的文字纹理的纹理尺寸均可为32x32;若该两个不同字 号均为大于等于33且小于等于64的、属于第四字号级别的字号,则,该两个字号下的各文字所生成的文字纹理的纹理尺寸均可为64x64;则相应地,可得到如下结论:
针对任一纹理尺寸,所述纹理尺寸可与属于同一字号级别的至少一个字号相对应。相应地,针对任一纹理类型,所述纹理类型在与至少一个纹理尺寸存在对应关系的同时,通常还会与至少一个字号存在相应的对应关系,具体可如表2所示(假设共存在1~64个字号,且假设所建立的纹理尺寸与纹理类型的对应关系如表1所示),本发明实施例对此不作赘述。相应地,在本发明所述实施例中,预先配置的纹理尺寸与纹理类型的对应关系还可扩展为预先配置的各字号或字号级别与纹理类型的对应关系,本发明实施例对此不作赘述。
纹理类型 对应字号 对应纹理尺寸
纹理类型1 1~8 长(或宽)=8,具体对应纹理尺寸8x8
纹理类型2 9~16 长(或宽)=16,具体对应纹理尺寸16x16
纹理类型3 17~32 长(或宽)=32,具体对应纹理尺寸32x32
纹理类型4 33~64 长(或宽)=64,具体对应纹理尺寸64x64
表2
进一步地,需要说明的是,在本发明所述实施例中,对于同一字号来说,该字号下的各文字所生成的文字纹理的纹理尺寸通常相同。例如,对于字号8来说,该字号8下的各文字(不管该文字为楷体还是宋体还是其他字体)所生成的文字纹理的纹理尺寸均可为8x8,本发明实施例对此也不作赘述。
进一步地,在得到纹理尺寸与纹理类型的对应关系之后,针对电子地图渲染过程中产生的任一待存储文字纹理,即可根据所述待存储文字纹理的纹理尺寸以及预先配置的各纹理尺寸与纹理类型的对应关系,确定与所述待存储文字纹理的纹理尺寸相对应的纹理类型,并将该确定的纹理类型作为所述待存储文字纹理对应的纹理类型,本发明实施例对此不作赘述。例如,参照表1或表2,若所述待存储文字纹理的纹理尺寸为8x8,则可确定所述待存储 文字纹理对应的纹理类型为纹理类型1。
另外需要说明的是,在本发明所述实施例中,在预先配置相应的纹理尺寸与纹理类型的对应关系之后,所述预先配置的纹理尺寸与纹理类型的对应关系还可根据实际情况进行相应调整,本发明实施例对此不作任何限定。
步骤102:在根据预先配置的纹理类型与纹理个数上限值的对应关系,确定所述对应的纹理类型下存储的文字纹理的个数小于所述对应的纹理类型所对应的纹理个数上限值时,将所述待存储文字纹理存储至所述对应的纹理类型下;其中,各纹理类型对应的纹理个数上限值是根据用于存储各文字纹理的设备的硬件资源预先配置的,并且,所述设备的硬件资源越多,对应的纹理尺寸越大的纹理类型所对应的纹理个数上限值越高。
具体地,由于每种纹理类型对应的纹理尺寸的大小不同,并且,纹理尺寸越大的文字纹理所占用的存储空间越大(如表3所示),因此,在本发明所述实施例中,为了达到对存储空间的合理利用,在进行纹理类型与纹理个数上限值的对应关系的配置时,需根据用于存储各文字纹理的设备的硬件资源,灵活配置各纹理类型对应的纹理个数上限值,以达到所述设备的硬件资源越多,对应的纹理尺寸越大的纹理类型所对应的纹理个数上限值越高的目的。
纹理类型 纹理尺寸 纹理张数 占用存储空间(字节)
纹理类型1 8x8 1000 64K
纹理类型2 16x16 1000 256K
纹理类型3 32x32 1000 1M
纹理类型4 64x64 1000 4M
表3
具体地,由表3可知,在假设电子地图渲染过程中可能生成的文字纹理的纹理尺寸为8x8、16x16、32x32以及64x64,且所配置的纹理类型与纹理尺寸的对应关系如表1或表2所示的前提下,对应的纹理尺寸为64x64以及32x32的纹理类型所占用的存储空间相对较大,因此,在进行纹理类型对应的纹理个数上限值的配置时,可重点控制对应的纹理尺寸为64x64以及32x32的纹理类 型所对应的纹理个数上限值。
例如,考虑设备的硬件资源至少可包括所述设备的像素取值(PPI取值)和/或所述设备的显存取值,相应地,在进行纹理类型对应的纹理个数上限值的配置时,可进行如下配置:
1)、若所述设备的像素取值越高,即电子地图中涉及到的大号文字越多,则对应的纹理尺寸越大的纹理类型所对应的纹理个数上限值可越高;反之,则可为其配置相应较小的纹理个数上限值;
2)、若所述设备的显存越大,即所述设备的存储空间越充足,则对应的纹理尺寸越大的纹理类型所对应的纹理个数上限值可越高;反之,则可为其配置相应较小的纹理个数上限值。
由上可知,可通过综合考虑上述两个因素,通过人工分析或在软件运行过程中自动调整各种纹理类型对应的纹理个数上限值,以达到对纹理存储空间大小的合理分配的目的。
具体地,在按照上述方式进行纹理个数上限值的配置后,所得到的各纹理类型与对应的纹理个数上限值的对应关系可如表4所示;其中,当设备的硬件资源大于设定阈值,即较充足时,纹理尺寸为64x64以及32x32的纹理类型所对应的纹理个数上限值n64以及n32可分别大于相应的纹理尺寸为16x16和/或8x8的纹理类型所对应的纹理个数上限值;相应地,当设备的硬件资源低于设定阈值,即不够充足时,纹理尺寸为64x64以及32x32的纹理类型所对应的纹理个数上限值n64以及n32可分别小于相应的纹理尺寸为16x16和/或8x8的纹理类型所对应的纹理个数上限值,本发明实施例对此不再赘述。
纹理类型 纹理尺寸 对应字号大小 纹理个数上限值
纹理类型1 8x8 1~8 n8
纹理类型2 16x16 9~16 n16
纹理类型3 32x32 17~32 n32
纹理类型4 64x64 33~64 n64
表4
进一步地,需要说明的是,在本发明所述实施例中,在配置相应的纹理类型与对应的纹理个数上限值的对应关系之后,所述配置的纹理类型与对应的纹理个数上限值的对应关系还可根据实际情况进行相应调整,本发明实施例对此不作任何限定。
进一步地,在配置纹理类型与纹理个数上限值的对应关系之后,针对任一待存储文字纹理,可按照如下方式对其进行相应管理:
根据预先配置的纹理类型与纹理个数上限值的对应关系,确定所述待存储文字纹理对应的纹理类型下存储的文字纹理的个数是否小于所述待存储文字纹理对应的纹理类型所对应的纹理个数上限值,若是,则将所述待存储文字纹理存储至所述待存储文字纹理对应的纹理类型下。
具体地,在本发明所述实施例中,针对任一纹理类型,可采用纹理列表(也可称为纹理链表)的形式对存储至所述纹理类型下的各文字纹理进行存储,即,针对任一纹理类型,所述纹理类型可与一相应的纹理列表一一对应(具体可如表5所示);并且,针对任一纹理列表,所述纹理列表中的文字纹理在电子地图中的使用频率越高,所述文字纹理在所述纹理列表中的位置排序越靠前。也就是说,可采用节点活跃度管理机制对存储的各文字纹理进行相应管理,将活跃度高的文字纹理常驻于纹理列表前端,将活跃度不高的文字纹理慢慢移至纹理列表尾端直至移出列表,以达到高频使用的文字纹理最大化的保存,低频使用的文字纹理及时地回收、进而提高文字纹理管理效果的目的。
纹理类型 纹理尺寸 纹理列表 对应字号大小 纹理个数上限值
纹理类型1 8x8 T1 1~8 n8
纹理类型2 16x16 T2 9~16 n16
纹理类型3 32x32 T3 17~32 n32
纹理类型4 64x64 T4 33~64 n64
表5
进一步地,在本发明所述实施例中,所述方法还可包括:
若确定所述待存储文字纹理对应的纹理类型下存储的文字纹理的个数等于所述待存储文字纹理对应的纹理类型所对应的纹理个数上限值,则在将所述待存储文字纹理对应的纹理类型下的一使用频率低于设定阈值的已存储文字纹理删除后,将所述待存储文字纹理存储至所述待存储文字纹理对应的纹理类型下。
具体地,由于在本发明所述实施例中,针对任一纹理类型,可采用纹理列表(也可称为纹理链表)的形式对存储至所述纹理类型下的各文字纹理进行存储;并且,针对任一纹理列表,所述纹理列表中的文字纹理在电子地图中的使用频率越高,所述文字纹理在所述纹理列表中的位置排序越靠前,因此,若确定所述待存储文字纹理对应的纹理类型下存储的文字纹理的个数等于所述待存储文字纹理对应的纹理类型所对应的纹理个数上限值,则可在将所述对应的纹理类型的纹理列表中排序最后的一已存储文字纹理删除后,将所述待存储文字纹理存储至所述对应的纹理类型的纹理列表中,本发明实施例对此不作赘述。
需要说明的是,针对任一纹理类型,由于所述纹理类型通常会与至少一个字号存在相应的对应关系,因此,在采用纹理列表的形式对该纹理类型下的文字纹理进行存储时,属于该纹理类型下的所有字号的文字纹理可共用同一纹理列表,本发明实施例对此也不作赘述。
进一步地,在本发明所述实施例中,由于在对各文字进行渲染时,针对任一文字,除了可生成与所述文字相对应的文字纹理之外,还可生成与所述文字相对应的文字信息,如所述文字的字体、字号、具体文字内容等属性信息,以便后续在电子地图上显示时使用,因此,在将所述待存储文字纹理存储至所述对应的纹理类型下的同时或之后,所述方法还可包括:
将所述待存储文字纹理对应的文字的文字信息存储至与所述待存储文字纹理对应的文字的字号相匹配的文字信息列表中。
也就是说,与文字纹理的存储方式类似,在本发明所述实施例中,也可采用文字信息列表(也可称为文字信息链表)的形式对各文字的文字信息进 行相应存储,本发明实施例对此不作赘述。并且,针对任一文字信息列表,所述文字信息列表通常可与一字号一一对应,即在本发明所述实施例中,任一字号均有一相应的文字信息列表与其相对应。例如,仍以字号为1~64为例,各个字号的文字信息列表可分别表示为C1、C2、...、C64等,本发明实施例对此不作赘述。
再有,在本发明所述实施例中,针对任一文字信息列表,所述文字信息列表中的文字信息对应的文字或文字纹理在电子地图中的使用频率越高,所述文字信息在所述文字信息列表中的位置排序也可越靠前。也就是说,也可采用节点活跃度管理机制对存储的各文字信息进行相应管理,将活跃度高的文字信息常驻于文字信息列表前端,将活跃度不高的文字信息慢慢移至文字信息列表尾端直至移出列表,以达到高频使用的文字信息最大化的保存,低频使用的文字信息及时地回收、进而提高文字信息管理效果的目的。
另外需要说明的是,在本发明所述实施例中,各文字信息的存储空间大小没有进行直接的分配,而是间接受制于相应的文字纹理的存储空间的大小,即纹理个数上限值决定了其对应纹理类型下的所有字号的文字信息的个数上限。也就是说,针对任一纹理类型,与所述纹理类型对应的各字号相匹配的各文字信息列表的文字信息个数上限值之和通常可不大于所述纹理类型对应的纹理个数上限值。
具体地,以表5为例,可得到如下结果:1~8号字的总的可存储文字信息的个数上限为n8,9~16号字的总的可存储文字信息的个数上限为n16,依次类推。另外,每一纹理类型下的每种字号的文字信息的个数m也不固定,具体可由电子地图实际渲染过程中的各字号的使用频率来决定,并符合如下公式(其中,m的下标表示相应的字号):
m1+m2+...+m8≤n8;或,m9+m10+...+m16≤n16;或,m17+m18+...+m32≤n32;或,m33+m34+...+m64≤n64。
进一步地,在本发明所述实施例中,在确定所述对应的纹理类型下存储的文字纹理的个数等于所述对应的纹理类型所对应的纹理个数上限值,且在 将所述对应的纹理类型下的一已存储文字纹理删除的同时或之后,所述方法还可包括:
从与所述已存储文字纹理对应的文字的字号相匹配的文字信息列表中,将所述已存储文字纹理对应的文字的文字信息进行删除。
下面以具体的实例对本发明实施例中所述的文字纹理管理方法进行简要说明:假设所渲染的新的文字为“文”,其对应的字号为24号,对应的文字纹理为x1,对应的文字纹理的纹理尺寸为32x32,对应的文字信息为y1;则在对其进行存储时,可执行以下步骤:
S1:查找纹理尺寸32x32或24号字号对应的纹理类型和相应的纹理列表T3;
S2:判断纹理尺寸32x32或24号字号对应的纹理类型下,即纹理列表T3中存储的文字纹理的个数t是否小于n32
若是,则可将x1添加至T3列表中,将y1添加至相应的C24列表中;
若否(即t=n32),则查找T3列表中的使用频率最小的文字纹理(或T3列表中的排序最靠后的文字纹理);假设该查找到的文字纹理x2为31号字“风”对应的文字纹理,且假设该查找到的文字纹理x2对应的文字信息为y2,则可将x2从T3列表中删除、将y2从C31列表中删除,并将x1添加到T3列表中、将y1添加到C24列表中,以实现该新的渲染文字的文字纹理以及文字信息的相应存储。
本发明实施例提供了一种文字纹理管理方法,在本发明实施例所述技术方案中,由于可根据纹理尺寸对各文字纹理进行分类并根据分类后所得到的各纹理类型对各文字纹理进行相应存储,并且,可根据用于存储各文字纹理的设备的硬件资源对各纹理类型对应的纹理个数上限值进行配置,其中,设备的硬件资源越多、对应的纹理尺寸越大的纹理类型的纹理个数上限值越大,因此,可在避免目前文字纹理管理中存在的纹理增删次数过多的基础上,达到合理利用设备存储空间的目的。
另外,由于在本发明实施例所述技术方案中,可通过相应的列表或链表 来进行文字纹理或文字信息的存储,并且,针对任一列表,所述列表中的文字纹理或文字信息在电子地图中的使用频率越高,所述文字纹理或文字信息在所述列表中的位置排序越靠前,从而可在达到高频使用的文字纹理或文字信息最大化的保存、低频使用的文字纹理或文字信息及时地回收的基础上,达到提高存储空间管理的方便性以及快捷性、进而加快渲染过程的运行效率的目的。
实施例二:
本发明实施例二提供了一种文字纹理管理设备,如图2所示,其为本发明实施例二中所述文字纹理管理设备的结构示意图,所述文字纹理管理设备可包括关系配置单元11、类型确定单元12以及纹理存储单元13,其中:
所述关系配置单元11可用于预先配置纹理尺寸与纹理类型的对应关系以及纹理类型与纹理个数上限值的对应关系,其中,各纹理类型对应的纹理个数上限值是根据用于存储各文字纹理的设备的硬件资源预先配置的,并且,所述设备的硬件资源越多,对应的纹理尺寸越大的纹理类型所对应的纹理个数上限值越高;例如,以所述设备的硬件资源至少包括所述设备的像素取值和/或所述设备的显存取值为例,所述设备的像素取值或所述设备的显存取值越大,对应的纹理尺寸越大的纹理类型所对应的纹理个数上限值越高;
所述类型确定单元12可用于针对电子地图渲染过程中产生的任一待存储文字纹理,根据所述待存储文字纹理的纹理尺寸以及所述关系配置单元11预先配置的纹理尺寸与纹理类型的对应关系,确定所述待存储文字纹理对应的纹理类型;
所述纹理存储单元13可用于在根据所述关系配置单元11预先配置的纹理类型与纹理个数上限值的对应关系,确定所述对应的纹理类型下存储的文字纹理的个数小于所述对应的纹理类型所对应的纹理个数上限值时,将所述待存储文字纹理存储至所述对应的纹理类型下。
进一步地,所述纹理存储单元13还可用于若确定所述对应的纹理类型下存储的文字纹理的个数等于所述对应的纹理类型所对应的纹理个数上限值, 则在将所述对应的纹理类型下的一使用频率低于设定阈值的已存储文字纹理删除后,将所述待存储文字纹理存储至所述对应的纹理类型下。
其中,针对任一纹理类型,所述纹理存储单元13具体可用于采用纹理列表(或纹理链表)的形式对存储至所述纹理类型下的各文字纹理进行存储;并且,针对任一纹理列表,所述纹理列表中的文字纹理的使用频率越高,所述文字纹理在所述纹理列表中的位置排序越靠前。也就是说,可采用节点活跃度管理机制对存储的各文字纹理进行相应管理,将活跃度高的文字纹理常驻于纹理列表前端,将活跃度不高的文字纹理慢慢移至纹理列表尾端直至移出列表,以达到高频使用的文字纹理最大化的保存,低频使用的文字纹理及时地回收、进而提高文字纹理管理效果的目的。
相应地,所述纹理存储单元13具体可用于若确定所述对应的纹理类型下存储的文字纹理的个数等于所述对应的纹理类型所对应的纹理个数上限值,则在将所述对应的纹理类型的纹理列表中排序最后的一已存储文字纹理删除后,将所述待存储文字纹理存储至所述对应的纹理类型的纹理列表中。
进一步地,在本发明所述实施例中,由于在对各文字进行渲染时,针对任一文字,除了可生成与所述文字相对应的文字纹理之外,还可生成与所述文字相对应的文字信息,如所述文字的字体、字号、具体文字内容等属性信息,以便后续在电子地图上显示时使用,因此,相应地,所述文字纹理管理设备还可包括信息存储单元14:
所述信息存储单元14可用于在将所述待存储文字纹理存储至所述对应的纹理类型下的同时或之后,将所述待存储文字纹理对应的文字的文字信息存储至与所述待存储文字纹理对应的文字的字号相匹配的文字信息列表中。
具体地,与文字纹理的存储方式类似,在本发明所述实施例中,所述信息存储单元14可采用文字信息列表(也可称为文字信息链表)的形式对各文字的文字信息进行相应存储;并且,针对任一文字信息列表,所述文字信息列表通常可与一字号一一对应,即在本发明所述实施例中,任一字号均有一相应的文字信息列表与其相对应。再有,针对任一文字信息列表,所述文字 信息列表中的文字信息对应的文字或文字纹理在电子地图中的使用频率越高,所述文字信息在所述文字信息列表中的位置排序也可越靠前。也就是说,也可采用节点活跃度管理机制对存储的各文字信息进行相应管理,将活跃度高的文字信息常驻于文字信息列表前端,将活跃度不高的文字信息慢慢移至文字信息列表尾端直至移出列表,以达到高频使用的文字信息最大化的保存,低频使用的文字信息及时地回收、进而提高文字信息管理效果的目的。
另外需要说明的是,在本发明所述实施例中,各文字信息的存储空间大小间接受制于相应的文字纹理的存储空间的大小,即纹理个数上限值决定了其对应纹理类型下的所有字号的文字信息的个数上限。也就是说,针对任一纹理类型,与所述纹理类型对应的各字号相匹配的各文字信息列表的文字信息个数上限值之和通常可不大于所述纹理类型对应的纹理个数上限值。
另外,每一纹理类型下的每种字号的文字信息的个数也不固定,具体可由电子地图实际渲染过程中的各字号的使用频率来决定,本发明实施例对此不作赘述。
进一步地,所述文字纹理管理设备还可包括信息删除单元15:
所述信息删除单元15可用于在纹理存储单元13确定所述对应的纹理类型下存储的文字纹理的个数等于所述对应的纹理类型所对应的纹理个数上限值,且在将所述对应的纹理类型下的一使用频率低于设定阈值的已存储文字纹理删除的同时或之后,从与所述已存储文字纹理对应的文字的字号相匹配的文字信息列表中,将所述已存储文字纹理对应的文字的文字信息进行删除。
本发明实施例提供了一种文字纹理管理设备,在本发明实施例所述技术方案中,由于可根据纹理尺寸对各文字纹理进行分类并根据分类后所得到的各纹理类型对各文字纹理进行相应存储,并且,可根据用于存储各文字纹理的设备的硬件资源对各纹理类型对应的纹理个数上限值进行配置,其中,设备的硬件资源越多、对应的纹理尺寸越大的纹理类型的纹理个数上限值越大,因此,可在避免目前文字纹理管理中存在的纹理增删次数过多的基础上,达到合理利用设备存储空间的目的。
另外,由于在本发明实施例所述技术方案中,可通过相应的列表或链表来进行文字纹理或文字信息的存储,并且,针对任一列表,所述列表中的文字纹理或文字信息在电子地图中的使用频率越高,所述文字纹理或文字信息在所述列表中的位置排序越靠前,从而可在达到高频使用的文字纹理或文字信息最大化的保存、低频使用的文字纹理或文字信息及时地回收的基础上,达到提高存储空间管理的方便性以及快捷性、进而加快渲染过程的运行效率的目的。
本领域技术人员应明白,本发明的实施例可提供为方法、装置(设备)、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本发明是参照根据本发明实施例的方法、装置(设备)和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
尽管已描述了本发明的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。

Claims (16)

  1. 一种文字纹理管理方法,其特征在于,包括:
    针对电子地图渲染过程中产生的任一待存储文字纹理,根据所述待存储文字纹理的纹理尺寸以及预先配置的纹理尺寸与纹理类型的对应关系,确定所述待存储文字纹理对应的纹理类型;并
    在根据预先配置的纹理类型与纹理个数上限值的对应关系,确定所述对应的纹理类型下存储的文字纹理的个数小于所述对应的纹理类型所对应的纹理个数上限值时,将所述待存储文字纹理存储至所述对应的纹理类型下;
    其中,各纹理类型对应的纹理个数上限值是根据用于存储各文字纹理的设备的硬件资源预先配置的;并且,所述设备的硬件资源越多,对应的纹理尺寸越大的纹理类型所对应的纹理个数上限值越高。
  2. 如权利要求1所述的文字纹理管理方法,其特征在于,所述设备的硬件资源至少包括所述设备的像素取值和/或所述设备的显存取值;
    其中,所述设备的像素取值或所述设备的显存取值越大,对应的纹理尺寸越大的纹理类型所对应的纹理个数上限值越高。
  3. 如权利要求1或2所述的文字纹理管理方法,其特征在于,所述方法还包括:
    若确定所述对应的纹理类型下存储的文字纹理的个数等于所述对应的纹理类型所对应的纹理个数上限值,则在将所述对应的纹理类型下的一使用频率低于设定阈值的已存储文字纹理删除后,将所述待存储文字纹理存储至所述对应的纹理类型下。
  4. 如权利要求3所述的文字纹理管理方法,其特征在于,
    针对任一纹理类型,采用纹理列表的形式对存储至所述纹理类型下的各文字纹理进行存储;并且,
    针对任一纹理列表,所述纹理列表中的文字纹理的使用频率越高,所述文字纹理在所述纹理列表中的位置排序越靠前。
  5. 如权利要求4所述的文字纹理管理方法,其特征在于,在将所述对应的纹理类型下的一使用频率低于设定阈值的已存储文字纹理删除后,将所述待存储文字纹理存储至所述对应的纹理类型下,包括:
    在将所述对应的纹理类型的纹理列表中排序最后的一已存储文字纹理删除后,将所述待存储文字纹理存储至所述对应的纹理类型的纹理列表中。
  6. 如权利要求1所述的文字纹理管理方法,其特征在于,在将所述待存储文字纹理存储至所述对应的纹理类型下的同时或之后,所述方法还包括:
    将所述待存储文字纹理对应的文字的文字信息存储至与所述待存储文字纹理对应的文字的字号相匹配的文字信息列表中。
  7. 如权利要求3所述的文字纹理管理方法,其特征在于,在确定所述对应的纹理类型下存储的文字纹理的个数等于所述对应的纹理类型所对应的纹理个数上限值,且在将所述对应的纹理类型下的一使用频率低于设定阈值的已存储文字纹理删除的同时或之后,所述方法还包括:
    从与所述已存储文字纹理对应的文字的字号相匹配的文字信息列表中,将所述已存储文字纹理对应的文字的文字信息进行删除。
  8. 如权利要求7所述的文字纹理管理方法,其特征在于,
    针对任一纹理类型,所述纹理类型对应至少一个字号;且
    与所述纹理类型对应的各字号相匹配的各文字信息列表的文字信息个数上限值之和不大于所述纹理类型对应的纹理个数上限值。
  9. 一种文字纹理管理设备,其特征在于,包括:
    关系配置单元,用于预先配置纹理尺寸与纹理类型的对应关系,以及,纹理类型与纹理个数上限值的对应关系,其中,各纹理类型对应的纹理个数上限值是根据用于存储各文字纹理的设备的硬件资源预先配置的,并且,所述设备的硬件资源越多,对应的纹理尺寸越大的纹理类型所对应的纹理个数上限值越高;
    类型确定单元,用于针对电子地图渲染过程中产生的任一待存储文字纹理, 根据所述待存储文字纹理的纹理尺寸以及所述关系配置单元预先配置的纹理尺寸与纹理类型的对应关系,确定所述待存储文字纹理对应的纹理类型;
    纹理存储单元,用于在根据所述关系配置单元预先配置的纹理类型与纹理个数上限值的对应关系,确定所述对应的纹理类型下存储的文字纹理的个数小于所述对应的纹理类型所对应的纹理个数上限值时,将所述待存储文字纹理存储至所述对应的纹理类型下。
  10. 如权利要求9所述的文字纹理管理设备,其特征在于,所述设备的硬件资源至少包括所述设备的像素取值和/或所述设备的显存取值;
    其中,所述设备的像素取值或所述设备的显存取值越大,对应的纹理尺寸越大的纹理类型所对应的纹理个数上限值越高。
  11. 如权利要求9或10所述的文字纹理管理设备,其特征在于,
    所述纹理存储单元,还用于若确定所述对应的纹理类型下存储的文字纹理的个数等于所述对应的纹理类型所对应的纹理个数上限值,则在将所述对应的纹理类型下的一使用频率低于设定阈值的已存储文字纹理删除后,将所述待存储文字纹理存储至所述对应的纹理类型下。
  12. 如权利要求11所述的文字纹理管理设备,其特征在于,
    所述纹理存储单元,具体用于针对任一纹理类型,采用纹理列表的形式对存储至所述纹理类型下的各文字纹理进行存储;并且,
    针对任一纹理列表,所述纹理列表中的文字纹理的使用频率越高,所述文字纹理在所述纹理列表中的位置排序越靠前。
  13. 如权利要求12所述的文字纹理管理设备,其特征在于,
    所述纹理存储单元,具体用于若确定所述对应的纹理类型下存储的文字纹理的个数等于所述对应的纹理类型所对应的纹理个数上限值,则在将所述对应的纹理类型的纹理列表中排序最后的一已存储文字纹理删除后,将所述待存储文字纹理存储至所述对应的纹理类型的纹理列表中。
  14. 如权利要求9所述的文字纹理管理设备,其特征在于,所述文字纹理 管理设备还包括信息存储单元:
    所述信息存储单元,用于在将所述待存储文字纹理存储至所述对应的纹理类型下的同时或之后,将所述待存储文字纹理对应的文字的文字信息存储至与所述待存储文字纹理对应的文字的字号相匹配的文字信息列表中。
  15. 如权利要求11所述的文字纹理管理设备,其特征在于,所述文字纹理管理设备还包括信息删除单元:
    所述信息删除单元,用于在纹理存储单元确定所述对应的纹理类型下存储的文字纹理的个数等于所述对应的纹理类型所对应的纹理个数上限值,且在将所述对应的纹理类型下的一使用频率低于设定阈值的已存储文字纹理删除的同时或之后,从与所述已存储文字纹理对应的文字的字号相匹配的文字信息列表中,将所述已存储文字纹理对应的文字的文字信息进行删除。
  16. 如权利要求15所述的文字纹理管理设备,其特征在于,
    针对任一纹理类型,所述纹理类型对应至少一个字号;且
    与所述纹理类型对应的各字号相匹配的各文字信息列表的文字信息个数上限值之和不大于所述纹理类型对应的纹理个数上限值。
PCT/CN2014/089672 2014-04-29 2014-10-28 一种文字纹理管理方法及设备 WO2015165228A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410178599.8A CN105022758B (zh) 2014-04-29 2014-04-29 一种文字纹理管理方法及设备
CN201410178599.8 2014-04-29

Publications (1)

Publication Number Publication Date
WO2015165228A1 true WO2015165228A1 (zh) 2015-11-05

Family

ID=54358105

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/089672 WO2015165228A1 (zh) 2014-04-29 2014-10-28 一种文字纹理管理方法及设备

Country Status (2)

Country Link
CN (1) CN105022758B (zh)
WO (1) WO2015165228A1 (zh)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106683189B (zh) * 2016-11-29 2019-09-27 浙江科澜信息技术有限公司 一种在三维场景中渲染文字的方法
CN106776500A (zh) * 2016-12-12 2017-05-31 中国航空工业集团公司西安航空计算技术研究所 一种字库纹理数据管理方法
CN107221020B (zh) * 2017-05-27 2021-04-16 北京奇艺世纪科技有限公司 一种文字纹理绘制方法及装置
CN111402382B (zh) * 2020-03-18 2023-04-07 东南数字经济发展研究院 一种提升分层分块三维模型数据渲染效率的分类优化方法
CN111782311B (zh) * 2020-05-11 2023-01-10 完美世界(北京)软件科技发展有限公司 渲染方法、装置、设备和可读介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130002680A1 (en) * 2011-06-30 2013-01-03 Google Inc. Rendering a text image using texture map character center encoding with character reference encoding
WO2013020075A2 (en) * 2011-08-03 2013-02-07 Google Inc. Prominence-based generation and rendering of map features
CN103186919A (zh) * 2011-12-28 2013-07-03 腾讯科技(深圳)有限公司 一种文字渲染方法及装置

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4405223B2 (ja) * 2003-09-30 2010-01-27 株式会社キングジム 文字情報処理システム、文字情報処理装置及び文字情報処理プログラム
JP4321549B2 (ja) * 2005-09-28 2009-08-26 セイコーエプソン株式会社 文書作成システム、文書作成方法、プログラムおよび記憶媒体
CN101800043A (zh) * 2010-02-04 2010-08-11 华为终端有限公司 一种显示矢量字体的方法和终端

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130002680A1 (en) * 2011-06-30 2013-01-03 Google Inc. Rendering a text image using texture map character center encoding with character reference encoding
WO2013020075A2 (en) * 2011-08-03 2013-02-07 Google Inc. Prominence-based generation and rendering of map features
CN103186919A (zh) * 2011-12-28 2013-07-03 腾讯科技(深圳)有限公司 一种文字渲染方法及装置

Also Published As

Publication number Publication date
CN105022758A (zh) 2015-11-04
CN105022758B (zh) 2019-08-09

Similar Documents

Publication Publication Date Title
WO2015165228A1 (zh) 一种文字纹理管理方法及设备
JP6542909B2 (ja) ファイル操作方法及び装置
CN101833542B (zh) 一种用户界面字体渲染方法及装置
US20180027061A1 (en) Method and apparatus for elastically scaling virtual machine cluster
CN107392835B (zh) 一种粒子系统的处理方法及装置
CN109144652B (zh) 一种视图显示方法、装置、电子设备及存储介质
CN105205014A (zh) 一种数据存储方法和装置
US8751542B2 (en) Dynamically scalable modes
JP5427640B2 (ja) 決定木生成装置、決定木生成方法、及びプログラム
US20120151173A1 (en) Inheritance of growth patterns for derived tables
US20150227393A1 (en) Dynamic Resource Allocation in Mapreduce
CN112150023A (zh) 任务分配方法、装置及存储介质
CN110399096A (zh) 分布式文件系统元数据缓存重删的方法、装置以及设备
CN106293953B9 (zh) 一种访问共享显示数据的方法及系统
CN106570060B (zh) 一种信息流中数据的随机抽取方法及装置
CN109388615A (zh) 基于Spark的任务处理方法及系统
CN104050100B (zh) 一种适用于大数据环境的数据流存储管理方法及系统
CN110930056A (zh) 一种基于思维导图的任务管理方法、终端设备及存储介质
CN112541140A (zh) 一种列表加载方法、终端设备、电子设备及存储介质
CN113703678B (zh) 一种存储桶索引重分裂的方法、装置、设备和介质
CN108021448A (zh) 一种内核空间的优化方法及装置
CN111159480B (zh) 一种基于电网gis数据的图形绘制方法
CN112215778B (zh) 一种基于三级区域划分的图像修复方法
CN109726023B (zh) 一种支持多线程多上下文的图形任务同步管理方法
CN113268456A (zh) 一种文件处理方法、系统、设备及计算机可读存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14891011

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14891011

Country of ref document: EP

Kind code of ref document: A1