{"id":35553,"date":"2005-05-24T11:16:48","date_gmt":"2005-05-24T11:16:48","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2005\/05\/24\/understanding-ternary-raster-operations\/"},"modified":"2005-05-24T11:16:48","modified_gmt":"2005-05-24T11:16:48","slug":"understanding-ternary-raster-operations","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20050524-48\/?p=35553","title":{"rendered":"Understanding ternary raster operations"},"content":{"rendered":"<p>It&#8217;s perfectly logical, which doesn&#8217;t mean that it&#8217;s easy to understand.\n A <a href=\"http:\/\/msdn.microsoft.com\/library\/en-us\/gdi\/pantdraw_6n77.asp\"> ternary raster operation<\/a> describes how three boolean values should combine to form an output boolean.  I was going to write up a description but found that the existing documentation pretty much covers it, so I refer you to that. In particular, look at the table that explains where PSo and DPSoo come from.<\/p>\n<p> Now, one question that has come up is &#8220;What is the algorithm for deriving the RPN raster operation description string from the operation index?&#8221; The answer is, &#8220;You stare at it and use your brain&#8217;s power of pattern-matching.&#8221;  There is no single &#8220;correct&#8221; expression of an operation index as RPN.  For example, &#8220;DPSoo&#8221; could have been written as &#8220;DSPoo&#8221; or &#8220;DSoPo&#8221; or as the equivalent but pointlessly esoteric &#8220;DPoDnPnSaao&#8221;.  All of these expressions have the same boolean truth table. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>It&#8217;s perfectly logical, which doesn&#8217;t mean that it&#8217;s easy to understand. A ternary raster operation describes how three boolean values should combine to form an output boolean. I was going to write up a description but found that the existing documentation pretty much covers it, so I refer you to that. In particular, look at [&hellip;]<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[25],"class_list":["post-35553","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>It&#8217;s perfectly logical, which doesn&#8217;t mean that it&#8217;s easy to understand. A ternary raster operation describes how three boolean values should combine to form an output boolean. I was going to write up a description but found that the existing documentation pretty much covers it, so I refer you to that. In particular, look at [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/35553","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=35553"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/35553\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=35553"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=35553"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=35553"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}