?? types.cpp
字號(hào):
/* types.cpp : code for classes (fully) defined in types.h * Author: Maxie D. Schmidt (created 5/20/2006) */#include "types.h"#include "classnotes.h"#include "runutils.h"xy_point NULL_POINT() { xy_point r_val; r_val.x = r_val.y = -1; return r_val;}box_t NULL_BOX() { box_t r_val; r_val.xy = NULL_POINT(); return r_val;}box_points NULL_PTS() { box_points r_val; r_val.r_most.x = r_val.r_most.y = -1; return r_val;}png_file::png_file() { is_valid = false; filename = ""; height = width = 0; buf = NULL; tracks = NULL; tracks_num_bytes = 0; parsed = false; scan_starting_line_num = 0; plist = NULL;}png_file::~png_file() { if(buf != NULL) { free(buf); free(tracks); }}// checks for black pixels or pixels within a range of (r, g, b) = (0, 0, 0);// the range is: r, g, b <= 100;bool png_file::grid(int row, int col) { if((row >= height) || (col >= width) || (row < 0) || (col < 0)) return false; unsigned char *ptr = buf + (row * width * 3) + (col * 3); if(within_interval(*ptr, *(ptr + 1), *(ptr + 2), grid_rgb_int)) return true; return false;}void png_file::mark(int row, int col) { if((row >= height) || (row < 0) || (col >= width) || (col < 0)) return; int byte_pos = (row * width + col) % 8; unsigned char byte = (0x80 >> byte_pos); *(tracks + ((row * width + col) / 8)) = byte | (*(tracks + ((row * width + col) / 8)));}bool png_file::is_marked(int row, int col) { if((row >= height) || (row < 0) || (col >= width) || (col < 0)) return false; int byte = *(tracks + ((row * width + col) / 8)); int byte_pos = (row * width + col) % 8; return ((0x80 >> byte_pos) & byte);}void png_file::cleanup_tracks() { for(int i = 0; i < tracks_num_bytes; i++) *(tracks + i) = 0x00;}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -