From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/79789 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: drops module (draft) Date: Thu, 06 Dec 2012 20:44:12 +0100 Message-ID: <50C0F58C.3020204@wxs.nl> References: <50C0D0F4.3020806@gmx.net> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1354823065 18163 80.91.229.3 (6 Dec 2012 19:44:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 6 Dec 2012 19:44:25 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Dec 06 20:44:36 2012 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TghN5-0007wP-IE for gctc-ntg-context-518@m.gmane.org; Thu, 06 Dec 2012 20:44:35 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 17523102BA; Thu, 6 Dec 2012 20:44:23 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id n0Fu+PUq59Ck; Thu, 6 Dec 2012 20:44:20 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 6C25F102B1; Thu, 6 Dec 2012 20:44:20 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id B5929102B1 for ; Thu, 6 Dec 2012 20:44:18 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id yMisf9cFc6Na for ; Thu, 6 Dec 2012 20:44:17 +0100 (CET) Original-Received: from filter4-til.mf.surf.net (filter4-til.mf.surf.net [194.171.167.220]) by balder.ntg.nl (Postfix) with ESMTP id C67C91026B for ; Thu, 6 Dec 2012 20:44:17 +0100 (CET) Original-Received: from smtp.ziggozakelijk.nl (D57D1DA2.static.ziggozakelijk.nl [213.125.29.162]) by filter4-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id qB6JiG99013385 for ; Thu, 6 Dec 2012 20:44:17 +0100 X-Default-Received-SPF: pass (skip=loggedin (res=PASS)) x-ip-name=10.100.1.101; Original-Received: from [10.100.1.101] (unverified [10.100.1.101]) by pragma-net.nl (SurgeMail 6.1c) with ESMTP (TLS) id 6546-1713362 for multiple; Thu, 06 Dec 2012 20:44:07 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.2; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 In-Reply-To: X-Authenticated-User: hagen@controller-9 X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=213.125.29.162; country=NL; region=16; city=Zeewolde; latitude=52.3302; longitude=5.5364; http://maps.google.com/maps?q=52.3302,5.5364&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0VIwjIgoA - d484fcde6848 - 20121206 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.220 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:79789 Archived-At: On 12/6/2012 7:05 PM, Aditya Mahajan wrote: > I always thought that shadows were possible to do in PDF (after all TikZ > does it using some type of PDF primitives). Since you are the PDF > expert, I am interested in knowing why you choose to go the ImageMagic > route. not so efficient but it shows a bit what bitmaps can do \starttext \startluacode local format = string.format local concat = table.concat function document.TestBitmap(nx,ny) nx = math.round(nx/65536) ny = math.round(ny/65536) nx = 2 * math.round(nx/2) ny = 2 * math.round(ny/2) local r = { } local dx = 255/nx local dy = 255/ny for i=1,ny/2 do local n = i*dy local c = { } for j=1,nx/2 do c[#c+1] = format("%02x",j*dx+n) end for j=nx/2,1,-1 do c[#c+1] = format("%02x",j*dx+n) end c = concat(c,"",1,nx) r[#r+1] = c end for i=ny/2,1,-1 do local n = i*dy local c = { } for j=1,nx/2 do c[#c+1] = format("%02x",j*dx+n) end for j=nx/2,1,-1 do c[#c+1] = format("%02x",j*dx+n) end c = concat(c,"",1,nx) r[#r+1] = c end r = concat(r,"\r",1,ny) figures.bitmapimage { data = r, xresolution = nx, yresolution = ny, } end \stopluacode \defineoverlay [BitMess] [{\scale [width=\dimexpr\overlaywidth+2ex,height=\dimexpr\overlayheight+2ex] {\ctxlua{document.TestBitmap(\number\dimexpr\overlaywidth,\number\dimexpr\overlayheight)}}}] \framed [width=10cm, height=10cm, frame=off, background={BitMess,color}, backgroundcolor=white] {test} \stoptext ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl ----------------------------------------------------------------- ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________