comparison lispref/display.texi @ 33996:d3bd47722971

image-mask-p keymap property image property changes
author Dave Love <fx@gnu.org>
date Wed, 29 Nov 2000 14:53:29 +0000
parents 701833d4b661
children 80050ac10dbf
comparison
equal deleted inserted replaced
33995:e8594de40767 33996:d3bd47722971
926 @cindex keymap of character (and overlays) 926 @cindex keymap of character (and overlays)
927 @kindex local-map @r{(overlay property)} 927 @kindex local-map @r{(overlay property)}
928 If this property is non-@code{nil}, it specifies a keymap for a portion 928 If this property is non-@code{nil}, it specifies a keymap for a portion
929 of the text. The property's value replaces the buffer's local map, when 929 of the text. The property's value replaces the buffer's local map, when
930 the character after point is within the overlay. @xref{Active Keymaps}. 930 the character after point is within the overlay. @xref{Active Keymaps}.
931
932 @item keymap
933 @kindex keymap @r{(overlay property)}
934 The @code{keymap} property is similar to @code{local-map} but overrides the
935 buffer's local map (and the map specified by the @code{local-map}
936 property) rather than replacing it.
931 @end table 937 @end table
932 938
933 @node Managing Overlays 939 @node Managing Overlays
934 @subsection Managing Overlays 940 @subsection Managing Overlays
935 941
2475 @item :algorithm @var{algorithm} 2481 @item :algorithm @var{algorithm}
2476 The @code{:algorithm} property, if non-@code{nil}, specifies a 2482 The @code{:algorithm} property, if non-@code{nil}, specifies a
2477 conversion algorithm that should be applied to the image before it is 2483 conversion algorithm that should be applied to the image before it is
2478 displayed; the value, @var{algorithm}, specifies which algorithm. 2484 displayed; the value, @var{algorithm}, specifies which algorithm.
2479 2485
2480 Currently, the only meaningful value for @var{algorithm} (aside from 2486 @table @code
2481 @code{nil}) is @code{laplace}; this applies the Laplace edge detection 2487 @item laplace
2482 algorithm, which blurs out small differences in color while highlighting 2488 @itemx emboss
2483 larger differences. People sometimes consider this useful for 2489 Specifies the Laplace edge detection algorithm, which blurs out small
2484 displaying the image for a ``disabled'' button. 2490 differences in color while highlighting larger differences. People
2485 2491 sometimes consider this useful for displaying the image for a
2486 @item :heuristic-mask @var{transparent-color} 2492 ``disabled'' button.
2487 The @code{:heuristic-mask} property, if non-@code{nil}, specifies that a 2493
2488 certain color in the image should be transparent. Each pixel where this 2494 @item (edge-detection :matrix @var{matrix} :color-adjust @var{adjust})
2489 color appears will actually allow the frame's background to show 2495 Specifies a general edge-detection algorithm. @var{matrix} must be
2490 through. 2496 either a nine-element list or a nine-element vector of numbers. A pixel
2491 2497 at position @math{x/y} in the transformed image is computed from
2492 If @var{transparent-color} is @code{t}, then determine the transparent 2498 original pixels around that position. @var{matrix} specifies, for each
2493 color by looking at the four corners of the image. This uses the color 2499 pixel in the neighborhood of @math{x/y}, a factor with which that pixel
2494 that occurs most frequently near the corners as the transparent color. 2500 will influence the transformed pixel; element @math{0} specifies the
2495 2501 factor for the pixel at @math{x-1/y-1}, element @math{1} the factor for
2496 Otherwise, @var{heuristic-mask} should specify the transparent color 2502 the pixel at @math{x/y-1} etc., as shown below:
2497 directly, as a list of three integers in the form @code{(@var{red} 2503 @iftex
2498 @var{green} @var{blue})}. 2504 @tex
2505 $$\pmatrix{x-1/y-1 & x/y-1 & x+1/y-1 \cr
2506 x-1/y & x/y & x+1/y \cr
2507 x-1/y+1& x/y+1 & x+1/y+1 \cr}$$
2508 @end tex
2509 @end iftex
2510 @ifnottex
2511 @display
2512 (x-1/y-1 x/y-1 x+1/y-1
2513 x-1/y x/y x+1/y
2514 x-1/y+1 x/y+1 x+1/y+1)
2515 @end display
2516 @end ifnottex
2517
2518 The resulting pixel is computed from the color intensity of the color
2519 resulting from summing up the RGB values of surrounding pixels,
2520 multiplied by the specified factors, and dividing that sum by the sum
2521 of the factors' absolute values.
2522
2523 Laplace edge-detection currently uses a matrix of
2524 @iftex
2525 @tex
2526 $$\pmatrix{1 & 0 & 0 \cr
2527 0& 0 & 0 \cr
2528 9 & 9 & -1 \cr}$$
2529 @end tex
2530 @end iftex
2531 @ifnottex
2532 @display
2533 (1 0 0
2534 0 0 0
2535 9 9 -1)
2536 @end display
2537 @end ifnottex
2538
2539 Emboss edge-detection uses a matrix of
2540 @iftex
2541 @tex
2542 $$\pmatrix{ 2 & -1 & 0 \cr
2543 -1 & 0 & 1 \cr
2544 0 & 1 & -2 \cr}$$
2545 @end tex
2546 @end iftex
2547 @ifnottex
2548 @display
2549 ( 2 -1 0
2550 -1 0 1
2551 0 1 -2)
2552 @end display
2553 @end ifnottex
2554
2555 @item disabled
2556 Specifies transforming the image so that it looks ``disabled''.
2557 @end table
2558
2559 @item :mask @var{mask}
2560 If @var{mask} is @code{heuristic} or @code{(heuristic @var{bg})}, build
2561 a clipping mask for the image, so that the background of a frame is
2562 visible behind the image. If @var{bg} is not specified, or if @var{bg}
2563 is @code{t}, determine the background color of the image by looking at
2564 the four corners of the image, assuming the most frequently occurring
2565 color from the corners is the background color of the image. Otherwise,
2566 @var{bg} must be a list @code{(@var{red} @var{green} @var{blue})}
2567 specifying the color to assume for the background of the image.
2568
2569 If @var{mask} is nil, remove a mask from the image, if it has one. Images
2570 in some formats include a mask which can be removed by specifying
2571 @code{:mask nil}.
2499 2572
2500 @item :file @var{file} 2573 @item :file @var{file}
2501 The @code{:file} property specifies to load the image from file 2574 The @code{:file} property specifies to load the image from file
2502 @var{file}. If @var{file} is not an absolute file name, it is expanded 2575 @var{file}. If @var{file} is not an absolute file name, it is expanded
2503 in @code{data-directory}. 2576 in @code{data-directory}.
2512 below describing the specific image format. For some image types, 2585 below describing the specific image format. For some image types,
2513 @code{:data} may not be supported; for some, it allows other data types; 2586 @code{:data} may not be supported; for some, it allows other data types;
2514 for some, @code{:data} alone is not enough, so you need to use other 2587 for some, @code{:data} alone is not enough, so you need to use other
2515 image properties along with @code{:data}. 2588 image properties along with @code{:data}.
2516 @end table 2589 @end table
2590
2591 @defun image-mask-p spec &optional frame
2592 @tindex image-mask-p
2593 This function returns @code{t} if image @var{spec} has a mask bitmap.
2594 @var{frame} is the frame on which the image will be displayed.
2595 @var{frame} @code{nil} or omitted means to use the selected frame.
2596 @end defun
2517 2597
2518 @node XBM Images 2598 @node XBM Images
2519 @subsection XBM Images 2599 @subsection XBM Images
2520 @cindex XBM 2600 @cindex XBM
2521 2601