TW201019270A - Method for fast filling coordinate points in a polygon - Google Patents

Method for fast filling coordinate points in a polygon Download PDF

Info

Publication number
TW201019270A
TW201019270A TW97144183A TW97144183A TW201019270A TW 201019270 A TW201019270 A TW 201019270A TW 97144183 A TW97144183 A TW 97144183A TW 97144183 A TW97144183 A TW 97144183A TW 201019270 A TW201019270 A TW 201019270A
Authority
TW
Taiwan
Prior art keywords
value
record
polygon
vertex
flag
Prior art date
Application number
TW97144183A
Other languages
Chinese (zh)
Other versions
TWI383336B (en
Inventor
Wei-Yu Lai
Original Assignee
Delta Electronics 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 Delta Electronics Inc filed Critical Delta Electronics Inc
Priority to TW97144183A priority Critical patent/TWI383336B/en
Publication of TW201019270A publication Critical patent/TW201019270A/en
Application granted granted Critical
Publication of TWI383336B publication Critical patent/TWI383336B/en

Links

Abstract

A method fast fills coordinate points in a polygon to calculate the area of the polygon. In a memory space, the record values of all coordinate points are reset to zero. The coordinate points for ordered apexes defining a polygon are input to the memory space. Connection points in the memory space are defined by connecting two apexes with predetermined order. The record value for each of these apexes is set as a flag or a line. The record value of each connection point is as a flag or a line. The record values of all coordinate points in the memory space are processed according to the record values in the apexes and the connection points. The area of the polygon can be calculated by the record values in the memory space. The method of the present invention can fast fill the coordinate points in the memory space with ordinary hardware, instead of complex hardware.

Description

201019270 六、發明說明: 【發明所屬之技術領域】 特別是一種多邊 本發明係有關於一種快速填色方法 形快速填色方法。 【先前技術】 自從邁入數位化的科技時代之後,配合著電腦 ❹ 參 步’料處理變成非常熱門的話題之一。所謂的影像處 理,指的就是將拍攝下來的影像,透過掃描器,或是 =用數位相機關後,在電腦巾以制軟體進 理。因為其類似傳統攝影時的暗房,因此影像處理軟= f數位暗房之稱。不過它免去暗房的不見天日以及與藥水 =可還:高成本痛苦。僅要幾個動作,效果立即呈現, =變化,數有趣的f彡像’並且制電腦可以大量複 製、P出、或是透過網際網路傳送。 填圖計算面積之技術是影像處理技術中非常重要的課 ^二而由於影像資料量一般都非常大,所以需處理之 ==處理__增加。但在成本有限、 S 前常見之填圖計算面積之技術處理時間 ?都過長’且處理時所佔用的記憶體空間也過大 I、杳^體上實現。因此若能發明一種快速方法’快速填滿 之圓形’使計算速度提昇’且有利於在資源有限之 硬體(例如人機界面ΗΜΙ )上實現,不需複雜之硬體架 4 201019270 構,實是影像處理者之福 【發明内容】 因此本發明之目的即在改善上述習知技術之運算緩 慢,並且可以一般硬體架構即可達成,不需複雜之硬體架 構。 ’、 為達成上述目的,本發明之多邊形快速填色方法主要 步驟包含.將一 §己憶體空間内所有座標點之記錄值歸零、 參 ❹ 於該記憶體空間内輸入一多邊形之頂點之座標、依序連接 該些頂點以決定兩該頂點之間的連接點、設定每一該些頂 點之汜錄值為一旗標值或一線段值、設定該些連接點之記 錄值為一旗標值或一線段值、依據該些頂點之該些記錄值 與該些連接點之該些記錄值處理該記憶體空間内之該些 標點之該些記錄值,以求得該多邊形之面積。本發明^夕 邊形快速填色方法可以一般硬體架構即可達二 之硬體架構。 小:複雜 【實施方式】 請先參考第七圖至第十一圖,其係為本發明之 快速填色方法可應用用途之說明。本發明之多邊^形 色方法之目的即在計算出例如該第七圖至該第十1中填 多:形的著⑼積’其中該些多邊形面積係 = (ordered node)定義。以 it μ w A 』即黑占 疋我以下將就本發明之多邊形 法之實施方式做詳盡說明。 、逮填色方 201019270 請參考第一圖,其係為本發明之多邊形快速填色方法 之机程圖。首先,步驟Si〇將一記憶體空間Pattern (大小 為R列乘C行)内所有座標點pQint)之記錄值 (record value)歸零,以為下一步驟做準備。配合第十二 圖’其係為記憶冑空間示意圖。言亥記憶體空間包含記錄多 數座標點(每一座標點之一記錄值代表一圖素(細υ)之 矩陣記憶單元,且假設該記憶體空間包含c行(1方向)X R(Y方向)列之座標點,因此隨著座標¥的下標變化,則 _座標點的列也會變化。本發明下列步驟係以逐列處理之方 式,但是須知也可用逐行處理方式,皆在本發明範圍之 内。再者,在第十二圖所示之記憶體空間中,座標係以由 左至右(X方向)、由上至下(Y方向)增加。接著,回到第 一圖,步驟S20於該記憶體内輸入一多邊形(N邊形)頂 點之座松依序為(Xi,γ,)…(Xn,% )。然後,步驟 S30依序連接5亥些頂點以決定兩該頂點之間的連接點,例 ❹如(X!,Υ,)連到(χ2,γ2 ) 、( Χ2,% )連到(Χ3, Υ3 )…等等,其令最後一頂點(Χν,Υν )則連接到第一頂 點(X!,Y,)。繼之’步驟S40設定每一該些頂點之記錄 值為一旗標值或一線段值(容後詳述)。步驟S50設定該 些連接點之記錄值為一旗標值或一線段值(容後詳述)。 步驟S60依據該些頂點之該些記錄值與該些連接點之該些 s己錄值處理該記憶體空間内之該些座標點之該些記錄值, 以求得該多邊形之面積(容後詳述)。 參見第四圖,在陣列狀的記憶體空間中,每一記憶單 201019270 元概稱為座標點(coordinate p〇int),而多邊形係由多數有 序頂點疋義’亦即圖中標示為m,m+l之點。再者,為了古十 算多邊形面積’兩個頂點之連線所界定之座標點稱為連接 點(connection point),亦即圖中為陰影凸顯之點。 明參考第二圖,其係為本發明之設定每一該些頂點之 記錄值為-旗標值或一線段值之流程圖,用以詳述前述該 步驟S40設定每一該些頂點之記錄值為一旗標值或一線段 值。假設:述該記憶體内,在N個頂點中,處理^個頂 參點’即目前處理的m頂點(current n〇de)的座標稱為(i , Y-),則前一頂點(previous node)座標則稱為(尨1 ,201019270 VI. Description of the invention: [Technical field to which the invention pertains] In particular, a multi-lateral invention relates to a rapid color filling method for rapid color filling. [Prior Art] Since entering the digital technology era, it has become one of the hot topics with the computer 参 step by step. The so-called image processing refers to the image taken through the scanner, or after using the digital phase mechanism, the software is processed in the computer towel. Because it is similar to the darkroom in traditional photography, the image processing is soft = f digital darkroom. However, it eliminates the darkness of the darkroom and the potion = can be returned: high cost pain. With just a few actions, the effect is immediately presented, = change, a number of interesting images, and the computer can be copied, popped, or transmitted over the Internet. The technique of plotting area calculation is a very important lesson in image processing technology. Since the amount of image data is generally very large, it needs to be processed == processing __ increase. However, in the case of limited cost, the technical processing time for calculating the area of the map before the S is too long and the memory space occupied by the processing is too large. Therefore, if a quick method of 'quick filling of the circle' is made to increase the calculation speed and it is beneficial to implement on a hardware with limited resources (for example, human-machine interface ,), no complicated hardware frame 4 201019270 is required. It is a blessing of the image processor. SUMMARY OF THE INVENTION Therefore, the object of the present invention is to improve the operation of the above-mentioned prior art, and it can be achieved in a general hardware architecture without requiring a complicated hardware architecture. In order to achieve the above object, the main steps of the polygon fast color filling method of the present invention include: zeroing the recorded values of all coordinate points in a memory space, and inputting the vertices of a polygon in the memory space. Coordinates, sequentially connecting the vertices to determine a connection point between the two vertices, setting a record value of each of the vertices as a flag value or a line segment value, and setting a record value of the connection points as a flag The value of the polygon or the value of the segment is calculated according to the record values of the vertices and the record values of the connection points to process the record values of the punctuation points in the memory space. The method for quickly filling colors of the present invention can achieve a hardware architecture of a general hardware architecture. Small: Complex [Embodiment] Please refer to the seventh to eleventh drawings, which are descriptions of the applicable applications of the quick color filling method of the present invention. The purpose of the multi-color method of the present invention is to calculate, for example, the seventh to the eleventh aspect of the multi-form: (9) product' in which the polygons are defined by an ordered node. I will refer to the implementation of the polygon method of the present invention in the following. , capture color side 201019270 Please refer to the first figure, which is the machine diagram of the polygon fast color filling method of the present invention. First, step Si 归 zeros the record value of all coordinate points pQint in a memory space pattern (size R column by C line) to prepare for the next step. In conjunction with the twelfth figure, it is a schematic diagram of the memory space. The memory space includes a matrix memory unit that records a majority of the coordinate points (one of each punctuation value represents a pixel (fine), and assumes that the memory space contains c rows (1 direction) XR (Y direction) column The coordinate point, therefore, as the subscript of the coordinate ¥ changes, the column of the _ coordinate point also changes. The following steps of the present invention are processed in a column-by-column manner, but the instructions may also be processed in a row-by-row manner, all within the scope of the present invention. Furthermore, in the memory space shown in Fig. 12, the coordinates are increased from left to right (X direction) and top to bottom (Y direction). Then, return to the first figure, steps S20 inputs a polygon (N-sided) vertex in the memory to be (Xi, γ,)...(Xn,%). Then, step S30 sequentially connects 5 vertices to determine the two vertices. The connection point between, for example, (X!, Υ,) is connected to (χ2, γ2), (Χ2,%) to (Χ3, Υ3), etc., which makes the last vertex (Χν, Υν) Then connected to the first vertex (X!, Y,). Following step S40, the record value of each of the vertices is set to one. A value or a line value (described in detail later). Step S50 sets the record value of the connection points as a flag value or a line value (described in detail later). Step S60 is based on the record values of the vertices. And the recorded values of the coordinate points in the memory space are processed to determine the area of the polygon (described in detail later). See the fourth figure, in the array. In the memory space, each memory sheet 201019270 is called a coordinate p〇int, and the polygon is defined by the majority of the ordered vertices, that is, the points marked m, m+l in the figure. Furthermore, the coordinate point defined by the line connecting the two vertices of the ancient ten-dimensional polygon area is called the connection point, that is, the point where the shadow is highlighted in the figure. The invention sets a flow chart in which the record value of each of the vertices is a -flag value or a line segment value, and is used to detail the step S40 to set the record value of each of the vertices as a flag value or a line segment value. Hypothesis: describe the memory, in the N vertices, handle ^ top parameters The point ′ is the coordinate of the currently processed m vertex (current n〇de) is called (i, Y-), then the previous vertex (the previous node) is called (尨1,

Yb_i ),下一頂點(next node)座標則稱為(Χη+ι , 一Y- ),XY即為習知之χγ軸座標值’若_第一點則其前 :頂點(LL )即為(Χν,Υν)。首先步驟獅判 =前頂點與前-頂點及下—頂點是否有反折㈣ecti〇n) 關係’亦即判斷下列兩種狀況: (1 ) ( 1>必+1 且 Υ„<Υ„Η ) (2 ) ( Ym<Y糾且 n 丨) 2否其中之-成立。若是,表示目前頂點與前—頂點及下 一頂點並未反折,則進人步驟難,設定該目前頂點 (X™,M之記錄值為一旗標值(FLAG);若否,表示目 則頂點與前-頂點及下—頂點有反折,則進人步驟湖, 設定該目前頂點(L,y„)之記錄值為一線段值 (UNE) °本發明之處理頂點屬性之流程可以軟體程式語 言表達如下: 201019270 y».+) and >= ym+i and Ym < Ym_} ) 〇r ( ^ 圪〉U) {Yb_i), the coordinates of the next vertex are called (Χη+ι, a Y-), and XY is the conventional χ γ axis coordinate value 'if _ first point then its front: vertex (LL) is ( Χν,Υν). First step lion judge = whether the front vertices and the front-vertex and the lower-vertex have reflexes (four) ecti〇n) The relationship 'is judged the following two conditions: (1) (1> must +1 and Υ„<Υ„Η (2) (Ym<Y correct and n 丨) 2 No one of them - established. If it is, it means that the current vertex and the front-vertex and the next vertex are not reversed, then it is difficult to enter the step, and the current vertex (XTM, M record value is a flag value (FLAG); if not, the target Then the vertex and the front-vertex and the lower-vertex have a reflex, and then enter the step lake, and set the record value of the current vertex (L, y) to a line value (UNE). The process of processing the vertex attribute of the present invention can be The software programming language is expressed as follows: 201019270 y».+) and >= ym+i and Ym < Ym_} ) 〇r ( ^ 圪〉U) {

Pattern[ a]U, ]··= FLAG; } else LINE;Pattern[ a]U, ]··= FLAG; } else LINE;

Pattern[ xm][Ym ❹ 點之三Γ其係為本發明之設定兩個頂點間連接 述該步驟S50設定該此連接點之,铬信我.始用以泮述則 -逑接點之s己錄值為-旗標值或-線 又值=份步驟。在此步驟係處理前述該目前頂點U, 二己錄1到:1 一頂點(Xra+1,Ym+i)之連線上的連接點 曰^、。首先於步驟S51G,判斷該目前頂點之列座標& 等於該下一頂點之列座標&,若否,代表該列座 不》等於该列座標Ym+1 ,則進入步驟S59〇結束;若是代 表該目前頂點與下-頂點不在同一列,此時進入步驟 S520 ’判斷§亥列座標γη是否大於該列座標u,若是’則 進入步驟S530 ’由該⑹]列處理至該(Υη+ι)+1列;若否, 則進入步驟S540,由該d!)-l列處理至該(Ym)+1列。這樣 的流程的目的在僅處理該頂點(Xn,Ym )連線到該頂點 (,Υ«+ι )之連線上的連接點之記錄值,但不包含 (X·»,γη )與(χωΗ ,Ym+1 )兩頂點。接著,步驟S55〇判 201019270 斷換列的第一個連接點的記錄值是否為一旗標值,即該 (L K )連線到该(,Υι〇+ι )之連線點在換列時, 垓換列的第一連接點的記錄值是否為一旗標值,若是,則 進入步驟S560,設定該換列的第一連接點的記錄值為一線 段值,·若否,則進入步驟_,設定該換列的第一連接點 的記錄值為-旗標值。這樣的流程的目的在於設定該換列 的第-連接點的記錄值為一旗標值,但若是原本該換列的 第-連接點的記錄值已經為一旗標值,則轉為設定該換列 ❿的第-連接點的記錄值成為一線段值。接著進入步驟 S580,設定該換列的其餘連接點的記錄值為線段值。如對 於多邊形所有兩個頂點之間的連接點都使用如第三圖之步 驟處理’即可達成第一圖步驟S5〇之連接點記錄值設 驟。 為了更明白解釋上述流程,請參考第四圖,其係為本 發明之設定該些連接點之記錄值為一旗標值或一線段值之 ❹實施例。圖内每—格即代表該記憶體内之位置,在此將 處理該頂點(Xm,Ym)連接到該頂點(“ ,Ym+1 )之連 線上的連接點之屬性。該第四圖囷中記號m代表該頂點 (Xm,% ),記號m+Ι代表該頂點(Xm+1 , Ym+1 ),記號 F代表旗払值,記號L代表一線段值。由此可以看出在 該(Xm,Ym )連接到該(u , Ym+i )之連線上的連接 點,在換列的第一連接點設定其記錄值為一旗標值F,其 餘連接點之記錄值設定為線段值L。 並請參考第五圖,其係為本發明之設定該些連接點之 201019270 2值為-旗標值或-線段值之又—實施例,旨在說明該 步驟_㈣該換列的第—連接點的記錄值為—線段值。 内=睛參考上述該第四圖之解釋,但請特別注意該第四圖 =第四列原本之第-連接點的記錄值為—旗標值f,在該 第五圖因為該步驟S55〇換列的第一點係為一旗標值F,於 ;進入該步驟S56°設定該換列的第-連接點之記錄值為」 線段值L。 經過上述之流程,設定完該些頂點與該 參之連接點的記錄值為-旗標值或一線段值後:接著^叶 异該些頂點順序連線所形成之面積(即該第七圖至該第十 著色面積)。請參考第六圖,其係為本發明之處理 形内一列數值之流程圖,用以詳述上述該步驟咖 ==點之該些記錄值與該些連接點之該些記錄值處 以憶體”内之該些座標點之該些記錄值,以求得該 多邊形之面積,例如可以計算該些記錄值為㈣ 參時(邏輯值1)的總量以求得著色面積。處理方式是由該 記憶體之第-列的每一座標點開始,完成後再進行第二 列,-直到最後-列,並且在每一列是由左至右對每一座 標點進行處理。參見第六圖,對每一列而言,首先步驟 S610開始,接著進人步驟遞判斷是否目前處理座標點之 記錄值為一旗標值,若是,則進入步驟S630,開始著色 (或開始於該座標點的記錄值填人",若在處理°同一列 剩餘座心點之§己錄值再遇到一旗標值則停止著色(戋停止 於該座標點的記錄值填入i )’接著再回到該步驟咖開 201019270 未遇到—旗標值),則進入步驟_,判定是 =到=理:的終點,若是,則進入步驟s結束處: =憶回到該步驟_開始。如此,逐列處理完 ^ (或二#列的所有座標點後,再加總所有列内被著 或其§己錄值被填入數值為邏輯1 )之該座標點數量, 即可知道欲求多邊形圖形之面積。本發明之處理多邊形内 數值之流程可以軟體程式語言表達如下(nc為該記憶體空 間之寬;NR為該記憶體空間之長): ❹ for(j:=〇;j< NR;j++) { DRAWJ1AG := 0; f〇r(i:=0;i<NC;i++)Pattern[ xm][Ym ❹ The third point is the connection between the two vertices of the present invention. This step S50 sets the connection point, and the chrome letter I. The recorded value is the -flag value or the - line value = step. In this step, the connection point 曰^, which is connected to the current vertex U, and the second vertex 1 to: 1 and a vertex (Xra+1, Ym+i) is processed. First, in step S51G, it is determined that the current vertex column coordinate & is equal to the next vertex column coordinate & if not, the representative column seating is equal to the column coordinate Ym+1, then proceeds to step S59〇; If the current vertex is not in the same column as the lower vertex, the process proceeds to step S520' to determine whether the coordinate γη is greater than the column coordinate u, and if so, the process proceeds to step S530, where the (6) column is processed to the (Υn+ι) +1 column; if not, proceed to step S540, and the d!)-l column is processed to the (Ym)+1 column. The purpose of such a process is to process only the recorded values of the connection points of the vertices (Xn, Ym) connected to the vertices (, Υ«+ι ), but not (X·», γη ) and ( χωΗ , Ym+1 ) two vertices. Next, in step S55, it is determined whether the record value of the first connection point of the 201019270 break column is a flag value, that is, the connection point of the (LK) connection to the (, Υι〇+ι) is changed. , the record value of the first connection point of the 垓 column is a flag value, and if yes, the process proceeds to step S560, and the record value of the first connection point of the column is set to a line value. If not, the process proceeds to the step. _, the record value of the first connection point of the re-column is set to a -flag value. The purpose of such a process is to set the record value of the first connection point of the column to a flag value, but if the record value of the first connection point of the replacement column is already a flag value, then the setting is changed to The recorded value of the first-join point of the column is changed to a line value. Next, proceeding to step S580, the record value of the remaining connection points of the replacement column is set to a line segment value. For example, if the connection point between all two vertices of the polygon is processed as in the third figure, the connection point record value setting of the first step S5 is achieved. In order to more clearly explain the above process, please refer to the fourth figure, which is an embodiment of the present invention for setting the record value of the connection points to a flag value or a line segment value. Each cell in the graph represents the position in the memory, where the attribute of the connection point connecting the vertex (Xm, Ym) to the line connecting the vertex (", Ym+1) is processed. The symbol m in the middle represents the vertex (Xm,%), the symbol m+Ι represents the vertex (Xm+1, Ym+1), the symbol F represents the flag value, and the symbol L represents the value of a line segment. The (Xm, Ym) is connected to the connection point of the connection line of (u, Ym+i), and the record value of the first connection point of the column is set to a flag value F, and the record values of the remaining connection points are set. For the line segment value L. Please refer to the fifth figure, which is the embodiment of the present invention for setting the 201019270 2 values of the connection points to be -flag values or - line segment values - an embodiment for explaining the step _ (four) The record value of the first-joining point of the column is - the value of the line segment. The inner-eye refers to the explanation of the fourth figure above, but please pay special attention to the record value of the fourth-graph-fourth original-connection point- The flag value f, in the fifth figure, because the first point of the step S55 is a flag value F, enter the step S56 ° to set the first connection of the column The record value "segment value L. After the above process, the record value of the connection point between the vertices and the parameter is set to a -flag value or a line segment value: then the area formed by the vertices sequentially connecting the lines (ie, the seventh picture) To the tenth coloring area). Please refer to the sixth figure, which is a flow chart of a column of values in the processing shape of the present invention, which is used to detail the recording values of the above-mentioned steps and the recording values of the connecting points. The recorded values of the coordinate points in the circle are used to obtain the area of the polygon. For example, the total value of the recording values (4) and the time (logical value 1) can be calculated to obtain the colored area. Each punctuation of the first column of the memory begins, and after completion, the second column, - until the last - column, and each column is processed from left to right for each punctuation. See Figure 6, for each In the first step, the first step S610 is started, and then the step of entering the step is to determine whether the record value of the currently processed coordinate point is a flag value. If yes, the process proceeds to step S630 to start coloring (or the record value starting from the coordinate point is filled in). ", if the § record value of the remaining center point of the same column is processed and then a flag value is encountered, the coloring is stopped (the record value of the stop point is filled in i) and then the step is returned. Open 201019270 did not encounter - flag value), Go to step _, and judge the end point of = to = rational: if yes, go to the end of step s: = recall to the step _ start. Thus, after processing all the coordinate points of the ^ (or the second # column) column by column, Adding the total number of punctuation points in the column or the value of the § record to the logical value 1), the area of the polygon pattern is known. The process of processing the value in the polygon of the present invention can be a software programming language. The expression is as follows (nc is the width of the memory space; NR is the length of the memory space): ❹ for(j:=〇;j<NR;j++) { DRAWJ1AG := 0; f〇r(i:=0 ;i<NC;i++)

DRAW.FLAG := abs(DRAW_FLAG -1); [ if(DRAW_FLAG == 1 AND Pattern[i][j] == 0) ΓDRAW.FLAG := abs(DRAW_FLAG -1); [ if(DRAW_FLAG == 1 AND Pattern[i][j] == 0) Γ

Pattern[i][j] = DRAW; 請參考該第七圖至該第十一圖,如前所述’其係為本 201019270 發明之多邊形快速填色方法之實施例。該些頂點依照號碼 依序連接,接著依照本發明之多邊形快速填色方法即可算 出著色面積。 綜上所述,當知本發明已具有產業利用性、新穎性與 進步性,又本發明之構造亦未曾見於同類產品及公開使 用,完全符合發明專利申請要件,爰依專利法提出申請。 【圖式簡單說明】 β 第一圖為本發明之多邊形快速填色方法之流程圖。 第二圖為本發明之設定每一該些頂點之記錄值為一旗標值 或一線段值之流程圖。 第三圖為本發明之設定兩頂點間之連接點之記錄值為一旗 標值或一線段值之流程圖。 第四圖為本發明之設定該些連接點之記錄值為一旗標值或 一線段值之一實施例。 ❹第五圖為本發明之設定該些連接點之記錄值為一旗標值或 一線段值之又一實施例。 第六圖為本發明之處理該多邊形内一列數值之流程圖。 第七圖至第十一圖為本發明之多邊形快速填色方法之實施 例0 第十二圖為記憶體空間示意圖。 【主要元件符號說明】 12 201019270 S10〜60步驟 S420〜S650 步驟 m ( Xm,Ym )位置 m+1 ( Χιη+1 ,Ym+l )位置 F旗標值 L線段值Pattern[i][j] = DRAW; Please refer to the seventh figure to the eleventh figure, as described above, which is an embodiment of the polygon rapid color filling method of the invention of 201019270. The vertices are sequentially connected in accordance with the number, and then the coloring area can be calculated according to the polygon fast color filling method of the present invention. In summary, it is known that the present invention has industrial applicability, novelty, and progressiveness, and the structure of the present invention has not been found in similar products and public use, and fully complies with the requirements of the invention patent application, and is filed according to the patent law. [Simple description of the figure] β The first figure is a flow chart of the method for quickly filling a polygon of the present invention. The second figure is a flow chart for setting a record value of each of the vertices as a flag value or a line segment value according to the present invention. The third figure is a flow chart of setting a record value of a connection point between two vertices as a flag value or a line segment value according to the present invention. The fourth figure is an embodiment of the present invention for setting the record value of the connection points to a flag value or a line segment value. The fifth figure is another embodiment of the present invention for setting the record value of the connection points to a flag value or a line segment value. The sixth figure is a flow chart of processing a column of values in the polygon of the present invention. 7 to 11 are embodiments of the method for rapidly filling a polygon according to the present invention. FIG. 12 is a schematic diagram of a memory space. [Description of main component symbols] 12 201019270 S10~60 steps S420~S650 Step m (Xm, Ym) position m+1 ( Χιη+1 , Ym+l ) position F flag value L line segment value

1313

Claims (1)

201019270 七、申請專利範圍: 1.種夕邊形快速填色方法,係應用於一記憶體空間内, 以計算該記憶體空間内之—多邊形之面積,其中該記憶 體工門^ 3在- X軸與一 γ軸延伸之多數陣列狀座標 點’且@乡邊㈣由多數之有序頂點所界定,該多邊形 快速填色方法包含: (A) 將該記憶體空間内所有座標點之記錄值歸零; (B) 於該記憶體空間内輪人該多邊形之該些頂點之座 0 標; (C )依序連接該些頂點以決定兩該頂點之間的連接 點, (D )設定每一該些頂點之記錄值為一旗標值或一線段 值; (E )設定該些連接點之記錄值為一旗標值或一線段 值,及 ❹(F )依據5彡些頂點之該些記錄值與該些連接點之該些 記錄值處理該記憶體空間内之該些座標點之該些記錄 值,以求得該多邊形之面積。 2. 如申睛專利範圍第!項之多邊形快速填色方法,其中, 該步驟(D)更包含: 、 (D1?若:前處理的頂點的γ值不小於下一頂點的γ值, 且4目剛處理的頂點的γ值小於前一頂點的Υ值,則設 定該目前處理的頂點的記錄值為-旗標值。 3. 如申請專利範圍第2項之多邊形快速填色方法其中, 201019270 該步驟(D)更包含: ⑽若該目前處理的頂點的Y值小於該下一頂點的γ 值,且該目前處理的頂點的Υ值不小於該前-頂點的γ 值,則設定該目前處理的頂點的記錄值為一旗標值。 4.如申請專利範圍第3項之多邊形快速填色方法,其中, 該步驟(D)更包含: ⑽)對於未U為—旗標值之該目前處理的頂點,則 設定其記錄值為一線段值。 _ 5.如中料㈣請第4項之多邊形快速填色方法,其中, 該步驟(Ε )更包含: (Ε1)逐列處理兩頂點之間的連接點;及 (Ε2)若換列的第—連接點之記錄值非為旗標值,則設定 該第一連接點之記錄值為旗標值。 6.如申請專㈣圍第5項之多邊_速填色方法,其中, 該步驟(Ε)更包含: ⑩⑽)右換列的第—連接點之記錄值為旗標值,則設定該 第一連接點之記錄值為線段值。 申請專利範圍第6項之多邊形快速填色方法,其中, -亥步驟(F )對該記憶體空間之處理順序為由左至右, 由上至下,該步驟(F)更包含: (F1)右於一處理列上的—座標點的記錄值為一旗標 值則開始著色,若後續座標點的記錄值也是一旗標值 則停止著色。 8.如申請專利範圍第7項之多邊形快速填色方法,其中, 15 201019270 該歩驟 更包含 (F2)讀該處⑼上的座標料域值,則判定是否兔#老w , 遇到一旗標 疋古為垓處理列之終點;及 (F3)若遇_處理狀終點 9.如申請M m U處理該處理列。 該步驟(F )更包含: 丹巴万法’其中, ❿ (F4 )加總該記憶體空 量’即為該多邊形之面 10.如申請專利範圍第9項 特定記錄值為對應邏輯 間内所有座標點之特定記錄值數 積。 之夕邊形快速填色方法,其中該 1之sg*錄值。 ❹201019270 VII. Patent application scope: 1. A method for quickly filling colors in a memory space, which is used to calculate the area of the polygon in the memory space, wherein the memory gate ^ 3 is in - The X-axis and a γ-axis extend a plurality of array-like coordinate points 'and @乡边(4) are defined by a plurality of ordered vertices, and the polygon fast color filling method comprises: (A) recording of all coordinate points in the memory space The value is zeroed; (B) the coordinates of the vertices of the polygon in the memory space are rounded; (C) the vertices are sequentially connected to determine the connection point between the two vertices, (D) setting each The record value of the vertices is a flag value or a line segment value; (E) setting the record value of the connection points as a flag value or a line segment value, and ❹(F) according to 5 vertices The record values and the record values of the connection points process the record values of the coordinate points in the memory space to determine the area of the polygon. 2. For example, the scope of the patent application! The polygon fast filling method of the item, wherein the step (D) further comprises: , (D1? if: the γ value of the pre-processed vertex is not smaller than the γ value of the next vertex, and the γ value of the vertex of the 4 mesh just processed If the value of the vertices of the previous vertex is smaller than the value of the vertices of the previous vertex, the value of the currently processed vertex is set to a flag value. 3. The method for fast color filling of polygons according to item 2 of the patent application is as follows: 201019270 This step (D) further includes: (10) If the Y value of the currently processed vertex is smaller than the γ value of the next vertex, and the Υ value of the currently processed vertex is not less than the γ value of the pre-vertex, the record value of the currently processed vertex is set to one. 4. The value of the flag is as follows: 4. The method for quickly filling a polygon according to item 3 of the patent application, wherein the step (D) further comprises: (10) setting the currently processed vertex without U-flag value The record value is a line segment value. _ 5. For the middle material (4), please refer to the polygon fast filling method of item 4, wherein the step (Ε) further includes: (Ε1) processing the connection point between the two vertices column by column; and (Ε2) if the column is replaced If the record value of the first connection point is not a flag value, the record value of the first connection point is set to be a flag value. 6. If you apply for the multi-level _ speed filling method of item 5 (4), the step (Ε) further includes: 10(10)) The record value of the first connection point of the right column is the flag value, then the number is set. The record value of a connection point is the line segment value. The polygon rapid color filling method of claim 6 wherein the processing step of the memory space is from left to right, from top to bottom, and the step (F) further comprises: (F1) The color value is started when the value of the coordinate point on the right-hand column is a flag value, and the coloring is stopped if the record value of the subsequent coordinate point is also a flag value. 8. The method of fast filling of polygons according to item 7 of the patent application, wherein, 15 201019270, the step further comprises (F2) reading the value of the coordinate range on the (9), determining whether the rabbit #老w, encounters one The flag is the end point of the processing column; and (F3) if the _ processing end point 9. If the application M m U processing the processing column. The step (F) further includes: the Danbawan method 'where ❿ (F4) sums the memory empty amount' is the face of the polygon 10. If the specific record value of the ninth item of the patent application scope is corresponding to the logical space The product of the specific recorded values of all coordinate points. An instant fill coloring method in which the sg* of the 1 is recorded. ❹
TW97144183A 2008-11-14 2008-11-14 Method for fast filling coordinate points in a polygon TWI383336B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW97144183A TWI383336B (en) 2008-11-14 2008-11-14 Method for fast filling coordinate points in a polygon

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW97144183A TWI383336B (en) 2008-11-14 2008-11-14 Method for fast filling coordinate points in a polygon

Publications (2)

Publication Number Publication Date
TW201019270A true TW201019270A (en) 2010-05-16
TWI383336B TWI383336B (en) 2013-01-21

Family

ID=44831685

Family Applications (1)

Application Number Title Priority Date Filing Date
TW97144183A TWI383336B (en) 2008-11-14 2008-11-14 Method for fast filling coordinate points in a polygon

Country Status (1)

Country Link
TW (1) TWI383336B (en)

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62192878A (en) * 1986-02-20 1987-08-24 Nippon Gakki Seizo Kk Painting-out method for polygon
GB2198019B (en) * 1986-11-18 1990-09-26 Ibm Graphics processing system
JPH01196675A (en) * 1988-01-30 1989-08-08 Toshiba Corp Pattern data preparing system
US6639593B1 (en) * 1998-07-31 2003-10-28 Adobe Systems, Incorporated Converting bitmap objects to polygons
US7388988B2 (en) * 2002-01-14 2008-06-17 Hewlett-Packard Development Company, L.P. Systems and methods for processing boundary information of a graphical object
CN101082980A (en) * 2006-06-01 2007-12-05 上海吉量软件科技有限公司 Intersection point matched pair stuffing algorithm

Also Published As

Publication number Publication date
TWI383336B (en) 2013-01-21

Similar Documents

Publication Publication Date Title
CN114549731B (en) Method and device for generating visual angle image, electronic equipment and storage medium
JP4418044B2 (en) Method for displaying characters in a digital font, method for defining characters in a digital font, and method for generating characters in a digital font
WO2021121108A1 (en) Image super-resolution and model training method and apparatus, electronic device, and medium
US7688317B2 (en) Texture mapping 2-D text properties to 3-D text
TW378312B (en) Circuit for determining non-homogeneous second order perspective texture mapping coordinates using linear interpolation
JP2010279038A (en) Method and system for electronic image real-time personalization
WO2024045442A1 (en) Image correction model training method, image correction method, device and storage medium
CN112053424B (en) Rendering method and device of 3D model
CN105930464B (en) Web rich media cross-screen adaptation method and device
CN115330986B (en) Method and system for processing graphics in block rendering mode
CN100481000C (en) Window and icon set system and method
EP4207051A1 (en) Image super-resolution method and electronic device
CN112700516B (en) Video rendering method and device based on deep learning
JP4677647B2 (en) Image processing apparatus, computer, and image forming apparatus
TW201019270A (en) Method for fast filling coordinate points in a polygon
US9275487B1 (en) System and method for performing non-affine deformations
AU2019200269B2 (en) An interactive user interface and its corresponding engine for improving image completion quality
TWI363311B (en) Method and device for scaling up or scaling down images with the same hardware
JP2021022922A (en) Method and device for correcting rolling shutter phenomenon, and computer-readable recording medium
CN107977923B (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
WO2022016996A1 (en) Image processing method, device, electronic apparatus, and computer readable storage medium
JP2019197324A (en) Image processing apparatus and image processing method
JP2008035455A (en) Image processing apparatus and program
JP2007006189A (en) Image forming apparatus
TWI799050B (en) Electronic device and method for detecting and recognizing character

Legal Events

Date Code Title Description
MM4A Annulment or lapse of patent due to non-payment of fees