changeset 31636:3ff1515f7c7a

*** empty log message ***
author Gerd Moellmann <gerd@gnu.org>
date Fri, 15 Sep 2000 11:49:22 +0000
parents 208d8385ccae
children c1f4bdbf8465
files etc/NEWS lisp/ChangeLog src/ChangeLog
diffstat 3 files changed, 78 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/etc/NEWS	Fri Sep 15 11:49:07 2000 +0000
+++ b/etc/NEWS	Fri Sep 15 11:49:22 2000 +0000
@@ -1581,6 +1581,9 @@
 * Lisp changes made after edition 2.6 of the Emacs Lisp Manual,
 (Display-related features are described in a page of their own below.)
 
+** In image specifications, `:heuristic-mask' has been replaced
+with the more general `:mask' property.
+
 ** A `?' can be used in a symbol name without escaping it with a
 backslash.
 
@@ -2998,20 +3001,56 @@
 
 `:algorithm ALGO'
 
-Apply an image algorithm to the image before displaying it.  ALGO must
-be a symbol specifying the algorithm.  Currently only `laplace' is
-supported which applies a Laplace edge detection algorithm to an image
-which is intended to display images "disabled."
-
-`:heuristic-mask BG'
-
-If BG is not nil, build a clipping mask for the image, so that the
-background of a frame is visible behind the image.  If BG is t,
-determine the background color of the image by looking at the 4
-corners of the image, assuming the most frequently occuring color from
-the corners is the background color of the image.  Otherwise, BG must
-be a list `(RED GREEN BLUE)' specifying the color to assume for the
-background of the image.
+Apply an image algorithm to the image before displaying it.
+
+ALGO `laplace' or `emboss' means apply a Laplace or ``emboss''
+edge-detection algorithm to the image.
+
+ALGO `(edge-detection :matrix MATRIX :color-adjust ADJUST)' means
+apply a general edge-detection algorithm.  MATRIX must be either a
+nine-element list or a nine-element vector of numbers.  A pixel at
+position x/y in the transformed image is computed from original pixels
+around that position.  MATRIX specifies, for each pixel in the
+neighborhood of x/y, a factor with which that pixel will influence the
+transformed pixel; element 0 specifies the factor for the pixel at
+x-1/y-1, element 1 the factor for the pixel at x/y-1 etc. as shown
+below.
+
+  (x-1/y-1  x/y-1  x+1/y-1
+   x-1/y    x/y    x+1/y
+   x-1/y+1  x/y+1  x+1/y+1)
+
+The resulting pixel is computed from the color intensity of the color
+resulting from summing up the RGB values of surrounding pixels,
+multiplied by the specified factors, and dividing that sum by the sum
+of the factors' absolute values.
+
+Laplace edge-detection currently uses a matrix of 
+
+  (1  0  0
+   0  0  0
+   9  9 -1)
+
+Emboss edge-detection uses a matrix of
+
+  ( 2 -1  0
+   -1  0  1
+    0  1 -2)
+
+`:mask MASK'
+
+If MASK is `heuristic' or `(heuristic BG)', build a clipping mask for
+the image, so that the background of a frame is visible behind the
+image.  If BG is not specified, or if BG is t, determine the
+background color of the image by looking at the 4 corners of the
+image, assuming the most frequently occuring color from the corners is
+the background color of the image.  Otherwise, BG must be a list `(RED
+GREEN BLUE)' specifying the color to assume for the background of the
+image.
+
+If MASK is nil, remove a mask from the image, if it has one.  Images
+in some formats include a mask which can be removed by specifying
+`:mask nil'.
 
 `:file FILE'
 
--- a/lisp/ChangeLog	Fri Sep 15 11:49:07 2000 +0000
+++ b/lisp/ChangeLog	Fri Sep 15 11:49:22 2000 +0000
@@ -1,3 +1,10 @@
+2000-09-15  Gerd Moellmann  <gerd@gnu.org>
+
+	* image.el (create-image): Doc fix.
+
+	* toolbar/toolbar.el (toolbar-add-item): Use `:mask heuristic'
+	instead of `:heuristic-mask t'.
+
 2000-09-14  Andrew Innes  <andrewi@gnu.org>
 
 	* makefile.w32-in: Revert to Unix line endings.
--- a/src/ChangeLog	Fri Sep 15 11:49:07 2000 +0000
+++ b/src/ChangeLog	Fri Sep 15 11:49:22 2000 +0000
@@ -1,3 +1,21 @@
+2000-09-15  Gerd Moellmann  <gerd@gnu.org>
+
+	* xfns.c (QCmatrix, QCcolor_adjustment, QCmask, Qemboss)
+	(Qedge_detection, Qheuristic): New symbols.
+	(syms_of_xfns): Initialize new symbols.
+	(lookup_image): Handle `:mask X', `:algorithm emboss', and
+	`algorithm (edge-detection ...)'.
+	(xbm_format, xpm_format, pbm_format, png_format, jpeg_format):
+	(tiff_format, gif_format, gs_format): Add `:mask'.
+	(XBM_MASK, XPM_MASK, PBM_MASK, PNG_MASK, JPEG_MASK, TIFF_MASK)
+	(GIF_MASK, GS_MASK): New enumerators.
+	(x_laplace_read_row, x_laplace_write_row): Functions removed.
+	(emboss_matrix, laplace_matrix): New variables.
+	(x_to_xcolors, x_from_xcolors, x_detect_edges, x_emboss)
+	(x_edge_detection): New functions.
+	(x_laplace): Rewritten in terms of x_detect_edges.
+	(x_build_heuristic_mask): If image has a mask, free it.
+
 2000-09-14  Andrew Innes  <andrewi@gnu.org>
 
 	* makefile.w32-in: Revert to Unix line endings.