GIFToWoWTexture/GIFConverter/TGASharpLib.cs
/// <summary>
/// Get information from TGA image.
/// </summary>
/// <returns>MultiLine string with info fields (one per line).</returns>
Get information from TGA image.
Get information from TGA image .
public string GetInfo()
        {
            StringBuilder SB = new StringBuilder();
            SB.AppendLine("Header:");
            SB.AppendLine("\tID Length = " + Header.IDLength);
            SB.AppendLine("\tImage Type = " + Header.ImageType);
            SB.AppendLine("\tHeader -> ImageSpec:");
            SB.AppendLine("\t\tImage Width = " + Header.ImageSpec.ImageWidth);
            SB.AppendLine("\t\tImage Height = " + Header.ImageSpec.ImageHeight);
            SB.AppendLine("\t\tPixel Depth = " + Header.ImageSpec.PixelDepth);
            SB.AppendLine("\t\tImage Descriptor (AsByte) = " + Header.ImageSpec.ImageDescriptor.ToByte());
            SB.AppendLine("\t\tImage Descriptor -> AttributeBits = " + Header.ImageSpec.ImageDescriptor.AlphaChannelBits);
            SB.AppendLine("\t\tImage Descriptor -> ImageOrigin = " + Header.ImageSpec.ImageDescriptor.ImageOrigin);
            SB.AppendLine("\t\tX_Origin = " + Header.ImageSpec.X_Origin);
            SB.AppendLine("\t\tY_Origin = " + Header.ImageSpec.Y_Origin);
            SB.AppendLine("\tColorMap Type = " + Header.ColorMapType);
            SB.AppendLine("\tHeader -> ColorMapSpec:");
            SB.AppendLine("\t\tColorMap Entry Size = " + Header.ColorMapSpec.ColorMapEntrySize);
            SB.AppendLine("\t\tColorMap Length = " + Header.ColorMapSpec.ColorMapLength);
            SB.AppendLine("\t\tFirstEntry Index = " + Header.ColorMapSpec.FirstEntryIndex);
            SB.AppendLine("\nImage / Color Map Area:");
            if (Header.IDLength > 0 && ImageOrColorMapArea.ImageID != null)
                SB.AppendLine("\tImage ID = \"" + ImageOrColorMapArea.ImageID.GetString() + "\"");
            else
                SB.AppendLine("\tImage ID = null");
            if (ImageOrColorMapArea.ImageData != null)
                SB.AppendLine("\tImage Data Length = " + ImageOrColorMapArea.ImageData.Length);
            else
                SB.AppendLine("\tImage Data = null");
            if (ImageOrColorMapArea.ColorMapData != null)
                SB.AppendLine("\tColorMap Data Length = " + ImageOrColorMapArea.ColorMapData.Length);
            else
                SB.AppendLine("\tColorMap Data = null");
            SB.AppendLine("\nDevelopers Area:");
            if (DevArea != null)
                SB.AppendLine("\tCount = " + DevArea.Count);
            else
                SB.AppendLine("\tDevArea = null");
            SB.AppendLine("\nExtension Area:");
            if (ExtArea != null)
            {
                SB.AppendLine("\tExtension Size = " + ExtArea.ExtensionSize);
                SB.AppendLine("\tAuthor Name = \"" + ExtArea.AuthorName.GetString() + "\"");
                SB.AppendLine("\tAuthor Comments = \"" + ExtArea.AuthorComments.GetString() + "\"");
                SB.AppendLine("\tDate / Time Stamp = " + ExtArea.DateTimeStamp);
                SB.AppendLine("\tJob Name / ID = \"" + ExtArea.JobNameOrID.GetString() + "\"");
                SB.AppendLine("\tJob Time = " + ExtArea.JobTime);
                SB.AppendLine("\tSoftware ID = \"" + ExtArea.SoftwareID.GetString() + "\"");
                SB.AppendLine("\tSoftware Version = \"" + ExtArea.SoftVersion + "\"");
                SB.AppendLine("\tKey Color = " + ExtArea.KeyColor);
                SB.AppendLine("\tPixel Aspect Ratio = " + ExtArea.PixelAspectRatio);
                SB.AppendLine("\tGamma Value = " + ExtArea.GammaValue);
                SB.AppendLine("\tColor Correction Table Offset = " + ExtArea.ColorCorrectionTableOffset);
                SB.AppendLine("\tPostage Stamp Offset = " + ExtArea.PostageStampOffset);
                SB.AppendLine("\tScan Line Offset = " + ExtArea.ScanLineOffset);
                SB.AppendLine("\tAttributes Type = " + ExtArea.AttributesType);
                if (ExtArea.ScanLineTable != null)
                    SB.AppendLine("\tScan Line Table = " + ExtArea.ScanLineTable.Length);
                else
                    SB.AppendLine("\tScan Line Table = null");
                if (ExtArea.PostageStampImage != null)
                    SB.AppendLine("\tPostage Stamp Image: " + ExtArea.PostageStampImage.ToString());
                else
                    SB.AppendLine("\tPostage Stamp Image = null");
                SB.AppendLine("\tColor Correction Table = " + (ExtArea.ColorCorrectionTable != null));
            }
            else
                SB.AppendLine("\tExtArea = null");
            SB.AppendLine("\nFooter:");
            if (Footer != null)
            {
                SB.AppendLine("\tExtension Area Offset = " + Footer.ExtensionAreaOffset);
                SB.AppendLine("\tDeveloper Directory Offset = " + Footer.DeveloperDirectoryOffset);
                SB.AppendLine("\tSignature (Full) = \"" + Footer.Signature.ToString() +
                    Footer.ReservedCharacter.ToString() + Footer.BinaryZeroStringTerminator.ToString() + "\"");
            }
            else
                SB.AppendLine("\tFooter = null");
            return SB.ToString();
        }
