revert #1148 as prematurely incorporated

it's getting there, but there have been a few spots noted where it eroneously corrupts text, so we'll have to pull this back out for a bit barring a proper resolution
This commit is contained in:
AzaezelX 2024-01-11 13:33:03 -06:00
parent 78b56688d3
commit f946088214
22 changed files with 1813 additions and 20385 deletions

View file

@ -71,10 +71,10 @@ public:
struct Registration
{
/// The read function prototype.
typedef bool(*ReadFunc)(const Torque::Path& path, GBitmap* bitmap);
typedef bool(*ReadFunc)(Stream &stream, GBitmap *bitmap);
/// The write function prototype. Compression levels are image-specific - see their registration declaration for details.
typedef bool(*WriteFunc)(const Torque::Path& path, GBitmap* bitmap, U32 compressionLevel);
typedef bool(*WriteFunc)(GBitmap *bitmap, Stream &stream, U32 compressionLevel);
/// Used to sort the registrations so that
/// lookups occur in a fixed order.
@ -241,16 +241,13 @@ public:
/// Read a bitmap from a stream
/// @param bmType This is a file extension to describe the type of the data [i.e. "png" for PNG file, etc]
/// @param ioStream The stream to read from
bool readBitmap(const String& bmType, const Torque::Path& path);
bool readBitmap( const String &bmType, Stream &ioStream );
/// Write a bitmap to a stream
/// @param bmType This is a file extension to describe the type of the data [i.e. "png" for PNG file, etc]
/// @param ioStream The stream to read from
/// @param compressionLevel Image format specific compression level. For JPEG sets the quality level percentage, range 0 to 100.
/// For PNG compression level is 0 - 10
/// Not used for other image formats.
bool writeBitmap( const String &bmType, const Torque::Path& path, U32 compressionLevel = U32_MAX );
/// @param compressionLevel Image format-specific compression level. If set to U32_MAX, we use the default compression defined when the format was registered.
bool writeBitmap( const String &bmType, Stream &ioStream, U32 compressionLevel = U32_MAX );
bool readMNG(Stream& io_rStream); // located in bitmapMng.cc
bool writeMNG(Stream& io_rStream) const;