Summary of the invention
For the word indistinguishable that shows or eye-catching not problem, the invention provides a kind of character displaying method and device, to address the above problem at least under bright and colourful background colour.
According to an aspect of the present invention, provide a kind of character displaying method, having comprised: obtained the background color contrast that is used for the zone of display text in electric terminal; Calculate the text color contrast with background color contrast coupling; Use text color contrast display text.
Preferably, before obtaining the background color contrast in the zone that is used for display text in electric terminal, also comprise: whether the background color that judgement is used for the zone of display text changes in the display text process; If background color changes in the display text process, the contrast of background extraction color from the display buffer of electric terminal; If background color does not change, continue to use the contrast of last time background extraction color from the display buffer of electric terminal in the display text process.
Preferably, whether the judgement background color that is used for the zone of display text changes in the display text process and comprises: detect the operation whether user arranges background; If so, the background color that is identified for the zone of display text changes in the display text process.
Preferably, obtaining the background color contrast that is used for the zone of display text in electric terminal comprises: use twice rectangle superposition algorithm to calculate the background color contrast, wherein, twice rectangle superposition algorithm comprises: obtain two rectangles in the zone that is used for display text, and calculate respectively the color contrast of two rectangles; The color contrast of two rectangles is carried out the rectangle stack by Fourier transform, obtain the background color contrast.
Preferably, calculating the text color contrast of mating with the background color contrast comprises: the background color contrast according to the predetermined value negate, is obtained the text color contrast.
Preferably, the background color contrast according to the predetermined value negate, is obtained the text color contrast and comprises: calculate in such a way the text color contrast: the text color contrast equals the poor of predetermined value and background color contrast.
According to a further aspect in the invention, provide a kind of character display apparatus, having comprised: the first acquisition module is used for obtaining the background color contrast that electric terminal is used for the zone of display text; Computing module is used for calculating the text color contrast of mating with the background color contrast; Display module is used for using text color contrast display text.
Preferably, said apparatus also comprises: judge module is used for judging whether the background color in the zone that is used for display text changes in the display text process; The second acquisition module is used for when judgment result is that of judge module is the contrast of background extraction color from the display buffer of electric terminal; The 3rd acquisition module is used at judge module when the determination result is NO, continue to use last from the display buffer of electric terminal the contrast of background extraction color.
Preferably, above-mentioned the first acquisition module comprises: the superposition calculation unit is used for using twice rectangle superposition algorithm to calculate the background color contrast, wherein, twice rectangle superposition algorithm comprises: obtain two rectangles in the zone that is used for display text, and calculate respectively the color contrast of two rectangles; The color contrast of two rectangles is carried out the rectangle stack by Fourier transform, obtain the background color contrast.
Preferably, above-mentioned computing module comprises: the negate unit is used for the background color contrast obtaining the text color contrast according to the predetermined value negate.
By the present invention, the background color contrast in the zone of display text is obtained in employing, then calculate with the text color contrast of this background color contrast coupling and in the mode of this word color contrast display text, the word indistinguishable or the eye-catching not problem that show have been solved under bright and colourful background colour, and then make the color contrast of the font that demonstrates and background more clear, improved user experience.
Embodiment
Hereinafter also describe in conjunction with the embodiments the present invention in detail with reference to accompanying drawing.Need to prove, in the situation that do not conflict, embodiment and the feature in embodiment in the application can make up mutually.
Consider the word indistinguishable or the eye-catching not problem that show at present under bright and colourful background colour, the present embodiment provides a kind of character displaying method, so that make the color contrast of font and background more clear under the prerequisite of the overall aesthetics that does not affect background picture.Fig. 1 is the process flow diagram according to the character displaying method of the embodiment of the present invention, and as shown in Figure 1, the method comprises the following steps:
Step S102 obtains the background color contrast that is used for the zone of display text in electric terminal;
Step S104 calculates the text color contrast with this background color contrast coupling;
Step S106 uses this word color contrast display text.
The present embodiment passes through said method, the background color contrast in the zone of display text is obtained in employing, then calculate with the text color contrast of this background color contrast coupling and in the mode of this word color contrast display text, under the prerequisite that does not change background picture, the word and the background color that demonstrate are complementary, thereby the word indistinguishable or the eye-catching not problem that show have been solved under bright and colourful background colour, and then make the color contrast of the font that demonstrates and background more clear, improved user experience.
Consider in the process according to the method display text of the present embodiment, change if be used for the background color in the zone of display text, can cause the text effects that finally demonstrates not good.So, for the method that makes the present embodiment can be applicable to the situation that background color changes in the display text process, be used for the background color contrast in zone of display text in obtaining electric terminal before, can also comprise: whether the background color that judgement is used for the zone of display text changes in the display text process; If background color changes in the display text process, the contrast of background extraction color from the display buffer of electric terminal; If background color does not change, continue to use the contrast of last time background extraction color from the display buffer of electric terminal in the display text process.Can make the color contrast of the font that demonstrates and background more clear in the situation that the background color in the zone of display text changes in this way, enlarge the scope of application of scheme.
Judgement is used for mode that whether background color in the zone of display text change in the display text process to be had a variety ofly, provides a kind of easier judgment mode in the present embodiment: detect the operation whether user arranges background; If so, the background color that is identified for the zone of display text changes in the display text process.This mode accuracy of judgement and simple.
Usually, can be directly the background color in the zone that is used for display text that gets be calculated this regional background color contrast, but for the background color contrast that makes the zone that is used for display text in the electric terminal that gets is more accurate, can use twice rectangle superposition algorithm to calculate the background color contrast.Wherein, twice rectangle superposition algorithm can comprise: obtain two rectangles in the zone that is used for display text, and calculate respectively the color contrast of two rectangles; The color contrast of two rectangles is carried out the rectangle stack by Fourier transform, obtain the background color contrast.Wherein, the position of two rectangles only need to satisfy that two rectangles can intersect and the zone of intersecting is that the viewing area gets final product, and when two rectangles were chosen, the size of two rectangles can be respectively 2 times of size in display text zone.The background color contrast that obtains in this way is more accurate, and then it is better to use the display effect of the text color contrast display text that this background color contrast calculates.
The mode of calculating the text color contrast of mating with the background color contrast has a lot, for example, with the negative of background color contrast as the text color contrast, perhaps with after background color contrast and designated value addition as the text color contrast, provide the mode of the text color contrast of the better calculating of a kind of effect and background color contrast coupling in the present embodiment: the background color contrast according to the predetermined value negate, is obtained the text color contrast.Wherein, with the background color contrast according to the predetermined value negate, obtaining the text color contrast comprises: calculate in such a way the text color contrast: the text color contrast equals the poor of predetermined value and background color contrast, for example, the maximal value that contrast is set is 65535, text color contrast=65535-background color contrast.
Corresponding to said method, the present embodiment also provides a kind of character display apparatus, Fig. 2 is the structured flowchart according to the character display apparatus of the embodiment of the present invention, and as shown in Figure 2, this device comprises: the first acquisition module 22, computing module 24 and display module 26.Wherein, the first acquisition module 22 is used for obtaining the background color contrast that electric terminal is used for the zone of display text; Computing module 24 is coupled with the first acquisition module 22, is used for calculating the text color contrast of the background color contrast coupling that gets with above-mentioned the first acquisition module 22; Display module 26 is coupled with computing module 24, is used for the text color contrast display text that uses above-mentioned computing module 24 to calculate.
the present embodiment passes through said apparatus, obtain the background color contrast in the zone of display text by the first acquisition module 22, computing module 24 calculates the text color contrast with this background color contrast coupling, display module 26 is in the mode of this word color contrast display text, under the prerequisite that does not change background picture, the word and the background color that demonstrate are complementary, thereby the word indistinguishable or the eye-catching not problem that show have been solved under bright and colourful background colour, and then make the color contrast of the font that demonstrates and background more clear, improved user experience.
Fig. 3 is that as shown in Figure 3, this device also comprises according to the structured flowchart of the first preferred character display apparatus of the embodiment of the present invention: judge module 32 is used for judging whether the background color in the zone that is used for display text changes in the display text process; The second acquisition module 34 is coupled with judge module 32 and the first acquisition module 22, is used for when judgment result is that of judge module 32 is the contrast of background extraction color from the display buffer of electric terminal; The 3rd acquisition module 36 is coupled with judge module 32 and the first acquisition module 22, is used at judge module 32 when the determination result is NO, continue to use last from the display buffer of electric terminal the contrast of background extraction color.
Fig. 4 is the structured flowchart according to the second preferred character display apparatus of the embodiment of the present invention, as shown in Figure 4, above-mentioned the first acquisition module 22 comprises: superposition calculation unit 222, be used for using twice rectangle superposition algorithm to calculate the background color contrast, wherein, twice rectangle superposition algorithm can comprise: obtain two rectangles in the zone that is used for display text, and calculate respectively the color contrast of two rectangles; The color contrast of two rectangles is carried out the rectangle stack by Fourier transform, obtain the background color contrast.
Fig. 5 is the structured flowchart according to the 3rd preferred character display apparatus of the embodiment of the present invention, and as shown in Figure 5, above-mentioned computing module 24 comprises: negate unit 242 is used for the background color contrast obtaining the text color contrast according to the predetermined value negate.
Describe below in conjunction with a preferred embodiment, the preferred embodiment combines above-described embodiment and preferred implementation.
A kind of method that background colour extracts automatically and font shows is provided in this preferred embodiment, the method can be applied to have in any electric terminal of display, for example, can be for LCDs (Liquid Crystal Display, referred to as LCD) portable electric terminal, below in conjunction with accompanying drawing, this preferred embodiment is described in detail further.
Fig. 6 is the process flow diagram of the core algorithm of font display packing according to the preferred embodiment of the invention, and as shown in Figure 6, the method comprises the following steps:
Step S601 judges whether background colour changes, and if so, enters step S602, otherwise enters step S603.
Step S602, if background colour changes, for example, the user is by arranging the operations such as background, the theme background that causes showing changes, and first obtains twice rectangle superposition value in this zone from the display buffer of equipment, changes step S604 over to.
Wherein, the display buffer of the said equipment refers to that the data that will show output to the buffer memory district of display device.
Step S603, if background colour does not change, bottom the character area that namely needs to show, background color can not change in the process of display font, in zone that will display text, adopt the rectangle superposition algorithm twice, background is calculated in the background color contrast of the part of this twice stack, changed over to step S604, if algorithm superimposed anomaly this flow process finish.
For example, twice above-mentioned rectangle superposition algorithm can be: at first, for the zone that needs display text, obtain two rectangles, wherein, the common factor of two rectangles is just in time the zone that will show; Secondly, respectively color contrast is asked in two rectangular areas; Then, by the stack of Fourier's rectangle, obtain the color contrast value of occuring simultaneously in two rectangular areas.
Step S604 carries out negate with the background color contrast value that calculates, and (for example obtains corresponding correlative value, the maximal value of contrast can be defined as 65535, the interval is 0-65535, if the contrast value that obtains is 628, first it is scaled 16 systems, be 0x274, according to each byte negate, obtain 0xFC8B respectively, be scaled the decimal system, be 64651), change step S605 over to, if negate extremely this flow process finish.
Step S605, in display text, the correlative value that step S604 negate obtains is set to text color, changes step S606 over to, if arrange extremely this flow process finishes.
Step S606 refreshes display text, if refresh extremely this flow process finishes.
Compare with the method that shows after the normally used cutting of industry viewing area, local special processing to background theme, the method that the background colour that this preferred embodiment provides extracts and font shows can be extracted background colour automatically, and calculate the color of the word that will show according to the background colour contrast of extracting, thereby the color contrast of the font of making and background is more clear, gives user's visual experience more attractive in appearance.
Fig. 7 is the schematic diagram of LCD displaying contents according to the preferred embodiment of the invention, as shown in Figure 7, LCD or other device display area can be divided into a plurality of viewing areas such as A, B, C, D, E, the color contrast of each viewing area may be different, if at a plurality of correct display texts in viewing area such as A, B, C, D, E, need the color contrast of background extraction.
Fig. 8 is the schematic diagram of LCD display part according to the preferred embodiment of the invention, and as shown in Figure 8, whole LCD shows or the viewing area of other display equipment.Fig. 9 is the schematic diagram of each viewing area according to the preferred embodiment of the invention, as shown in Figure 9, certain zone that is illustrated in LCD or other display equipment is divided into a plurality of zones such as A, B, C, D, E again, namely, be in the single viewing area of separating, it is split new a plurality of viewing areas again, progressively carry out refinement, by the stack of rectangle, the color contrast of the background that gets will be more accurately reliable.
Can find out in sum, the invention solves the word indistinguishable or the eye-catching not problem that show under bright and colourful background colour, and then make the color contrast of the font that demonstrates and background more clear, improve user experience.
obviously, those skilled in the art should be understood that, above-mentioned each module of the present invention or each step can realize with general calculation element, they can concentrate on single calculation element, perhaps be distributed on the network that a plurality of calculation elements form, alternatively, they can be realized with the executable program code of calculation element, thereby, they can be stored in memory storage and be carried out by calculation element, and in some cases, can carry out step shown or that describe with the order that is different from herein, perhaps they are made into respectively each integrated circuit modules, perhaps a plurality of modules in them or step being made into the single integrated circuit module realizes.Like this, the present invention is not restricted to any specific hardware and software combination.
The above is only the preferred embodiments of the present invention, is not limited to the present invention, and for a person skilled in the art, the present invention can have various modifications and variations.Within the spirit and principles in the present invention all, any modification of doing, be equal to replacement, improvement etc., within all should being included in protection scope of the present invention.