]> git.sesse.net Git - vlc/blob - include/vlc_image.h
* src/misc/image.c, include/vlc_image.h: new image handler facility making use of...
[vlc] / include / vlc_image.h
1 /*****************************************************************************
2  * vlc_image.h : wrapper for image reading/writing facilities
3  *****************************************************************************
4  * Copyright (C) 2004 VideoLAN
5  * $Id$
6  *
7  * Authors: Gildas Bazin <gbazin@videolan.org>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
22  *****************************************************************************/
23
24 #ifndef _VLC_IMAGE_H
25 #define _VLC_IMAGE_H 1
26
27 #include "vlc_video.h"
28
29 struct image_handler_t
30 {
31     picture_t * (*pf_read) ( image_handler_t *, block_t *,
32                              video_format_t *, video_format_t * );
33     picture_t * (*pf_read_url) ( image_handler_t *, const char *,
34                                  video_format_t *, video_format_t * );
35     block_t* (*pf_write) ( image_handler_t *, picture_t *,
36                            video_format_t *, video_format_t * );
37     int (*pf_write_url) ( image_handler_t *, picture_t *,
38                           video_format_t *, video_format_t *, const char * );
39
40     /* Private properties */
41     vlc_object_t *p_parent;
42     decoder_t *p_dec;
43     encoder_t *p_enc;
44     filter_t  *p_filter;
45 };
46
47 VLC_EXPORT( image_handler_t *, __image_HandlerCreate, ( vlc_object_t * ) );
48 #define image_HandlerCreate( a ) __image_HandlerCreate( VLC_OBJECT(a) )
49 VLC_EXPORT( void, image_HandlerDelete, ( image_handler_t * ) );
50
51 #define image_Read( a, b, c, d ) a->pf_read( a, b, c, d )
52 #define image_ReadUrl( a, b, c, d ) a->pf_read_url( a, b, c, d )
53 #define image_Write( a, b, c, d ) a->pf_write( a, b, c, d )
54 #define image_WriteUrl( a, b, c, d, e ) a->pf_write_url( a, b, c, d, e )
55
56 #endif /* _VLC_IMAGE_H */