1 /*---------------------------------------------------------------------------*
2 
3   Copyright (C) 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 
13 #pragma once
14 #ifndef __GFDFILETEXTURE_H__
15 #define __GFDFILETEXTURE_H__
16 
17 #ifdef __cplusplus
18 extern "C"
19 {
20 #endif // __cplusplus
21 
22 /// @addtogroup GFDFileTextureGroup
23 /// @{
24 
25 ///
26 /// For Writing gtx file.
27 ///
28 
29 /// \brief Creates a gtx file based on the passed values in GX2Texture
30 ///
31 /// \param pFilename    Name of the output file
32 /// \param gpuVer       GPU version
33 /// \param swapMode     Endian swap mode for image data (GPU data)
34 /// \param alignMode    Align mode for adding data specific alignment size padding block before image data (GPU data)
35 /// \param numTextures  Number of textures in pTexture
36 /// \param pTexture     Input GX2Texture pointer used to create gtx file
37 /// \return true or false
38 ///
39 /// \donotcall \notthreadsafe \hostonly \enddonotcall
40 ///
41 GFD_DECLSPEC bool GFD_API GFDWriteFileTexture(char* pFilename, GFDGPUVersion gpuVer, GFDEndianSwapMode swapMode, GFDAlignMode alignMode, u32 numTextures, GX2Texture* pTexture);
42 
43 /// \brief Appends textures based on the passed in GX2Texture to an existing gtx file
44 ///
45 /// \param pFilename    Name of the file to append textures
46 /// \param gpuVer       GPU version
47 /// \param swapMode     Endian swap mode for image data (GPU data)
48 /// \param alignMode    Align mode for adding data specific alignment size padding block before image data (GPU data)
49 /// \param numTexture  Number of textures in pTexture
50 /// \param pTexture     Input GX2Texture pointer used to create gtx file
51 /// \return true or false
52 ///
53 /// \donotcall \notthreadsafe \hostonly \enddonotcall
54 ///
55 GFD_DECLSPEC bool GFD_API GFDAppendWriteFileTexture(char* pFilename, GFDGPUVersion gpuVer, GFDEndianSwapMode swapMode, GFDAlignMode alignMode, u32 numTexture, GX2Texture* pTexture);
56 
57 ///
58 /// For Reading gtx file.
59 ///
60 
61 /// \brief Reads a gtx file and sets data to GX2Texture. Need to call GFDFreeFileTexture after reading.
62 ///
63 /// \param pTexture     Output GX2Texture pointer
64 /// \param gpuVer       GPU version
65 /// \param swapMode     Endian swap mode for image data (GPU data)
66 /// \param fileName    Name of the input gtx file
67 /// \return true or false
68 ///
69 /// \donotcall \notthreadsafe \hostonly \enddonotcall
70 ///
71 GFD_DECLSPEC bool GFD_API GFDReadFileTexture(GX2Texture* pTexture, GFDGPUVersion gpuVer, GFDEndianSwapMode swapMode, const char* fileName);
72 
73 /// \brief Free GX2Texture allocated by GFDReadFileTexture.
74 ///
75 /// \param pTexture     GX2Texture pointer to free
76 ///
77 /// \donotcall \notthreadsafe \hostonly \enddonotcall
78 ///
79 GFD_DECLSPEC void GFD_API GFDFreeFileTexture(GX2Texture* pTexture);
80 
81 /// @}
82 
83 #ifdef __cplusplus
84 }
85 #endif // __cplusplus
86 
87 #endif  //#ifndef __GFDFILETEXTURE_H__
88