Quoting Ville Syrj�l�: > > A generic version would check if the MSB of each RGB channel matches, > > but I don't think there's an acceptable implementation for this. > > Something like this? > > if (DFB_BYTES_PER_PIXEL(format) == 1 || > (dfb_color_to_pixel(config->format, 0x80,0x80,0x80) ^ > dfb_color_to_pixel(format, 0x80,0x80,0x80)) == 0) > format = config->format; > > Are there problems with this implementation?
I thought about dfb_color_to_pixel(), but too short to see that two calls would be enough. Anyways, comparing both results should be the same. Ok, no extra function ;) -- Best regards, Denis Oliver Kropp .------------------------------------------. | DirectFB - Hardware accelerated graphics | | http://www.directfb.org/ | "------------------------------------------" _______________________________________________ directfb-dev mailing list [email protected] http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev
