예제 #1
0
            // C O N S T R U C T O R ////////////////////////////////////////////////////////////////////////////////////////////
            /// <summary>
            /// Constructor. Parses the imagedata of a TGAData class
            /// </summary>
            /// <param name="tgadata">The TGAData to parse</param>
            /// <param name="imagetype">ImageTypes enum of the sort of image we're deconstructing</param>
            /// <param name="offset">The index of the first entry in the image table</param>
            public ImageReader(TGAData tgadata, int offset)
            {
                _tgadata = tgadata;

                r = 0;

                switch (_tgadata.imagetype)
                {
                    case ImageTypes.UncompressedBlackAndWhite:
                    case ImageTypes.UncompressedTrueColor:
                        ParseUncompressed(ReadFromRaw, offset);
                        break;
                    case ImageTypes.UncompressedColorMap:
                        ParseUncompressed(ReadFromTable, offset);
                        break;

                    case ImageTypes.RLETrueColor:
                        ParseRLE(ReadFromRaw, offset);
                        break;
                    case ImageTypes.RLEColorMap:
                        ParseRLE(ReadFromTable, offset);
                        break;
                } // end switch
            }
예제 #2
0
 // M E T H O D S ////////////////////////////////////////////////////////////////////////////////////////////////////////
 /// <summary>
 /// Initializer for TGAData
 /// </summary>
 private void InitializeTGAImage()
 {
     _tgaData = new TGAData();
 }