{"id":4809,"date":"2020-03-24T16:32:04","date_gmt":"2020-03-24T07:32:04","guid":{"rendered":"http:\/\/aval-global.com\/?p=4809"},"modified":"2020-03-24T19:29:54","modified_gmt":"2020-03-24T10:29:54","slug":"c-%ec%98%81%ec%83%81%ec%9d%98-%ed%9c%98%eb%8f%84-%ea%b0%92-%ec%b7%a8%eb%93%9d-%ec%86%8d%eb%8f%84-%eb%b9%84%ea%b5%90","status":"publish","type":"post","link":"https:\/\/aval-global.com\/?p=4809&lang=ko","title":{"rendered":"[C#] \uc601\uc0c1\uc758 \ud718\ub3c4 \uac12 \ucde8\ub4dd \uc18d\ub3c4 \ube44\uad50"},"content":{"rendered":"<p><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-1 fusion-flex-container nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row fusion-flex-align-items-flex-start fusion-flex-content-wrap\" style=\"max-width:calc( 1150px + 0px );margin-left: calc(-0px \/ 2 );margin-right: calc(-0px \/ 2 );\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-0 fusion_builder_column_1_1 1_1 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:100%;--awb-margin-top-large:0px;--awb-spacing-right-large:0px;--awb-margin-bottom-large:20px;--awb-spacing-left-large:0px;--awb-width-medium:100%;--awb-spacing-right-medium:0px;--awb-spacing-left-medium:0px;--awb-width-small:100%;--awb-spacing-right-small:0px;--awb-spacing-left-small:0px;\"><div class=\"fusion-column-wrapper fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-text fusion-text-1\"><p>C#\uc5d0\uc11c \uc601\uc0c1\uc758 \ud718\ub3c4 \uac12\uc744 \ucde8\ub4dd\ud558\uac70\ub098 \uc124\uc815\ud560 \ub54c, GetPixel, SetPixel \ubc29\uc2dd\uc744 \uc0ac\uc6a9\ud558\uba74 \uc18d\ub3c4\uac00 \ub2a6\uc5b4\uc9c0\uae30 \ub54c\ubb38\uc5d0 LockBits ~ UnlockBits\uc5d0 \ubc84\ud2bc\uc744 \ub178\ucd9c\uc2dc\ucf1c \ud718\ub3c4\ub97c \ucde8\ub4dd\ud558\uac70\ub098 \uc124\uc815\ud558\ub294 \uac83\uc774 \uc77c\ubc18\uc801\uc785\ub2c8\ub2e4. \uc774\ubc88 \uc2dc\uac04\uc5d0\ub294 \uc5ec\ub7ec\uac00\uc9c0 \ucc98\ub9ac \ubc29\ubc95\uc744 \uc774\uc6a9\ud588\uc744 \ub54c\uc758 \ucc98\ub9ac \uc2dc\uac04\uc744 \ube44\uad50\ud574 \ubcf4\uc558\uc2b5\ub2c8\ub2e4.<\/p>\n<table style=\"border-collapse: collapse; width: 37.926%; height: 168px;\" border=\"1\">\n<tbody>\n<tr style=\"height: 24px;\">\n<td style=\"width: 10.6962%; background-color: #1940b5; height: 24px;\" colspan=\"2\"><span style=\"color: #ffffff;\">Testing Environment<\/span><\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 10.6962%; height: 24px;\">OS<\/td>\n<td style=\"width: 27.2603%; height: 24px;\">Windows10 64bit ver.1809<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 10.6962%; height: 24px;\">CPU<\/td>\n<td style=\"width: 27.2603%; height: 24px;\">Intel Core i7-7700K 4.2GHz<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 10.6962%; height: 24px;\">Memory<\/td>\n<td style=\"width: 27.2603%; height: 24px;\">32GB<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 10.6962%; height: 24px;\">.NET Framework<\/td>\n<td style=\"width: 27.2603%; height: 24px;\">4.5.2<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 10.6962%; height: 24px;\">\ud50c\ub7ab\ud3fc<\/td>\n<td style=\"width: 27.2603%; height: 24px;\">Any CPU (32Bit \uc6b0\uc120)<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 10.6962%; height: 24px;\">\ud3c9\uac00\uc601\uc0c1<\/td>\n<td style=\"width: 27.2603%; height: 24px;\">JPEG 6,000 x 4,000px 24bit Color<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\ud14c\uc2a4\ud2b8\ub294 \uceec\ub7ec\uc601\uc0c1\uc758 \ud718\ub3c4 \uac12\uc744 R,G,B\ub85c \uac01\uac01 \ucde8\ub4dd\ud558\uace0 \uba85\uc554 \uac12\uc744 \ubc18\uc804\ud558\uc5ec \ud718\ub3c4 \uac12\uc744 \ub2e4\uc2dc \ub300\uc785\ud558\ub294 \ud504\ub85c\uadf8\ub7a8\uc744 \uc0ac\uc6a9\ud558\uc600\uc2b5\ub2c8\ub2e4.<\/p>\n<ol>\n<li>\ucc98\ub9ac\uacb0\uacfc\ub294 \uc544\ub798\uc640 \uac19\uc774 \ubc1d\uc74c\u2192\uc5b4\ub450\uc6c0\u2192\ubc1d\uc74c\u2192\uc5b4\ub450\uc6c0\uc744 \ubc18\ubcf5\ud558\ub3c4\ub85d \ud558\uc600\uc2b5\ub2c8\ub2e4.<\/li>\n<li>\ucc98\ub9ac \uc2dc\uac04 : 5\ubc88 \ubc18\ubcf5 \ucc98\ub9ac \uc2dc\uc758 \ud3c9\uade0 \uc2dc\uac04\uc744 \uce21\uc815\ud558\uc600\uc2b5\ub2c8\ub2e4.<\/li>\n<\/ol>\n<p><img decoding=\"async\" class=\"alignnone size-800 alignleft\" src=\"https:\/\/imagingsolution.net\/wordpress\/wp-content\/uploads\/2019\/11\/set_get_bright_speed_1.png\" width=\"391\" height=\"353\" \/><img decoding=\"async\" class=\"alignnone size-800 alignleft\" src=\"https:\/\/imagingsolution.net\/wordpress\/wp-content\/uploads\/2019\/11\/set_get_bright_speed_2.png\" width=\"391\" height=\"353\" \/><\/p>\n<\/div><\/div><\/div><\/div><\/div><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-2 fusion-flex-container nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row fusion-flex-align-items-flex-start fusion-flex-content-wrap\" style=\"max-width:calc( 1150px + 0px );margin-left: calc(-0px \/ 2 );margin-right: calc(-0px \/ 2 );\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-1 fusion_builder_column_1_1 1_1 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:100%;--awb-margin-top-large:0px;--awb-spacing-right-large:0px;--awb-margin-bottom-large:20px;--awb-spacing-left-large:0px;--awb-width-medium:100%;--awb-spacing-right-medium:0px;--awb-spacing-left-medium:0px;--awb-width-small:100%;--awb-spacing-right-small:0px;--awb-spacing-left-small:0px;\"><div class=\"fusion-column-wrapper fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-text fusion-text-2\"><h3>1. GetPixel, SetPixel\uc744 \uc0ac\uc6a9\ud55c \ubc29\ubc95<\/h3>\n<\/div><style type=\"text\/css\" scopped=\"scopped\">.fusion-syntax-highlighter-1 > .CodeMirror, .fusion-syntax-highlighter-1 > .CodeMirror .CodeMirror-gutters {background-color:var(--awb-color1);}.fusion-syntax-highlighter-1 > .CodeMirror .CodeMirror-gutters { background-color: var(--awb-color2); }.fusion-syntax-highlighter-1 > .CodeMirror .CodeMirror-linenumber { color: var(--awb-color8); }<\/style><div class=\"fusion-syntax-highlighter-container fusion-syntax-highlighter-1 fusion-syntax-highlighter-theme-light\" style=\"opacity:0;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:14px;border-width:1px;border-style:solid;border-color:var(--awb-color3);\"><div class=\"syntax-highlighter-copy-code\"><span class=\"syntax-highlighter-copy-code-title\" data-id=\"fusion_syntax_highlighter_1\" style=\"font-size:14px;\">Copy to Clipboard<\/span><\/div><label for=\"fusion_syntax_highlighter_1\" class=\"screen-reader-text\">Syntax Highlighter<\/label><textarea class=\"fusion-syntax-highlighter-textarea\" id=\"fusion_syntax_highlighter_1\" data-readOnly=\"nocursor\" data-lineNumbers=\"1\" data-lineWrapping=\"\" data-theme=\"default\" data-mode=\"text\/x-scss\">\/\/\/ <summary>\n\/\/\/ GetPixel\u3001SetPixel\ub85c \ud718\ub3c4 \uac12 \ucde8\ub4dd \uc124\uc815\n\/\/\/ <\/summary>\n\/\/\/ <param name=\"bmp\"><\/param>\nprivate void NegativeImage1(Bitmap bmp)\n{\nvar width = bmp.Width;\nvar height = bmp.Height;\nColor col;\nint r, g, b;\nfor (int y = 0; y < height; y++)\n{\nfor (int x = 0; x < width; x++)\n{\n\/\/ \ud718\ub3c4 \uac12 \ucde8\ub4dd\ncol = bmp.GetPixel(x, y);\nr = col.R;\ng = col.G;\nb = col.B;\n\/\/ \uc0c9 \ubc18\uc804\ncol = Color.FromArgb(255 - r, 255 - g, 255 - b);\n\/\/ \ud718\ub3c4 \uac12 \uc124\uc815\nbmp.SetPixel(x, y, col);\n}\n}\n}\n\ud3c9\uade0 \ucc98\ub9ac \uc2dc\uac04\uc740 27,439msec \n\n<\/textarea><\/div><div class=\"fusion-text fusion-text-3\"><h3>2. LockBits~UnlockBits\uc5d0\uc11c \ud3ec\uc778\ud130\uff08Scan0\uff09\uc744 \ucde8\ub4dd\ud558\uace0 \ub370\uc774\ud130\ub97c \ubcf5\uc0ac\ud558\uc5ec \ucc98\ub9ac\ud55c \ud6c4,<br \/>\n\uacb0\uacfc\ub97c \uae30\uc900\uc73c\ub85c \uc7ac\ubcf5\uc0ac \ud558\ub294 \ubc29\ubc95<\/h3>\n<\/div><style type=\"text\/css\" scopped=\"scopped\">.fusion-syntax-highlighter-2 > .CodeMirror, .fusion-syntax-highlighter-2 > .CodeMirror .CodeMirror-gutters {background-color:var(--awb-color1);}.fusion-syntax-highlighter-2 > .CodeMirror .CodeMirror-gutters { background-color: var(--awb-color2); }.fusion-syntax-highlighter-2 > .CodeMirror .CodeMirror-linenumber { color: var(--awb-color8); }<\/style><div class=\"fusion-syntax-highlighter-container fusion-syntax-highlighter-2 fusion-syntax-highlighter-theme-light\" style=\"opacity:0;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:14px;border-width:1px;border-style:solid;border-color:var(--awb-color3);\"><div class=\"syntax-highlighter-copy-code\"><span class=\"syntax-highlighter-copy-code-title\" data-id=\"fusion_syntax_highlighter_2\" style=\"font-size:14px;\">Copy to Clipboard<\/span><\/div><label for=\"fusion_syntax_highlighter_2\" class=\"screen-reader-text\">Syntax Highlighter<\/label><textarea class=\"fusion-syntax-highlighter-textarea\" id=\"fusion_syntax_highlighter_2\" data-readOnly=\"nocursor\" data-lineNumbers=\"1\" data-lineWrapping=\"\" data-theme=\"default\" data-mode=\"text\/x-scss\">\/\/\/ <summary>\n\/\/\/ Lock Bits, Unlock Bits\uc5d0\uc11c \uc601\uc0c1 \ub370\uc774\ud130\ub97c \ud3ec\uc778\ud2b8\ub85c \ucde8\ub4dd\ud558\uace0 \ubc30\uc5f4 \uc21c\uc73c\ub85c \ucc98\ub9ac \n\/\/\/ <\/summary>\n\/\/\/ <param name=\"bmp\"><\/param>\nprivate void NegativeImage2(Bitmap bmp)\n{\nvar width = bmp.Width;\nvar height = bmp.Height;\n\/\/ Bitmap\ub97c Lock\nvar bmpData = bmp.LockBits(\nnew Rectangle(0, 0, width, height),\nSystem.Drawing.Imaging.ImageLockMode.ReadWrite,\nbmp.PixelFormat\n);\n\/\/ \uba54\ubaa8\ub9ac \ud3ed\uc758 Byte \uc218\ub97c \ucde8\ub4dd\nvar stride = Math.Abs(bmpData.Stride);\n\/\/ \uc601\uc0c1 \ub370\uc774\ud130 \uc800\uc7a5\uc6a9 \ubc30\uc5f4\nvar data = new byte[stride * bmpData.Height];\n\/\/ Bitmap\ub370\uc774\ud130\ub97c \ubcf5\uc0ac\nSystem.Runtime.InteropServices.Marshal.Copy(\nbmpData.Scan0,\ndata,\n0,\nstride * bmpData.Height\n);\nbyte r, g, b;\nint lineIndex = 0;\nfor (int y = 0; y < height; y++)\n{\nfor (int x = 0; x < width * 3; x += 3)\n{\n\/\/ \ud718\ub3c4 \uac12 \ucde8\ub4dd\nr = data[lineIndex + x + 2];\ng = data[lineIndex + x + 1];\nb = data[lineIndex + x]; ;\n\/\/ \ud718\ub3c4 \uac12 \uc124\uc815\ndata[lineIndex + x + 2] = (byte)(255 - r);\ndata[lineIndex + x + 1] = (byte)(255 - g);\ndata[lineIndex + x] = (byte)(255 - b);\n}\nlineIndex += stride;\n}\n\/\/ \ubc30\uc5f4\uc744 Bitmap \ub370\uc774\ud130\ub85c \ubcf5\uc0ac\nSystem.Runtime.InteropServices.Marshal.Copy(\ndata,\n0,\nbmpData.Scan0,\nstride * bmpData.Height\n);\n\/\/ Unlock\nbmp.UnlockBits(bmpData);\n}\n\ud3c9\uade0 \ucc98\ub9ac \uc2dc\uac04\uc740 101msec<\/textarea><\/div><div class=\"fusion-text fusion-text-4\"><h3>3. Marshal\ud074\ub798\uc2a4\uc758 ReadByte, WriteByte \ubc29\ubc95\uc73c\ub85c \ud3ec\uc778\ud130(Scan0)\uc5d0 \uc9c1\uc811 \uac12\uc744 \uc77d\uace0 \uc4f0\ub294 \ubc29\ubc95<\/h3>\n<\/div><style type=\"text\/css\" scopped=\"scopped\">.fusion-syntax-highlighter-3 > .CodeMirror, .fusion-syntax-highlighter-3 > .CodeMirror .CodeMirror-gutters {background-color:var(--awb-color1);}.fusion-syntax-highlighter-3 > .CodeMirror .CodeMirror-gutters { background-color: var(--awb-color2); }.fusion-syntax-highlighter-3 > .CodeMirror .CodeMirror-linenumber { color: var(--awb-color8); }<\/style><div class=\"fusion-syntax-highlighter-container fusion-syntax-highlighter-3 fusion-syntax-highlighter-theme-light\" style=\"opacity:0;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:14px;border-width:1px;border-style:solid;border-color:var(--awb-color3);\"><div class=\"syntax-highlighter-copy-code\"><span class=\"syntax-highlighter-copy-code-title\" data-id=\"fusion_syntax_highlighter_3\" style=\"font-size:14px;\">Copy to Clipboard<\/span><\/div><label for=\"fusion_syntax_highlighter_3\" class=\"screen-reader-text\">Syntax Highlighter<\/label><textarea class=\"fusion-syntax-highlighter-textarea\" id=\"fusion_syntax_highlighter_3\" data-readOnly=\"nocursor\" data-lineNumbers=\"1\" data-lineWrapping=\"\" data-theme=\"default\" data-mode=\"text\/x-scss\">\/\/\/ <summary>\n\/\/\/ Marshal\ud074\ub798\uc2a4\uc758 ReadByte, WriteByte\ub85c \ud718\ub3c4 \uac12\uc744 \ucde8\ub4dd\ud558\ub294 \ubc29\ubc95\n\/\/\/ <\/summary>\n\/\/\/ <param name=\"bmp\"><\/param>\nprivate void NegativeImage3(Bitmap bmp)\n{\nvar width = bmp.Width;\nvar height = bmp.Height;\n\/\/ Bitmap\ub97c Lock\nvar bmpData = bmp.LockBits(\nnew Rectangle(0, 0, width, height),\nSystem.Drawing.Imaging.ImageLockMode.ReadWrite,\nbmp.PixelFormat\n);\n\/\/ \uba54\ubaa8\ub9ac \ud3ed\uc758 Byte\uc218\ub97c \ucde8\ub4dd\nvar stride = Math.Abs(bmpData.Stride);\nbyte r, g, b;\nint lineIndex = 0;\nvar ptr = bmpData.Scan0;\nfor (int y = 0; y < height; y++)\n{\nfor (int x = 0; x < width * 3; x += 3)\n{\n\/\/ \ud718\ub3c4 \uac12\uc744 \ucde8\ub4dd\nr = System.Runtime.InteropServices.Marshal.ReadByte(ptr, lineIndex + x + 2);\ng = System.Runtime.InteropServices.Marshal.ReadByte(ptr, lineIndex + x + 1);\nb = System.Runtime.InteropServices.Marshal.ReadByte(ptr, lineIndex + x);\n\/\/ \ud718\ub3c4 \uac12 \uc124\uc815\nSystem.Runtime.InteropServices.Marshal.WriteByte(ptr, lineIndex + x + 2, (byte)(255 - r));\nSystem.Runtime.InteropServices.Marshal.WriteByte(ptr, lineIndex + x + 1, (byte)(255 - g));\nSystem.Runtime.InteropServices.Marshal.WriteByte(ptr, lineIndex + x, (byte)(255 - b));\n}\nlineIndex += stride;\n}\n\/\/ Unlock\nbmp.UnlockBits(bmpData);\n\n\ud3c9\uade0 \ucc98\ub9ac \uc2dc\uac04\uc740273.6msec<\/textarea><\/div><div class=\"fusion-text fusion-text-5\"><h3>4. Unsafe\ub97c \uc0ac\uc6a9\ud55c \ud3ec\uc778\ud130(Scan0)\uc744 \uc9c1\uc811 \uc77d\uace0 \uc4f0\ub294 \ubc29\ubc95<\/h3>\n<\/div><style type=\"text\/css\" scopped=\"scopped\">.fusion-syntax-highlighter-4 > .CodeMirror, .fusion-syntax-highlighter-4 > .CodeMirror .CodeMirror-gutters {background-color:var(--awb-color1);}.fusion-syntax-highlighter-4 > .CodeMirror .CodeMirror-gutters { background-color: var(--awb-color2); }.fusion-syntax-highlighter-4 > .CodeMirror .CodeMirror-linenumber { color: var(--awb-color8); }<\/style><div class=\"fusion-syntax-highlighter-container fusion-syntax-highlighter-4 fusion-syntax-highlighter-theme-light\" style=\"opacity:0;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:14px;border-width:1px;border-style:solid;border-color:var(--awb-color3);\"><div class=\"syntax-highlighter-copy-code\"><span class=\"syntax-highlighter-copy-code-title\" data-id=\"fusion_syntax_highlighter_4\" style=\"font-size:14px;\">Copy to Clipboard<\/span><\/div><label for=\"fusion_syntax_highlighter_4\" class=\"screen-reader-text\">Syntax Highlighter<\/label><textarea class=\"fusion-syntax-highlighter-textarea\" id=\"fusion_syntax_highlighter_4\" data-readOnly=\"nocursor\" data-lineNumbers=\"1\" data-lineWrapping=\"\" data-theme=\"default\" data-mode=\"text\/x-scss\">\/\/\/ <summary>\n\/\/\/ usafe\uc758 \ud3ec\uc778\ud130\ub97c \uc0ac\uc6a9\ud558\uc5ec \ud718\ub3c4 \uac12\uc744 \ucde8\ub4dd\ud558\ub294 \ubc29\ubc95\n\/\/\/ <\/summary>\n\/\/\/ <param name=\"bmp\"><\/param>\nprivate void NegativeImage4(Bitmap bmp)\n{\nvar width = bmp.Width;\nvar height = bmp.Height;\n\/\/ Bitmap\uc744 Lock\nvar bmpData = bmp.LockBits(\nnew Rectangle(0, 0, width, height),\nSystem.Drawing.Imaging.ImageLockMode.ReadWrite,\nbmp.PixelFormat\n);\n\/\/ \uba54\ubaa8\ub9ac \ud3ed\uc758 Byte\uc218 \ucde8\ub4dd\nvar stride = Math.Abs(bmpData.Stride);\nunsafe\n{\n\/\/ \uc601\uc0c1 \ub370\uc774\ud130 \uc800\uc7a5\uc6a9 \ubc30\uc5f4\nvar ptr = (byte*)bmpData.Scan0;\nbyte r, g, b;\nbyte* pLine = ptr;\nfor (int y = 0; y < height; y++)\n{\n\/\/ \ud589\uc758 \uccab \uba38\ub9ac \ud3ec\uc778\ud2b8\nptr = pLine;\nfor (int x = 0; x < width; x++)\n{\n\/\/ \ud718\ub3c4 \uac12 \ucde8\ub4dd\nr = ptr[2];\ng = ptr[1];\nb = ptr[0];\n\/\/ \ud718\ub3c4 \uac12 \uc124\uc815\nptr[2] = (byte)(255 - r);\nptr[1] = (byte)(255 - g);\nptr[0] = (byte)(255 - b);\n\/\/ \ub2e4\uc74c \ud53d\uc140\ub85c \nptr += 3;\n}\n\/\/ \ub2e4\uc74c \ub77c\uc778\uc73c\ub85c \npLine += stride;\n}\n}\n\/\/ Unlock\nbmp.UnlockBits(bmpData);\n}\n\ud3c9\uade0 \ucc98\ub9ac \uc2dc\uac04\uc74025.4msec\n<\/textarea><\/div><div class=\"fusion-text fusion-text-6\"><h3>5. \ud3ec\uc778\ud130\ub85c \uc77d\uace0 \uc4f0\uba70 Parallel.For\uc744 \uc0ac\uc6a9\ud558\uc5ec \ucc98\ub9ac\ub97c \ubcd1\ub82c\ud654 \ud558\ub294 \ubc29\ubc95<\/h3>\n<\/div><style type=\"text\/css\" scopped=\"scopped\">.fusion-syntax-highlighter-5 > .CodeMirror, .fusion-syntax-highlighter-5 > .CodeMirror .CodeMirror-gutters {background-color:var(--awb-color1);}.fusion-syntax-highlighter-5 > .CodeMirror .CodeMirror-gutters { background-color: var(--awb-color2); }.fusion-syntax-highlighter-5 > .CodeMirror .CodeMirror-linenumber { color: var(--awb-color8); }<\/style><div class=\"fusion-syntax-highlighter-container fusion-syntax-highlighter-5 fusion-syntax-highlighter-theme-light\" style=\"opacity:0;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:14px;border-width:1px;border-style:solid;border-color:var(--awb-color3);\"><div class=\"syntax-highlighter-copy-code\"><span class=\"syntax-highlighter-copy-code-title\" data-id=\"fusion_syntax_highlighter_5\" style=\"font-size:14px;\">Copy to Clipboard<\/span><\/div><label for=\"fusion_syntax_highlighter_5\" class=\"screen-reader-text\">Syntax Highlighter<\/label><textarea class=\"fusion-syntax-highlighter-textarea\" id=\"fusion_syntax_highlighter_5\" data-readOnly=\"nocursor\" data-lineNumbers=\"1\" data-lineWrapping=\"\" data-theme=\"default\" data-mode=\"text\/x-scss\">\/\/\/ <summary>\n\/\/\/ usafe\uc758 \ud3ec\uc778\ud130\ub97c \uc0ac\uc6a9\ud558\uc5ec \ud718\ub3c4 \uac12\uc758 \ucde8\ub4dd \uc124\uc815\uc744 \ubcd1\ub82c \ucc98\ub9ac\n\/\/\/ <\/summary>\n\/\/\/ <param name=\"bmp\"><\/param>\nprivate void NegativeImage5(Bitmap bmp)\n{\nvar width = bmp.Width;\nvar height = bmp.Height;\n\/\/ Bitmap\uc744 Lock\nvar bmpData = bmp.LockBits(\nnew Rectangle(0, 0, width, height),\nSystem.Drawing.Imaging.ImageLockMode.ReadWrite,\nbmp.PixelFormat\n);\n\/\/ \uba54\ubaa8\ub9ac \ud3ed\uc758 Byte \uc218\ub97c \ucde8\ub4dd\nvar stride = Math.Abs(bmpData.Stride);\nunsafe\n{\n\/\/ \uc601\uc0c1 \ub370\uc774\ud130 \uc800\uc7a5\uc6a9 \ubc30\uc5f4\nvar ptr = (byte*)bmpData.Scan0;\nParallel.For(0, height, y =>\n{\n\/\/ \ud589\uc758 \uccab \uba38\ub9ac \ud3ec\uc778\ud130\nbyte* pLine = ptr + y * stride;\nfor (int x = 0; x < width; x++)\n{\n\/\/ \ud718\ub3c4 \uac12 \ucde8\ub4dd\nbyte r = pLine[2];\nbyte g = pLine[1];\nbyte b = pLine[0];\n\/\/ \ud718\ub3c4 \uac12 \uc124\uc815\npLine[2] = (byte)(255 - r);\npLine[1] = (byte)(255 - g);\npLine[0] = (byte)(255 - b);\n\/\/ \ub2e4\uc74c \ud53d\uc140\ub85c\npLine += 3;\n}\n}\n);\n}\n\/\/ Unlock\nbmp.UnlockBits(bmpData);\n}\n\n\ud3c9\uade0 \ucc98\ub9ac \uc2dc\uac04\uc74011.4msec\n<\/textarea><\/div><div class=\"fusion-text fusion-text-7\"><h3>6. \ucc98\ub9ac\ub97c \ubd88\ub7ec\uc624\ub294 \ud504\ub85c\uadf8\ub7a8<\/h3>\n<\/div><style type=\"text\/css\" scopped=\"scopped\">.fusion-syntax-highlighter-6 > .CodeMirror, .fusion-syntax-highlighter-6 > .CodeMirror .CodeMirror-gutters {background-color:var(--awb-color1);}.fusion-syntax-highlighter-6 > .CodeMirror .CodeMirror-gutters { background-color: var(--awb-color2); }.fusion-syntax-highlighter-6 > .CodeMirror .CodeMirror-linenumber { color: var(--awb-color8); }<\/style><div class=\"fusion-syntax-highlighter-container fusion-syntax-highlighter-6 fusion-syntax-highlighter-theme-light\" style=\"opacity:0;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:14px;border-width:1px;border-style:solid;border-color:var(--awb-color3);\"><div class=\"syntax-highlighter-copy-code\"><span class=\"syntax-highlighter-copy-code-title\" data-id=\"fusion_syntax_highlighter_6\" style=\"font-size:14px;\">Copy to Clipboard<\/span><\/div><label for=\"fusion_syntax_highlighter_6\" class=\"screen-reader-text\">Syntax Highlighter<\/label><textarea class=\"fusion-syntax-highlighter-textarea\" id=\"fusion_syntax_highlighter_6\" data-readOnly=\"nocursor\" data-lineNumbers=\"1\" data-lineWrapping=\"\" data-theme=\"default\" data-mode=\"text\/x-scss\">pictureBox1.SizeMode = PictureBoxSizeMode.Zoom;\nvar bmp = new Bitmap(@\"C:\\Temp\\syurijou.JPG\"); \/\/ 6000 x 4000 x 24bit\npictureBox1.Image = bmp;\nvar sw = new System.Diagnostics.Stopwatch();\nMessageBox.Show(\"\uac1c\uc2dc\");\nsw.Start();\n\/\/ GetPixel\u3001SetPixel\nNegativeImage1(bmp);\nsw.Stop();\npictureBox1.Refresh();\nMessageBox.Show($\"NegativeImage1: {sw.ElapsedMilliseconds} msec\");\nsw.Reset();\nsw.Start();\n\/\/ \ubc30\uc5f4\uc744 \uace0\ub824\ud55c \ubc29\ubc95\nNegativeImage2(bmp);\nsw.Stop();\npictureBox1.Refresh();\nMessageBox.Show($\"NegativeImage2: {sw.ElapsedMilliseconds} msec\");\nsw.Reset();\nsw.Start();\n\/\/ Mershal\u306eReadByte\u3001WriteByte\nNegativeImage3(bmp);\nsw.Stop();\npictureBox1.Refresh();\nMessageBox.Show($\"NegativeImage3: {sw.ElapsedMilliseconds} msec\");\nsw.Reset();\nsw.Start();\n\/\/ usafe\uc758 \ud3ec\uc778\ud130\nNegativeImage4(bmp);\nsw.Stop();\npictureBox1.Refresh();\nMessageBox.Show($\"NegativeImage4: {sw.ElapsedMilliseconds} msec\");\nsw.Reset();\nsw.Start();\n\/\/ usafe \ud3ec\uc778\ud130\uc758 \ubcd1\ub82c\ucc98\ub9ac\nNegativeImage5(bmp);\nsw.Stop();\npictureBox1.Refresh();\nMessageBox.Show($\"NegativeImage5: {sw.ElapsedMilliseconds} msec\");\n<\/textarea><\/div><\/div><\/div><\/div><\/div><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-3 fusion-flex-container nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row fusion-flex-align-items-flex-start fusion-flex-content-wrap\" style=\"max-width:calc( 1150px + 0px );margin-left: calc(-0px \/ 2 );margin-right: calc(-0px \/ 2 );\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-2 fusion_builder_column_1_1 1_1 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:100%;--awb-margin-top-large:0px;--awb-spacing-right-large:0px;--awb-margin-bottom-large:20px;--awb-spacing-left-large:0px;--awb-width-medium:100%;--awb-spacing-right-medium:0px;--awb-spacing-left-medium:0px;--awb-width-small:100%;--awb-spacing-right-small:0px;--awb-spacing-left-small:0px;\"><div class=\"fusion-column-wrapper fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-text fusion-text-8\"><h2>\uacb0\ub860<\/h2>\n<h3>\ucc98\ub9ac\ubc29\ubc95\uc5d0 \ub530\ub978 \ucc98\ub9ac\uc2dc\uac04<\/h3>\n<p>\ucc98\ub9ac\ubc29\ubc95\uc5d0 \ub530\ub978 \ucc98\ub9ac\uc2dc\uac04\uc740 \uc544\ub798\uc640 \uac19\uc774 \ubc84\uc804\uacfc Bit\uc5d0 \ub530\ub77c \uc0c1\uc774\ud588\uc2b5\ub2c8\ub2e4.<br \/>\n32Bit \ub3d9\uc791 \uc2dc, .NET Framework\uc758 4.5.2\uc640 4.7.2\uc5d0\uc11c\uc758 \ucc28\uc774\ub294 \ud06c\uac8c \uc5c6\uc5c8\uc9c0\ub9cc, \uac19\uc740 .NET Framework\uc758 \ubc84\uc804\uc5d0\uc11c 32bit\uc640 64Bit \ub3d9\uc791\uc744 \ube44\uad50\ud574\ubcf4\uba74, 64Bit\uc5d0\uc11c \uc870\uae08 \ube60\ub978 \uacb0\uacfc\ub97c \uc5bb\uc744 \uc218 \uc788\uc5c8\uc2b5\ub2c8\ub2e4.<\/p>\n<ol>\n<li><strong>.NET Framework 4.5.2 &#8211; 32Bit \uae30\uc900<br \/>\n<\/strong><\/p>\n<table style=\"border-collapse: collapse; width: 56.236%;\" border=\"1\">\n<tbody>\n<tr>\n<td style=\"width: 38.7976%; background-color: #1755d1;\"><span style=\"color: #ffffff;\">\ubc29\ubc95<\/span><\/td>\n<td style=\"width: 17.4384%; background-color: #1755d1;\"><span style=\"color: #ffffff;\">\ucc98\ub9ac\uc2dc\uac04 (ms)<\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 38.7976%;\">GetPixel, SetPixel<\/td>\n<td style=\"width: 17.4384%;\">27,439<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 38.7976%;\">LockBits,\u00a0UnlockBits\ub85c \ubc30\uc5f4\uc744 \uace0\ub824\ud55c \ucc98\ub9ac<\/td>\n<td style=\"width: 17.4384%;\">101<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 38.7976%;\">Marshal \ud074\ub798\uc2a4\uc758\u00a0ReadByte, WriteByte<\/td>\n<td style=\"width: 17.4384%;\">273.6<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 38.7976%;\">Unsafe \ud3ec\uc778\ud130\ub85c \ucc98\ub9ac<\/td>\n<td style=\"width: 17.4384%;\">25.4<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 38.7976%;\">Unsafe \ud3ec\uc778\ud130\ub85c \ubcd1\ub82c\ucc98\ub9ac<\/td>\n<td style=\"width: 17.4384%;\">11.4<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/li>\n<li><strong>.NET Framework 4.7.2 &#8211; 32Bit \uae30\uc900<br \/>\n<\/strong><\/p>\n<table style=\"border-collapse: collapse; width: 56.236%;\" border=\"1\">\n<tbody>\n<tr>\n<td style=\"width: 38.7976%; background-color: #1755d1;\"><span style=\"color: #ffffff;\">\ubc29\ubc95<\/span><\/td>\n<td style=\"width: 17.4384%; background-color: #1755d1;\"><span style=\"color: #ffffff;\">\ucc98\ub9ac\uc2dc\uac04 (ms)<\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 38.7976%;\">GetPixel, SetPixel<\/td>\n<td style=\"width: 17.4384%;\">27,293.4<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 38.7976%;\">LockBits,\u00a0UnlockBits\ub85c \ubc30\uc5f4\uc744 \uace0\ub824\ud55c \ucc98\ub9ac<\/td>\n<td style=\"width: 17.4384%;\">101.8<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 38.7976%;\">Marshal \ud074\ub798\uc2a4\uc758\u00a0ReadByte, WriteByte<\/td>\n<td style=\"width: 17.4384%;\">290.8<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 38.7976%;\">Unsafe \ud3ec\uc778\ud130\ub85c \ucc98\ub9ac<\/td>\n<td style=\"width: 17.4384%;\">24.4<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 38.7976%;\">Unsafe \ud3ec\uc778\ud130\ub85c \ubcd1\ub82c\ucc98\ub9ac<\/td>\n<td style=\"width: 17.4384%;\">9.8<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/li>\n<li><strong>.NET Framework 4.7.2 &#8211; 64bit \uae30\uc900<\/strong><br \/>\n<table style=\"border-collapse: collapse; width: 56.236%;\" border=\"1\">\n<tbody>\n<tr>\n<td style=\"width: 38.7976%; background-color: #1755d1;\"><span style=\"color: #ffffff;\">\ubc29\ubc95<\/span><\/td>\n<td style=\"width: 17.4384%; background-color: #1755d1;\"><span style=\"color: #ffffff;\">\ucc98\ub9ac\uc2dc\uac04 (ms)<\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 38.7976%;\">GetPixel, SetPixel<\/td>\n<td style=\"width: 17.4384%;\">21,281.2<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 38.7976%;\">LockBits,\u00a0UnlockBits\ub85c \ubc30\uc5f4\uc744 \uace0\ub824\ud55c \ucc98\ub9ac<\/td>\n<td style=\"width: 17.4384%;\">85.4<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 38.7976%;\">Marshal \ud074\ub798\uc2a4\uc758\u00a0ReadByte, WriteByte<\/td>\n<td style=\"width: 17.4384%;\">213.6<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 38.7976%;\">Unsafe \ud3ec\uc778\ud130\ub85c \ucc98\ub9ac<\/td>\n<td style=\"width: 17.4384%;\">27.2<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 38.7976%;\">Unsafe \ud3ec\uc778\ud130\ub85c \ubcd1\ub82c\ucc98\ub9ac<\/td>\n<td style=\"width: 17.4384%;\">9.2<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/li>\n<\/ol>\n<h3>[\ucc38\uace0 \ubc0f \uc8fc\uc758\uc0ac\ud56d]<\/h3>\n<ul>\n<li>\ubcf8 \ube14\ub85c\uadf8\uc758 \ub0b4\uc6a9\uc740 \ubcf8\uc0ac AVALDATA\uc758 \uc18c\ud504\ud2b8\uc6e8\uc5b4 \uc5d4\uc9c0\ub2c8\uc5b4\uc778 Akira Yaskawa\uc528\uac00 \uc6b4\uc601\ud558\ub294 \ube14\ub85c\uadf8(<a href=\"http:\/\/www.imagingsolution.net\">Imaging Solution.net<\/a>)\uc5d0\uc11c \ubc1c\ucdcc\ud55c \uac83\uc73c\ub85c, \ucd94\uac00 \uc815\ubcf4\uac00 \ud544\uc694\ud560 \uacbd\uc6b0 Yaskawa \uc528\uc758 \ube14\ub85c\uadf8\ub97c \ucc38\uace0\ud558\uc2dc\uae30 \ubc14\ub78d\ub2c8\ub2e4.<\/li>\n<li>\ubcf8 \ub0b4\uc6a9\uc744 \uacf5\uc720\ud558\uac70\ub098 \ucc38\uace0\ud558\ub294 \uac83\uc5d0\ub294 \uc81c\uc57d\uc744 \ub450\uc9c0 \uc54a\uace0 \uc788\uc9c0\ub9cc, \ubb34\ub2e8 \ubcf5\uc81c \ub610\ub294 \uc218\uc815, \uc7ac\uc0dd\uc0b0\ud558\uc5ec \uc0c1\uc5c5\uc801\uc73c\ub85c \uc774\uc6a9\ud558\ub294 \ud589\uc704\ub294 \uc0bc\uac00\ud558\uc2dc\uae30 \ubc14\ub78d\ub2c8\ub2e4.<\/li>\n<li>\uc704 \uc790\ub8cc\uc758 \uc0ac\uc6a9\uc5d0 \uc81c\uc57d\uc744 \ub450\uc9c0 \uc54a\uc73c\ub098, \uc0ac\uc6a9\uc5d0 \ub530\ub978 \ubc84\uadf8 \ubc1c\uc0dd \ub4f1\uc758 \ucc45\uc784\uc740 \uc0ac\uc6a9\uc790\uc5d0\uac8c \uc788\uc73c\ub2c8 \uc8fc\uc758 \ud558\uc2dc\uae30 \ubc14\ub78d\ub2c8\ub2e4.<\/li>\n<\/ul>\n<\/div><\/div><\/div><\/div><\/div><\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":3,"featured_media":4831,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[240],"tags":[256],"class_list":["post-4809","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-c-ko"],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/aval-global.com\/index.php?rest_route=\/wp\/v2\/posts\/4809","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/aval-global.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/aval-global.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/aval-global.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/aval-global.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4809"}],"version-history":[{"count":13,"href":"https:\/\/aval-global.com\/index.php?rest_route=\/wp\/v2\/posts\/4809\/revisions"}],"predecessor-version":[{"id":4837,"href":"https:\/\/aval-global.com\/index.php?rest_route=\/wp\/v2\/posts\/4809\/revisions\/4837"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/aval-global.com\/index.php?rest_route=\/wp\/v2\/media\/4831"}],"wp:attachment":[{"href":"https:\/\/aval-global.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4809"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aval-global.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4809"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aval-global.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4809"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}