FFmpeg
spherical.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016 Vittorio Giovara <vittorio.giovara@gmail.com>
3  *
4  * This file is part of FFmpeg.
5  *
6  * FFmpeg is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * FFmpeg is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with FFmpeg; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
26 #ifndef AVUTIL_SPHERICAL_H
27 #define AVUTIL_SPHERICAL_H
28 
29 #include <stddef.h>
30 #include <stdint.h>
31 
57 
66 
73 };
74 
82 typedef struct AVSphericalMapping {
87 
126  int32_t yaw;
127  int32_t pitch;
128  int32_t roll;
129 
167  uint32_t bound_left;
168  uint32_t bound_top;
169  uint32_t bound_right;
170  uint32_t bound_bottom;
171 
182  uint32_t padding;
184 
192 
206  size_t width, size_t height,
207  size_t *left, size_t *top,
208  size_t *right, size_t *bottom);
209 
218 
226 int av_spherical_from_name(const char *name);
232 #endif /* AVUTIL_SPHERICAL_H */
int32_t pitch
Rotation around the right vector [-90, 90].
Definition: spherical.h:127
AVSphericalMapping * av_spherical_alloc(size_t *size)
Allocate a AVSphericalVideo structure and initialize its fields to default values.
Definition: spherical.c:24
Video represents a portion of a sphere mapped on a flat surface using equirectangular projection...
Definition: spherical.h:72
Video represents a sphere mapped on a flat surface using equirectangular projection.
Definition: spherical.h:56
void av_spherical_tile_bounds(const AVSphericalMapping *map, size_t width, size_t height, size_t *left, size_t *top, size_t *right, size_t *bottom)
Convert the bounding fields from an AVSphericalVideo from 0.32 fixed point to pixels.
Definition: spherical.c:36
uint32_t bound_bottom
Distance from the bottom edge.
Definition: spherical.h:170
Video frame is split into 6 faces of a cube, and arranged on a 3x2 layout.
Definition: spherical.h:65
uint32_t bound_right
Distance from the right edge.
Definition: spherical.h:169
int av_spherical_from_name(const char *name)
Get the AVSphericalProjection form a human-readable name.
Definition: spherical.c:68
int32_t yaw
Rotation around the up vector [-180, 180].
Definition: spherical.h:126
struct AVSphericalMapping AVSphericalMapping
This structure describes how to handle spherical videos, outlining information about projection...
uint32_t padding
Number of pixels to pad from the edge of each cube face.
Definition: spherical.h:182
AVSphericalProjection
Projection of the video surface(s) on a sphere.
Definition: spherical.h:51
int32_t roll
Rotation around the forward vector [-180, 180].
Definition: spherical.h:128
This structure describes how to handle spherical videos, outlining information about projection...
Definition: spherical.h:82
uint32_t bound_top
Distance from the top edge.
Definition: spherical.h:168
enum AVSphericalProjection projection
Projection type.
Definition: spherical.h:86
uint32_t bound_left
Distance from the left edge.
Definition: spherical.h:167
const char * av_spherical_projection_name(enum AVSphericalProjection projection)
Provide a human-readable name of a given AVSphericalProjection.
Definition: spherical.c:60