From: Matthias Kramm Date: Wed, 10 Feb 2010 01:52:30 +0000 (-0800) Subject: spec adjustments X-Git-Tag: version-0-9-1~155 X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=commitdiff_plain;h=624c262b3c009663d6b9319e74f991a94369bd24 spec adjustments --- diff --git a/spec/textarea3.pdf b/spec/textarea3.pdf index 4e5f882..5e35f13 100644 Binary files a/spec/textarea3.pdf and b/spec/textarea3.pdf differ diff --git a/spec/textarea3.py b/spec/textarea3.py index 556aa79..3e5542b 100644 --- a/spec/textarea3.py +++ b/spec/textarea3.py @@ -27,17 +27,20 @@ PDF_fill(p) PDF_setfont(p, font, 4.0) i = 0 -for y in range(height / 3): +for y in range(height / 6): text = "".join([md5.md5(str(i+j*732849)).hexdigest() for j in range(9)]) - for x in range(width / 3): - r,g,b = img.getpixel((x*3, height-1-y*3)) + for x in range(width / 6): + r,g,b = img.getpixel((x*6, height-1-y*6)) l = math.sqrt(r*r+g*g+b*b) if not r and not g and not b: continue - white = l / 444.0 - PDF_setfont(p, font, 0.5+white*7) - PDF_setrgbcolor_fill(p, r/l, g/l, b/l) - PDF_set_text_pos(p, x*3, y*3); + white = (l / 444.0)*5 + PDF_setfont(p, font, 0.5+int(white)*4) + r = 0.3 + 0.3 * int((r/l)*3) + g = 0.3 + 0.3 * int((g/l)*3) + b = 0.3 + 0.3 * int((b/l)*3) + PDF_setrgbcolor_fill(p, r, g, b) + PDF_set_text_pos(p, x*6, y*6); PDF_show(p, text[x]) i = i + 1