1 #ifndef _PixelHistoPicGen_h_
2 #define _PixelHistoPicGen_h_
15 void convertBmp(
const std::string& fileBMP,
const std::string& convertFile);
20 void transferReadImgToImg(
void);
21 void drawDiscToImg(
int disc,
bool isClicked =
false);
22 void drawPanelToImg(
int disc,
int panel,
int x,
int y,
bool isClicked =
false);
23 void drawBladeToImg(
int disc,
32 bool isClicked =
false);
33 void drawFillRectAng(
int x,
int y,
int w,
int h,
int r,
int g,
int b,
float deg);
45 void setImgPixel(
int x,
int y,
int r,
int g,
int b);
46 void fillFPixColors(
void);
47 std::string getFPixStandardName(
48 int disc,
int panel,
int halfDisc,
int blade,
int roc);
50 std::string stdName,
int& disc,
int& panel,
int& halfDisc,
int& blade,
int& roc);
54 void writeBImgToBmp(std::string filename);
55 void transferReadImgToBImg(
void);
56 void fillBPixColors(
void);
57 void drawLayerToBImg(
int layer,
bool isClicked =
false);
58 void drawBPixRoc(
int x,
int y,
int r,
int g,
int b);
59 std::string getBPixStandardName(
int layer,
int pm,
int row,
int col);
60 void getBPixIndices(std::string stdName,
int& layer,
int& pm,
int& row,
int& col);
80 void setAuxPixel(
int x,
int y,
int r,
int g,
int b);
81 void writeAuxToBmp(
char* fn);
85 void PrepareDetectorNavigatorJava(
void);
87 void createClickMask(std::string maskString,
int size);
91 void writeTurtleToBmp(
const char* fn);
92 void generateTurtle(
const std::string& filepath);
93 void resetFPixGood(
int disk);
94 int getFPixGood(
int disk);
95 void resetBPixGood(
int part);
96 int getBPixGood(
int part);
112 bool imageMagickInstallChecked =
false;
113 bool imageMagickInstalled =
false;
120 IMG_WIDTH = 600 * IMG_DIM_MULT,
121 IMG_HEIGHT = 600 * IMG_DIM_MULT,
122 IMG_HEADER_SIZE = 54,
123 IMG_RAW_SIZE = IMG_WIDTH * IMG_HEIGHT * 3,
124 IMG_FILE_SIZE = IMG_RAW_SIZE + IMG_HEADER_SIZE,
126 DET_DISCL_X = 300 * IMG_DIM_MULT,
127 DET_DISCL_Y = 300 * IMG_DIM_MULT,
128 DET_DISCR_X = 900 * IMG_DIM_MULT,
129 DET_DISCR_Y = 300 * IMG_DIM_MULT,
130 DET_DISC_RADIUS = 295 * IMG_DIM_MULT,
131 DET_ROC_SIZE = 9 * IMG_DIM_MULT,
132 DET_ROC_OFFSET = 3 * IMG_DIM_MULT,
133 DET_PLAQ_OFFSET = 4 * IMG_DIM_MULT,
137 BIMG_WIDTH = 300 * BIMG_DIM_MULT,
138 BIMG_HEIGHT = 600 * BIMG_DIM_MULT,
139 BIMG_HEADER_SIZE = 54,
140 BIMG_RAW_SIZE = BIMG_WIDTH * BIMG_HEIGHT * 3,
141 BIMG_FILE_SIZE = BIMG_RAW_SIZE + BIMG_HEADER_SIZE,
145 BPIX_LYRP_XOFF = 307,
157 WEB_LARGE_WIDTH = IMG_WIDTH / IMG_DIM_MULT,
158 WEB_LARGE_HEIGHT = IMG_HEIGHT / IMG_DIM_MULT,
159 WEB_MINI_WIDTH = WEB_LARGE_WIDTH / 4,
160 WEB_MINI_HEIGHT = WEB_LARGE_HEIGHT / 4,
161 WEB_BLARGE_WIDTH = WEB_LARGE_WIDTH,
162 WEB_BLARGE_HEIGHT = WEB_LARGE_HEIGHT,
163 WEB_BMINI_WIDTH = WEB_BLARGE_WIDTH / 6,
164 WEB_BMINI_HEIGHT = WEB_BLARGE_HEIGHT / 3,
167 WEB_DISC_X = DET_DISCL_X / IMG_DIM_MULT,
168 WEB_DISC_Y = DET_DISCL_Y / IMG_DIM_MULT,
169 WEB_DISC_RADIUS = DET_DISC_RADIUS / IMG_DIM_MULT,
170 WEB_ROC_SIZE = DET_ROC_SIZE / IMG_DIM_MULT,
171 WEB_ROC_OFFSET = DET_ROC_OFFSET / IMG_DIM_MULT,
172 WEB_PLAQ_OFFSET = DET_PLAQ_OFFSET / IMG_DIM_MULT,
173 WEB_BLYR_XOFF = BPIX_LYRM_XOFF * WEB_BLARGE_WIDTH / BIMG_WIDTH,
174 WEB_BLYR_YOFF = BPIX_LYRM_YOFF * WEB_BLARGE_HEIGHT / BIMG_HEIGHT,
175 WEB_BROC_WIDTH = BPIX_ROC_WIDTH * WEB_BLARGE_WIDTH / BIMG_WIDTH,
176 WEB_BROC_HEIGHT = BPIX_ROC_HEIGHT * WEB_BLARGE_HEIGHT / BIMG_HEIGHT,
177 WEB_BCOL_OFFSET = BPIX_COL_OFFSET * WEB_BLARGE_WIDTH / BIMG_WIDTH,
178 WEB_BROW_OFFSET = BPIX_ROW_OFFSET * WEB_BLARGE_HEIGHT / BIMG_HEIGHT,
190 COLOR_HIGHLIGHT_R = 255,
191 COLOR_HIGHLIGHT_G = 255,
192 COLOR_HIGHLIGHT_B = 100,
198 AUX_IMG_WIDTH = WEB_ROC_SIZE * 4 + 1,
199 AUX_IMG_HEIGHT = AUX_IMG_WIDTH,
200 AUX_IMG_HEADER_SIZE = 108,
201 AUX_IMG_RAW_SIZE = AUX_IMG_WIDTH * AUX_IMG_HEIGHT * 4,
202 AUX_IMG_FILE_SIZE = AUX_IMG_RAW_SIZE + AUX_IMG_HEADER_SIZE + 14,
206 TUR_IMG_HEIGHT = 256,
207 TUR_IMG_HEADER_SIZE = 108,
208 TUR_IMG_RAW_SIZE = TUR_IMG_WIDTH * TUR_IMG_HEIGHT * 4,
209 TUR_IMG_FILE_SIZE = TUR_IMG_RAW_SIZE + TUR_IMG_HEADER_SIZE + 14,
213 unsigned char& bpix_(
int layer,
int pm,
int row,
int col,
int rgb)
218 return bpixLyr1_[pm][row][col][rgb];
220 return bpixLyr2_[pm][row][col][rgb];
222 return bpixLyr3_[pm][row][col][rgb];
229 unsigned char fpix_[4][2][2][12][24][3];
237 unsigned char bpixLyr1_[2][BPIX_LYR1_ROWS][BPIX_LYR_COLS][3];
238 unsigned char bpixLyr2_[2][BPIX_LYR2_ROWS][BPIX_LYR_COLS][3];
239 unsigned char bpixLyr3_[2][BPIX_LYR3_ROWS][BPIX_LYR_COLS][3];
243 unsigned char img_[IMG_WIDTH][IMG_HEIGHT][3];
244 unsigned char bimg_[BIMG_WIDTH][BIMG_HEIGHT]
246 unsigned char auxImg_[AUX_IMG_WIDTH][AUX_IMG_HEIGHT]
248 unsigned char*** readImg_;
249 int readImgW_, readImgH_;
251 unsigned char turtleImg_[TUR_IMG_WIDTH][TUR_IMG_HEIGHT]
void createAuxImages(void)
generates pre-made images for web-client
void drawFillRect(int x, int y, int w, int h, int r, int g, int b, float m1=1.0f, float m2=0.0f, float m3=0.0f, float m4=1.0f)
draws rect to img buffer. {x,y} is lower left corner. d is degrees of rotation around z-axis.
void writeImgToBmp(std::string filename)
write img buffer to bmp file
void readBmpToReadImg(const std::string &filename)
read bmp file to readImg_ buffer
void createRocAlphaMasks(void)
added 2nd trip
void initImgBuffer(int sourceKey)
fpix buffer
void clearTurtleBuffer(int r, int g, int b, int a)
initializes aux buffer to all invisible black pixels
void initBImgBuffer(int sourceKey)
bpix buffer
void PrepareDetectorNavigatorHtml(void)
web page essentials
void clearAuxBuffer(int r, int g, int b, int a)
auxiliary buffer
void drawFillRectAngAux(int x, int y, int w, int h, int r, int g, int b, float deg)
void drawFillRectAux(int x, int y, int w, int h, int r, int g, int b, float m1=1.0f, float m2=0.0f, float m3=0.0f, float m4=1.0f)
void setRocColor(std::string stdName, int r, int g, int b)
common