public string GetInfo ( ) { StringBuilder SB = new StringBuilder ( ) ; SB . AppendLine ( " " ) ; SB . AppendLine ( " \t " + Header . IDLength ) ; SB . AppendLine ( " \t " + Header . ImageType ) ; SB . AppendLine ( " \t " ) ; SB . AppendLine ( " \t \t " + Header . ImageSpec . ImageWidth ) ; SB . AppendLine ( " \t \t " + Header . ImageSpec . ImageHeight ) ; SB . AppendLine ( " \t \t " + Header . ImageSpec . PixelDepth ) ; SB . AppendLine ( " \t \t " + Header . ImageSpec . ImageDescriptor . ToByte ( ) ) ; SB . AppendLine ( " \t \t " + Header . ImageSpec . ImageDescriptor . AlphaChannelBits ) ; SB . AppendLine ( " \t \t " + Header . ImageSpec . ImageDescriptor . ImageOrigin ) ; SB . AppendLine ( " \t \t " + Header . ImageSpec . X_Origin ) ; SB . AppendLine ( " \t \t " + Header . ImageSpec . Y_Origin ) ; SB . AppendLine ( " \t " + Header . ColorMapType ) ; SB . AppendLine ( " \t " ) ; SB . AppendLine ( " \t \t " + Header . ColorMapSpec . ColorMapEntrySize ) ; SB . AppendLine ( " \t \t " + Header . ColorMapSpec . ColorMapLength ) ; SB . AppendLine ( " \t \t " + Header . ColorMapSpec . FirstEntryIndex ) ; SB . AppendLine ( " \n " ) ; if ( Header . IDLength > 0 && ImageOrColorMapArea . ImageID != null ) SB . AppendLine ( " \t \" " + ImageOrColorMapArea . ImageID . GetString ( ) + " \" " ) ; else SB . AppendLine ( " \t " ) ; if ( ImageOrColorMapArea . ImageData != null ) SB . AppendLine ( " \t " + ImageOrColorMapArea . ImageData . Length ) ; else SB . AppendLine ( " \t " ) ; if ( ImageOrColorMapArea . ColorMapData != null ) SB . AppendLine ( " \t " + ImageOrColorMapArea . ColorMapData . Length ) ; else SB . AppendLine ( " \t " ) ; SB . AppendLine ( " \n " ) ; if ( DevArea != null ) SB . AppendLine ( " \t " + DevArea . Count ) ; else SB . AppendLine ( " \t " ) ; SB . AppendLine ( " \n " ) ; if ( ExtArea != null ) { SB . AppendLine ( " \t " + ExtArea . ExtensionSize ) ; SB . AppendLine ( " \t \" " + ExtArea . AuthorName . GetString ( ) + " \" " ) ; SB . AppendLine ( " \t \" " + ExtArea . AuthorComments . GetString ( ) + " \" " ) ; SB . AppendLine ( " \t " + ExtArea . DateTimeStamp ) ; SB . AppendLine ( " \t \" " + ExtArea . JobNameOrID . GetString ( ) + " \" " ) ; SB . AppendLine ( " \t " + ExtArea . JobTime ) ; SB . AppendLine ( " \t \" " + ExtArea . SoftwareID . GetString ( ) + " \" " ) ; SB . AppendLine ( " \t \" " + ExtArea . SoftVersion + " \" " ) ; SB . AppendLine ( " \t " + ExtArea . KeyColor ) ; SB . AppendLine ( " \t " + ExtArea . PixelAspectRatio ) ; SB . AppendLine ( " \t " + ExtArea . GammaValue ) ; SB . AppendLine ( " \t " + ExtArea . ColorCorrectionTableOffset ) ; SB . AppendLine ( " \t " + ExtArea . PostageStampOffset ) ; SB . AppendLine ( " \t " + ExtArea . ScanLineOffset ) ; SB . AppendLine ( " \t " + ExtArea . AttributesType ) ; if ( ExtArea . ScanLineTable != null ) SB . AppendLine ( " \t " + ExtArea . ScanLineTable . Length ) ; else SB . AppendLine ( " \t " ) ; if ( ExtArea . PostageStampImage != null ) SB . AppendLine ( " \t " + ExtArea . PostageStampImage . ToString ( ) ) ; else SB . AppendLine ( " \t " ) ; SB . AppendLine ( " \t " + ( ExtArea . ColorCorrectionTable != null ) ) ; } else SB . AppendLine ( " \t " ) ; SB . AppendLine ( " \n " ) ; if ( Footer != null ) { SB . AppendLine ( " \t " + Footer . ExtensionAreaOffset ) ; SB . AppendLine ( " \t " + Footer . DeveloperDirectoryOffset ) ; SB . AppendLine ( " \t \" " + Footer . Signature . ToString ( ) + Footer . ReservedCharacter . ToString ( ) + Footer . BinaryZeroStringTerminator . ToString ( ) + " \" " ) ; } else SB . AppendLine ( " \t " ) ; return SB . ToString ( ) ; }
Get information from TGA image.
Get information from TGA image .
MultiLine string with info fields (one per line).
MultiLine string with info fields ( one per line ) .