Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the invention, the technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that obtains under the creative work prerequisite.
A kind of electronic document display method that the embodiment of the invention provides, as shown in Figure 1, the method step comprises:
S101, loading electronic document.
S102, obtain the desired display complexity of display device.
This desired display complexity has reflected that the user uses the desired display speed of this display device, can be according to the performance parameter of display device etc., calculate with default computing method.
S103, obtain the demonstration complexity of electronic document under various display modes.
Electronic document has comprised multiple display unit, such as text, vector graphics, raster graphic etc.
Can according to display quality from high to low, plurality of display modes be set.In every kind of display mode, can according to the importance of various display units, determine the display mode of the various display units under each display mode.
Electronic document has reflected its display speed under various display modes in the demonstration complexity under the various display modes, can calculate according to the performance parameter of display device and the correlation parameter of the various display units of electronic document etc.Concrete, for example under a certain display mode, different display modes for various display units, calculate respectively the complexity of various display units under the display mode of correspondence, the complexity addition of all display units is just obtained the demonstration complexity of this electronic document under this display mode.
S104, according to the desired display complexity, from above-mentioned demonstration complexity, select the selected complexity that shows.
Concrete, can be from above-mentioned demonstration complexity, to select the selected complexity that shows of the conduct that equals the desired display complexity; Perhaps, from above-mentioned demonstration complexity, select less than and near the selected complexity that shows of the conduct of desired display complexity; Perhaps, if above-mentioned demonstration complexity all greater than the desired display complexity, the selected complexity that shows of the conduct of selective value minimum then.
S105, show this electronic document with selected display mode corresponding to complexity that show.
The electronic document display method that the embodiment of the invention provides, after loading electronic document, obtain the desired display complexity of display device and obtain the demonstration complexity of described electronic document under various display modes, afterwards, according to the desired display complexity, from show complexity, select the selected complexity that shows, show electronic document with this selected display mode corresponding to complexity that show again.Like this, because electronic document has been considered the display performance of display device in the process that shows, adopted suitable display mode, thereby can guarantee faster display speed.And the space of a whole page of electronic document is not done any change, can show according to the space of a whole page of former document, improved user's impression.
The electronic document display method that another embodiment of the present invention provides, electronic document as shown in Figure 2, comprising three display units: word segment display unit 201, image section display unit 202, gradual change partial display unit 203.The display packing step is as follows:
Step 1 sets in advance display mode as shown in Figure 3.
In Fig. 3, display mode divides according to display quality from high to low for four kinds of display modes, i.e. A, B, C, D.In every kind of display mode, the importance difference according to display unit is provided with different display modes again.Concrete: in display mode A, the word segment display unit shows with the T1 mode, and the image section display unit shows with the M1 mode, and gradual change partial display unit shows with the G1 mode; In display mode B, the word segment display unit shows with the T1 mode, and the image section display unit shows with the M1 mode, and gradual change partial display unit shows with the G2 mode; In display mode C, the word segment display unit shows with the T1 mode, and the image section display unit shows with the M2 mode, and gradual change partial display unit shows with the G2 mode; In display mode D, the word segment display unit shows with the T2 mode, and the image section display unit shows with the M2 mode, and gradual change partial display unit shows with the G2 mode.
Fig. 4 is the circular of complexity of T1, the T2 display mode of word segment display unit.
T1 is the reverse sawtooth flow display in Fig. 4, and its complexity calculating method is C * S
2* 50; T2 is non-flow display, and its complexity calculating method is C * S
2* 30.Wherein, C is character number, and S is font size.
Fig. 5 is the circular of complexity of M1, the M2 display mode of image section display unit.
M1 is that bilinear interpolation shows in Fig. 5, and its complexity calculating method is W * H * 200; M 2 is the demonstration of arest neighbors difference, and its complexity calculating method is W * H * 50.Wherein, W is picture traverse, and H is picture altitude.
Fig. 6 is the circular of complexity of G1, the G2 display mode of gradual change partial display unit.
G1 is that the interpolation calculation gradual change shows in Fig. 6, and its complexity calculating method is W ' * H ' * 400; G 2 fills with Neutral colour to show, its complexity calculating method is W ' * H ' * 10.Wherein, W ' is the gradual change width, and H ' is the gradual change height.
Need to prove, the present embodiment just illustrates in these used computing method that each shows complexity, the embodiment of the invention is not restricted to this, other computing method also can, for example can take the display quality grade as parameter, calculate the complexity of various display units etc. with computing method.And the correlation parameter of display unit also is not limited to this, can also be other correlation parameters.In addition, calculate the complexity of display unit can also be further with reference to the performance parameter of display device etc.
Step 2 loads electronic document shown in Figure 2.
Then, obtain the desired display complexity of display device.In the present embodiment, the computing method of desired display complexity are F * T, and wherein, F is the CPU frequency of display device, and T is the page displaying time of expectation.In the present embodiment, suppose that CPU frequency is 300MHz (F), the page displaying time of expectation is 50 milliseconds (T), and the desired display complexity of the display device that then gets access to is F * T=15,000,000.
Need to prove, the present embodiment just illustrates at this used desired display complexity calculating method, and the embodiment of the invention is not restricted to this, and other computing method also can.And the performance parameter of display device also is not limited to this, can be the various parameters of reflection expense operation time.
Step 3 is obtained the demonstration complexity of electronic document under various display modes.
Concrete, at first get access to the correlation parameter of the various display units of electronic document, in the present embodiment, the character number of word segment display unit 201 is 84 (C), font size is 36 pixels (S); The display width of image section display unit 202 is 250 pixels (W), shows highly be 150 pixels (H); The display width of gradual change partial display unit 203 is 500 pixels (W '), shows highly be 40 pixels (H ').
Then, calculate the complexity of various display units under various display modes according to Fig. 3 to Fig. 6, and the demonstration complexity of electronic document under various display modes, as shown in Figure 7.Wherein, the demonstration complexity of electronic document is the complexity sum of all display units under this display mode.
Step 4 according to desired display complexity 15,000,000, is selected the selected complexity that shows from showing in the complexity 20,943,200,13,143,200,7,518,200,5,340,920.Concrete, can be according to display quality A, B from high to low, the order of C, D, one by one the demonstration complexity of the electronic document that calculates is compared with the desired display complexity, in the present embodiment, with less than and near the desired display complexity as the selected complexity that shows.Can obviously find out 13,143 from Fig. 7,200 meet the requirements.
Selecting by this way the selected complexity that shows in the present embodiment, is under the prerequisite that shows with fast speed, guarantees to greatest extent display quality.
Step 5 shows electronic document with the selected B display mode of complexity 13,143,200 correspondences that shows.The word segment display unit 201 that is electronic document adopts T1 reverse sawtooth flow display mode to show, image section display unit 202 adopts the bilinear interpolation mode to show, gradual change partial display unit 203 adopts the Neutral colour filling mode to show.
Like this, final display effect shows with better quality important writings and image part, relatively unessential gradual change is partly used than inferior quality show, makes the reader under the prerequisite that reaches desired display speed, reads maximum quantity of information.
In addition, owing to the embodiment of the invention is not set type again to the content of the page, thereby kept the whole structure of original space of a whole page.
The display processing unit 80 that the embodiment of the invention provides as shown in Figure 8, comprising:
Loading unit 801 is used for loading electronic document;
The first acquiring unit 802 is for the desired display complexity of obtaining display device;
Second acquisition unit 803 is used for obtaining the demonstration complexity of this electronic document under various display modes;
Selected cell 804 is used for according to the desired display complexity, selects the selected complexity that shows from show complexity;
Display unit 805 is used for showing electronic document with this selected display mode corresponding to complexity that show.
The display processing unit that the embodiment of the invention provides, after loading electronic document, obtain the desired display complexity of display device and obtain the demonstration complexity of described electronic document under various display modes, afterwards, according to the desired display complexity, from show complexity, select the selected complexity that shows, show electronic document with this selected display mode corresponding to complexity that show again.Like this, because electronic document has been considered the display performance of display device in the process that shows, adopted suitable display mode, thereby can guarantee faster display speed.And the space of a whole page of electronic document is not done any change, can show according to the space of a whole page of former document, improved user's impression.
Further, as shown in Figure 9, this first acquiring unit 802 comprises:
Display device parameter acquisition module 8021 is for the performance parameter of obtaining display device;
Desired display complexity computing module 8022 is for the desired display complexity that calculates this display device according to the performance parameter of display device.
This second acquisition unit 803 comprises:
Display unit acquisition module 8031 is for the correlation parameter of the various display units that obtain electronic document;
Show complexity computing unit 8032, be used for calculating the demonstration complexity of electronic document under various display modes according to the correlation parameter of various display units.
Here, show that complexity computing unit 8032 can also further utilize the performance parameter of the display device that display device parameter acquisition module 8021 obtains to calculate the demonstration complexity of electronic document under various display modes.
One of ordinary skill in the art will appreciate that: all or part of step that realizes said method embodiment can be finished by the relevant hardware of programmed instruction, aforesaid program can be stored in the computer read/write memory medium, this program is carried out the step that comprises said method embodiment when carrying out; And aforesaid storage medium comprises: the various media that can be program code stored such as ROM, RAM, magnetic disc or CD.
The above; be the specific embodiment of the present invention only, but protection scope of the present invention is not limited to this, anyly is familiar with those skilled in the art in the technical scope that the present invention discloses; can expect easily changing or replacing, all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection domain of described claim.