CN101661738B - Electronic device and anti-aliasing processing method thereof - Google Patents

Electronic device and anti-aliasing processing method thereof Download PDF

Info

Publication number
CN101661738B
CN101661738B CN200910174613.6A CN200910174613A CN101661738B CN 101661738 B CN101661738 B CN 101661738B CN 200910174613 A CN200910174613 A CN 200910174613A CN 101661738 B CN101661738 B CN 101661738B
Authority
CN
China
Prior art keywords
pixel
sequence valve
gradually
layer
exponent number
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN200910174613.6A
Other languages
Chinese (zh)
Other versions
CN101661738A (en
Inventor
陈晓娟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Via Technologies Inc
Original Assignee
Via Technologies Inc
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 Via Technologies Inc filed Critical Via Technologies Inc
Priority to CN200910174613.6A priority Critical patent/CN101661738B/en
Publication of CN101661738A publication Critical patent/CN101661738A/en
Application granted granted Critical
Publication of CN101661738B publication Critical patent/CN101661738B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Generation (AREA)

Abstract

The invention provides an electronic device and an anti-aliasing processing method thereof. The method comprises the following steps: assigning a current pixel in the first memory area which stores a plurality of pixels; using the current pixel as the centre to execute a judgment program separately in the first direction, the second direction, the third direction and the fourth direction to judge whether aliasing exists in any direction; executing a calculation program in each aliasing-containing direction to calculate the order of the gradation; according to the order of the gradation of each aliasing-containing direction and the preset conditions, determining whether the aliasing-containing direction is needed to perform anti-aliasing processing; and performing anti-aliasing processing according to the order of the gradation in each direction which is needed to perform anti-aliasing processing. The device and the method of the invention can be used to generate smooth and beautiful electronic maps and has the advantage of saving the computing resource and the memory.

Description

Electronic installation and its anti-aliasing processing method
Technical field
The present invention is relevant for a kind of electronic installation and its reverse sawtooth (anti-aliasing) disposal route, and is particularly to a kind of anti-aliasing processing method carrying out according to the sequence valve of pixel (pixel) color.
Background technology
The mobile device with navigation feature is very universal, and the emphasis of navigation feature is to draw electronic chart to watch for user.This kind of map, mostly with regions such as For Polygons Representation park schools, represents road with polygon line segment, wherein has the sideline at oblique angle can on picture, present zigzag.Reverse sawtooth treatment technology can pass through computing, in above-mentioned sideline, adds gradual layer color, makes polygon line segment and polygon on map picture seem smoother, makes map more attractive in appearance.
Processor (processor) efficiency of general mobile device is not high, and memory span is limited, and the operating system of using does not directly provide the function support of reverse sawtooth.The reverse sawtooth calculation method existing at present, if not consuming time, take exactly more memory resource, cannot have two advantages that save time and economize storer simultaneously.
For example, over-extraction sample reverse sawtooth algorithm (super-samplinganti-aliasing) is map painting canvas (canvas) to be expanded to n * n times of size of original painting canvas, all object sizes and line width must, with n times of calculating and plotting, narrow down to original size by the painting canvas of expansion via computing after having drawn again.This algorithm can consume a large amount of computings and memory resource.
Some ready-made function library (library), anti-particle geometric function library (the Anti-Grain Geometry Library of open source (open source) for example, hereinafter to be referred as AGG function library) can in drawing, carry out reverse sawtooth processing, the image of drawing out has had smooth effect.Because AGG function library is not to aim at the function library that mobile operating system is developed, although effect is very good, quite expend calculation resources.
Summary of the invention
The invention provides a kind of anti-aliasing processing method, the method provides a kind of compute mode of comparatively saving computational resource and memory resource, can make the map of mobile device present more attractive in appearance.
The present invention separately provides a kind of electronic installation, carries out above-mentioned anti-aliasing processing method, can make map show smoothly attractive in appearance, not only saves computational resource, also can save storer.
The present invention proposes a kind of anti-aliasing processing method, comprises the following steps.In the first memory block that stores a plurality of pixels, specify current pixel.Centered by current pixel, in first direction, second direction, third direction and fourth direction, carry out determining program respectively, to judge whether each above-mentioned direction has sawtooth.In serrate each above-mentioned direction, carry out calculation procedure, to calculate its gradually layer exponent number.According to the gradually layer exponent number and pre-conditioned of serrate each above-mentioned direction, determine whether serrate each above-mentioned direction needs reverse sawtooth to process.And in each the above-mentioned direction that needs reverse sawtooth to process, according to layer exponent number gradually, carry out gradually the layer program of tinting, to carry out reverse sawtooth processing.
A kind of electronic installation of the another proposition of the present invention, comprises the first memory block and processor.The first memory block stores a plurality of pixels.Processor couples the first memory block, in the first memory block, specifies current pixel, and centered by current pixel, carries out determining program respectively, to determine whether each above-mentioned direction has sawtooth in first direction, second direction, third direction and fourth direction.Processor is also carried out calculation procedure in serrate each above-mentioned direction, to calculate its gradually layer exponent number.In addition, whether processor needs reverse sawtooth to process according to the gradually layer exponent number of serrate each above-mentioned direction and serrate each the above-mentioned direction of pre-conditioned decision, and in each the above-mentioned direction that needs reverse sawtooth to process, according to layer exponent number gradually, carry out gradually the layer program of tinting, to carry out reverse sawtooth processing.
Based on above-mentioned, the present invention uses simple and effective algorithm, and utilizes the color priority of map making to carry out reverse sawtooth processing, can produce level and smooth electronic chart attractive in appearance, and has the advantage of saving computational resource and storer concurrently.
Accompanying drawing explanation
Fig. 1 is the calcspar according to a kind of electronic installation of one embodiment of the invention.
Fig. 2 illustrates the memory block 130 of Fig. 1 and 140 stored contents.
Fig. 3 is the pixel relative position schematic diagram according to one embodiment of the invention.
Fig. 4 is the process flow diagram according to a kind of method for drawing map of one embodiment of the invention.
Fig. 5 is the process flow diagram of step 450 in Fig. 4.
Fig. 6 is the process flow diagram of step 550 in Fig. 5.
Fig. 7, Fig. 8 A, Fig. 8 B, Fig. 9 A and Fig. 9 B are the schematic diagram of processing according to the reverse sawtooth of one embodiment of the invention.
Figure 10 and Figure 11 are the effect schematic diagram of processing according to the reverse sawtooth of one embodiment of the invention.
Embodiment
For above-mentioned feature and advantage of the present invention can be become apparent, special embodiment below, and coordinate appended graphic being described in detail below.
Fig. 1 is the calcspar according to a kind of electronic installation 100 of one embodiment of the invention.Electronic installation 100 comprises display 110, processor 120, memory block 130 and memory block 140.Wherein memory block 130 and 140 can belong to same storer, also can belong to different storeies.Processor 120 is coupled between display 110 and memory block 130,140, is responsible for drawing electronic chart, and electronic chart is made to reverse sawtooth and process.Memory block 130 stored electrons maps, the namely color value of each pixel of stored electrons map.The corresponding sequence valve of color value (details aftermentioned) of each pixel of the 140 stored electrons maps in memory block.Display 110 is responsible for showing the electronic chart of processing through reverse sawtooth.The electronic installation 100 of one embodiment of the invention can be automobile navigation apparatus, mobile phone, personal digital assistant or other Portable mobile devices with electronic map function.
Fig. 4 is the process step that the processor 120 of the present embodiment is drawn electronic chart.The drafting of electronic chart has a default priority.First, draw ocean (step 410).Then draw the urban area (step 420) in Taipei, Taibei city and so on.Then draw the polygonal regions (step 430) such as school, park.Then draw the polygon line segment (step 440) of road, this class of railway.The polygon and the polygon line segment that at this time need reverse sawtooth to process have all completed drafting, are exactly next that reverse sawtooth is processed (step 450).And then drafting does not need sight spot small icons (step 460) and sight spot and the road name (step 470) of reverse sawtooth processing.Then processor 120 can be controlled display 110, the map that its demonstration is completed.
In the flow process of Fig. 4, for example each landform of ocean, park, road and so on must be used unique unduplicated color to draw, and could when reverse sawtooth is processed, correctly judge colour superimposition situation.Drawing order from various landform in Fig. 4 flow process, can draw the drafting priority of the corresponding color value of various landform.The present embodiment is all colours using drawing electronic chart, according to the priority of drawing, from 1 open numbering, and obtains the sequence valve of all colours.The corresponding sequence valve of more preferential color value is lower, and sequence valve 1 i.e. correspondence is plotted in the color on electronic chart at first.The electronic chart of the present embodiment is 130 to draw in memory block, and memory block 130 stores the color value of each pixel that forms maps, 140 of the memory blocks corresponding sequence valve of color that stores each above-mentioned pixel.
Fig. 5 is the process flow diagram of step 450 in Fig. 4 flow process, namely the process flow diagram of the performed anti-aliasing processing method of processor 120.When step 440 completes, the electronic chart that needs reverse sawtooth to process is stored in memory block 130, and memory block 140 there is no data.First step of Fig. 5 flow process, sequence valve corresponding to the color value of each pixel of memory block 130 converts to exactly, is stored in the correspondence position (step 510) of memory block 140.In other steps of Fig. 5, if processor 120 needs the sequence valve of certain pixel, just directly from memory block, 140 read, can save the time that color value is converted to sequence valve like this.
Fig. 2 is an example of step 510, and memory block 130 and 140 each grid wherein represents a pixel.The electronic chart of supposing this example only has 3 * 3 sizes, and only has black-and-white two color.The sequence valve of white and black is respectively 1 and 2, and namely white background is preferentially drawn, and then just draws black line segment.As shown in Figure 2, memory block 130 stores the color value of white and black, 140 of the memory blocks sequence valve 1 and 2 storing after conversion.
The anti-aliasing processing method of the present embodiment is that each pixel of memory block 130 is processed one by one according to preset order.This preset order can be from top to bottom, by left-to-right, can be also other orders, as long as each pixel that comprises memory block 130.After setting up the content of memory block 140, processor 120 specifies first to carry out the current pixel (step 520) of reverse sawtooth processing according to aforesaid preset order.Then centered by current pixel, in the upper and lower, left and right of current pixel, this four direction is carried out determining program respectively, to judge whether each above-mentioned direction has sawtooth (step 530).
In the present embodiment, the determining program full symmetric that this four direction is carried out in upper and lower, left and right, take top below as example, and the details of determining program is described.Fig. 3 is the pixel relative position schematic diagram of the present embodiment, and the P0 of central authorities represents current pixel, namely the center of the anti-aliasing processing method of the present embodiment.First, above current pixel, specify the first pixel, the second pixel and the 3rd pixel.Wherein the second pixel is current pixel neighbor (the namely P2 of Fig. 3) up, the first pixel and the 3rd pixel be respectively current pixel with above be 45 degree angles both direction on two neighbors (the namely P1 of Fig. 3 and P3).If the sequence valve of the first pixel and/or the 3rd pixel equals the sequence valve of current pixel, and the sequence valve of current pixel is greater than the sequence valve of the second pixel, and there is sawtooth judgement top.
If at the above-mentioned determining program of the right-hand execution of current pixel, the first pixel, the second pixel and the 3rd pixel are respectively P3, P6 and P9.If carry out determining program below current pixel, the first pixel, the second pixel and the 3rd pixel are respectively P9, P8 and P7.If the left at current pixel is carried out determining program, the first pixel, the second pixel and the 3rd pixel are respectively P7, P4 and P1.Whether serrate the determining program that judges all directions condition and top be identical, and it will not go into details.
After judging whether all directions have sawtooth, next step is to carry out calculation procedure in serrate each direction, to calculate the gradually layer exponent number (step 540) of all directions.In the present embodiment, the calculation procedure that this four direction is carried out in upper and lower, left and right is also full symmetric.Take right-hand is example, as follows in the calculation procedure details of right-hand execution.
First, the sequence valve that compares the first pixel (P3), the 3rd pixel (P9) and current pixel (P0).If only there is the sequence valve of the first pixel (P3) identical with the sequence valve of current pixel (P0),, from the first pixel (P3), along right-hand calculating, there is the contiguous pixels length of same color value, as right-hand gradually layer exponent number.Take Fig. 7 as example, if 702 are current pixels, from its first pixel 704, start along right-hand calculating, only have a pixel that color is identical, namely 704 itself.So in the example of Fig. 7, right-hand gradually layer exponent number is 1.
On the other hand, if only there is the sequence valve of the 3rd pixel (P9) identical with the sequence valve of current pixel (P0),, from the 3rd pixel (P9), along right-hand calculating, there is the contiguous pixels length of same color value, as right-hand gradually layer exponent number.Take Fig. 8 A as example, if 802 are current pixels, from its 3rd pixel 804, start along right-hand calculating, have three pixels that color is identical.So in this example, right-hand gradually layer exponent number is 3.If the 806th, current pixel, starts along right-hand calculating from its 3rd pixel 808, has four pixels that color is identical.So in this example, right-hand gradually layer exponent number is 4.
On the other hand, if the sequence valve of the first pixel (P3) and the 3rd pixel (P9) is all identical with the sequence valve of current pixel (P0), calculate respectively in the above described manner the contiguous pixels length with same color value of the first pixel (P3) and the 3rd pixel (P9), and get shorter one wherein as right-hand gradually layer exponent number.
In the present embodiment, the calculation procedure of carrying out in its excess-three direction and right-hand calculation procedure full symmetric, its details can be analogized and obtain from right-hand calculation procedure, and therefore it will not go into details.
After calculating the gradually layer exponent number of all directions, next step is the gradually layer exponent number and pre-conditioned according to all directions, determines whether all directions need reverse sawtooth to process (step 550).Fig. 6 is above-mentioned pre-conditioned detailed process.First, check pre-conditioned judged direction (step 610).If above or below, just check whether the gradually layer exponent number of this direction is less than default constant (step 620).The default constant of the present embodiment is 2.If the gradually layer exponent number of this direction is less than default constant, determines that this direction does not need reverse sawtooth to process (step 630), otherwise determine that this direction needs reverse sawtooth to process (step 640).
Next, getting back to step 610, is right-hand or left if pre-conditioned judged, just checks whether a gradually layer exponent number for this direction is less than default constant (step 650).If the gradually layer exponent number of this direction is less than default constant, above or below just checking, whether there is the gradually layer exponent number (step 660) that is more than or equal to default constant.If so, determine that this direction does not need reverse sawtooth to process (step 670), otherwise determine that this direction needs reverse sawtooth to process (step 680).In addition,, in the inspection of step 650, if the gradually layer exponent number of this direction is more than or equal to default constant, just determine that this direction needs reverse sawtooth to process (step 680).
In the flow process of Fig. 6, above-below direction and left and right directions can be exchanged, the flow process after exchange also can be carried out correct reverse sawtooth and be processed.
Determine whether all directions need after reverse sawtooth processes, and next step is in each direction that needs reverse sawtooth to process, according to its gradually layer exponent number carry out gradually the layer program of tinting, to carry out reverse sawtooth processing (step 560).The so-called gradually layer program of tinting is to tint in the direction of program carrying out layer gradually, at the neighbor of current pixel, inserts respectively the gradual layer color value between the color value of each above-mentioned neighbor and the color value of current pixel.Wherein, the neighbor quantity of inserting gradual layer color value equals to carry out tint the gradually layer exponent number of direction of program of layer gradually.That is to say, tint in the direction of program carrying out layer gradually, from the next pixel of this current pixel, until n pixel all needs to insert corresponding gradual layer color value, n is for carrying out tint the gradually layer exponent number of direction of program of layer gradually.The proportion of the color value of current pixel in above-mentioned gradual layer color value is inverse ratio with corresponding neighbor and the distance of current pixel.
After the reverse sawtooth that completes current pixel is processed, whether processor 120 checks all pixels of memory block 130 be all disposed (step 570).If so, flow process so far finishes.If also have pixel untreated, processor 120 can be specified next current pixel (step 580) according to above-mentioned preset order, then gets back to step 530, and next current pixel is carried out to reverse sawtooth processing.
Take Fig. 7 as example, known according to the flow process of Fig. 6, when current pixel is 702, the left and the right-hand reverse sawtooth that all needs that determine pixel 702 are processed, when current pixel is 704, determine that the left of pixel 704 needs reverse sawtooth to process, when current pixel is 706, the right-hand reverse sawtooth that needs that determines pixel 706 is processed, and the gradually layer exponent number of above direction is all 1.Take the right-hand of pixel 702 is example, and gradually a layer exponent number is 1 o'clock, and the formula of gradual layer color value is as follows.
GC(R1)=C(P0)/2+C(R1)/2
Wherein GC (R1) is for inserting the gradual layer color value of the right-hand neighbor of pixel 702, R1 represents first right-hand neighbor, C (P0) represents the color value of current pixel 702, and C (R1) represents the original color value of right-hand neighbor of current pixel 702.Fig. 7 left side is the electronic chart before reverse sawtooth is processed, and Fig. 7 the right is the electronic chart after reverse sawtooth is processed.Because the electronic chart of this example only has black-and-white two color, the gradual layer color of inserting is the grey between black and white.
Take Fig. 8 A as example, and pixel 802 right-hand needs reverse sawtooth to process, its gradually a layer exponent number be 3.Therefore, the right-hand of pixel 802 has three neighbors need to insert gradual layer color, and the formula of gradual layer color value is as follows.
GC(R1)=C(P0)×3/4+C(R1)×1/4
GC(R2)=C(P0)×2/4+C(R2)×2/4
GC(R3)=C(P0)×1/4+C(R3)×3/4
Wherein GC (R1), GC (R2), GC (R3) represent respectively to insert pixel 802 right-hand first, the gradual layer color value of second and the 3rd neighbor, C (P0) represents the color value of pixel 802, C (R1), C (R2), C (R3) represent respectively pixel 802 right-hand first, second and the 3rd the original color value of neighbor.
Generally speaking, if certain direction of current pixel need reverse sawtooth process and also its gradually a layer exponent number be n, current pixel need to be inserted gradual layer color at n neighbor of this direction, the formula of gradual layer color value is as follows.
GC(Ni)=C(P0)×(n+1-i)/(n+1)+C(Ni)×i/(n+1)
Wherein i is the positive integer from 1 to n, GC (Ni) represents to insert current pixel in the gradual layer color value of i neighbor of this direction, C (P0) represents the color value of current pixel, and C (Ni) represents that current pixel is at i the color value that neighbor is original of this direction.
Fig. 8 A is the electronic chart before reverse sawtooth is processed, and Fig. 8 B is the figure that dwindles of Fig. 8 A, and wherein has sawtooth clearly.Fig. 9 A is the electronic chart of processing through reverse sawtooth, and Fig. 9 B is the figure that dwindles of Fig. 9 A.Original polygon line segment is black, and background is white, according to above-mentioned formula, after neighbor is inserted gradually layer grey, as shown in Figure 9 B, can remove sawtooth, makes electronic chart comparatively smoothly attractive in appearance.Figure 10 and Figure 11 are another group examples, and wherein Figure 10 is the electronic chart before reverse sawtooth is processed, and Figure 11 is the electronic chart after reverse sawtooth is processed, and as shown in figure 11, sawtooth is removed, and electronic chart is obviously more smoothly attractive in appearance than Figure 10.
Above anti-aliasing processing method is all to take monochrome map as example, if colour map can separately be processed each component of its color space (color space).For example use the electronic chart of RGB (being Red Green Blue) color space, can by three components of its red, green, blue separately, carry out separately remerging after reverse sawtooth processing.
Anti-aliasing processing method of the present invention only need to increase the memory block 140 of storage sequence value outside the memory block 130 of stored electrons map.In certain embodiments of the present invention, the color value length of each pixel is 32, and the color that electronic chart is used is no more than 255 kinds, and the sequence valve of each pixel only needs 8.So in these embodiments, the memory block 140 that the present invention increases, its storage space only needs 1/4th of original memory block 130.
Anti-aliasing processing method of the present invention does not affect the drawing electronic map time originally, but after mapping completes, processes reverse sawtooth again.In addition, anti-aliasing processing method of the present invention is only done gradually layer computing for need pixel to be processed, can reduce the non-essential extra computation time.
Below exemplify some experimental datas, the usefulness of the anti-aliasing processing method of one embodiment of the invention is described.The electronic installation of the present embodiment uses the processor of 195MHz, and the resolution of electronic chart is 320 * 240.Table 1 below compares the memory consumption of various anti-aliasing processing methods in the present embodiment.
The memory consumption comparison of table 1 anti-aliasing processing method
Anti-aliasing processing method Memory consumption (MB)
Without reverse sawtooth, process 13.8
Anti-aliasing processing method of the present invention 14.25
AGG function library 13.95
2 * 2 over-extraction sample reverse sawtooth algorithms 16.04
4 * 4 over-extraction sample reverse sawtooth algorithms 20.04
As shown in Table 1, anti-aliasing processing method of the present invention, its memory consumption only has more 3.3% than the situation of not doing reverse sawtooth processing, only than AGG function library, has more 2.2%.
In the middle of table 2 comparison sheet 1 below, various anti-aliasing processing methods are drawn 12 times that different electronic charts are required.
The drawing electronic map time comparison of table 2 anti-aliasing processing method
Figure G2009101746136D00101
Figure G2009101746136D00111
As shown in Table 2, the mapping time of anti-aliasing processing method of the present invention is far fewer than its excess-three kind anti-aliasing processing method.Therefore the anti-aliasing processing method of electronic installation of the present invention and its execution, not only can provide level and smooth electronic chart attractive in appearance, and has the advantage of saving computational resource and saving storer concurrently.
The foregoing is only preferred embodiment of the present invention; so it is not in order to limit scope of the present invention; anyone familiar with this technology; without departing from the spirit and scope of the present invention; can do on this basis further improvement and variation, so the scope that claims were defined that protection scope of the present invention is worked as with the application is as the criterion.
Being simply described as follows of symbol in accompanying drawing:
1,2: pixel order value
100: electronic installation
110: display
120: processor
130,140: memory block
410-470,510-580,610-680: process step
702-706,802-808: pixel
P0-P9: pixel relative position.

Claims (10)

1. an anti-aliasing processing method, is characterized in that, comprising:
In one first memory block that stores a plurality of pixels, specify a current pixel;
Centered by this current pixel, respectively at a first direction, one second direction, one third direction and a fourth direction are carried out a determining program, to judge whether each above-mentioned direction has sawtooth, this determining program comprises: in this direction of carrying out this determining program, specify one first pixel, one second pixel and one the 3rd pixel, wherein this second pixel is that this current pixel is at the neighbor of carrying out the direction of this determining program, this first pixel and the 3rd pixel are respectively this current pixel and in the direction with carrying out this determining program, are two neighbors on the both direction at 45 degree angles, if the sequence valve of this first pixel and the 3rd pixel equals the sequence valve of this current pixel, and the sequence valve of this current pixel is greater than the sequence valve of this second pixel, and the direction that this determining program is carried out in judgement has sawtooth, if the sequence valve of this first pixel or the 3rd pixel equals the sequence valve of this current pixel, and the sequence valve of this current pixel is greater than the sequence valve of this second pixel, and the direction that this determining program is carried out in judgement has sawtooth,
Gradually layer exponent number in serrate each the above-mentioned direction of serrate each above-mentioned direction calculating;
According to this layer exponent number and one pre-conditioned gradually of serrate each above-mentioned direction, determine whether serrate each above-mentioned direction needs reverse sawtooth to process, this pre-conditioned comprising: if this of this first direction gradually a layer exponent number be less than a default constant, determine that this first direction does not need reverse sawtooth to process, otherwise determine that this first direction needs reverse sawtooth to process; If this of this second direction gradually layer exponent number is less than this default constant, determines that this second direction does not need reverse sawtooth to process, otherwise determine that this second direction needs reverse sawtooth to process; If this of this third direction gradually layer exponent number be less than this default constant and this first direction or this second direction have be more than or equal to this default constant gradually layer exponent number, determine that this third direction does not need reverse sawtooth to process, otherwise determine that this third direction needs reverse sawtooth to process; If this of this fourth direction gradually layer exponent number be less than this default constant and this first direction or this second direction have be more than or equal to this default constant gradually layer exponent number, determine that this fourth direction does not need reverse sawtooth to process, otherwise determine that this fourth direction needs reverse sawtooth to process; And
In each the above-mentioned direction that needs reverse sawtooth to process, according to this gradually layer exponent number carry out the layer program of tinting gradually, to carry out reverse sawtooth processing, this gradually the layer program of tinting comprise: carry out this gradually layer tint program the party upwards, at the neighbor of this current pixel, insert respectively the gradual layer color value between the color value of each above-mentioned neighbor and the color value of this current pixel, the quantity of wherein inserting the above-mentioned neighbor of gradual layer color value equals to carry out this gradually tint this layer exponent number gradually of direction of program of layer, the proportion of the color value of this current pixel in above-mentioned gradual layer color value is inverse ratio with the distance of corresponding this neighbor and this current pixel.
2. anti-aliasing processing method according to claim 1, is characterized in that, this first direction and this second direction are respectively above-below direction, and this third direction and this fourth direction are respectively left and right directions.
3. anti-aliasing processing method according to claim 1, is characterized in that, this first direction and this second direction are respectively left and right directions, and this third direction and this fourth direction are respectively above-below direction.
4. anti-aliasing processing method according to claim 1, is characterized in that, before the step of specifying this current pixel, also comprises:
The corresponding sequence valve of the color value of each pixel of this first memory block is stored in to the correspondence position of one second memory block, wherein this sequence valve represents that the color value of this corresponding pixel is in the drafting priority of this first memory block, and the corresponding sequence valve of more preferential color value is just lower; And
From this second memory block, read the sequence valve of each pixel of this first memory block.
5. anti-aliasing processing method according to claim 1, is characterized in that, calculate serrate each party to gradually layer exponent number step comprise:
The sequence valve of this first pixel, the 3rd pixel and this current pixel relatively;
If only there is the sequence valve of this first pixel identical with the sequence valve of this current pixel, from this first pixel, along this direction of carrying out this calculating, calculate the contiguous pixels length with same color value, as this layer exponent number gradually of carrying out the direction of this calculating;
If only there is the 3rd sequence valve of pixel identical with the sequence valve of this current pixel, from the 3rd pixel, along the direction calculating of carrying out this calculating, there is the contiguous pixels length of same color value, as this layer exponent number gradually of carrying out the direction of this calculating; And
If the sequence valve of this first pixel and the 3rd pixel is all identical with the sequence valve of this current pixel, calculate respectively in the above described manner the contiguous pixels length with same color value of this first pixel and the 3rd pixel, and get shorter one wherein as this layer exponent number gradually of carrying out the direction of this calculating.
6. an electronic installation, is characterized in that, comprising:
One first memory block, stores a plurality of pixels; And
One processor, couple this first memory block, in this first memory block, specify a current pixel, centered by this current pixel, respectively at a first direction, one second direction, one third direction and a fourth direction are carried out a determining program, to determine whether each above-mentioned direction has sawtooth, this determining program comprises: in this direction of carrying out this determining program, specify one first pixel, one second pixel and one the 3rd pixel, wherein this second pixel is that this current pixel is at the neighbor of carrying out the direction of this determining program, this first pixel and the 3rd pixel are respectively this current pixel and in the direction with carrying out this determining program, are two neighbors on the both direction at 45 degree angles, if the sequence valve of this first pixel and the 3rd pixel equals the sequence valve of this current pixel, and the sequence valve of this current pixel is greater than the sequence valve of this second pixel, and the direction that this determining program is carried out in judgement has sawtooth, if the sequence valve of this first pixel or the 3rd pixel equals the sequence valve of this current pixel, and the sequence valve of this current pixel is greater than the sequence valve of this second pixel, and the direction that this determining program is carried out in judgement has sawtooth, and
Gradually layer exponent number in serrate each the above-mentioned direction of serrate each above-mentioned direction calculating, according to this layer exponent number and one pre-conditioned gradually of serrate each above-mentioned direction, determine whether serrate each above-mentioned direction needs reverse sawtooth to process, and in each the above-mentioned direction that needs reverse sawtooth to process, according to this gradually layer exponent number carry out the layer program of tinting gradually, to carry out reverse sawtooth processing
Wherein, this pre-conditioned comprising: if this of this first direction gradually a layer exponent number be less than a default constant, determine that this first direction does not need reverse sawtooth to process, otherwise determine that this first direction needs reverse sawtooth to process; If this of this second direction gradually layer exponent number is less than this default constant, determines that this second direction does not need reverse sawtooth to process, otherwise determine that this second direction needs reverse sawtooth to process; If this of this third direction gradually layer exponent number be less than this default constant and this first direction or this second direction have be more than or equal to this default constant gradually layer exponent number, determine that this third direction does not need reverse sawtooth to process, otherwise determine that this third direction needs reverse sawtooth to process; If this of this fourth direction gradually layer exponent number be less than this default constant and this first direction or this second direction have be more than or equal to this default constant gradually layer exponent number, determine that this fourth direction does not need reverse sawtooth to process, otherwise determine that this fourth direction needs reverse sawtooth to process
This gradually the layer program of tinting comprise: carry out this gradually layer tint program the party upwards, at the neighbor of this current pixel, insert respectively the gradual layer color value between the color value of each above-mentioned neighbor and the color value of this current pixel, the quantity of wherein inserting the above-mentioned neighbor of gradual layer color value equals to carry out this gradually tint this layer exponent number gradually of direction of program of layer, and the proportion of the color value of this current pixel in above-mentioned gradual layer color value is inverse ratio with corresponding this neighbor and the distance of this current pixel.
7. electronic installation according to claim 6, is characterized in that, this first direction and this second direction are respectively above-below direction, and this third direction and this fourth direction are respectively left and right directions.
8. electronic installation according to claim 6, is characterized in that, this first direction and this second direction are respectively left and right directions, and this third direction and this fourth direction are respectively above-below direction.
9. electronic installation according to claim 6, it is characterized in that, also comprise one second memory block, this processor is stored in the corresponding sequence valve of the color value of each pixel of this first memory block the correspondence position of this second memory block, and the sequence valve of each pixel of this first memory block is read in this second memory block certainly, wherein this sequence valve represents that the color value of this corresponding pixel is in the drafting priority of this first memory block, and the corresponding sequence valve of more preferential color value is just lower.
10. electronic installation according to claim 6, is characterized in that, calculate serrate each party to gradually layer exponent number step comprise:
The sequence valve of this first pixel, the 3rd pixel and this current pixel relatively;
If only there is the sequence valve of this first pixel identical with the sequence valve of this current pixel, from this first pixel, along this direction of carrying out this calculating, calculate the contiguous pixels length with same color value, as this layer exponent number gradually of carrying out the direction of this calculating;
If only there is the 3rd sequence valve of pixel identical with the sequence valve of this current pixel, from the 3rd pixel, along the direction calculating of carrying out this calculating, there is the contiguous pixels length of same color value, as this layer exponent number gradually of carrying out the direction of this calculating; And
If the sequence valve of this first pixel and the 3rd pixel is all identical with the sequence valve of this current pixel, calculate respectively in the above described manner the contiguous pixels length with same color value of this first pixel and the 3rd pixel, and get shorter one wherein as this layer exponent number gradually of carrying out the direction of this calculating.
CN200910174613.6A 2009-09-18 2009-09-18 Electronic device and anti-aliasing processing method thereof Active CN101661738B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200910174613.6A CN101661738B (en) 2009-09-18 2009-09-18 Electronic device and anti-aliasing processing method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200910174613.6A CN101661738B (en) 2009-09-18 2009-09-18 Electronic device and anti-aliasing processing method thereof

Publications (2)

Publication Number Publication Date
CN101661738A CN101661738A (en) 2010-03-03
CN101661738B true CN101661738B (en) 2014-04-02

Family

ID=41789713

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200910174613.6A Active CN101661738B (en) 2009-09-18 2009-09-18 Electronic device and anti-aliasing processing method thereof

Country Status (1)

Country Link
CN (1) CN101661738B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI631552B (en) * 2017-07-21 2018-08-01 Ili Technology Corp. Display apparatus and image processing method thereof
CN109528095B (en) * 2018-12-28 2020-11-17 深圳市愚公科技有限公司 Calibration method of sweeping record chart, sweeping robot and mobile terminal

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1308923A1 (en) * 2001-11-02 2003-05-07 Telefonaktiebolaget L M Ericsson (Publ) Method and device providing enhanced characters
CN101106686A (en) * 2007-08-31 2008-01-16 威盛电子股份有限公司 Inserted interleaving removal conversation method and device for remote end
CN101458916A (en) * 2007-12-14 2009-06-17 深圳迈瑞生物医疗电子股份有限公司 Waveform antialiasing method and waveform antialiasing processing apparatus
CN101620725A (en) * 2008-07-03 2010-01-06 辉达公司 Hybrid multisample/supersample antialiasing

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1308923A1 (en) * 2001-11-02 2003-05-07 Telefonaktiebolaget L M Ericsson (Publ) Method and device providing enhanced characters
CN101106686A (en) * 2007-08-31 2008-01-16 威盛电子股份有限公司 Inserted interleaving removal conversation method and device for remote end
CN101458916A (en) * 2007-12-14 2009-06-17 深圳迈瑞生物医疗电子股份有限公司 Waveform antialiasing method and waveform antialiasing processing apparatus
CN101620725A (en) * 2008-07-03 2010-01-06 辉达公司 Hybrid multisample/supersample antialiasing

Also Published As

Publication number Publication date
CN101661738A (en) 2010-03-03

Similar Documents

Publication Publication Date Title
US8368695B2 (en) Transforming offline maps into interactive online maps
US8374428B2 (en) Color balancing for partially overlapping images
CN110503146B (en) Data enhancement method and device, computing equipment and computer storage medium
US10068518B2 (en) Method, apparatus and system for dithering an image
US20060077209A1 (en) Pixel center position displacement
CN108052642A (en) Electronic Chart Display method based on tile technology
JP2008542827A (en) Variable scale map display using non-perspective imaging
CN103020888B (en) Image translation upgrades display packing and system
CN108664454A (en) E-book page display method, device and terminal device
CN111489322B (en) Method and device for adding sky filter to static picture
CN101661738B (en) Electronic device and anti-aliasing processing method thereof
CN114092575B (en) Digital earth real-time coloring method and device
US8355580B2 (en) Method and system for generating boundary in the process of rasterizing vector graphic as well as method for producing the system
CN103543974A (en) Method and system for improving font clarity
CN112070854A (en) Image generation method, device, equipment and storage medium
CN103593822B (en) The method and apparatus that frosted special effect processing is carried out to data image
CN112465931B (en) Image text erasing method, related equipment and readable storage medium
CN112330769B (en) Method and device for generating dotted line texture and electronic equipment
TWI405146B (en) Electronic device and anti-aliasing method thereof
CN111062863B (en) Method, device, equipment and storage medium for binding 3D model with longitude and latitude coordinates
CN111369676B (en) Map image processing method and device and vehicle-mounted equipment
CN102005060A (en) Method and device for automatically removing selected images in pictures
WO2024046105A1 (en) Anti-aliasing method and apparatus for image, and device, medium and program product
KR100647367B1 (en) Pass rendering method of two dimensions object in the mobile terminal
CN109803163B (en) Image display method and device and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant