블로그 이미지
재미 공작소!
루미루트

Notice

Recent Post

Recent Comment

Recent Trackback

Archive

calendar

1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
  • total
  • today
  • yesterday

'분류 전체보기'에 해당되는 글 6건

  1. 2007.05.08 Flood fill 알고리즘 5
  2. 2007.04.27 특수문자
  3. 2007.04.23 대항해시대2 for windows XP
  4. 2007.04.20 Greek alphabet 2
  5. 2007.04.13 ASCII CODE 1
  6. 2007.04.11 Open The Blog! Wow~!
2007. 5. 8. 21:48 카테고리 없음

Flood fill

Flood fill, also called seed fill, is an algorithm that determines the area connected to a given node in a multi-dimensional array. It is used in the "bucket" fill tool of paint programs to determine which parts of a bitmap to fill with color, and in puzzle games such as Minesweeper, Puyo Puyo, Lumines, and Magical Drop for determining which pieces are cleared.

 
 
recursive flood-fill with 4 directions

 
The flood fill algorithm takes three parameters: a start node, a target color, and a replacement color. The algorithm looks for all nodes in the array which are connected to the start node by a path of the target color, and changes them to the replacement color. There are many ways in which the flood-fill algorithm can be structured, but they all make use of a
queue or stack data structure, explicitly or implicitly. One implicitly stack-based (recursive) flood-fill implementation (for a two-dimensional array) goes as follows:


Flood-fill
(node, target-color, replacement-color): 1. If the color of node is not equal to target-color, return. 2. Set the color of node to replacement-color. 3. Perform Flood-fill (one step to the west of node, target-color, replacement-color). Perform Flood-fill (one step to the east of node, target-color, replacement-color). Perform Flood-fill (one step to the north of node, target-color, replacement-color). Perform Flood-fill (one step to the south of node, target-color, replacement-color). 4. Return.








recursive flood-fill with 8 directions

 
Though easy to understand, this implementation is impractical in languages and environments where stack space is severely constrained (e.g.
Java applets).

An explicitly queue-based implementation might resemble the following:


Flood-fill
(node, target-color, replacement-color): 1. Set Q to the empty queue. 2. If the color of node is not equal to target-color, return. 3. Add node to the end of Q. 4. For each element n of Q: 5. Set the color of n to replacement-color. 6. If the color of the node to the west of n is target-color, add that node to the end of Q. If the color of the node to the east of n is target-color, add that node to the end of Q. If the color of the node to the north of n is target-color, add that node to the end of Q. If the color of the node to the south of n is target-color, add that node to the end of Q. 7. Continue looping until Q is exhausted. 8. Return.






Most practical implementations use a loop for the west and east directions as an optimization to avoid the overhead of queue management:











Flood-fill
(node, target-color, replacement-color): 1. Set Q to the empty queue. 2. If the color of node is not equal to target-color, return. 3. Add node to the end of Q. 4. For each element n of Q: 5. If the color of n is not equal to target-color, skip this iteration. 6. Set w and e equal to n. 7. Move w to the west until the color of the node to the west of w no longer matches target-color. 8. Move e to the east until the color of the node to the east of e no longer matches target-color. 9. Set the color of nodes between w and e to replacement-color. 10. For each node n between w and e: 11. If the color of the node to the north of n is target-color, add that node to the end of Q. If the color of the node to the south of n is target-color, add that node to the end of Q. 12. Continue looping until Q is exhausted. 13. Return.


Adapting the algorithm to use an additional array to store the shape of the region allows generalization to cover "fuzzy" flood filling, where an element can differ by up to a specified threshold from the source symbol. Using this additional array as an
alpha channel allows the edges of the filled region to blend somewhat smoothly with the not-filled region.


Scanline Fill

The algorithm can be sped up by filling lines. Instead of pushing each potential future pixel coordinate into the stack, it inspects the neighbour lines (previous and next) to find adjacent segments that may be filled in a future pass; the coordinates (either the start or the end) of the line segment are pushed on the stack. In most of cases this scanline algorithm is at least an order of magnitude faster than the per-pixel one...

posted by 루미루트
2007. 4. 27. 01:45 카테고리 없음
! - Exclamation Point (엑스클러메이션 포인트)
" - Quotation Mark (쿼테이션 마크)
# - Crosshatch (크로스해치), Sharp(샵), Pound Sign(파운드 사인)
$ - Dollar Sign (달러사인)
% - Percent Sign (퍼센트사인)
@ - At Sign (앳 사인, 혹은 앳), Commercial At(커머셜 앳)
& - Ampersand (앰퍼샌드)
' - Apostrophe (어파스트로피)
* - Asterisk (애스터리스크)
- - Hyphen (하이픈), Dash (대시)
. - Period (피리어드), Full Stop (풀스탑)
/ - Slash (슬래시), Virgule (버귤)
\ - Back Slash (백슬래시)
\ - Won sign (원사인)
: - Colon (콜론)
; - Semicolon (세미콜론)
^ - Circumflex (서컴플렉스), Caret (캐럿)
` - Grave (그레이브)
{ - Left Brace (레프트 브레이스)
} - Right Brace (라이트 브레이스)
[ - Left Bracket (레프트 브래킷)
] - Right Bracket (라이트 브래킷)
( - Left Parenthesis (레프트 퍼렌씨시스)
) - Right Parenthesis (라이트 퍼렌씨시스)
| - Vertical Bar (버티컬바)
~ - Tilde (틸드)
= - Equal Sign (이퀄사인)
+ - Plus Sign (플러스사인)
- - Minus Sign (마이너스사인)
_ - Underscore (언더스코어), Underline (언더라인)
< - Less Than Sign (레스댄 사인), Left Angle Bracket(레프트 앵글브래킷)
> - Greater Than Sign (그레이터댄 사인), Right Angle Bracket (라이트 앵글브래킷)
posted by 루미루트
2007. 4. 23. 19:52 카테고리 없음
posted by 루미루트
2007. 4. 20. 03:15 카테고리 없음
Main alphabet

Below is a table listing the modern Greek letters, as well as their forms when romanized. The table also provides the equivalent phoenician letter from which each Greek letter is derived. Pronunciations transcribed using the International Phonetic Alphabet.

Also note that the classical pronunciation given below is the reconstructed pronunciation of Attic in the late 5th and early 4th century (BC). Some of the letters had different pronunciations in pre-classical times or in non-Attic dialects. For details, see History of the Greek alphabet and Ancient Greek phonology. For details on post-classical Ancient Greek pronunciation, see Koine Greek phonology.

Letter Name Pronunciation Corresponding
Phoenician
letter
Transliteration1 Numeric value
Ancient
Greek
Medieval
Greek
(polytonic)
Modern
Greek
English Classical
Ancient
Greek
Modern
Greek
Ancient
Greek
Modern
Greek
Α α ἄλφα άλφα Alpha [a] [aː] [a] Aleph Aleph a 1
Β β βῆτα βήτα Beta [b] [v] Beth Beth b v 2
Γ γ γάμμα γάμμα
γάμα
Gamma [g] [ɣ~ʝ] Gimel Gimel g gh, g, y 3
Δ δ δέλτα δέλτα Delta [d] [ð] Daleth Daleth d d, dh 4
Ε ε εἶ ἒ ψιλόν έψιλον Epsilon [e] He He e 5
Ζ ζ ζῆτα ζήτα Zeta [zd]
(or [dz]?)
later [zː]
[z] Zayin Zayin z 7
Η η ἦτα ήτα Eta [ɛː] [i] Heth Heth e, ē i 8
Θ θ θῆτα θήτα Theta [tʰ] [θ] Teth Teth th 9
Ι ι ἰῶτα ιώτα
γιώτα
Iota [i] [iː] [i], [j] Yodh Yodh i 10
Κ κ κάππα κάππα
κάπα
Kappa [k] [k~c] Kaph Kaph k 20
Λ λ λάβδα λάμβδα λάμδα
λάμβδα
Lambda [l] Lamedh Lamedh l 30
Μ μ μῦ μι
μυ
Mu [m] Mem Mem m 40
Ν ν νῦ νι
νυ
Nu [n] Nun Nun n 50
Ξ ξ ξεῖ ξῖ ξι Xi [ks] Samekh Samekh x x, ks 60
Ο ο οὖ ὂ μικρόν όμικρον Omicron [o] Ayin 'Ayin o 70
Π π πεῖ πῖ πι Pi [p] Pe Pe p 80
Ρ ρ ῥῶ ρω Rho [r], [r̥] [r] Res Resh r (: rh) r 100
Σ σ
ς
(final)
σῖγμα σίγμα Sigma [s] Sin Shin s 200
Τ τ ταῦ ταυ Tau [t] Taw Taw t 300
Υ υ ὓ ψιλόν ύψιλον Upsilon [y] [yː]
(earlier [u] [uː])
[i] Waw Waw u, y y, v, f 400
Φ φ φεῖ φῖ φι Phi [pʰ] [f] origin disputed
(see text)
ph f 500
Χ χ χεῖ χῖ χι Chi [kʰ] [x~ç] ch ch, kh 600
Ψ ψ ψεῖ ψῖ ψι Psi [ps] ps 700
Ω ω ὦ μέγα ωμέγα Omega [ɔː] [o] Ayin 'Ayin o, ō o 800

* 출처 : http://en.wikipedia.org/wiki/Greek_alphabet
posted by 루미루트
2007. 4. 13. 14:14 카테고리 없음
ASCII control characters

Binary Oct Dec Hex Abbr PR[a] CS[b] CEC[c] Description
000 0000 000 0 00 NUL ^@ \0 Null character
000 0001 001 1 01 SOH ^A Start of Header
000 0010 002 2 02 STX ^B Start of Text
000 0011 003 3 03 ETX ^C End of Text
000 0100 004 4 04 EOT ^D End of Transmission
000 0101 005 5 05 ENQ ^E Enquiry
000 0110 006 6 06 ACK ^F Acknowledgment
000 0111 007 7 07 BEL ^G \a Bell
000 1000 010 8 08 BS ^H \b Backspace[d][i]
000 1001 011 9 09 HT ^I \t Horizontal Tab
000 1010 012 10 0A LF ^J \n Line feed
000 1011 013 11 0B VT ^K \v Vertical Tab
000 1100 014 12 0C FF ^L \f Form feed
000 1101 015 13 0D CR ^M \r Carriage return[h]
000 1110 016 14 0E SO ^N Shift Out
000 1111 017 15 0F SI ^O Shift In
001 0000 020 16 10 DLE ^P Data Link Escape
001 0001 021 17 11 DC1 ^Q Device Control 1 (oft. XON)
001 0010 022 18 12 DC2 ^R Device Control 2
001 0011 023 19 13 DC3 ^S Device Control 3 (oft. XOFF)
001 0100 024 20 14 DC4 ^T Device Control 4
001 0101 025 21 15 NAK ^U Negative Acknowledgement
001 0110 026 22 16 SYN ^V Synchronous Idle
001 0111 027 23 17 ETB ^W End of Trans. Block
001 1000 030 24 18 CAN ^X Cancel
001 1001 031 25 19 EM ^Y End of Medium
001 1010 032 26 1A SUB ^Z Substitute
001 1011 033 27 1B ESC ^[ \e[f] Escape[g]
001 1100 034 28 1C FS ^\ File Separator
001 1101 035 29 1D GS ^] Group Separator
001 1110 036 30 1E RS ^^ Record Separator
001 1111 037 31 1F US ^_ Unit Separator
111 1111 177 127 7F DEL ^? Delete[e][i]


ASCII printable characters

Binary Oct Dec Hex Glyph
010 0000 040 32 20 SP
010 0001 041 33 21 !
010 0010 042 34 22 "
010 0011 043 35 23 #
010 0100 044 36 24 $
010 0101 045 37 25 %
010 0110 046 38 26 &
010 0111 047 39 27 '
010 1000 050 40 28 (
010 1001 051 41 29 )
010 1010 052 42 2A *
010 1011 053 43 2B +
010 1100 054 44 2C ,
010 1101 055 45 2D -
010 1110 056 46 2E .
010 1111 057 47 2F /
011 0000 060 48 30 0
011 0001 061 49 31 1
011 0010 062 50 32 2
011 0011 063 51 33 3
011 0100 064 52 34 4
011 0101 065 53 35 5
011 0110 066 54 36 6
011 0111 067 55 37 7
011 1000 070 56 38 8
011 1001 071 57 39 9
011 1010 072 58 3A :
011 1011 073 59 3B ;
011 1100 074 60 3C <
011 1101 075 61 3D =
011 1110 076 62 3E >
011 1111 077 63 3F ?
 
Binary Oct Dec Hex Glyph
100 0000 100 64 40 @
100 0001 101 65 41 A
100 0010 102 66 42 B
100 0011 103 67 43 C
100 0100 104 68 44 D
100 0101 105 69 45 E
100 0110 106 70 46 F
100 0111 107 71 47 G
100 1000 110 72 48 H
100 1001 111 73 49 I
100 1010 112 74 4A J
100 1011 113 75 4B K
100 1100 114 76 4C L
100 1101 115 77 4D M
100 1110 116 78 4E N
100 1111 117 79 4F O
101 0000 120 80 50 P
101 0001 121 81 51 Q
101 0010 122 82 52 R
101 0011 123 83 53 S
101 0100 124 84 54 T
101 0101 125 85 55 U
101 0110 126 86 56 V
101 0111 127 87 57 W
101 1000 130 88 58 X
101 1001 131 89 59 Y
101 1010 132 90 5A Z
101 1011 133 91 5B [
101 1100 134 92 5C \
101 1101 135 93 5D ]
101 1110 136 94 5E ^
101 1111 137 95 5F _
 
Binary Oct Dec Hex Glyph
110 0000 140 96 60 `
110 0001 141 97 61 a
110 0010 142 98 62 b
110 0011 143 99 63 c
110 0100 144 100 64 d
110 0101 145 101 65 e
110 0110 146 102 66 f
110 0111 147 103 67 g
110 1000 150 104 68 h
110 1001 151 105 69 i
110 1010 152 106 6A j
110 1011 153 107 6B k
110 1100 154 108 6C l
110 1101 155 109 6D m
110 1110 156 110 6E n
110 1111 157 111 6F o
111 0000 160 112 70 p
111 0001 161 113 71 q
111 0010 162 114 72 r
111 0011 163 115 73 s
111 0100 164 116 74 t
111 0101 165 117 75 u
111 0110 166 118 76 v
111 0111 167 119 77 w
111 1000 170 120 78 x
111 1001 171 121 79 y
111 1010 172 122 7A z
111 1011 173 123 7B {
111 1100 174 124 7C |
111 1101 175 125 7D }
111 1110 176 126 7E ~
posted by 루미루트
2007. 4. 11. 02:30 카테고리 없음
posted by 루미루트