Revert "revert #1148 as prematurely incorporated"

This reverts commit f946088214.
This commit is contained in:
marauder2k7 2024-01-20 18:01:57 +00:00
parent bd2121b674
commit 7216ba8530
22 changed files with 20385 additions and 1813 deletions

View file

@ -71,10 +71,10 @@ public:
struct Registration
{
/// The read function prototype.
typedef bool(*ReadFunc)(Stream &stream, GBitmap *bitmap);
typedef bool(*ReadFunc)(const Torque::Path& path, GBitmap* bitmap);
/// The write function prototype. Compression levels are image-specific - see their registration declaration for details.
typedef bool(*WriteFunc)(GBitmap *bitmap, Stream &stream, U32 compressionLevel);
typedef bool(*WriteFunc)(const Torque::Path& path, GBitmap* bitmap, U32 compressionLevel);
/// Used to sort the registrations so that
/// lookups occur in a fixed order.
@ -241,13 +241,16 @@ 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, Stream &ioStream );
bool readBitmap(const String& bmType, const Torque::Path& path);
/// 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. 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 );
/// @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 );
bool readMNG(Stream& io_rStream); // located in bitmapMng.cc
bool writeMNG(Stream& io_rStream) const;