1 /*---------------------------------------------------------------------*
2 Project:  tc library
3 File:     TCImageList.h
4 
5 Copyright 1998-2001 Nintendo.  All rights reserved.
6 
7 These coded instructions, statements and computer programs contain
8 proprietary information of Nintendo of America Inc. and/or Nintendo
9 Company Ltd., and are protected by Federal copyright law.  They may
10 not be disclosed to third parties or copied or duplicated in any form,
11 in whole or in part, without the prior written consent of Nintendo.
12 
13 Change History:
14 
15    $Log: TCImageList.h,v $
16    Revision 1.1  2006/02/17 09:02:16  mitu
17    1st version
18 
19 
20     4     4/11/01 3:04p John
21     Updated header copyrights and pathname.
22 
23     3     3/09/01 2:48p John
24     Added TCImage.wrapS and TCImage.wrapT and TCSetImageWrap.   Added
25     ability to specify wrapS and wrapT mode using TCS script file.
26 
27     2     3/17/00 1:15p Mikepc
28     change tc to use indices numbered from 0:
29     added TCFindImagePos prototype.
30 
31     1     12/03/99 3:44p Ryan
32 
33     10    10/08/99 2:44p Mikepc
34     update for tplConv portability: altered data structures, replaced
35     references to 'read tga code' with ' *fileFn, removed redundant
36     functions.
37 
38     9     9/17/99 12:25p Mikepc
39     arbitrary palette size is gone- took RemapColors() from reduceColor.cpp
40     ( file is now removed), renamed it to RemapImageColors and placed it
41     here.
42 
43     8     9/16/99 8:48p Mikepc
44 
45     7     8/26/99 4:56p Mikepc
46     added namespace protection to remove potential name collisions with
47     tool code.  Exceptions are CreateTplFile and QuickConvert.  These are
48     extern "C" linked.
49 
50     6     8/26/99 11:37a Mikepc
51 
52     5     8/26/99 11:01a Mikepc
53     tplConv rewrite for memory usage efficiency, batch file processing
54     ability.
55 
56   $NoKeywords: $
57 
58 -----------------------------------------------------------------------*/
59 
60 
61 #ifndef __TCIMAGELIST_H__
62 #define __TCIMAGELIST_H__
63 
64 
65 /********************************/
66 #include <charPipeline/tc/TCLayer.h>
67 
68 /********************************/
69 typedef struct TCImage
70 {
71     u32 index;              // image index from script file.  This is also the .tpl bank location
72 
73 	u32 colorSrcImage;      // srcImage index for color layer
74 	u32 alphaSrcImage;      // srcImage index for alpha layer; 0 if no alpha layer
75 
76     u32 texelFormat;        // Dolphin texture format from script file
77 
78 	u32 minLOD;             // minimum LOD level desired relative to srcImage
79 	u32 maxLOD;             // maximum LOD level desired relative to srcImage
80 	u32 remapMinLOD;        // remapped (actual) minLOD for .tpl file
81 
82     u32 wrapS;              // wrap mode in S axis
83     u32 wrapT;              // wrap mode in T axis
84 
85     //-------------------
86 
87 	TCLayer lyColor;        // color layer
88 	TCLayer lyAlpha;        // alpha layer
89 
90     u32 tplImageBankOffset;	// bytes from top of .tpl file to image texel data
91     u32 tplBufferSize;      // size of image buffer including padding to 32B tiles
92 
93 	struct TCImage* prev;
94 	struct TCImage* next;
95 
96 }TCImage, *TCImagePtr;
97 
98 /********************************/
99 extern TCImage* ImHead;
100 
101 /*>*******************************(*)*******************************<*/
102 void     TCSetImageValues	   ( void );
103 TCImage* TCNewImage			   ( void );
104 void     TCSortImageByIndex	   ( void );
105 void     TCCopyImage		   ( TCImage* src,  TCImage* dst );
106 TCImage* TCFindImageByIndex	   ( u32      index              );
107 void     TCSetImageIndex	   ( TCImage* im,   u32 index    );
108 
109 void     TCSetImageLayerAtt	   ( TCImage* im,   u32 colorLayer, u32 alphaLayer );
110 void     TCSetImageWrap 	   ( TCImage* im,   u32 wrapS, u32 wrapT );
111 
112 void     TCSetImageTexelFormat ( TCImage* im,   u32 texelFmt );
113 
114 void     TCSetImageMipMap	   ( TCImage* im,   u32 minLOD, u32 maxLOD, u32 baseLOD );
115 
116 u32      TCFindImagePos        ( TCImage* im );
117 
118 /*>*******************************(*)*******************************<*/
119 
120 #endif  // __TCIMAGELIST_H__
121