pandemonium_engine/modules/wfc/image_indexer.h

32 lines
558 B
C++
Raw Normal View History

2022-04-22 22:54:42 +02:00
#ifndef IMAGE_INDEXER_H
#define IMAGE_INDEXER_H
#include "core/image.h"
#include "core/reference.h"
#include "core/variant.h"
#include "core/oa_hash_map.h"
2022-04-22 22:54:42 +02:00
class ImageIndexer : public Reference {
GDCLASS(ImageIndexer, Reference);
public:
PoolColorArray get_colors();
PoolIntArray index_image(Ref<Image> image);
void reset();
2022-04-22 22:54:42 +02:00
PoolByteArray indices_to_argb8_data(const PoolIntArray &indices);
ImageIndexer();
~ImageIndexer();
protected:
static void _bind_methods();
private:
PoolColorArray _colors;
OAHashMap<Color, int> _col_map;
2022-04-22 22:54:42 +02:00
};
#endif