2 * Asterisk -- An open source telephony toolkit.
4 * Copyright (C) 1999 - 2006, Digium, Inc.
6 * Mark Spencer <markster@digium.com>
8 * See http://www.asterisk.org for more information about
9 * the Asterisk project. Please do not directly contact
10 * any of the maintainers of this project for assistance;
11 * the project provides a web site, mailing lists and IRC
12 * channels for your use.
14 * This program is free software, distributed under the terms of
15 * the GNU General Public License Version 2. See the LICENSE file
16 * at the top of the source tree.
20 * \brief General Asterisk channel definitions for image handling
23 #ifndef _ASTERISK_IMAGE_H
24 #define _ASTERISK_IMAGE_H
26 /*! \brief structure associated with registering an image format */
28 char *name; /*!< Name */
29 char *desc; /*!< Description */
30 char *exts; /*!< Extension(s) (separated by '|' ) */
31 int format; /*!< Image format */
32 struct ast_frame *(*read_image)(int fd, int len); /*!< Read an image from a file descriptor */
33 int (*identify)(int fd); /*!< Identify if this is that type of file */
34 int (*write_image)(int fd, struct ast_frame *frame); /*!< Returns length written */
35 AST_LIST_ENTRY(ast_imager) list; /*!< For linked list */
39 * \brief Check for image support on a channel
40 * \param chan channel to check
41 * Checks the channel to see if it supports the transmission of images
42 * \return non-zero if image transmission is supported
44 int ast_supports_images(struct ast_channel *chan);
47 * \brief Sends an image
48 * \param chan channel to send image on
49 * \param filename filename of image to send (minus extension)
50 * Sends an image on the given channel.
51 * \retval 0 on success
54 int ast_send_image(struct ast_channel *chan, char *filename);
57 * \brief Make an image
58 * \param filename filename of image to prepare
59 * \param preflang preferred language to get the image...?
60 * \param format the format of the file
61 * Make an image from a filename ??? No estoy positivo
62 * \retval an ast_frame on success
63 * \retval NULL on failure
65 struct ast_frame *ast_read_image(char *filename, const char *preflang, int format);
68 * \brief Register image format
69 * \param imgdrv Populated ast_imager structure with info to register
70 * Registers an image format
71 * \return 0 regardless
73 int ast_image_register(struct ast_imager *imgdrv);
76 * \brief Unregister an image format
77 * \param imgdrv pointer to the ast_imager structure you wish to unregister
78 * Unregisters the image format passed in.
81 void ast_image_unregister(struct ast_imager *imgdrv);
84 * \brief Initialize image stuff
85 * Initializes all the various image stuff. Basically just registers the cli stuff
86 * \return 0 all the time
88 int ast_image_init(void);
90 #endif /* _ASTERISK_IMAGE_H */