Class image

Class Documentation

class legion::core::image

Object encapsulating the binary representation of an image.

Public Functions

template<typename T>
T *get_raw_data()

Get the binary representation of the image with different pointer types. Each pointer type is only enabled if the channel format is the same. The void* type is always enabled.

void apply_raw(bool lazyApply = true)

Apply changes made to the binary data gotten with get_raw_data() to the colors read with read_colors().

Parameters
  • lazyApply: Apply immediately if false, otherwise the changes will only actually be applied when read_colors() is called.

const std::vector<math::color> &read_colors()

Convert the binary image representation to a more usable representation if it hasn’t been converted before and return the new representation.

Return

const std::vector<math::color>& List with all the colors in the image.

size_type data_size()

Get the data size of the binary data.

inline bool operator==(const image &other)
image() = default
inline image(const image &other)
inline image(image &&other)
inline image &operator=(const image &other)
inline image &operator=(image &&other)
inline ~image()
template<>
inline void *get_raw_data()
template<>
inline byte *get_raw_data()
template<>
inline uint16 *get_raw_data()
template<>
inline float *get_raw_data()

Public Members

std::string name
math::ivec2 size
channel_format format
image_components components
size_type dataSize
byte *data

Friends

friend class ImageCache