⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 runutils.h

📁 Ocr source code. provides an Ocr engine that works in C++ language.
💻 H
字号:
/* runutils.h : misc. functions for running the program * Author: Maxie D. Schmidt (created 5/20/2006)           */#ifndef _RUNUTILS_H_#define _RUNUTILS_H_#include <stdlib.h>#include <stdio.h>#include <errno.h>#include <string.h>#include <time.h>#include <dirent.h>#include <png.h>#include <gtkmm/window.h>#include <gtkmm/messagedialog.h>#include <string>#include <vector>using namespace std;#include "types.h"#include "classnotes.h"#include "parselist.h"#ifndef png_jmpbuf#define png_jmpbuf(png_ptr)  ((png_ptr)->jmpbuf)#endif//#define max(x, y)  ((x > y) ? x : y)//#define min(x, y)  ((x < y) ? x : y)// init:void setup_classnotes_dirs();bool init_png_file(string filename, png_file *pf);// save text to file:bool save_text(string file, bool append);// config:bool parse_from_config(string filename);bool write_config_file(string filename);// string utils:string trim_whitespace(string input);string strip_newlines(string input);string strip_unused_chars(string input); // unused by the profilevector<string> split_string(string input, char delimeter);string int_to_string(int val);string double_to_string(double val);// error checking:bool directory_exists(string dir_name);bool file_exists(string filename);// error handling:string resolve_local_error(int error_code);bool stamp_log_file(string stamp);bool log_error(int lerror_code, const char *msg, char *errno_msg);void popup_message(Gtk::Window &window, string message);// math:int max(int x0, int x1);int min(int x0, int x1);// intervals:int_interval_t create_interval(int lower, int upper);rgb_interval_t create_interval(int Rl, int Ru, int Gl, int Gu, int Bl, int Bu);bool within_interval(int value, int_interval_t interval, bool ends_inclusive);bool within_interval(int R, int G, int B, rgb_interval_t interval);// checks against NULL for types:bool equals_NULL_POINT(xy_point pt);bool equals_NULL_BOX(box_t box);bool equals_NULL_PTS(box_points pts);// xy_point:xy_point create_xy_point(int x, int y);// boxes:box_t create_box(int lcorner_x, int lcorner_y, int vlen, int hlen);box_t extreme_points_to_box(box_points pts);bool fits_in_box(box_t main_box, box_t box);bool box_equals_box(box_t box0, box_t box1);box_points find_biggest_box(box_points pt0, box_points pt1);box_t find_biggest_box(box_t box0, box_t box1);vector<box_t> remove_duplicates(vector<box_t> boxen);vector<box_t> sort_boxes_ltor(vector<box_t> boxen);// for parsing:vector< vector<bool> > zero_matrix(int rows, int cols);void clear_matrix(vector< vector<bool> > &matrix);grid_int_t zero_grid(int rows, int cols);// for rgb buffers:bool grid(unsigned char *buf, int height, int width, int row, int col);// training parsing / misc:vector<int> sort_lower_to_upper(vector<int> input);#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -