2013-07-26 22:38:34 +02:00
|
|
|
|
|
|
|
// STL includes
|
|
|
|
#include <iostream>
|
|
|
|
|
2013-08-03 23:24:22 +02:00
|
|
|
// HyperionPNG includes
|
|
|
|
#include <hyperionpng/HyperionPng.h>
|
2013-07-26 22:38:34 +02:00
|
|
|
|
2013-08-03 23:24:22 +02:00
|
|
|
template <typename Hyperion_T>
|
|
|
|
void process(Hyperion_T& hyperion)
|
2013-07-26 22:38:34 +02:00
|
|
|
{
|
2013-08-03 23:24:22 +02:00
|
|
|
hyperion.setInputSize(64, 64);
|
|
|
|
|
|
|
|
// Obtain reference to buffer
|
|
|
|
RgbImage& image = hyperion.image();
|
|
|
|
|
|
|
|
// Write some data to the image
|
|
|
|
std::cout << "Write data to buffer-image" << std::endl;
|
|
|
|
for (unsigned y=0; y<image.height(); ++y)
|
2013-07-26 22:38:34 +02:00
|
|
|
{
|
2013-08-03 23:24:22 +02:00
|
|
|
for (unsigned x=0; x<image.width(); ++x)
|
2013-07-26 22:38:34 +02:00
|
|
|
{
|
2013-08-03 23:24:22 +02:00
|
|
|
const RgbColor color = {255, 0, 0};
|
|
|
|
image(x,y) = color;
|
2013-07-26 22:38:34 +02:00
|
|
|
}
|
2013-08-03 23:24:22 +02:00
|
|
|
}
|
2013-07-26 22:38:34 +02:00
|
|
|
|
2013-08-03 23:24:22 +02:00
|
|
|
std::cout << "Commit image to write png" << std::endl;
|
|
|
|
for (unsigned i=0; i<40; ++i)
|
|
|
|
{
|
|
|
|
// Commit the image (writing first png)
|
|
|
|
hyperion.commit();
|
2013-07-26 22:38:34 +02:00
|
|
|
}
|
2013-08-03 23:24:22 +02:00
|
|
|
std::cout << "FINISHED" << std::endl;
|
|
|
|
}
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
// Construct instance of Hyperion-PNG
|
|
|
|
std::cout << "Initialisaing Hyperion PNG" << std::endl;
|
|
|
|
HyperionPng hyperion;
|
2013-07-26 22:38:34 +02:00
|
|
|
|
2013-08-03 23:24:22 +02:00
|
|
|
process(hyperion);
|
2013-07-26 22:38:34 +02:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|