VLC 4.0.0-dev
libvlc_picture.h
Go to the documentation of this file.
1/*****************************************************************************
2 * libvlc_picture.h: libvlc external API
3 *****************************************************************************
4 * Copyright (C) 2018 VLC authors and VideoLAN
5 *
6 * Authors: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU Lesser General Public License as published by
10 * the Free Software Foundation; either version 2.1 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this program; if not, write to the Free Software Foundation,
20 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
21 *****************************************************************************/
22
23#ifndef VLC_LIBVLC_PICTURE_H
24#define VLC_LIBVLC_PICTURE_H 1
25
26# ifdef __cplusplus
27extern "C" {
28# endif
29
32
34{
39
40/**
41 * Increment the reference count of this picture.
42 *
43 * \see libvlc_picture_release()
44 * \param pic A picture object
45 * \return the same object
46 */
49
50/**
51 * Decrement the reference count of this picture.
52 * When the reference count reaches 0, the picture will be released.
53 * The picture must not be accessed after calling this function.
54 *
55 * \see libvlc_picture_retain
56 * \param pic A picture object
57 */
58LIBVLC_API void
60
61/**
62 * Saves this picture to a file. The image format is the same as the one
63 * returned by \link libvlc_picture_type \endlink
64 *
65 * \param pic A picture object
66 * \param path The path to the generated file
67 * \return 0 in case of success, -1 otherwise
68 */
69LIBVLC_API int
70libvlc_picture_save( const libvlc_picture_t* pic, const char* path );
71
72/**
73 * Returns the image internal buffer, including potential padding.
74 * The libvlc_picture_t owns the returned buffer, which must not be modified nor
75 * freed.
76 *
77 * \param pic A picture object
78 * \param size A pointer to a size_t that will hold the size of the buffer [required]
79 * \return A pointer to the internal buffer.
80 */
81LIBVLC_API const unsigned char*
82libvlc_picture_get_buffer( const libvlc_picture_t* pic, size_t *size );
83
84/**
85 * Returns the picture type
86 *
87 * \param pic A picture object
88 * \see libvlc_picture_type_t
89 */
92
93/**
94 * Returns the image stride, ie. the number of bytes per line.
95 * This can only be called on images of type libvlc_picture_Argb
96 *
97 * \param pic A picture object
98 */
99LIBVLC_API unsigned int
101
102/**
103 * Returns the width of the image in pixels
104 *
105 * \param pic A picture object
106 */
107LIBVLC_API unsigned int
109
110/**
111 * Returns the height of the image in pixels
112 *
113 * \param pic A picture object
114 */
115LIBVLC_API unsigned int
117
118/**
119 * Returns the time at which this picture was generated, in milliseconds
120 * \param pic A picture object
121 */
124
125/**
126 * Returns the number of pictures in the list
127 */
129
130/**
131 * Returns the picture at the provided index.
132 *
133 * If the index is out of bound, the result is undefined.
134 */
136 size_t index );
137
138/**
139 * Destroys a picture list and releases the pictures it contains
140 * \param list The list to destroy
141 *
142 * Calling this function with a NULL list is safe and will return immediately
143 */
145
146# ifdef __cplusplus
147}
148# endif
149
150#endif // VLC_LIBVLC_PICTURE_H
struct vlc_param ** list
Definition: core.c:402
int64_t libvlc_time_t
Definition: libvlc.h:78
#define LIBVLC_API
Definition: libvlc.h:42
LIBVLC_API libvlc_picture_t * libvlc_picture_list_at(const libvlc_picture_list_t *list, size_t index)
Returns the picture at the provided index.
struct libvlc_picture_t libvlc_picture_t
Definition: libvlc_picture.h:30
struct libvlc_picture_list_t libvlc_picture_list_t
Definition: libvlc_picture.h:31
LIBVLC_API const unsigned char * libvlc_picture_get_buffer(const libvlc_picture_t *pic, size_t *size)
Returns the image internal buffer, including potential padding.
LIBVLC_API libvlc_time_t libvlc_picture_get_time(const libvlc_picture_t *pic)
Returns the time at which this picture was generated, in milliseconds.
LIBVLC_API libvlc_picture_t * libvlc_picture_retain(libvlc_picture_t *pic)
Increment the reference count of this picture.
LIBVLC_API unsigned int libvlc_picture_get_width(const libvlc_picture_t *pic)
Returns the width of the image in pixels.
LIBVLC_API void libvlc_picture_release(libvlc_picture_t *pic)
Decrement the reference count of this picture.
LIBVLC_API unsigned int libvlc_picture_get_stride(const libvlc_picture_t *pic)
Returns the image stride, ie.
libvlc_picture_type_t
Definition: libvlc_picture.h:34
@ libvlc_picture_Argb
Definition: libvlc_picture.h:35
@ libvlc_picture_Jpg
Definition: libvlc_picture.h:37
@ libvlc_picture_Png
Definition: libvlc_picture.h:36
LIBVLC_API int libvlc_picture_save(const libvlc_picture_t *pic, const char *path)
Saves this picture to a file.
LIBVLC_API void libvlc_picture_list_destroy(libvlc_picture_list_t *list)
Destroys a picture list and releases the pictures it contains.
LIBVLC_API size_t libvlc_picture_list_count(const libvlc_picture_list_t *list)
Returns the number of pictures in the list.
LIBVLC_API unsigned int libvlc_picture_get_height(const libvlc_picture_t *pic)
Returns the height of the image in pixels.
LIBVLC_API libvlc_picture_type_t libvlc_picture_type(const libvlc_picture_t *pic)
Returns the picture type.