From c5d4a44f449a8203a8b1da9b18806a718d80f131 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 31 Mar 2010 17:26:31 +0100 Subject: util: Use u_format_pack.py's code instead of u_format_access.py. --- src/gallium/auxiliary/util/u_format_pack.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/gallium/auxiliary/util/u_format_pack.py') diff --git a/src/gallium/auxiliary/util/u_format_pack.py b/src/gallium/auxiliary/util/u_format_pack.py index f40b3bdf2e..4831912f02 100644 --- a/src/gallium/auxiliary/util/u_format_pack.py +++ b/src/gallium/auxiliary/util/u_format_pack.py @@ -38,6 +38,7 @@ import sys +import math from u_format_parse import * @@ -90,6 +91,20 @@ def generate_format_type(format): print +def generate_srgb_tables(): + print 'static ubyte srgb_to_linear[256] = {' + for i in range(256): + print ' %s,' % (int(math.pow((i / 255.0 + 0.055) / 1.055, 2.4) * 255)) + print '};' + print + print 'static ubyte linear_to_srgb[256] = {' + print ' 0,' + for i in range(1, 256): + print ' %s,' % (int((1.055 * math.pow(i / 255.0, 0.41666) - 0.055) * 255)) + print '};' + print + + def bswap_format(format): '''Generate a structure that describes the format.''' -- cgit v1.2.3