Euphoria
eu::core::Image Struct Reference

#include <image.h>

Public Member Functions

void make_invalid ()
 
void setup (int image_width, int image_height, bool alpha, int default_value)
 
void setup_with_alpha_support (int image_width, int image_height, int default_value=0)
 if default value is negative, default value is ignored, otherwise its the default value for both R, G, B, and A. More...
 
void setup_no_alpha_support (int image_width, int image_height, int default_value=0)
 
void set_pixel (int x, int y, const Rgbai &color)
 
void set_pixel (int x, int y, unsigned char r, unsigned char g, unsigned char b, unsigned char a)
 
template<typename TFunc >
void run_image_filter (TFunc f)
 
template<typename TFunc >
void run_for_all_top_bottom (TFunc f)
 
template<typename TFunc >
void set_all_top_bottom (TFunc f)
 
template<typename TFunc >
void set_all_bottom_top (TFunc f)
 
Rgbai get_pixel (int x, int y) const
 
std::shared_ptr< MemoryChunkwrite (ImageWriteFormat format, int jpeg_quality=100) const
 
int get_pixel_index (int x, int y) const
 
bool is_valid () const
 
Recti get_indices () const
 
const unsigned char * get_pixel_data () const
 
int get_pixel_byte_size () const
 

Public Attributes

std::vector< unsigned char > components
 
int width = 0
 
int height = 0
 
bool has_alpha = false
 

Detailed Description

Definition at line 28 of file image.h.

Member Function Documentation

◆ get_indices()

Recti eu::core::Image::get_indices ( ) const

Definition at line 168 of file image.cc.

◆ get_pixel()

Rgbai eu::core::Image::get_pixel ( int  x,
int  y 
) const

Definition at line 137 of file image.cc.

◆ get_pixel_byte_size()

int eu::core::Image::get_pixel_byte_size ( ) const

Definition at line 32 of file image.cc.

◆ get_pixel_data()

const unsigned char * eu::core::Image::get_pixel_data ( ) const

Definition at line 178 of file image.cc.

◆ get_pixel_index()

int eu::core::Image::get_pixel_index ( int  x,
int  y 
) const

Definition at line 94 of file image.cc.

◆ is_valid()

bool eu::core::Image::is_valid ( ) const

Definition at line 161 of file image.cc.

◆ make_invalid()

void eu::core::Image::make_invalid ( )

Definition at line 20 of file image.cc.

◆ run_for_all_top_bottom()

template<typename TFunc >
void eu::core::Image::run_for_all_top_bottom ( TFunc  f)
inline

Definition at line 83 of file image.h.

◆ run_image_filter()

template<typename TFunc >
void eu::core::Image::run_image_filter ( TFunc  f)
inline

Definition at line 71 of file image.h.

◆ set_all_bottom_top()

template<typename TFunc >
void eu::core::Image::set_all_bottom_top ( TFunc  f)
inline

Definition at line 107 of file image.h.

◆ set_all_top_bottom()

template<typename TFunc >
void eu::core::Image::set_all_top_bottom ( TFunc  f)
inline

Definition at line 95 of file image.h.

◆ set_pixel() [1/2]

void eu::core::Image::set_pixel ( int  x,
int  y,
const Rgbai color 
)

Definition at line 104 of file image.cc.

◆ set_pixel() [2/2]

void eu::core::Image::set_pixel ( int  x,
int  y,
unsigned char  r,
unsigned char  g,
unsigned char  b,
unsigned char  a 
)

Definition at line 111 of file image.cc.

◆ setup()

void eu::core::Image::setup ( int  image_width,
int  image_height,
bool  alpha,
int  default_value 
)

Definition at line 62 of file image.cc.

◆ setup_no_alpha_support()

void eu::core::Image::setup_no_alpha_support ( int  image_width,
int  image_height,
int  default_value = 0 
)

Definition at line 51 of file image.cc.

◆ setup_with_alpha_support()

void eu::core::Image::setup_with_alpha_support ( int  image_width,
int  image_height,
int  default_value = 0 
)

if default value is negative, default value is ignored, otherwise its the default value for both R, G, B, and A.

Definition at line 39 of file image.cc.

◆ write()

std::shared_ptr< MemoryChunk > eu::core::Image::write ( ImageWriteFormat  format,
int  jpeg_quality = 100 
) const

Definition at line 233 of file image.cc.

Member Data Documentation

◆ components

std::vector<unsigned char> eu::core::Image::components

Definition at line 31 of file image.h.

◆ has_alpha

bool eu::core::Image::has_alpha = false

Definition at line 34 of file image.h.

◆ height

int eu::core::Image::height = 0

Definition at line 33 of file image.h.

◆ width

int eu::core::Image::width = 0

Definition at line 32 of file image.h.


The documentation for this struct was generated from the following files: