diff options
Diffstat (limited to 'Runtime/FileSystem/ImageJobs.h')
-rw-r--r-- | Runtime/FileSystem/ImageJobs.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/Runtime/FileSystem/ImageJobs.h b/Runtime/FileSystem/ImageJobs.h new file mode 100644 index 0000000..77e48e0 --- /dev/null +++ b/Runtime/FileSystem/ImageJobs.h @@ -0,0 +1,46 @@ +#pragma once +#include <vector> +#include "Runtime/Threading/Job.h" +#include "Runtime/Lua/LuaHelper.h" +#include "Runtime/Threading/JobSystem.h" + +struct ImageDataBridge +{ + void* pixels; + int width; + int height; + int channels; +}; + +// in: string +// out: ImageData +class ReadImageFileJob : public Job +{ +public: + ReadImageFileJob(LuaBind::VM* vm, int indexOfCallback, const char* path); + ~ReadImageFileJob(); + + void Dispacth(void* param) override; + void Process() override; + bool IsFinished() override; + +private: + std::string path; + bool isFinished; + ImageDataBridge bridge; + LuaBind::StrongRef callback; // 完成后的回调函数 +}; + +// in: string[] +// out: ImageData[] +class ReadImageFilesJob : public Job +{ + +}; + +// in: DataBuffer[] +// out: ImageData[] +class DecodeImageFilesJob : public Job +{ + +};
\ No newline at end of file |