1cdc920a0Smrg/**************************************************************************
2cdc920a0Smrg *
3cdc920a0Smrg * Copyright 2009 Marek Olšák <maraeo@gmail.com>
4cdc920a0Smrg *
5cdc920a0Smrg * Permission is hereby granted, free of charge, to any person obtaining a
6cdc920a0Smrg * copy of this software and associated documentation files (the
7cdc920a0Smrg * "Software"), to deal in the Software without restriction, including
8cdc920a0Smrg * without limitation the rights to use, copy, modify, merge, publish,
9cdc920a0Smrg * distribute, sub license, and/or sell copies of the Software, and to
10cdc920a0Smrg * permit persons to whom the Software is furnished to do so, subject to
11cdc920a0Smrg * the following conditions:
12cdc920a0Smrg *
13cdc920a0Smrg * The above copyright notice and this permission notice (including the
14cdc920a0Smrg * next paragraph) shall be included in all copies or substantial portions
15cdc920a0Smrg * of the Software.
16cdc920a0Smrg *
17cdc920a0Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18cdc920a0Smrg * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19cdc920a0Smrg * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
20af69d88dSmrg * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
21cdc920a0Smrg * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22cdc920a0Smrg * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23cdc920a0Smrg * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24cdc920a0Smrg *
25cdc920a0Smrg **************************************************************************/
26cdc920a0Smrg
27cdc920a0Smrg#ifndef U_TEXTURE_H
28cdc920a0Smrg#define U_TEXTURE_H
29cdc920a0Smrg
30af69d88dSmrg#include "pipe/p_compiler.h"
31af69d88dSmrg
32cdc920a0Smrg#ifdef __cplusplus
33cdc920a0Smrgextern "C" {
34cdc920a0Smrg#endif
35cdc920a0Smrg
36cdc920a0Smrg/**
37cdc920a0Smrg * Convert 2D texture coordinates of 4 vertices into cubemap coordinates
38cdc920a0Smrg * in the given face.
39cdc920a0Smrg * Coordinates must be in the range [0,1].
40cdc920a0Smrg *
41cdc920a0Smrg * \param face          Cubemap face.
42cdc920a0Smrg * \param in_st         4 pairs of 2D texture coordinates to convert.
43cdc920a0Smrg * \param in_stride     Stride of in_st in floats.
44cdc920a0Smrg * \param out_str       STR cubemap texture coordinates to compute.
45cdc920a0Smrg * \param out_stride    Stride of out_str in floats.
46cdc920a0Smrg */
47cdc920a0Smrgvoid util_map_texcoords2d_onto_cubemap(unsigned face,
48cdc920a0Smrg                                       const float *in_st, unsigned in_stride,
49af69d88dSmrg                                       float *out_str, unsigned out_stride,
50af69d88dSmrg                                       boolean allow_scale);
51cdc920a0Smrg
52cdc920a0Smrg
53cdc920a0Smrg#ifdef __cplusplus
54cdc920a0Smrg}
55cdc920a0Smrg#endif
56cdc920a0Smrg
57cdc920a0Smrg#endif
58