[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz/gfx libpaper/colors.py libpaper/papermill.p...
From: |
Janne V. Kujala |
Subject: |
[Gzz-commits] gzz/gfx libpaper/colors.py libpaper/papermill.p... |
Date: |
Mon, 03 Mar 2003 09:09:54 -0500 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Janne V. Kujala <address@hidden> 03/03/03 09:09:54
Modified files:
gfx/libpaper : colors.py papermill.py
gfx/util : papersampler.py
Log message:
add blend option to colors.py for blending the colors toward white
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libpaper/colors.py.diff?tr1=1.20&tr2=1.21&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libpaper/papermill.py.diff?tr1=1.76&tr2=1.77&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/util/papersampler.py.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
Patches:
Index: gzz/gfx/libpaper/colors.py
diff -u gzz/gfx/libpaper/colors.py:1.20 gzz/gfx/libpaper/colors.py:1.21
--- gzz/gfx/libpaper/colors.py:1.20 Sun Mar 2 12:11:14 2003
+++ gzz/gfx/libpaper/colors.py Mon Mar 3 09:09:54 2003
@@ -39,7 +39,8 @@
return " ".join([str(a) for a in arg])
def __init__(self, seed,
colors = 8,
- minlum = 80):
+ minlum = 80,
+ blend = 0):
rnd = self.rnd = java.util.Random(seed)
huerange = rnd.nextGaussian() * 90
@@ -89,7 +90,8 @@
col = [clampSat(YSTtoRGB(c)) for c in yst]
shuffle(col, rnd.nextDouble)
- #col = [ [.5 + .5*c for c in cc] for cc in col]
+ if blend > 0:
+ col = [ [blend * 1 + (1 - blend) * c for c in cc] for cc in col]
if dbg:
Index: gzz/gfx/libpaper/papermill.py
diff -u gzz/gfx/libpaper/papermill.py:1.76 gzz/gfx/libpaper/papermill.py:1.77
--- gzz/gfx/libpaper/papermill.py:1.76 Mon Mar 3 07:25:47 2003
+++ gzz/gfx/libpaper/papermill.py Mon Mar 3 09:09:54 2003
@@ -115,7 +115,8 @@
def getPaper(self, seed, passmask=[1,1,1,1,1,1,1],
numcolors = 8,
- minlum = 80):
+ minlum = 80,
+ blend = 0):
pap = PaperHanger()
pap.reg = Registry()
@@ -132,7 +133,8 @@
# XXX: TODO: these could be passed inside the paper object
# (and then the textures, too, would be protected from gc)
- colors = Colors(rng.nextInt(), colors = numcolors, minlum = minlum)
+ colors = Colors(rng.nextInt(), colors = numcolors, minlum = minlum,
+ blend = blend)
textures = Textures(rng.nextInt())
rootrep = TexGenXYRepeatUnit(rng, scale = 0.3 * scaleFactor)
@@ -160,8 +162,8 @@
return pap
def getOptimizedPaper(self, seed, w, passmask = [1, 1, 1, 1, 1, 1, 1],
- numcolors = 8, minlum = 80):
- pap = self.getPaper(seed, passmask, numcolors, minlum)
+ numcolors = 8, minlum = 80, blend = 0):
+ pap = self.getPaper(seed, passmask, numcolors, minlum, blend)
if not GL.hasExtension("GL_SGIS_generate_mipmap"):
print "Warning: not returning optimized paper because"
Index: gzz/gfx/util/papersampler.py
diff -u gzz/gfx/util/papersampler.py:1.7 gzz/gfx/util/papersampler.py:1.8
--- gzz/gfx/util/papersampler.py:1.7 Mon Mar 3 08:50:49 2003
+++ gzz/gfx/util/papersampler.py Mon Mar 3 09:09:54 2003
@@ -35,7 +35,7 @@
lightnesses = [
{ "numcolors" : 8, "minlum" : 80 },
- { "numcolors" : 8, "minlum" : 94 },
+ { "numcolors" : 8, "minlum" : 80, "blend" : 0.5 },
{ "numcolors" : 1, "minlum" : 80 },
]
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gzz-commits] gzz/gfx libpaper/colors.py libpaper/papermill.p...,
Janne V. Kujala <=