<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://www.yasunaga-lab.bio.kyutech.ac.jp/Eos/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://www.yasunaga-lab.bio.kyutech.ac.jp/Eos/index.php?action=history&amp;feed=atom&amp;title=tgaFile%28API%29</id>
		<title>tgaFile(API) - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://www.yasunaga-lab.bio.kyutech.ac.jp/Eos/index.php?action=history&amp;feed=atom&amp;title=tgaFile%28API%29"/>
		<link rel="alternate" type="text/html" href="http://www.yasunaga-lab.bio.kyutech.ac.jp/Eos/index.php?title=tgaFile(API)&amp;action=history"/>
		<updated>2026-06-04T16:10:53Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.23.6</generator>

	<entry>
		<id>http://www.yasunaga-lab.bio.kyutech.ac.jp/Eos/index.php?title=tgaFile(API)&amp;diff=4429&amp;oldid=prev</id>
		<title>Kinoshita: /* Read tga file */</title>
		<link rel="alternate" type="text/html" href="http://www.yasunaga-lab.bio.kyutech.ac.jp/Eos/index.php?title=tgaFile(API)&amp;diff=4429&amp;oldid=prev"/>
				<updated>2014-10-07T08:50:08Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Read tga file&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 08:50, 7 October 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 84:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 84:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Read tga file===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Read tga file===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Read the header information from '''fpt''', and store to '''tga-&amp;gt;Header'''. If '''tga''' is NULL, allocate the memory by using '''tgaFileInit'' beforehand.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Read the header information from '''fpt''', and store to '''tga-&amp;gt;Header'''. If '''tga''' is NULL, allocate the memory by using '''tgaFileInit&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'&lt;/ins&gt;'' beforehand.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; extern tgaFile* tgaFileHeaderRead(tgaFile* tga, FILE* fpt, int mode);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; extern tgaFile* tgaFileHeaderRead(tgaFile* tga, FILE* fpt, int mode);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Read the data from '''fpt''', and store to '''tga-&amp;gt;Image'''. Then store also the header by using '''tgaFileImageInit'''.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Read the data from '''fpt''', and store to '''tga-&amp;gt;Image'''. Then store also the header by using '''tgaFileImageInit'''.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Kinoshita</name></author>	</entry>

	<entry>
		<id>http://www.yasunaga-lab.bio.kyutech.ac.jp/Eos/index.php?title=tgaFile(API)&amp;diff=4428&amp;oldid=prev</id>
		<title>Kinoshita: Created page with &quot;DataManip/'''tgaFile''' is API for tga data.  == constant ==  typedef enum tgaFileColorMap {  	tgaFileColorMapNoColorMap=0,  	tgaFileColorMapColorMap=1  } tgaFileColorMap;...&quot;</title>
		<link rel="alternate" type="text/html" href="http://www.yasunaga-lab.bio.kyutech.ac.jp/Eos/index.php?title=tgaFile(API)&amp;diff=4428&amp;oldid=prev"/>
				<updated>2014-10-07T08:49:30Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;DataManip/&amp;#039;&amp;#039;&amp;#039;tgaFile&amp;#039;&amp;#039;&amp;#039; is API for &lt;a href=&quot;/Eos/index.php?title=tga&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;tga (page does not exist)&quot;&gt;tga&lt;/a&gt; data.  == constant ==  typedef enum tgaFileColorMap {  	tgaFileColorMapNoColorMap=0,  	tgaFileColorMapColorMap=1  } tgaFileColorMap;...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;DataManip/'''tgaFile''' is API for [[tga]] data.&lt;br /&gt;
&lt;br /&gt;
== constant ==&lt;br /&gt;
 typedef enum tgaFileColorMap {&lt;br /&gt;
 	tgaFileColorMapNoColorMap=0,&lt;br /&gt;
 	tgaFileColorMapColorMap=1&lt;br /&gt;
 } tgaFileColorMap;&lt;br /&gt;
&lt;br /&gt;
 typedef enum tgaFileImageType {&lt;br /&gt;
 	tgaFileImageTypeNoImage  = 0,	&lt;br /&gt;
 	tgaFileImageTypeColorMappedImage = 1,&lt;br /&gt;
 	tgaFileImageTypeTrueColorImage   = 2,&lt;br /&gt;
 	tgaFileImageTypeBlackAndWhite    = 3,&lt;br /&gt;
 	tgaFileImageTypeRLEColorMappedImage = 9,&lt;br /&gt;
 	tgaFileImageTypeRLETrueColorImage   = 10,&lt;br /&gt;
 	tgaFileImageTypeRLEBlackAndWhite    = 11&lt;br /&gt;
 } tgaFileImageType;&lt;br /&gt;
&lt;br /&gt;
 typedef enum tgaFileImageOrigin {&lt;br /&gt;
 	tgaFileImageOriginBottomLeft  = 0,&lt;br /&gt;
 	tgaFileImageOriginBottomRight = 1,&lt;br /&gt;
 	tgaFileImageOriginTopLeft     = 2,&lt;br /&gt;
 	tgaFileImageOriginTopRight    = 3 &lt;br /&gt;
 } tgaFileImageOrigin;&lt;br /&gt;
&lt;br /&gt;
== struct ==&lt;br /&gt;
 typedef struct tgaFileColorMapSpecification {&lt;br /&gt;
 	short FirstEntryIndex;&lt;br /&gt;
 	short ColorMapLength;&lt;br /&gt;
 	unsigned char ColorMapEntrySize;&lt;br /&gt;
 } tgaFileColorMapSpecification;&lt;br /&gt;
&lt;br /&gt;
 typedef union tgaFileDescriptor {&lt;br /&gt;
 	unsigned char All;&lt;br /&gt;
 	struct {&lt;br /&gt;
 		unsigned char AlphaChannelBits:4;&lt;br /&gt;
 		unsigned char ImageOrigin:2;&lt;br /&gt;
 		unsigned char Unused:2;&lt;br /&gt;
 	} Bit;&lt;br /&gt;
 } tgaFileDescriptor;&lt;br /&gt;
&lt;br /&gt;
 typedef struct tgaFileImageSpecification {&lt;br /&gt;
 	short Xorigin;&lt;br /&gt;
 	short Yorigin;&lt;br /&gt;
 	short Width;&lt;br /&gt;
 	short Height;&lt;br /&gt;
 	unsigned char Depth;&lt;br /&gt;
 	tgaFileDescriptor Descriptor;&lt;br /&gt;
 } tgaFileImageSpecification;&lt;br /&gt;
&lt;br /&gt;
 typedef struct tgaFileHeader {&lt;br /&gt;
 	unsigned char IDLength;                        /*  1 Byte */&lt;br /&gt;
 	unsigned char ColorMapType;                    /*  1 Byte */              &lt;br /&gt;
 	unsigned char ImageType;                       /*  1 Byte */&lt;br /&gt;
 	tgaFileColorMapSpecification ColorMapSpec;     /*  5 Bytes */&lt;br /&gt;
 	tgaFileImageSpecification ImageSpec;           /* 10 Bytes */&lt;br /&gt;
 } tgaFileHeader;                                   /* 18 Bytes */ &lt;br /&gt;
&lt;br /&gt;
 typedef unsigned char tgaFileImageID;&lt;br /&gt;
 typedef unsigned char tgaFileColorMapData;&lt;br /&gt;
 typedef unsigned char tgaFileImageData;&lt;br /&gt;
 typedef unsigned char tgaFileDeveloperData;&lt;br /&gt;
&lt;br /&gt;
 typedef struct tgaFile {&lt;br /&gt;
 	tgaFileHeader        Header;                   /* Field 1-5 : fixed: 18 Bytes */&lt;br /&gt;
 	tgaFileImageID*      ImageID;                  /* Field 6: variable */&lt;br /&gt;
 	tgaFileColorMapData* ColorMapData;             /* Field 7: variable */&lt;br /&gt;
 	tgaFileImageData*    Image;                /* Field 8: variable */&lt;br /&gt;
 	tgaFileDeveloperData* DeveloperData;           /* Field 9: variable */ &lt;br /&gt;
 &lt;br /&gt;
 	/* Additional Information */&lt;br /&gt;
 	int flagHeader; &lt;br /&gt;
 	int ImageDataOffset;&lt;br /&gt;
 	int ImageDataBytes;&lt;br /&gt;
 } tgaFile;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
== API ==&lt;br /&gt;
===Initialize===&lt;br /&gt;
If '''tga''' is NULL, allocate the memory. If '''fpt''' is not NULL, Read the header by using '''tgaFileHeaderRead''', and store to '''tga'''.&lt;br /&gt;
 extern tgaFile* tgaFileInit(tgaFile* tga, FILE* fpt, int mode);&lt;br /&gt;
Initialize '''tga-&amp;gt;Image''' allocating the memory. If the header doesn't exist, read header from '''fpt''' by using '''tgaFileHeaderRead'''.&lt;br /&gt;
 extern tgaFile* tgaFileImageInit(tgaFile* tga, FILE* fpt, int mode);&lt;br /&gt;
&lt;br /&gt;
===Read tga file===&lt;br /&gt;
Read the header information from '''fpt''', and store to '''tga-&amp;gt;Header'''. If '''tga''' is NULL, allocate the memory by using '''tgaFileInit'' beforehand.&lt;br /&gt;
 extern tgaFile* tgaFileHeaderRead(tgaFile* tga, FILE* fpt, int mode);&lt;br /&gt;
Read the data from '''fpt''', and store to '''tga-&amp;gt;Image'''. Then store also the header by using '''tgaFileImageInit'''.&lt;br /&gt;
 extern tgaFile* tgaFileImageDataRead(tgaFile* tga, FILE* fpt, int mode);&lt;br /&gt;
Call '''tgaFileImageDataRead'''.&lt;br /&gt;
 extern tgaFile* tgaFileRead(tgaFile* tga, FILE* fpt, int mode);&lt;br /&gt;
&lt;br /&gt;
===tgafileOutput===&lt;br /&gt;
Output header of '''tga''' to file '''out'''. (mode: Output type by tgaFileColorMap)&lt;br /&gt;
 extern void tgaFileHeaderPrint(tgaFile* tga, FILE* out, int mode);&lt;/div&gt;</summary>
		<author><name>Kinoshita</name></author>	</entry>

	</feed>