MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / dumpImage

Method dumpImage

Engine/source/gfx/bitmap/ddsLoader.cpp:749–768  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

747}
748
749void DDSFile::SurfaceData::dumpImage(DDSFile *dds, U32 mip, const char *file)
750{
751 GBitmap *foo = new GBitmap(dds->mWidth >> mip, dds->mHeight >> mip, false, dds->mFormat);
752
753 // Copy our data in.
754 dMemcpy(foo->getWritableBits(), mMips[mip], dds->getSurfaceSize(dds->mHeight, dds->mWidth, mip) );
755
756 FileStream stream;
757
758 stream.open( file, Torque::FS::File::Write );
759
760 if ( stream.getStatus() == Stream::Ok )
761 {
762 // Write it out.
763 foo->writeBitmap("png", stream);
764 }
765
766 // Clean up.
767 delete foo;
768}
769
770void DDSFile::SurfaceData::readNextMip(DDSFile *dds, Stream &s, U32 height, U32 width, U32 mipLevel, bool skip)
771{

Callers

nothing calls this directly

Calls 6

getWritableBitsMethod · 0.80
writeBitmapMethod · 0.80
dMemcpyFunction · 0.50
getSurfaceSizeMethod · 0.45
openMethod · 0.45
getStatusMethod · 0.45

Tested by

no test coverage detected