-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathroboimage.h
More file actions
66 lines (60 loc) · 1.42 KB
/
roboimage.h
File metadata and controls
66 lines (60 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#ifndef ROBOIMAGE_H
#define ROBOIMAGE_H
#include <QGraphicsItem>
#include <QString>
#include <QImage>
#include <QColor>
#include <QDataStream>
#include <QTextStream>
#include <QFile>
#include <QPainter>
#include "colorspace.h"
#include "colorzone.h"
class RoboImage
{
public:
enum DisplayModes
{
Color,
Y,
U,
V,
Red,
Green,
Blue,
Hue,
Saturation,
Value
} display;
public:
RoboImage(int wd, int ht);
QRectF boundingRect() const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
void read(QString filename);
int getWidth() {return width;}
int getHeight(){return height;}
int** getYImage() { return yImg;}
int** getUImage() { return uImg;}
int** getVImage() { return vImg;}
int getY(int x, int y) { return yImg[x][y];}
int getU(int x, int y) { return uImg[x][y];}
int getV(int x, int y) { return vImg[x][y];}
int getRed(int x, int y);
int getGreen(int x, int y);
int getBlue(int x, int y);
int getH(int x, int y);
int getS(int x, int y);
int getZ(int x, int y);
int** monoChrome() { return yImg;}
QImage fast();
QImage bmp();
void yuv(int i, int j, int y, int u, int v);
void rgb(int i, int j, int r, int g, int b);
private:
int width;
int height;
int** yImg;
int** uImg;
int** vImg;
};
#endif // ROBOIMAGE_H