all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: MON KEY <monkey@sandpframing.com>
To: emacs-devel@gnu.org
Subject: Re: Drawing in images?
Date: Mon, 28 Sep 2009 20:31:13 -0400	[thread overview]
Message-ID: <d2afcfda0909281731x5d7a5b29j512efe7ea91fb184@mail.gmail.com> (raw)

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




             reply	other threads:[~2009-09-29  0:31 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-29  0:31 MON KEY [this message]
2009-09-29  5:29 ` Drawing in images? martin rudalics
2009-09-29 20:25   ` MON KEY
  -- strict thread matches above, loose matches on Subject: below --
2009-08-27  0:52 MON KEY
2009-08-27  6:31 ` joakim
2009-08-27 18:07   ` MON KEY
2009-08-27 19:05     ` joakim
2009-08-28 16:22       ` MON KEY
2009-08-27 22:21   ` Chong Yidong
2009-08-27 23:51     ` joakim
2009-09-16 19:04     ` joakim
2009-09-17 19:13       ` MON KEY
2009-09-17 21:04         ` Lennart Borgman
2009-09-17 21:08           ` Lennart Borgman
2009-09-17 23:00           ` Jason Rumney
2009-09-17 23:09             ` Lennart Borgman
2009-09-17 21:46         ` joakim
2009-09-17 22:09           ` Lennart Borgman
2009-09-17 22:46             ` Juanma Barranquero
2009-09-17 22:56               ` Lennart Borgman
2009-09-17 22:56         ` Jason Rumney
2009-09-17 22:59           ` Lennart Borgman
2009-08-25 22:57 joakim
2009-08-26  1:07 ` Stefan Monnier
2009-08-26  5:58   ` joakim
2009-08-26 14:45     ` Stefan Monnier
2009-08-26  9:05   ` Jason Rumney
2009-08-28  0:49 ` YAMAMOTO Mitsuharu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d2afcfda0909281731x5d7a5b29j512efe7ea91fb184@mail.gmail.com \
    --to=monkey@sandpframing.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.