[interfacekit] GraphicsDefs.h addition
- From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
- To: "OpenBeOS Interface Kit" <interfacekit@xxxxxxxxxxxxx>
- Date: Mon, 10 Jan 2005 17:00:56 +0100 CET
Hi there,
does anybody mind if I apply this patch:
--- GraphicsDefs.h 9 Jul 2002 12:24:32 -0000 1.1
+++ GraphicsDefs.h 10 Jan 2005 15:56:35 -0000
@@ -60,6 +60,22 @@
uint8 green;
uint8 blue;
uint8 alpha;
+
+#if defined(__cplusplus)
+ // some convenient additions
+
+ inline bool
+ operator==(const rgb_color& o) const
+ {
+ return *(const uint32 *)this == *(const uint32 *)&o;
+ }
+
+ inline bool
+ operator!=(const rgb_color& o) const
+ {
+ return *(const uint32 *)this != *(const uint32 *)&o;
+ }
+#endif
} rgb_color;
As you might have realized, this extends rgb_color. Similar (and more)
is done in Dano, but I think this is the minimum must have. A SetTo()
method would be great, too, but for unknown reasons it has been called
set_to() in Dano, so I wanted to hear your comments first. Since it's
defined inline anyway, I think we can safely rename it too SetTo()/
Set() without too much annoyance - I never liked Set() because it's
mostly SetTo() elsewhere, but with regard to graphics, Set() seems to
be used consistently as well.
Bye,
Axel.
- Follow-Ups:
- [interfacekit] Re: GraphicsDefs.h addition
- From: Axel Dörfler
Other related posts:
- » [interfacekit] GraphicsDefs.h addition
- » [interfacekit] Re: GraphicsDefs.h addition
- » [interfacekit] Re: GraphicsDefs.h addition
- » [interfacekit] Re: GraphicsDefs.h addition
- » [interfacekit] Re: GraphicsDefs.h addition
- » [interfacekit] Re: GraphicsDefs.h addition
- » [interfacekit] Re: GraphicsDefs.h addition
- [interfacekit] Re: GraphicsDefs.h addition
- From: Axel Dörfler