#include <textga/textga.h>
void main()
{// Load TGAFile
::textga::TGAFileLoader loader( "tgaFilePath.tga" );
if ( !loader.isLoaded() )
{// Load Failed
return;
}
// Standard TGA Check
const ::textga::TGADataAccessor tgaDataAccessor = loader.tgaDataAccessor();
if ( !tgaDataAccessor.isSupportedTGA() )
{// Not supported tga file
return;
}
// Standard TGA Data Access
// tgaDataAccessor.width(); // get width
// tgaDataAccessor.height(); // get height
// tgaDataAccessor.pixelAtIndex(0); // get first pixel data
// and more. see TGADataAccessor.hpp
// TexTarga Check
if ( !tgaDataAccessor.isTexTarga() )
{// Not tex targa
return;
}
// TexTarga Data Access
// tgaDataAccessor.pixelFormat() // get PixelFormat(see PixelFormat.hpp)
// tgaDataAccessor.srcDataPixelAtIndex(0) // get before convert pixel data
// and more. see TGADataAccessor.hpp
}