Empirical
Public Member Functions | Public Attributes | List of all members
emp::internal::ImageInfo Struct Reference

Detailed information about an image. More...

#include <RawImage.h>

Public Member Functions

 ImageInfo (const std::string &_url)
 
void MarkLoaded ()
 Trigger this image as loaded. More...
 
void MarkError ()
 Trigger this image as having an error. More...
 
void OnLoad (const std::function< void()> &callback_fun)
 Add a new function to be called when the image finishes loading. More...
 
void OnError (const std::function< void()> &callback_fun)
 Add a new function to be called if an image load has an error. More...
 

Public Attributes

int img_id
 Unique ID for this image. More...
 
std::string url
 Full URL of file containing image. More...
 
bool has_loaded
 Is this image finished loading? More...
 
bool has_error
 Were there any errors in loading image? More...
 
Signal< void()> on_load
 Actions for when image is finished loading. More...
 
Signal< void()> on_error
 Actions for when image has trouble loading. More...
 

Detailed Description

Detailed information about an image.

Constructor & Destructor Documentation

emp::internal::ImageInfo::ImageInfo ( const std::string &  _url)
inline

Member Function Documentation

void emp::internal::ImageInfo::MarkError ( )
inline

Trigger this image as having an error.

void emp::internal::ImageInfo::MarkLoaded ( )
inline

Trigger this image as loaded.

void emp::internal::ImageInfo::OnError ( const std::function< void()> &  callback_fun)
inline

Add a new function to be called if an image load has an error.

void emp::internal::ImageInfo::OnLoad ( const std::function< void()> &  callback_fun)
inline

Add a new function to be called when the image finishes loading.

Member Data Documentation

bool emp::internal::ImageInfo::has_error
mutable

Were there any errors in loading image?

bool emp::internal::ImageInfo::has_loaded
mutable

Is this image finished loading?

int emp::internal::ImageInfo::img_id

Unique ID for this image.

Signal<void()> emp::internal::ImageInfo::on_error

Actions for when image has trouble loading.

Signal<void()> emp::internal::ImageInfo::on_load

Actions for when image is finished loading.

std::string emp::internal::ImageInfo::url

Full URL of file containing image.


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