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 */
32 /*! Extension(s) (separated by '|' ) */
36 /*! Read an image from a file descriptor */
37 struct ast_frame *(*read_image)(int fd, int len);
38 /*! Identify if this is that type of file */
39 int (*identify)(int fd);
40 /*! Returns length written */
41 int (*write_image)(int fd, struct ast_frame *frame);
42 /*! For linked list */
43 AST_LIST_ENTRY(ast_imager) list;
47 * \brief Check for image support on a channel
48 * \param chan channel to check
49 * Checks the channel to see if it supports the transmission of images
50 * \return non-zero if image transmission is supported
52 int ast_supports_images(struct ast_channel *chan);
55 * \brief Sends an image
56 * \param chan channel to send image on
57 * \param filename filename of image to send (minus extension)
58 * Sends an image on the given channel.
59 * \retval 0 on success
62 int ast_send_image(struct ast_channel *chan, char *filename);
65 * \brief Make an image
66 * \param filename filename of image to prepare
67 * \param preflang preferred language to get the image...?
68 * \param format the format of the file
69 * Make an image from a filename ??? No estoy positivo
70 * \retval an ast_frame on success
71 * \retval NULL on failure
73 struct ast_frame *ast_read_image(char *filename, const char *preflang, int format);
76 * \brief Register image format
77 * \param imgdrv Populated ast_imager structure with info to register
78 * Registers an image format
79 * \return 0 regardless
81 int ast_image_register(struct ast_imager *imgdrv);
84 * \brief Unregister an image format
85 * \param imgdrv pointer to the ast_imager structure you wish to unregister
86 * Unregisters the image format passed in.
89 void ast_image_unregister(struct ast_imager *imgdrv);
92 * \brief Initialize image stuff
93 * Initializes all the various image stuff. Basically just registers the cli stuff
94 * \return 0 all the time
96 int ast_image_init(void);
98 #endif /* _ASTERISK_IMAGE_H */