Read file with EGAMI

Include EGAMI

#include <egami/egami.hpp>

Declare image interface

// create an empty Image (no type and no inside data)
egami::Image image;

Read a Bitmap or an PNG

Read a bitmap

image = egami::load("DATA:read.bmp");

Read a PNG

egami::Image image = egami::load("DATA:read.png");

Read a SVG

Read a svg

egami::Image image = egami::load("DATA:read.svg");

Read a svg and natively rescale it:

image = egami::load("DATA:read.svg", ivec2(800,600));

All example file

#include <test-debug/debug.hpp>
#include <egami/egami.hpp>
#include "read.hpp"
static void readBMP() {
// create an empty Image (no type and no inside data)
egami::Image image;
image = egami::load("DATA:read.bmp");
TEST_INFO("image exist (BMP): " << image.exist());
}
static void readSVG() {
egami::Image image = egami::load("DATA:read.svg");
TEST_INFO("image exist (SVG): " << image.exist());
image = egami::load("DATA:read.svg", ivec2(800,600));
TEST_INFO("image exist (SVG-rescale): " << image.exist());
// TODO : image = egami::load("DATA:read.svg", 0.5);
TEST_INFO("image exist (SVG-scale): " << image.exist());
}
static void readPNG() {
egami::Image image = egami::load("DATA:read.png");
TEST_INFO("image exist (PNG): " << image.exist());
}
void appl::read() {
readBMP();
readSVG();
readPNG();
}