Moved MNIST sample to QImage conversion to MNIST loader

main
mandlm 2015-11-01 15:00:32 +01:00
parent eecd7a0fe6
commit 1d343a079a
1 changed files with 7 additions and 0 deletions

View File

@ -6,6 +6,8 @@
#include <memory>
#include <inttypes.h>
#include <QImage>
class MnistLoader
{
private:
@ -21,6 +23,11 @@ public:
public:
uint8_t label;
uint8_t data[SAMPLE_WIDTH * SAMPLE_HEIGHT];
QImage toQImage() const
{
return QImage(data, SAMPLE_WIDTH, SAMPLE_HEIGHT, QImage::Format_Grayscale8);
}
};
using MnistSample = Sample<SampleWidth, SampleHeight>;