1 /*---------------------------------------------------------------------------*
2 
3   Copyright 2010-2011 Nintendo.  All rights reserved.
4 
5   These coded instructions, statements, and computer programs contain
6   proprietary information of Nintendo of America Inc. and/or Nintendo
7   Company Ltd., and are protected by Federal copyright law.  They may
8   not be disclosed to third parties or copied or duplicated in any form,
9   in whole or in part, without the prior written consent of Nintendo.
10 
11  *---------------------------------------------------------------------------*/
12 #if !defined(_ATI_TEX_TEXTURE_H_INCLUDED_)
13 #define _ATI_TEX_TEXTURE_H_INCLUDED_
14 
15 /// @addtogroup GX2TexUtilGroup
16 /// @{
17 
18 #if defined(WIN32) || defined(WIN64)
19 #include <windows/gx2.h>
20 #else
21 #include <cafe/gx2.h>
22 #endif
23 
24 #include "texUtils.h"
25 
26 #if _MSC_VER > 1000
27 #pragma once
28 #endif // _MSC_VER > 1000
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 typedef enum
35 {
36     PE_OK,            ///< No error - success.
37     PE_AlreadyLoaded, ///< The plugin is already loaded.
38     PE_Unknown,       ///< An error occured.
39 } TU_Error;
40 
41 /// A set of flags indicating cube-map faces.
42 typedef enum
43 {
44    MS_CF_None        = 0x00, ///< No cube-map faces.
45    MS_CF_PositiveX   = 0x01, ///< The positive-X cube-map face.
46    MS_CF_NegativeX   = 0x02, ///< The negative-X cube-map face.
47    MS_CF_PositiveY   = 0x04, ///< The positive-Y cube-map face.
48    MS_CF_NegativeY   = 0x08, ///< The negative-Y cube-map face.
49    MS_CF_PositiveZ   = 0x10, ///< The positive-Z cube-map face.
50    MS_CF_NegativeZ   = 0x20, ///< The negative-Z cube-map face.
51    MS_CF_All         = 0x3f, ///< All the cube-map faces.
52 } MS_CubeFace;
53 
54 /// \brief The format of data in the channels of texture.
55 typedef enum
56 {
57     CF_Unknown     = 0,
58     /// 8-bit integer data
59     CF_8bit        = 1,
60     /// 16-bit float data
61     CF_Float16     = 2,
62     /// 32-bit float data
63     CF_Float32     = 3,
64     /// Compressed data
65     CF_Compressed  = 4,
66     /// 16-bit integer data
67     CF_16bit       = 5,
68     /// 10-bit integer data in the color channels & 2-bit integer data in the alpha channel
69     CF_2101010     = 6,
70     /// 1555
71     CF_1555        = 7,
72     /// 4444
73     CF_4444        = 8,
74     /// 32-bit integer data
75     CF_32bit       = 9,
76 } ChannelFormat;
77 
78 /// \brief The type of data the texture represents.
79 typedef enum
80 {
81     /// An RGB texture padded to u32 width
82     TDT_XRGB       = 0,
83     /// An ARGB texture
84     TDT_ARGB       = 1,
85     /// A normal map
86     TDT_NORMAL_MAP = 2,
87     /// A single component texture
88     TDT_R          = 3,
89     /// A two component texture
90     TDT_RG         = 4,
91     /// A three component texture
92     TDT_RGB        = 5
93 } TextureDataType;
94 
95 /// \brief The type of the texture.
96 typedef enum
97 {
98     /// A regular 2D texture
99     TT_2D             = 0,
100     /// A cubemap texture
101     TT_CubeMap        = 1,
102     /// A volume texture
103     TT_VolumeTexture  = 2,
104 } TextureType;
105 
106 /// \brief A struct for storing ARGB8 colors.
107 typedef struct
108 {
109     /// The color as an array of components
110     u8 rgba[4];
111 } COLOR;
112 
113 typedef enum
114 {
115    MS_Default        = 0,
116    MS_AlphaPremult   = 1,
117 } MS_Flags;
118 
119 /// \brief A MipLevel is the fundamental unit for containing texture data.
120 ///
121 /// The MipLevel structure contains the dimensions, size and data pointer for
122 /// a given mipmap level.
123 ///
124 typedef struct
125 {
126     s32 width;      ///< Width of the data in pixels.
127     s32 height;     ///< Height of the data in pixels.
128     u32 byteSize;   ///< Size of the data in bytes.
129     u8* pData;      ///< A pointer to the texture data that this MipLevel contains.
130 } MipLevel;
131 
132 #ifdef __cplusplus
133 };
134 #endif
135 
136 /////////////////////////////////////////////////////////////////////////////
137 
138 /// @}
139 
140 #endif // !defined(_ATI_TA_TEXTURE_H_INCLUDED_)
141