Mercurial > emacs
comparison src/image.c @ 85039:50b33e26718b
(syms_of_image) <image-types>: Fix typo in docstring.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Thu, 04 Oct 2007 16:57:27 +0000 |
parents | 589ba73a64a6 |
children | 4f61ded4a62e |
comparison
equal
deleted
inserted
replaced
85038:f758797cae00 | 85039:50b33e26718b |
---|---|
1708 | 1708 |
1709 | 1709 |
1710 /* Clear image cache of frame F. FORCE_P non-zero means free all | 1710 /* Clear image cache of frame F. FORCE_P non-zero means free all |
1711 images. FORCE_P zero means clear only images that haven't been | 1711 images. FORCE_P zero means clear only images that haven't been |
1712 displayed for some time. Should be called from time to time to | 1712 displayed for some time. Should be called from time to time to |
1713 reduce the number of loaded images. If image-eviction-seconds is | 1713 reduce the number of loaded images. If image-cache-eviction-delay |
1714 non-nil, this frees images in the cache which weren't displayed for | 1714 is non-nil, this frees images in the cache which weren't displayed |
1715 at least that many seconds. */ | 1715 for at least that many seconds. */ |
1716 | 1716 |
1717 void | 1717 void |
1718 clear_image_cache (f, force_p) | 1718 clear_image_cache (f, force_p) |
1719 struct frame *f; | 1719 struct frame *f; |
1720 int force_p; | 1720 int force_p; |
2884 2. a bool-vector of size >= WIDTH * HEIGHT | 2884 2. a bool-vector of size >= WIDTH * HEIGHT |
2885 | 2885 |
2886 3. a vector of strings or bool-vectors, one for each line of the | 2886 3. a vector of strings or bool-vectors, one for each line of the |
2887 bitmap. | 2887 bitmap. |
2888 | 2888 |
2889 4. A string containing an in-memory XBM file. WIDTH and HEIGHT | 2889 4. a string containing an in-memory XBM file. WIDTH and HEIGHT |
2890 may not be specified in this case because they are defined in the | 2890 may not be specified in this case because they are defined in the |
2891 XBM file. | 2891 XBM file. |
2892 | 2892 |
2893 Both the file and data forms may contain the additional entries | 2893 Both the file and data forms may contain the additional entries |
2894 `:background COLOR' and `:foreground COLOR'. If not present, | 2894 `:background COLOR' and `:foreground COLOR'. If not present, |
4281 } | 4281 } |
4282 | 4282 |
4283 return XPM_TK_EOF; | 4283 return XPM_TK_EOF; |
4284 } | 4284 } |
4285 | 4285 |
4286 /* Functions for color table lookup in XPM data. A Key is a string | 4286 /* Functions for color table lookup in XPM data. A key is a string |
4287 specifying the color of each pixel in XPM data. A value is either | 4287 specifying the color of each pixel in XPM data. A value is either |
4288 an integer that specifies a pixel color, Qt that specifies | 4288 an integer that specifies a pixel color, Qt that specifies |
4289 transparency, or Qnil for the unspecified color. If the length of | 4289 transparency, or Qnil for the unspecified color. If the length of |
4290 the key string is one, a vector is used as a table. Otherwise, a | 4290 the key string is one, a vector is used as a table. Otherwise, a |
4291 hash table is used. */ | 4291 hash table is used. */ |
8440 } | 8440 } |
8441 | 8441 |
8442 return success_p; | 8442 return success_p; |
8443 } | 8443 } |
8444 | 8444 |
8445 /* svg_load_image is a helper function for svg_load, which does the actual | 8445 /* svg_load_image is a helper function for svg_load, which does the |
8446 loading given contents and size, apart from frame and image | 8446 actual loading given contents and size, apart from frame and image |
8447 structures, passed from svg_load. | 8447 structures, passed from svg_load. |
8448 | 8448 |
8449 Uses librsvg to do most of the image processing. | 8449 Uses librsvg to do most of the image processing. |
8450 | 8450 |
8451 Returns non-zero when sucessful. */ | 8451 Returns non-zero when successful. */ |
8452 static int | 8452 static int |
8453 svg_load_image (f, img, contents, size) | 8453 svg_load_image (f, img, contents, size) |
8454 /* Pointer to emacs frame sturcture. */ | 8454 /* Pointer to emacs frame structure. */ |
8455 struct frame *f; | 8455 struct frame *f; |
8456 /* Pointer to emacs image structure. */ | 8456 /* Pointer to emacs image structure. */ |
8457 struct image *img; | 8457 struct image *img; |
8458 /* String containing the SVG XML data to be parsed. */ | 8458 /* String containing the SVG XML data to be parsed. */ |
8459 unsigned char *contents; | 8459 unsigned char *contents; |
8559 #endif | 8559 #endif |
8560 } | 8560 } |
8561 | 8561 |
8562 /* This loop handles opacity values, since Emacs assumes | 8562 /* This loop handles opacity values, since Emacs assumes |
8563 non-transparent images. Each pixel must be "flattened" by | 8563 non-transparent images. Each pixel must be "flattened" by |
8564 calculating he resulting color, given the transparency of the | 8564 calculating the resulting color, given the transparency of the |
8565 pixel, and the image background color. */ | 8565 pixel, and the image background color. */ |
8566 for (y = 0; y < height; ++y) | 8566 for (y = 0; y < height; ++y) |
8567 { | 8567 { |
8568 for (x = 0; x < width; ++x) | 8568 for (x = 0; x < width; ++x) |
8569 { | 8569 { |
8570 unsigned red; | 8570 unsigned red; |
9043 | 9043 |
9044 /* Must be defined now becase we're going to update it below, while | 9044 /* Must be defined now becase we're going to update it below, while |
9045 defining the supported image types. */ | 9045 defining the supported image types. */ |
9046 DEFVAR_LISP ("image-types", &Vimage_types, | 9046 DEFVAR_LISP ("image-types", &Vimage_types, |
9047 doc: /* List of potentially supported image types. | 9047 doc: /* List of potentially supported image types. |
9048 Each element of the list is a symbol for a image type, like 'jpeg or 'png. | 9048 Each element of the list is a symbol for an image type, like 'jpeg or 'png. |
9049 To check whether it is really supported, use `image-type-available-p'. */); | 9049 To check whether it is really supported, use `image-type-available-p'. */); |
9050 Vimage_types = Qnil; | 9050 Vimage_types = Qnil; |
9051 | 9051 |
9052 DEFVAR_LISP ("image-library-alist", &Vimage_library_alist, | 9052 DEFVAR_LISP ("image-library-alist", &Vimage_library_alist, |
9053 doc: /* Alist of image types vs external libraries needed to display them. | 9053 doc: /* Alist of image types vs external libraries needed to display them. |