World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
Структура AVSphericalMapping

#include <spherical.h>

Открытые атрибуты

enum AVSphericalProjection projection
 
uint32_t padding
 
Initial orientation

There fields describe additional rotations applied to the sphere after the video frame is mapped onto it. The sphere is rotated around the viewer, who remains stationary. The order of transformation is always yaw, followed by pitch, and finally by roll.

The coordinate system matches the one defined in OpenGL, where the forward vector (z) is coming out of screen, and it is equivalent to a rotation matrix of R = r_y(yaw) * r_x(pitch) * r_z(roll).

A positive yaw rotates the portion of the sphere in front of the viewer toward their right. A positive pitch rotates the portion of the sphere in front of the viewer upwards. A positive roll tilts the portion of the sphere in front of the viewer to the viewer's right.

These values are exported as 16.16 fixed point.

See this equirectangular projection as example:

Yaw
-180 0 180
90 +-------------+-------------+ 180
| | | up
P | | | y| forward
i | ^ | | /z
t 0 +-------------X-------------+ 0 Roll | /
c | | | | /
h | | | 0|/_____right
| | | x
-90 +-------------+-------------+ -180
X - the default camera center
^ - the default up vector
int32_t yaw
 Rotation around the up vector [-180, 180]. Подробнее...
 
int32_t pitch
 Rotation around the right vector [-90, 90]. Подробнее...
 
int32_t roll
 Rotation around the forward vector [-180, 180]. Подробнее...
 
Bounding rectangle

These fields indicate the location of the current tile, and where it should be mapped relative to the original surface. They are exported as 0.32 fixed point, and can be converted to classic pixel values with av_spherical_bounds().

+----------------+----------+
| |bound_top |
| +--------+ |
| bound_left |tile | |
+<---------->| |<--->+bound_right
| +--------+ |
| | |
| bound_bottom| |
+----------------+----------+

If needed, the original video surface dimensions can be derived by adding the current stream or frame size to the related bounds, like in the following example:

original_width = tile->width + bound_left + bound_right;
original_height = tile->height + bound_top + bound_bottom;
Заметки
These values are valid only for the tiled equirectangular projection type (AV_SPHERICAL_EQUIRECTANGULAR_TILE), and should be ignored in all other cases.
uint32_t bound_left
 Distance from the left edge. Подробнее...
 
uint32_t bound_top
 Distance from the top edge. Подробнее...
 
uint32_t bound_right
 Distance from the right edge. Подробнее...
 
uint32_t bound_bottom
 Distance from the bottom edge. Подробнее...
 

Подробное описание

This structure describes how to handle spherical videos, outlining information about projection, initial layout, and any other view modifier.

Заметки
The struct must be allocated with av_spherical_alloc() and its size is not a part of the public ABI.

См. определение в файле spherical.h строка 82

Данные класса

◆ projection

enum AVSphericalProjection AVSphericalMapping::projection

Projection type.

См. определение в файле spherical.h строка 86

◆ yaw

int32_t AVSphericalMapping::yaw

Rotation around the up vector [-180, 180].

См. определение в файле spherical.h строка 126

◆ pitch

int32_t AVSphericalMapping::pitch

Rotation around the right vector [-90, 90].

См. определение в файле spherical.h строка 127

◆ roll

int32_t AVSphericalMapping::roll

Rotation around the forward vector [-180, 180].

См. определение в файле spherical.h строка 128

◆ bound_left

uint32_t AVSphericalMapping::bound_left

Distance from the left edge.

См. определение в файле spherical.h строка 167

◆ bound_top

uint32_t AVSphericalMapping::bound_top

Distance from the top edge.

См. определение в файле spherical.h строка 168

◆ bound_right

uint32_t AVSphericalMapping::bound_right

Distance from the right edge.

См. определение в файле spherical.h строка 169

◆ bound_bottom

uint32_t AVSphericalMapping::bound_bottom

Distance from the bottom edge.

См. определение в файле spherical.h строка 170

◆ padding

uint32_t AVSphericalMapping::padding

Number of pixels to pad from the edge of each cube face.

Заметки
This value is valid for only for the cubemap projection type (AV_SPHERICAL_CUBEMAP), and should be ignored in all other cases.

См. определение в файле spherical.h строка 182


Объявления и описания членов структуры находятся в файле:
AVSphericalMapping::bound_right
uint32_t bound_right
Distance from the right edge.
Definition: spherical.h:169
AVSphericalMapping::bound_bottom
uint32_t bound_bottom
Distance from the bottom edge.
Definition: spherical.h:170
AVSphericalMapping::bound_left
uint32_t bound_left
Distance from the left edge.
Definition: spherical.h:167
AVSphericalMapping::bound_top
uint32_t bound_top
Distance from the top edge.
Definition: spherical.h:168