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

📄 920428-2.c

📁 this is a gcc file, you can download it and learn its usetility, for further detail please look at t
💻 C
📖 第 1 页 / 共 2 页
字号:
struct gs_state_s { gs_state *saved; gs_memory_procs memory_procs; gs_matrix_fixed ctm; gs_matrix ctm_inverse; int inverse_valid; struct gx_path_s *path; struct gx_clip_path_s *clip_path; int clip_rule; struct line_params_s *line_params; struct halftone_params_s *halftone; float (*ht_proc)(floatp, floatp ); gs_int_point ht_phase; gs_int_point phase_mod; struct gs_color_s *color; struct gx_device_color_s *dev_color; struct gx_transfer_s *transfer; struct gs_font_s *font; gs_matrix char_tm; int char_tm_valid; byte in_cachedevice; byte in_charpath; int level; float flatness; int stroke_adjust; struct device_s *device; int device_is_shared;};typedef unsigned long gx_bitmap_id;typedef struct gx_bitmap_s { byte *data; int raster; gs_int_point size; gx_bitmap_id id; ushort rep_width, rep_height;} gx_bitmap;typedef unsigned long gx_color_index;typedef unsigned short gx_color_value;typedef struct gx_device_color_info_s { int num_components; int depth; gx_color_value max_gray; gx_color_value max_rgb; gx_color_value dither_gray; gx_color_value dither_rgb;} gx_device_color_info;typedef struct gx_device_procs_s gx_device_procs;struct gx_device_s { int params_size; gx_device_procs *procs; const char *dname; int width; int height; float x_pixels_per_inch; float y_pixels_per_inch; float l_margin, b_margin, r_margin, t_margin; gx_device_color_info color_info; int is_open;};typedef struct gs_prop_item_s gs_prop_item;struct gx_device_procs_s { int (*open_device)(gx_device *dev ); void (*get_initial_matrix)(gx_device *dev, gs_matrix *pmat ); int (*sync_output)(gx_device *dev ); int (*output_page)(gx_device *dev, int num_copies, int flush ); int (*close_device)(gx_device *dev ); gx_color_index (*map_rgb_color)(gx_device *dev, gx_color_value red, gx_color_value green, gx_color_value blue ); int (*map_color_rgb)(gx_device *dev, gx_color_index color, gx_color_value rgb[3] ); int (*fill_rectangle)(gx_device *dev, int x, int y, int width, int height, gx_color_index color ); int (*tile_rectangle)(gx_device *dev, gx_bitmap *tile, int x, int y, int width, int height, gx_color_index color0, gx_color_index color1, int phase_x, int phase_y ); int (*copy_mono)(gx_device *dev, unsigned char *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height, gx_color_index color0, gx_color_index color1 ); int (*copy_color)(gx_device *dev, unsigned char *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height ); int (*draw_line)(gx_device *dev, int x0, int y0, int x1, int y1, gx_color_index color ); int (*get_bits)(gx_device *dev, int y, unsigned char *data, unsigned int size, int pad_to_word ); int (*get_props)(gx_device *dev, gs_prop_item *plist ); int (*put_props)(gx_device *dev, gs_prop_item *plist, int count );};extern unsigned int gx_device_bytes_per_scan_line(gx_device *dev, int pad_to_word );int gx_default_open_device(gx_device *dev );void gx_default_get_initial_matrix(gx_device *dev, gs_matrix *pmat );int gx_default_sync_output(gx_device *dev );int gx_default_output_page(gx_device *dev, int num_copies, int flush );int gx_default_close_device(gx_device *dev );gx_color_index gx_default_map_rgb_color(gx_device *dev, gx_color_value red, gx_color_value green, gx_color_value blue );int gx_default_map_color_rgb(gx_device *dev, gx_color_index color, gx_color_value rgb[3] );int gx_default_tile_rectangle(gx_device *dev, gx_bitmap *tile, int x, int y, int width, int height, gx_color_index color0, gx_color_index color1, int phase_x, int phase_y );int gx_default_copy_color(gx_device *dev, unsigned char *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height );int gx_default_draw_line(gx_device *dev, int x0, int y0, int x1, int y1, gx_color_index color );int gx_default_get_bits(gx_device *dev, int y, unsigned char *data, unsigned int size, int pad_to_word );int gx_default_get_props(gx_device *dev, gs_prop_item *plist );int gx_default_put_props(gx_device *dev, gs_prop_item *plist, int count );typedef struct device_s { gx_device *info; int is_band_device; gx_color_index white, black;} device;int gs_initmatrix(gs_state * ), gs_defaultmatrix(const gs_state *, gs_matrix * ), gs_currentmatrix(const gs_state *, gs_matrix * ), gs_setmatrix(gs_state *, const gs_matrix * ), gs_translate(gs_state *, floatp, floatp ), gs_scale(gs_state *, floatp, floatp ), gs_rotate(gs_state *, floatp ), gs_concat(gs_state *, const gs_matrix * );int gs_transform(gs_state *, floatp, floatp, gs_point * ), gs_dtransform(gs_state *, floatp, floatp, gs_point * ), gs_itransform(gs_state *, floatp, floatp, gs_point * ), gs_idtransform(gs_state *, floatp, floatp, gs_point * );static intctm_set_inverse(gs_state *pgs){ int code = gs_matrix_invert(&*(gs_matrix *)&(pgs)->ctm , &pgs->ctm_inverse); 0; if ( code < 0 ) return code; pgs->inverse_valid = 1; return 0;}voidgs_update_matrix_fixed(gs_matrix_fixed *pmat){ (*pmat). tx = ((float)(((*pmat). tx_fixed = ((fixed)(((*pmat). tx)*(float)(1<<12 ) )) )*(1.0/(1<<12 ) ))) , (*pmat). ty = ((float)(((*pmat). ty_fixed = ((fixed)(((*pmat). ty)*(float)(1<<12 ) )) )*(1.0/(1<<12 ) )));}intgs_initmatrix(gs_state *pgs){ gx_device *dev = pgs->device->info; (*dev->procs->get_initial_matrix)(dev, &*(gs_matrix *)&(pgs)->ctm ); (pgs->ctm). tx = ((float)(((pgs->ctm). tx_fixed = ((fixed)(((pgs->ctm). tx)*(float)(1<<12 ) )) )*(1.0/(1<<12 ) ))) , (pgs->ctm). ty = ((float)(((pgs->ctm). ty_fixed = ((fixed)(((pgs->ctm). ty)*(float)(1<<12 ) )) )*(1.0/(1<<12 ) ))) , pgs->inverse_valid = 0, pgs->char_tm_valid = 0; return 0;}intgs_defaultmatrix(const gs_state *pgs, gs_matrix *pmat){ gx_device *dev = pgs->device->info; (*dev->procs->get_initial_matrix)(dev, pmat); return 0;}intgs_currentmatrix(const gs_state *pgs, gs_matrix *pmat){ *pmat = *(gs_matrix *)&(pgs)->ctm; return 0;}intgs_setmatrix(gs_state *pgs, const gs_matrix *pmat){ *(gs_matrix *)&(pgs)->ctm = *pmat; (pgs->ctm). tx = ((float)(((pgs->ctm). tx_fixed = ((fixed)(((pgs->ctm). tx)*(float)(1<<12 ) )) )*(1.0/(1<<12 ) ))) , (pgs->ctm). ty = ((float)(((pgs->ctm). ty_fixed = ((fixed)(((pgs->ctm). ty)*(float)(1<<12 ) )) )*(1.0/(1<<12 ) ))) , pgs->inverse_valid = 0, pgs->char_tm_valid = 0; return 0;}intgs_translate(gs_state *pgs, floatp dx, floatp dy){ gs_point pt; int code; if ( (code = gs_distance_transform(dx, dy, &*(gs_matrix *)&(pgs)->ctm , &pt)) < 0 ) return code; pgs->ctm.tx += pt.x; pgs->ctm.ty += pt.y; (pgs->ctm). tx = ((float)(((pgs->ctm). tx_fixed = ((fixed)(((pgs->ctm). tx)*(float)(1<<12 ) )) )*(1.0/(1<<12 ) ))) , (pgs->ctm). ty = ((float)(((pgs->ctm). ty_fixed = ((fixed)(((pgs->ctm). ty)*(float)(1<<12 ) )) )*(1.0/(1<<12 ) ))) , pgs->inverse_valid = 0, pgs->char_tm_valid = 0; return 0;}intgs_scale(gs_state *pgs, floatp sx, floatp sy){ pgs->ctm.xx *= sx; pgs->ctm.xy *= sx; pgs->ctm.yx *= sy; pgs->ctm.yy *= sy; pgs->inverse_valid = 0, pgs->char_tm_valid = 0; return 0;}intgs_rotate(gs_state *pgs, floatp ang){ int code = gs_matrix_rotate(&*(gs_matrix *)&(pgs)->ctm , ang, &*(gs_matrix *)&(pgs)->ctm ); pgs->inverse_valid = 0, pgs->char_tm_valid = 0; return code;}intgs_concat(gs_state *pgs, const gs_matrix *pmat){ int code = gs_matrix_multiply(pmat, &*(gs_matrix *)&(pgs)->ctm , &*(gs_matrix *)&(pgs)->ctm ); (pgs->ctm). tx = ((float)(((pgs->ctm). tx_fixed = ((fixed)(((pgs->ctm). tx)*(float)(1<<12 ) )) )*(1.0/(1<<12 ) ))) , (pgs->ctm). ty = ((float)(((pgs->ctm). ty_fixed = ((fixed)(((pgs->ctm). ty)*(float)(1<<12 ) )) )*(1.0/(1<<12 ) ))) , pgs->inverse_valid = 0, pgs->char_tm_valid = 0; return code;}intgs_transform(gs_state *pgs, floatp x, floatp y, gs_point *pt){ return gs_point_transform(x, y, &*(gs_matrix *)&(pgs)->ctm , pt);}intgs_dtransform(gs_state *pgs, floatp dx, floatp dy, gs_point *pt){ return gs_distance_transform(dx, dy, &*(gs_matrix *)&(pgs)->ctm , pt);}intgs_itransform(gs_state *pgs, floatp x, floatp y, gs_point *pt){ if ( !!(((*(long *)(&((&pgs->ctm)->xy)) | *(long *)(&( (&pgs->ctm)->yx)) ) << 1) == 0) ) { return gs_point_transform_inverse(x, y, &*(gs_matrix *)&(pgs)->ctm , pt); } else { if ( !pgs->inverse_valid ) { int code = ctm_set_inverse(pgs); if ( code < 0 ) return code; }; return gs_point_transform(x, y, &pgs->ctm_inverse, pt); }}intgs_idtransform(gs_state *pgs, floatp dx, floatp dy, gs_point *pt){ if ( !!(((*(long *)(&((&pgs->ctm)->xy)) | *(long *)(&( (&pgs->ctm)->yx)) ) << 1) == 0) ) { return gs_distance_transform_inverse(dx, dy, &*(gs_matrix *)&(pgs)->ctm , pt); } else { if ( !pgs->inverse_valid ) { int code = ctm_set_inverse(pgs); if ( code < 0 ) return code; }; return gs_distance_transform(dx, dy, &pgs->ctm_inverse, pt); }}intgs_translate_to_fixed(register gs_state *pgs, fixed px, fixed py){ pgs->ctm.tx = ((float)((pgs->ctm.tx_fixed = px)*(1.0/(1<<12 ) ))); pgs->ctm.ty = ((float)((pgs->ctm.ty_fixed = py)*(1.0/(1<<12 ) ))); pgs->inverse_valid = 0; pgs->char_tm_valid = 1; return 0;}intgx_matrix_to_fixed_coeff(const gs_matrix *pmat, register fixed_coeff *pfc, int max_bits){ gs_matrix ctm; int scale = -10000; int expt, shift; ctm = *pmat; pfc->skewed = 0; if ( !((*(long *)(&(ctm.xx)) << 1) == 0) ) { (void)frexp(ctm.xx, &scale); } if ( !((*(long *)(&(ctm.xy)) << 1) == 0) ) { (void)frexp(ctm.xy, &expt); if ( expt > scale ) scale = expt; pfc->skewed = 1; } if ( !((*(long *)(&(ctm.yx)) << 1) == 0) ) { (void)frexp(ctm.yx, &expt); if ( expt > scale ) scale = expt; pfc->skewed = 1; } if ( !((*(long *)(&(ctm.yy)) << 1) == 0) ) { (void)frexp(ctm.yy, &expt); if ( expt > scale ) scale = expt; } scale = sizeof(long) * 8 - 1 - max_bits - scale; shift = scale - 12; if ( shift > 0 ) { pfc->shift = shift; pfc->round = (fixed)1 << (shift - 1); } else { pfc->shift = 0; pfc->round = 0; scale -= shift; } pfc->xx = (((*(long *)(&(ctm.xx)) << 1) == 0) ? 0 : (long)ldexp(ctm.xx, scale)); pfc->yy = (((*(long *)(&(ctm.yy)) << 1) == 0) ? 0 : (long)ldexp(ctm.yy, scale)); if ( pfc->skewed ) { pfc->xy = (((*(long *)(&(ctm.xy)) << 1) == 0) ? 0 : (long)ldexp(ctm.xy, scale)); pfc->yx = (((*(long *)(&(ctm.yx)) << 1) == 0) ? 0 : (long)ldexp(ctm.yx, scale)); } else pfc->xy = pfc->yx = 0; pfc->max_bits = max_bits; return 0;}

⌨️ 快捷键说明

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