Blender  V2.93
BLI_uvproject.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 #pragma once
17 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 struct Object;
27 struct ProjCameraInfo;
28 
29 /* create uv info from the camera, needs to be freed */
31  float rotmat[4][4],
32  float winx,
33  float winy);
34 
35 /* apply uv from uvinfo (camera) */
36 void BLI_uvproject_from_camera(float target[2], float source[3], struct ProjCameraInfo *uci);
37 
38 /* apply uv from perspective matrix */
39 void BLI_uvproject_from_view(float target[2],
40  float source[3],
41  float persmat[4][4],
42  float rotmat[4][4],
43  float winx,
44  float winy);
45 
46 /* apply ortho uv's */
47 void BLI_uvproject_from_view_ortho(float target[2], float source[3], const float rotmat[4][4]);
48 
49 /* so we can adjust scale with keeping the struct private */
50 void BLI_uvproject_camera_info_scale(struct ProjCameraInfo *uci, float scale_x, float scale_y);
51 
52 #ifdef __cplusplus
53 }
54 #endif
void BLI_uvproject_from_view(float target[2], float source[3], float persmat[4][4], float rotmat[4][4], float winx, float winy)
Definition: uvproject.c:94
void BLI_uvproject_from_view_ortho(float target[2], float source[3], const float rotmat[4][4])
Definition: uvproject.c:186
void BLI_uvproject_from_camera(float target[2], float source[3], struct ProjCameraInfo *uci)
Definition: uvproject.c:41
struct ProjCameraInfo * BLI_uvproject_camera_info(struct Object *ob, float rotmat[4][4], float winx, float winy)
void BLI_uvproject_camera_info_scale(struct ProjCameraInfo *uci, float scale_x, float scale_y)
Definition: uvproject.c:197
float rotmat[4][4]
Definition: uvproject.c:36