-
Notifications
You must be signed in to change notification settings - Fork 1
/
BitmapBatchExtractor.h
34 lines (30 loc) · 1.04 KB
/
BitmapBatchExtractor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#pragma once
#include <stdint.h>
#include <string>
#include <vector>
#include "module/ModuleManager.h"
#include "logger/logger.h"
#include "BitmapHandle.h"
class BitmapBatchExtractor{
public:
void extract(std::string path, std::vector<uint32_t> bitmaps, int mipmap = 0, int threadcount = 0); // 0 means automatic
BitmapBatchExtractor(ModuleManager* modman, Logger* logger);
private:
struct bitmapWorkerControl{
// I don't think anything in here really needs locks or atomicity
// however, coherency between threads is assumed (which should be the case on x86 I think, and other architectures aren't really targeted currently)
uint32_t globalId; // ID to export
std::string path; // path to export to
int mipmap; // mipmap to export (if only lower ones exist, take the lowest one)
enum workerStatus{
WORKER_IDLE,
WORKER_NEW_WORK,
WORKER_WORKING
} status;
bool kill;
bool isRunning;
};
static void bitmapWorkerLoop(ModuleManager* modman, bitmapWorkerControl* control, Logger* logger);
ModuleManager* modman;
Logger* logger;
};