[pygame] Formal definitions for the BLEND operations
Hi, I am trying to write unit tests for the blit blend operations and am running into problems. There are no formal definitions as to what exactly a BLEND_ADD, BLEND_SUB and BLEND_MULT do. Sure they are add, subtract and multiply. But what happens with overflow and underflow. Do they truncate or just return maximum or minimum values. I will not look as the source for the answers because then I would just write the tests to pass rather than making tests that reflect the original intent of the operations. Lenard -- Lenard Lindstrom le...@telus.net
Re: [pygame] Formal definitions for the BLEND operations
Pin to 0 and 255. Don't roll over. Or is there something else? On Tue, Feb 10, 2009 at 11:11 AM, Lenard Lindstrom le...@telus.net wrote: Hi, I am trying to write unit tests for the blit blend operations and am running into problems. There are no formal definitions as to what exactly a BLEND_ADD, BLEND_SUB and BLEND_MULT do. Sure they are add, subtract and multiply. But what happens with overflow and underflow. Do they truncate or just return maximum or minimum values. I will not look as the source for the answers because then I would just write the tests to pass rather than making tests that reflect the original intent of the operations. Lenard -- Lenard Lindstrom le...@telus.net
Re: [pygame] Formal definitions for the BLEND operations
Ok, that will work I can't comment on it as I don't know the intended uses for the arithmetic operations. Lenard Brian Fisher wrote: Pin to 0 and 255. Don't roll over. Or is there something else? On Tue, Feb 10, 2009 at 11:11 AM, Lenard Lindstrom le...@telus.net mailto:le...@telus.net wrote: Hi, I am trying to write unit tests for the blit blend operations and am running into problems. There are no formal definitions as to what exactly a BLEND_ADD, BLEND_SUB and BLEND_MULT do. Sure they are add, subtract and multiply. But what happens with overflow and underflow. Do they truncate or just return maximum or minimum values. I will not look as the source for the answers because then I would just write the tests to pass rather than making tests that reflect the original intent of the operations.