From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: MON KEY Newsgroups: gmane.emacs.devel Subject: Re: Drawing in images? Date: Mon, 28 Sep 2009 20:31:13 -0400 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1254184294 11195 80.91.229.12 (29 Sep 2009 00:31:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 29 Sep 2009 00:31:34 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 29 02:31:27 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MsQco-0000jz-Ob for ged-emacs-devel@m.gmane.org; Tue, 29 Sep 2009 02:31:27 +0200 Original-Received: from localhost ([127.0.0.1]:48232 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MsQcn-00026K-VR for ged-emacs-devel@m.gmane.org; Mon, 28 Sep 2009 20:31:26 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MsQci-000265-Qq for emacs-devel@gnu.org; Mon, 28 Sep 2009 20:31:20 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MsQcd-00025r-BC for emacs-devel@gnu.org; Mon, 28 Sep 2009 20:31:19 -0400 Original-Received: from [199.232.76.173] (port=37580 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MsQcd-00025o-4j for emacs-devel@gnu.org; Mon, 28 Sep 2009 20:31:15 -0400 Original-Received: from mail-gx0-f212.google.com ([209.85.217.212]:63599) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MsQcc-0006Xp-RU for emacs-devel@gnu.org; Mon, 28 Sep 2009 20:31:15 -0400 Original-Received: by gxk4 with SMTP id 4so3255841gxk.8 for ; Mon, 28 Sep 2009 17:31:13 -0700 (PDT) Original-Received: by 10.150.15.42 with SMTP id 42mr8882188ybo.266.1254184273114; Mon, 28 Sep 2009 17:31:13 -0700 (PDT) X-Google-Sender-Auth: f23ead56563199bb X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:115757 Archived-At: While examining dragbox2.el it occurred to me that an alternative way to set a crop would be to use emacs window... er actually 5 windows! 68. _________________________________________________________________ | ! | | | window1 ! | window4 | | ! | | | ! | | | \|/ | | |---------------------------------------------------| | | | /!\ | | | | ! | | | | Y-axis ! | | | | ! | | | | ! | | | | ! | | | | ! | | | | ! | | | | window5 ! | | |~~~~~~~~~~>|<~~~~~~~~~~~~~~~~+~~~~~~~~~~~~~~~~~~~~>|<~~~~~~~~~~~~| | | ! X-axis | | | | ! | | | | ! | | | | ! | | | | ! | | | | ! | | | | ! | | | | ! | | | | ! | | | | \!/ | | | |-----------------------------------------------------| | | /!\ window3 | | | ! | | | ! | | | ! | | window2 | ! | |___________|_________________|___________________________________| 68^ * Assume that the image to be cropped/bounded is in window5. * Assume that all windows have a ~1-3 pixel border. * Assume that window1, window2, window3, window4 can _only_ be expanded contracted on the axis indicated. * Assume that window 5 is the only window that can be expanded/contracted on both axis. * Assume use of a library such as Drew Adams' DoReMi or equivalent. * Assume Y-axis -> Up/Down expansion/contraction * Assume X-axis -> Left/Right expansion/contraction Window1 can expand/contract only along the Y-axis Window2 can expand/contract only along the X-axis Window3 can expand/contract only along the y-axis Window4 can expand/contract only along the X-axis Window5 can expand/contract along both the X-axis and Y-axis. Window5 can recenter/reset the image along both the X-axis and Y-axis. Shouldn't `posn-object-width-height', `posn-window', `posn-area' etc. get one reasonably accurate pixel coardinates for a crop? If so, doesn't this give us visual feedback without need of external calls, SVG overlays, GTK wonkery etc.? Also, a novel idea for doing image rotation using artist.el as influenced by Unpaper's "Virtual Bar": (URL `http://unpaper.berlios.de/img/deskew-detail1.png') (URL `http://unpaper.berlios.de/img/deskew-detail2.png') Which skews an image against a "Virtual Line" by calculating the skew against some baseline (x-axis, y-axis, both) i.e. the radian as the virtual line's deviation from "square". Emacs window (preferably in a dedicated frame) +--------------------------------------------------------60. | | | +-----------------------------------------------+ | | | . | | | | / | | | | / | | | | / | | | | / | | | | / | | | | / | | | | / | | | | / <-Virtual Line | | | | / | | | | / | | | | / | | | | / | | | | / | | | | / | | | | / | | | | / | | | | / | | | | / | | | | . | | | | | | | | | | | | | | | | | | | | | | | | | | | Y | | | | | A Skewed Image (needs rotating) | | | +-----------------------------------------------+ | | X | +--------------------------------------------------------60. s_P