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

Method dumpImage

Engine/source/gfx/bitmap/ddsFile.cpp:562–581  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

560}
561
562void DDSFile::SurfaceData::dumpImage(DDSFile *dds, U32 mip, const char *file)
563{
564 GBitmap *foo = new GBitmap(dds->mWidth >> mip, dds->mHeight >> mip, false, dds->mFormat);
565
566 // Copy our data in.
567 dMemcpy(foo->getWritableBits(), mMips[mip], dds->getSurfaceSize(dds->mHeight, dds->mWidth, mip) );
568
569 FileStream stream;
570
571 stream.open( file, Torque::FS::File::Write );
572
573 if ( stream.getStatus() == Stream::Ok )
574 {
575 // Write it out.
576 foo->writeBitmap("png", stream);
577 }
578
579 // Clean up.
580 delete foo;
581}
582
583void DDSFile::SurfaceData::readNextMip(DDSFile *dds, Stream &s, U32 height, U32 width, U32 mipLevel, bool skip)
584{

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected