add func to path manager. fix bitmap handler. add general bitmap handler getter

This commit is contained in:
2023-09-07 21:57:48 +08:00
parent f7f1478ecf
commit 54a3dd7776
11 changed files with 264 additions and 66 deletions

View File

@ -15,6 +15,22 @@ namespace LibCmo::CK2::DataHandlers {
virtual ~CKBitmapHandler() {}
LIBCMO_DISABLE_COPY_MOVE(CKBitmapHandler);
/**
* @brief General CKBitmapHandler getter.
* @param ext[in] The file extention help finding corresponding bitmap handler.
* @param guid[in] The GUID of bitmap handler used in fall back finding.
* @remark
* + Returns a reader capable of reading file with the given extension ext
* + It may be several plugins that support the same extension, in which case a preferedGUID identifying the reader that should be returned can be given (optionnal).
* @return The pointer to CKBitmapHandler. nullptr if fail to find.
*/
static CKBitmapHandler* GetBitmapHandler(const CKFileExtension& ext, const CKGUID& guid);
/**
* @brief General CKBitmapHandler disposer
* @param handler[in] The handler need to be free.
*/
static void ReleaseBitmapHandler(CKBitmapHandler* handler);
/**
* @brief Returns the current default bitmap options.
* @return Current default bitmap options
@ -75,8 +91,6 @@ namespace LibCmo::CK2::DataHandlers {
virtual bool SaveFile(CKSTRING u8filename, const VxMath::VxImageDescEx* write_image, const CKBitmapProperties& codec_param) override;
virtual CKDWORD SaveMemory(void* memory, const VxMath::VxImageDescEx* write_image, const CKBitmapProperties& codec_param) override;
protected:
CKBitmapProperties c_DefaultProp;
};
class CKBitmapTGAHandler : public CKBitmapHandler {
@ -91,8 +105,6 @@ namespace LibCmo::CK2::DataHandlers {
virtual bool SaveFile(CKSTRING u8filename, const VxMath::VxImageDescEx* write_image, const CKBitmapProperties& codec_param) override;
virtual CKDWORD SaveMemory(void* memory, const VxMath::VxImageDescEx* write_image, const CKBitmapProperties& codec_param) override;
protected:
CKBitmapProperties c_DefaultProp;
};
}