-
Notifications
You must be signed in to change notification settings - Fork 65
Expand file tree
/
Copy pathImageBitmap.h
More file actions
36 lines (23 loc) · 817 Bytes
/
Copy pathImageBitmap.h
File metadata and controls
36 lines (23 loc) · 817 Bytes
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
35
36
#pragma once
#include <memory>
#include "webgpu/webgpu_cpp.h"
#include "PlatformContext.h"
#include "RNFHybridObject.h"
namespace rnwgpu {
class ImageBitmap : public margelo::HybridObject {
public:
explicit ImageBitmap(ImageData &imageData)
: HybridObject("ImageBitmap"), _imageData(imageData) {}
size_t getWidth() { return _imageData.width; }
size_t getHeight() { return _imageData.height; }
void *getData() { return _imageData.data.data(); }
size_t getSize() { return _imageData.data.size(); }
void loadHybridMethods() override {
registerHybridGetter("width", &ImageBitmap::getWidth, this);
registerHybridGetter("height", &ImageBitmap::getHeight, this);
}
size_t getMemoryPressure() override { return getSize(); }
private:
ImageData _imageData;
};
} // namespace rnwgpu