;ELC   
;;; Compiled by pot@pot.cnuce.cnr.it on Tue Mar 18 15:46:30 2003
;;; from file /home/pot/gnu/emacs-pretest.new/lisp/image.el
;;; in Emacs version 21.3
;;; with bytecomp version 2.85.4.1
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.
(if (and (boundp 'emacs-version)
	 (< (aref emacs-version (1- (length emacs-version))) ?A)
	 (or (and (boundp 'epoch::version) epoch::version)
	     (string-lessp emacs-version "19.29")))
    (error "`image.el' was compiled for Emacs 19.29 or later"))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(custom-declare-group 'image nil "Image support." :group 'multimedia)
#@400 Alist of (REGEXP . IMAGE-TYPE) pairs used to auto-detect image types.
When the first bytes of an image file match REGEXP, it is assumed to
be of image type IMAGE-TYPE if IMAGE-TYPE is a symbol.  If not a symbol,
IMAGE-TYPE must be a pair (PREDICATE . TYPE).  PREDICATE is called
with one argument, a string containing the image data.  If PREDICATE returns
a non-nil value, TYPE is the image's type 
(defconst image-type-regexps '(("\\`/[	\n ]*\\*.*XPM.\\*/" . xpm) ("\\`P[1-6]" . pbm) ("\\`GIF8" . gif) ("\\`\211PNG\n" . png) ("\\`[	\n ]*#define" . xbm) ("\\`\\(MM \\*\\|II\\* \\)" . tiff) ("\\`[	\n ]*%!PS" . postscript) ("\\`\377\330" image-jpeg-p . jpeg)) (#$ . 683))
#@66 Value is non-nil if DATA, a string, consists of JFIF image data.
(defalias 'image-jpeg-p #[(data) "\301\302\"\205\n \303\304\215\207" [data string-match "\\`\377\330" jfif (byte-code "G\305	\nW\205] 	H\306U\204 \307\310\311\"\210	T\211\305\\\nY\203( \307\310\311\"\210\312	TH\313\"	\305\\H\\	H\314Y\203S \315X\203S \307\310\316\317	\211\f\\O\"\"\210	\f\\\320\\*\202 *\207" [data i len code nbytes 2 255 throw jfif nil lsh 8 224 239 string-match "JFIF" 1] 9)] 3 (#$ . 1364)])
#@129 Determine the image type from image data DATA.
Value is a symbol specifying the image type or nil if type cannot
be determined.
(defalias 'image-type-from-data #[(data) "\306\n\203< 	\204< \n@@\n@A9\203  \307\f\"\2043 :\2035 @!\2035 A\211\2035 \nA*\202 	*\207" [image-type-regexps type types image-type regexp data nil string-match] 3 (#$ . 1863)])
#@147 Determine the type of image file FILE from its first few bytes.
Value is a symbol specifying the image type, or nil if type cannot
be determined.
(defalias 'image-type-from-file-header #[(file) "\304!\204 \305	\"\305!\306\307\310!!\311\216r\nq\210\312\313!\210\314\313\315\316$\210\317 +\320!)\207" [file data-directory #1=#:temp-buffer header file-name-directory expand-file-name get-buffer-create generate-new-buffer-name " *temp*" ((byte-code "\301!\203\n \302!\210\301\207" [#1# buffer-name kill-buffer] 2)) set-buffer-multibyte nil insert-file-contents-literally 0 256 buffer-string image-type-from-data] 5 (#$ . 2235)])
#@97 Value is non-nil if image type TYPE is available.
Image types are symbols like `xbm' or `jpeg'.
(defalias 'image-type-available-p #[(type) "\302\301!\205 	>??\207" [type image-types boundp] 2 (#$ . 2879)])
#@566 Create an image.
FILE-OR-DATA is an image file name or image data.
Optional TYPE is a symbol describing the image type.  If TYPE is omitted
or nil, try to determine the image type from its first few bytes
of image data.  If that doesn't work, and FILE-OR-DATA is a file name,
use its file extension as image type.
Optional DATA-P non-nil means FILE-OR-DATA is a string containing image data.
Optional PROPS are additional image attributes to assign to the image,
like, e.g. `:mask MASK'.
Value is the image created, or nil if images of type TYPE are not supported.
(defalias 'create-image #[(file-or-data &optional type data-p &rest props) "\204 	;\204 \305\306	\"\210\2042 \n\204: \307	!\211\204: \310	!\211\204* \305\311!\210\312!)\202: \n\204: \313	!\n\204B \305\311!\210\n9\204L \305\314\n\"\210\315\n!\205d \316\317\320\n\203^ \321\202_ \322	\257\f\"\207" [data-p file-or-data type extension props error "Invalid image file name `%s'" image-type-from-file-header file-name-extension "Cannot determine image type" intern image-type-from-data "Invalid image type `%s'" image-type-available-p append image :type :data :file] 7 (#$ . 3094)])
#@575 Put image IMAGE in front of POS in the current buffer.
IMAGE must be an image created with `create-image' or `defimage'.
IMAGE is displayed by putting an overlay into the current buffer with a
`before-string' STRING that has a `display' property whose value is the
image.  STRING is defaulted if you omit it.
POS may be an integer or marker.
AREA is where to display the image.  AREA nil or omitted means
display it in the text area, a value of `left-margin' means
display it in the left marginal area, a value of `right-margin'
means display it in the right marginal area.
(defalias 'put-image #[(image pos &optional string area) "\204 \306p\n\242\302=\204 \307\310\n\"\210\203# \311>\204# \307\312\"\210\313!\314\f\211	#\2044 \n\2029 \315D\nD\316\317G\320%\210\321\322\323#\210\321\324#+\207" [string buffer image area pos prop "x" error "Not an image: %s" (left-margin right-margin) "Invalid area %s" copy-sequence make-overlay margin put-text-property 0 display overlay-put put-image t before-string overlay] 6 (#$ . 4255)])
#@428 Insert IMAGE into current buffer at point.
IMAGE is displayed by inserting STRING into the current buffer
with a `display' property whose value is the image.  STRING is
defaulted if you omit it.
AREA is where to display the image.  AREA nil or omitted means
display it in the text area, a value of `left-margin' means
display it in the left marginal area, a value of `right-margin'
means display it in the right marginal area.
(defalias 'insert-image #[(image &optional string area) "\204 \304	\242\301=\204 \305\306	\"\210\n\203! \n\307>\204! \305\310\n\"\210\n\203. \311\nD	D\2023 \301	AB`c\210\312`\313	\314	\315\313C\257#)\207" [string image area start " " error "Not an image: %s" (left-margin right-margin) "Invalid area %s" margin add-text-properties display intangible rear-nonsticky] 9 (#$ . 5314)])
#@170 Remove images between START and END in BUFFER.
Remove only images that were put in BUFFER with calls to `put-image'.
BUFFER nil or omitted means use the current buffer.
(defalias 'remove-images #[(start end &optional buffer) "\204 p\305	\n\"\211\205& @\306\f\307\"\203 \310\f!\210)A\211\204 \311)\207" [buffer start end overlays overlay overlays-in overlay-get put-image delete-overlay nil] 4 (#$ . 6140)])
#@733 Find an image, choosing one of a list of image specifications.

SPECS is a list of image specifications.

Each image specification in SPECS is a property list.  The contents of
a specification are image type dependent.  All specifications must at
least contain the properties `:type TYPE' and either `:file FILE' or
`:data DATA', where TYPE is a symbol specifying the image type,
e.g. `xbm', FILE is the file to load the image from, and DATA is a
string containing the actual image data.  The specification whose TYPE
is supported, and FILE exists, is used to construct the image
specification to be returned.  Return nil if no specification is
satisfied.

The image is looked for first on `load-path' and then in `data-directory'.
(defalias 'find-image #[(specs) "\306	\203\217 \204\217 	@\307\n\310\"\307\n\311\"\307\n\312\"\306\313!\203\210 ;\203\200 \204T \203T \314@\"\315!\203K )A\202. \204l \314\"\315!\203k )\203| \300\316\317\n!\312#B)\202\210 \f\203\210 \300\nB	A-\202 )\207" [image specs spec type data file nil plist-get :type :data :file image-type-available-p expand-file-name file-readable-p plist-put copy-sequence found load-path path try-file data-directory] 5 (#$ . 6564)])
#@721 Define SYMBOL as an image.

SPECS is a list of image specifications.  DOC is an optional
documentation string.

Each image specification in SPECS is a property list.  The contents of
a specification are image type dependent.  All specifications must at
least contain the properties `:type TYPE' and either `:file FILE' or
`:data DATA', where TYPE is a symbol specifying the image type,
e.g. `xbm', FILE is the file to load the image from, and DATA is a
string containing the actual image data.  The first image
specification whose TYPE is supported, and FILE exists, is used to
define SYMBOL.

Example:

   (defimage test-image ((:type xpm :file "~/test1.xpm")
                         (:type xbm :file "~/test1.xbm")))
(defalias 'defimage '(macro . #[(symbol specs &optional doc) "\303\304\305	DD\nF\207" [symbol specs doc defvar find-image quote] 5 (#$ . 7819)]))
(provide 'image)
