{"id":106,"date":"2022-02-28T21:55:41","date_gmt":"2022-02-28T20:55:41","guid":{"rendered":"http:\/\/graphics32\/?page_id=106"},"modified":"2024-03-06T11:24:42","modified_gmt":"2024-03-06T10:24:42","slug":"naming-conventions","status":"publish","type":"page","link":"https:\/\/melander.dk\/graphics32\/naming-conventions\/","title":{"rendered":"Naming Conventions"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The <a href=\"https:\/\/graphics32.github.io\/Docs\/Units\/GR32\/Classes\/TBitmap32\/_Body.htm\">TBitmap32<\/a> class provides a large number of methods for single pixel access and single pixel width line drawing. While the prefix of these methods indicate <em>what<\/em> they do (draw a line, access a pixel, etc.), the postfix denotes <em>how<\/em> they behave. The methods can include one or more of the following postfixes:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Postfix<\/th><th>Name<\/th><th>Description<\/th><th>Sample (magnified x4)<\/th><th>Examples<\/th><\/tr><\/thead><tbody><tr><td>(none)<\/td><td><\/td><td>Methods without modifiers offer maximum performance.<br>Lines and pixels are rendered without anti-aliasing and without color blending.<br>No clipping is performed so coordinates are expected to be within bitmap boundaries. Out of bounds coordinates can cause access violations and memory overwrites.<\/td><td><img loading=\"lazy\" decoding=\"async\" width=\"100\" height=\"48\" class=\"wp-image-173\" style=\"width: 100px;\" src=\"https:\/\/melander.dk\/graphics32\/wp-content\/uploads\/2022\/03\/Line.png\" alt=\"\"><\/td><td>Line<br>HorzLine<br>Pixel<br>FillRect<\/td><\/tr><tr><td>S<\/td><td>Safe<\/td><td>Clipping is performed when coordinates extend beyond bitmap boundaries.<br>This modifier can be combined with any <strong>one<\/strong> of the anti-aliasing or transparent modifiers below (T, A, X or F) and also with the stippling (P) modifier.<\/td><td><img loading=\"lazy\" decoding=\"async\" width=\"100\" height=\"48\" class=\"wp-image-173\" style=\"width: 100px;\" src=\"https:\/\/melander.dk\/graphics32\/wp-content\/uploads\/2022\/03\/Line.png\" alt=\"\"><\/td><td>LineS<br>LineToS<br>PixelS<\/td><\/tr><tr><td>T<\/td><td>Transparent<\/td><td>Semi-transparent pixels are merged onto the background image (though still without anti-aliasing).<\/td><td><img loading=\"lazy\" decoding=\"async\" width=\"100\" height=\"48\" class=\"wp-image-178\" style=\"width: 100px;\" src=\"https:\/\/melander.dk\/graphics32\/wp-content\/uploads\/2022\/03\/LineT.png\" alt=\"\"><\/td><td>LineTS<br>LineToTS<br>FillRectTS<\/td><\/tr><tr><td>A<\/td><td>Anti-aliased<\/td><td>Uses a modified version of <a href=\"https:\/\/en.wikipedia.org\/wiki\/Bresenham%27s_line_algorithm\">Bresenham\u2019s algorithm<\/a> known as <a href=\"https:\/\/en.wikipedia.org\/wiki\/Xiaolin_Wu%27s_line_algorithm\">Wu\u2019s antialiasing<\/a>.<\/td><td><img loading=\"lazy\" decoding=\"async\" width=\"100\" height=\"48\" class=\"wp-image-174\" style=\"width: 100px;\" src=\"https:\/\/melander.dk\/graphics32\/wp-content\/uploads\/2022\/03\/LineA.png\" alt=\"\"><\/td><td>LineA<br>LineAS<\/td><\/tr><tr><td>X<\/td><td>Fixed<\/td><td>Coordinates are in fixed point (<code>TFixed<\/code>) format.<br>These methods also employ a more sophisticated anti-aliasing algorithm than that used in the \u2018A\u2019 methods above.<\/td><td><img loading=\"lazy\" decoding=\"async\" width=\"100\" height=\"48\" class=\"wp-image-175\" style=\"width: 100px;\" src=\"https:\/\/melander.dk\/graphics32\/wp-content\/uploads\/2022\/03\/LineF.png\" alt=\"\"><\/td><td>LineX<br>LineXS<br>PixelXS<\/td><\/tr><tr><td>F<\/td><td>Float<\/td><td>Coordinates are in floating point (<code>TFloat<\/code>) format.<br>These methods employ the same anti-aliasing algorithm used in the \u2018X\u2019 methods.<\/td><td><img loading=\"lazy\" decoding=\"async\" width=\"100\" height=\"48\" class=\"wp-image-175\" style=\"width: 100px;\" src=\"https:\/\/melander.dk\/graphics32\/wp-content\/uploads\/2022\/03\/LineF.png\" alt=\"\"><\/td><td>LineFS<br>PixelFS<\/td><\/tr><tr><td>P<\/td><td>Stippling<\/td><td>Lines are drawn using a <a href=\"https:\/\/melander.dk\/graphics32\/line-patterns\/\">stippling pattern<\/a>.<br>This modifier must be combined with either the &#8216;X&#8217; or &#8216;F&#8217; modifiers above.<\/td><td><img loading=\"lazy\" decoding=\"async\" width=\"100\" height=\"48\" class=\"wp-image-176\" style=\"width: 100px;\" src=\"https:\/\/melander.dk\/graphics32\/wp-content\/uploads\/2022\/03\/LineFP.png\" alt=\"\"><\/td><td>LineFSP<br>LineXSP<\/td><\/tr><\/tbody><tfoot><tr><td><\/td><td><\/td><td>For lines, all the methods listed above draw line segments that are <strong>a single pixel wide<\/strong>.<br>To draw thicker lines, see the <a href=\"https:\/\/graphics32.github.io\/Docs\/Units\/GR32_Polygons\/Routines\/Polyline.htm\">Polyline<\/a> and <a href=\"https:\/\/graphics32.github.io\/Docs\/Units\/GR32_Polygons\/Routines\/PolyPolyline.htm\">PolyPolyline<\/a> functions in the <a href=\"https:\/\/graphics32.github.io\/Docs\/Units\/GR32_Polygons\/_Body.htm\">GR32_Polygons<\/a> unit. Those functions also produce better anti-aliased blending over fully transparent backgrounds (when compared with X &amp; F modified methods above).<\/td><td><img loading=\"lazy\" decoding=\"async\" width=\"100\" height=\"48\" class=\"wp-image-177\" style=\"width: 100px;\" src=\"https:\/\/melander.dk\/graphics32\/wp-content\/uploads\/2022\/03\/LineQ.png\" alt=\"\"><\/td><td><\/td><\/tr><\/tfoot><\/table><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>The TBitmap32 class provides a large number of methods for single pixel access and single pixel width line drawing. While the prefix of these methods indicate what they do (draw a line, access a pixel, etc.), the postfix denotes how<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-106","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/melander.dk\/graphics32\/wp-json\/wp\/v2\/pages\/106","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/melander.dk\/graphics32\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/melander.dk\/graphics32\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/melander.dk\/graphics32\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/melander.dk\/graphics32\/wp-json\/wp\/v2\/comments?post=106"}],"version-history":[{"count":12,"href":"https:\/\/melander.dk\/graphics32\/wp-json\/wp\/v2\/pages\/106\/revisions"}],"predecessor-version":[{"id":436,"href":"https:\/\/melander.dk\/graphics32\/wp-json\/wp\/v2\/pages\/106\/revisions\/436"}],"wp:attachment":[{"href":"https:\/\/melander.dk\/graphics32\/wp-json\/wp\/v2\/media?parent=106"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}