2022-02-10 23:07:11 +01:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
2012-02-17 19:59:41 +01:00
|
|
|
#pragma once
|
2010-03-23 19:28:38 +01:00
|
|
|
|
2019-02-17 22:08:12 +01:00
|
|
|
/** \file
|
|
|
|
* \ingroup bli
|
2011-02-18 14:58:08 +01:00
|
|
|
*/
|
|
|
|
|
2020-03-02 15:04:53 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2010-03-23 21:04:05 +01:00
|
|
|
struct Object;
|
2019-01-28 11:08:24 +01:00
|
|
|
struct ProjCameraInfo;
|
2010-03-23 19:28:38 +01:00
|
|
|
|
2021-12-09 10:01:44 +01:00
|
|
|
/**
|
|
|
|
* Create UV info from the camera, needs to be freed.
|
|
|
|
*
|
|
|
|
* \param rotmat: can be `obedit->obmat` when uv project is used.
|
|
|
|
* \param winx, winy: can be from `scene->r.xsch / ysch`.
|
|
|
|
*/
|
2012-05-05 02:23:55 +02:00
|
|
|
struct ProjCameraInfo *BLI_uvproject_camera_info(struct Object *ob,
|
|
|
|
float rotmat[4][4],
|
|
|
|
float winx,
|
|
|
|
float winy);
|
2010-03-23 19:28:38 +01:00
|
|
|
|
2021-12-09 10:01:44 +01:00
|
|
|
/**
|
|
|
|
* Apply UV from uvinfo (camera).
|
|
|
|
*/
|
2012-05-05 02:23:55 +02:00
|
|
|
void BLI_uvproject_from_camera(float target[2], float source[3], struct ProjCameraInfo *uci);
|
2010-03-23 19:28:38 +01:00
|
|
|
|
2021-12-09 10:01:44 +01:00
|
|
|
/**
|
|
|
|
* Apply uv from perspective matrix.
|
|
|
|
* \param persmat: Can be `rv3d->persmat`.
|
|
|
|
*/
|
2012-05-05 02:23:55 +02:00
|
|
|
void BLI_uvproject_from_view(float target[2],
|
|
|
|
float source[3],
|
|
|
|
float persmat[4][4],
|
|
|
|
float rotmat[4][4],
|
|
|
|
float winx,
|
|
|
|
float winy);
|
2010-03-23 19:28:38 +01:00
|
|
|
|
2021-12-09 10:01:44 +01:00
|
|
|
/**
|
|
|
|
* Apply orthographic UV's.
|
|
|
|
*/
|
2020-08-02 09:17:31 +02:00
|
|
|
void BLI_uvproject_from_view_ortho(float target[2], float source[3], const float rotmat[4][4]);
|
2010-03-23 19:28:38 +01:00
|
|
|
|
2021-12-09 10:01:44 +01:00
|
|
|
/**
|
|
|
|
* So we can adjust scale with keeping the struct private.
|
|
|
|
*/
|
2012-05-05 02:23:55 +02:00
|
|
|
void BLI_uvproject_camera_info_scale(struct ProjCameraInfo *uci, float scale_x, float scale_y);
|
2010-06-15 23:46:02 +02:00
|
|
|
|
2020-03-02 15:04:53 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|