Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals

drawTv_props.h File Reference

#include <tinatool/draw/draw_TvDef.h>
#include <tina/math/mathDef.h>

Include dependency graph for drawTv_props.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Functions

void tv_background_set (Tv *tv, Tina_pixel color)
void tv_color_set (Tv *tv, Tina_pixel color)
void tv_color_reset (Tv *tv, Tina_pixel color)
int tv_get_pixel (Tv *tv, Ipos pos)
Tina_pixel tv_get_grey (Tv *tv, Ipos pos)
void tv_set_color (Tv *tv, Tina_pixel color)
int tv_color_get (Tv *tv)
int tv_get_color (Tv *tv)
int tv_set_op (Tv *tv, int op)
int tv_get_op (Tv *tv)
int tv_set_linewidth (Tv *tv, int width)
int tv_get_linewidth (Tv *tv)
int tv_set_linestyle (Tv *tv, int style)
int tv_get_linestyle (Tv *tv)
void tv_named_font_set (Tv *tv, char *font_name)
char * tv_named_font_get (Tv *tv)
void tv_save_draw (Tv *tv)
void tv_set_overlay (Tv *tv)
void tv_reset_color (Tv *tv, Tina_pixel color, int r, int g, int b)
void tv_reset_named_color (Tv *tv, Tina_pixel color, char *color_name)
void tv_reset_draw (Tv *tv)
void * tv_set_drawdata (Tv *tv, void *newdrawdata)
int tv_set_zoomlevel (Tv *tv, int zoomlevel)
void tv_set_paint_mode (Tv *tv, int mode)
void tv_get_text_extent (Tv *tv, char *string, int *xmin, int *xmax, int *ymin, int *ymax)

Variables

void(*)() tv_set_fulldraw (Tv *tv, void(*newfulldraw)())
void(*)() tv_set_skeldraw (Tv *tv, void(*newskeldraw)())
void(*)() tv_set_backdraw (Tv *tv, void(*newbackdraw)())


Function Documentation

void tv_background_set Tv tv,
Tina_pixel  color
 

Definition at line 76 of file drawTv_props.c.

References tv::cmap_data_visible, cmap_type_dynamic, cmap_data_visible::std_lut, Tina_pixel, Tv, tv::tv_screen, tv_screen_background_set(), and cmap_data_visible::type.

00077 {
00078     if (tv && tv->tv_screen 
00079         && tv->cmap_data_visible->type == cmap_type_dynamic)
00080     {
00081         tv_screen_background_set(tv->tv_screen,
00082                                tv->cmap_data_visible->std_lut[color]);
00083     }
00084 }

Here is the call graph for this function:

int tv_color_get Tv tv  ) 
 

Definition at line 152 of file drawTv_props.c.

References tv::color, and Tv.

00153 {
00154     return (tv->color);
00155 }

void tv_color_reset Tv tv,
Tina_pixel  color
 

Definition at line 101 of file drawTv_props.c.

References Tina_pixel, Tv, tv::tv_screen, and tv_screen_color_set().

Referenced by cmap_tool_redraw().

00102 {
00103     if (tv && tv->tv_screen)
00104     {
00105         tv_screen_color_set(tv->tv_screen, color);
00106     }
00107 }

Here is the call graph for this function:

void tv_color_set Tv tv,
Tina_pixel  color
 

Definition at line 89 of file drawTv_props.c.

References tv::cmap_data_visible, tv::color, cmap_data_visible::std_lut, Tina_pixel, Tv, tv::tv_screen, and tv_screen_color_set().

Referenced by cmap_tool_redraw(), conn_add_regions(), conn_delete_line(), conn_delete_pixel(), draw_profile_region(), overlay_proc(), tv_pick_proc(), tv_set_color(), tv_string2_col(), tv_zbuff_image_convex_poly(), tv_zbuff_interp_convex_poly(), tv_zbuff_interp_general_poly(), xpartdraw(), ypartdraw(), and zpartdraw().

00090 {
00091     if (tv)
00092         tv->color = color;
00093     if (tv && tv->tv_screen && tv->cmap_data_visible )
00094     {
00095         tv_screen_color_set(tv->tv_screen, tv->cmap_data_visible->std_lut[color]);
00096     }
00097 }

Here is the call graph for this function:

int tv_get_color Tv tv  ) 
 

Definition at line 157 of file drawTv_props.c.

References tv::color, and Tv.

Referenced by draw_corr_match_edgels(), pick_corr_match_draw(), and stereo_corr_match_draw().

00158 {
00159     return (tv->color);
00160 }

Tina_pixel tv_get_grey Tv tv,
Ipos  pos
 

Definition at line 118 of file drawTv_props.c.

References tv::cmap_data_visible, CMAPLOOKUPSIZE, cmap_data_visible::std_lut, Tina_pixel, Tv, tv::tv_screen, and tv_screen_get_pixel().

Referenced by grey_print().

00119 {
00120     Tina_pixel color = 0;
00121     unsigned long min_diff = ULONG_MAX;
00122     unsigned long pixel;
00123     int     i;
00124 
00125     if (tv == NULL || tv->tv_screen == NULL)
00126         return (0);
00127 
00128     pixel = tv_screen_get_pixel(tv->tv_screen, pos);
00129 
00130     /* Find the closest match in cmap_lookup to the pixel */
00131     for (i = 0; i < CMAPLOOKUPSIZE; i++)
00132     {
00133         int     diff = abs((int) (tv->cmap_data_visible->std_lut[i] - pixel));
00134 
00135         if (diff < min_diff)
00136         {
00137             min_diff = diff;
00138             color = i;
00139         }
00140     }
00141 
00142     return (color);
00143 }

Here is the call graph for this function:

int tv_get_linestyle Tv tv  ) 
 

Definition at line 217 of file drawTv_props.c.

References tv::linestyle, and Tv.

00218 {
00219     return (tv->linestyle);
00220 }

int tv_get_linewidth Tv tv  ) 
 

Definition at line 198 of file drawTv_props.c.

References tv::linewidth, and Tv.

Referenced by smm_go_to_proc(), smm_matcher_proc(), and transform_proc().

00199 {
00200     return (tv->linewidth);
00201 }

int tv_get_op Tv tv  ) 
 

Definition at line 178 of file drawTv_props.c.

References tv::op, and Tv.

00179 {
00180     return (tv->op);
00181 }

int tv_get_pixel Tv tv,
Ipos  pos
 

Definition at line 110 of file drawTv_props.c.

References Tv, tv::tv_screen, and tv_screen_get_pixel().

Referenced by pixel_print().

00111 {
00112     if (tv == NULL || tv->tv_screen == NULL)
00113         return (0);
00114     return (tv_screen_get_pixel(tv->tv_screen, pos));
00115 }

Here is the call graph for this function:

void tv_get_text_extent Tv tv,
char *  string,
int *  xmin,
int *  xmax,
int *  ymin,
int *  ymax
 

Definition at line 422 of file drawTv_props.c.

References tv::font_name, Tv, tv::tv_screen, and tv_screen_get_text_extent().

Referenced by legend(), tv_cctext(), tv_cltext(), tv_crtext(), tv_lctext(), tv_uctext(), and tv_zbuff_text3().

00423 {
00424     if (tv && tv->tv_screen)
00425     {
00426         tv_screen_get_text_extent(tv->tv_screen, tv->font_name, string,
00427                                   xmin, xmax, ymin, ymax);
00428     } else
00429     {
00430         *xmin = *xmax = *ymin = *ymax = 0;
00431     }
00432 }

Here is the call graph for this function:

char* tv_named_font_get Tv tv  ) 
 

Definition at line 241 of file drawTv_props.c.

References tv::font_name, and Tv.

00242 {
00243     return (tv ? tv->font_name : "");
00244 }

void tv_named_font_set Tv tv,
char *  font_name
 

Definition at line 227 of file drawTv_props.c.

References tv::font_name, Tv, tv::tv_screen, and tv_screen_named_font_set().

Referenced by imcalc_graph_tv_make().

00228 {
00229     if (tv && tv->tv_screen)
00230     {
00231         (void) strncpy(tv->font_name, font_name, STRING128);
00232         /* Ensure tv->font_name is NULL terminated */
00233 
00234         tv->font_name[STRING128 - 1] = '\0';
00235 
00236         tv_screen_named_font_set(tv->tv_screen, tv->font_name);
00237     }
00238 }

Here is the call graph for this function:

void tv_reset_color Tv tv,
Tina_pixel  color,
int  r,
int  g,
int  b
 

Definition at line 283 of file drawTv_props.c.

References tv::cmap_data_visible, cmap_type_dynamic, cmap_data_visible::std_lut, Tina_pixel, Tv, tv::tv_screen, tv_screen_alloc_color(), tv_screen_reset_color(), and cmap_data_visible::type.

Referenced by bkgrnd_choice_proc(), and display_create().

00284 {
00285     extern void tv_screen_reset_color();
00286 
00287     if (tv && tv->tv_screen && tv->cmap_data_visible) 
00288     {
00289         if (tv->cmap_data_visible->type == cmap_type_dynamic)
00290             tv_screen_reset_color(tv->tv_screen,
00291                             (tv->cmap_data_visible->std_lut[color]),
00292                               r, g, b);
00293          else
00294             tv_screen_alloc_color(tv->tv_screen,
00295                                   /* warning: passing argument 2 of 'tv_screen_alloc_color' from incompatible pointer type */
00296                             &(tv->cmap_data_visible->std_lut[color]),
00297                               r, g, b);
00298     }
00299 }

Here is the call graph for this function:

void tv_reset_draw Tv tv  ) 
 

Definition at line 316 of file drawTv_props.c.

References tv::cmap_data_visible, tv_draw::color, tv::color, tv::draw, tv_draw::font_name, tv::font_name, tv_draw::linestyle, tv::linestyle, tv_draw::linewidth, tv::linewidth, tv_draw::op, tv::op, cmap_data_visible::overlay_mask, tv_draw::overlay_on, tv::overlay_on, rfree(), rop_xor, Tv, Tv_draw, tv::tv_screen, tv_screen_named_font_set(), tv_screen_set_color(), tv_screen_set_linestyle(), tv_screen_set_linewidth(), and tv_screen_set_op().

Referenced by centredot(), conic2_draw_col(), conn_add_regions(), density_list_overlayer(), display_stereo_match(), draw_circle_plot(), draw_circle_up(), draw_leftcross(), draw_line_plot(), draw_line_up(), draw_rightcross(), draw_roi_plot(), draw_roi_up(), epi_left_up(), epi_right_up(), export_inner_proc(), export_outer_proc(), export_proc(), geom_col_draw(), input_poly_proc(), mask_size_point_u(), mask_size_start_u(), model_left_up(), mono_pick_mlist_cordraw(), order_left_up(), order_right_up(), paxis_set_end(), pick_mlist_cordraw(), pick_model_matches(), pick_scene_matches(), picklist_match_string_draw(), plot_rightpix(), plot_tvpix(), pmove_frame_put(), pnt_place_up(), pnt_redraw_up(), raster_left_up(), raster_right_up(), raxis_set_end(), rmove_frame_put(), scene_left_up(), seq_skeldraw(), skeldraw(), spline_mark_point(), spline_replace_up(), stereo_corner_proc(), store_loc(), tal_comp(), tv_edges(), tv_edges_conn(), tv_edges_conn_propmask(), tv_imzoom_proc(), tv_pick_proc(), tv_polyroi_proc(), tv_roi_proc(), tv_roigbl_proc(), tv_roipnt_proc(), tv_string2_col(), tv_terrain_fill3(), tv_zoom2_proc(), tv_zoom3_proc(), tv_zoomaf_proc(), tv_zoomgr_proc(), xpartdraw(), ypartdraw(), and zpartdraw().

00317 {
00318     Tv_draw *draw;
00319 
00320     if (tv && tv->draw && tv->tv_screen)
00321     {
00322         draw = (Tv_draw *) tv->draw->to;
00323         tv->overlay_on = draw->overlay_on;
00324         tv->color = draw->color;
00325         tv->op = draw->op;
00326         tv->linewidth = draw->linewidth;
00327         tv->linestyle = draw->linestyle;
00328         (void) strncpy(tv->font_name, draw->font_name, STRING128);
00329         /* Ensure tv->font_name is NULL terminated */
00330         tv->font_name[STRING128 - 1] = '\0';
00331 
00332         if (tv->overlay_on)
00333         {
00334             tv_screen_set_op(tv->tv_screen, rop_xor);
00335             tv_screen_set_color(tv->tv_screen, tv->cmap_data_visible->overlay_mask);
00336         } else
00337         {
00338             tv_screen_set_op(tv->tv_screen, tv->op);
00339             tv_screen_set_color(tv->tv_screen, tv->color);
00340         }
00341         tv_screen_set_linewidth(tv->tv_screen, tv->linewidth);
00342         tv_screen_set_linestyle(tv->tv_screen, tv->linestyle);
00343         tv_screen_named_font_set(tv->tv_screen, tv->font_name);
00344 
00345         tv->draw = link_rm_el(tv->draw);
00346         rfree((void *) draw);
00347     }
00348 }

Here is the call graph for this function:

void tv_reset_named_color Tv tv,
Tina_pixel  color,
char *  color_name
 

Definition at line 302 of file drawTv_props.c.

References tv::cmap_data_visible, cmap_type_dynamic, cmap_data_visible::std_lut, Tina_pixel, Tv, tv::tv_screen, tv_screen_reset_named_color(), and cmap_data_visible::type.

00303 {
00304     extern void tv_screen_reset_named_color();
00305 
00306     if (tv && tv->tv_screen && tv->cmap_data_visible->std_lut 
00307         && tv->cmap_data_visible->type == cmap_type_dynamic)
00308     {
00309         tv_screen_reset_named_color(tv->tv_screen, tv->cmap_data_visible->std_lut[color],
00310                                     color_name);
00311 
00312     }
00313 }

Here is the call graph for this function:

void tv_save_draw Tv tv  ) 
 

Definition at line 247 of file drawTv_props.c.

References tv::color, tv_draw::color, tv::draw, tv::font_name, tv_draw::font_name, tv::linestyle, tv_draw::linestyle, tv::linewidth, tv_draw::linewidth, tv::op, tv_draw::op, tv::overlay_on, tv_draw::overlay_on, ref_addtostart(), rfree(), Tv, and Tv_draw.

Referenced by centredot(), conic2_draw_col(), display_stereo_match(), draw_leftcross(), draw_rightcross(), geom_col_draw(), model_left_up(), paxis_set_start(), pick_model_matches(), pick_scene_matches(), picklist_match_string_draw(), plot_rightpix(), plot_tvpix(), pmove_frame_get(), pnt_place_down(), raxis_set_start(), rmove_frame_get(), scene_left_up(), set_tal_down(), spline_mark_point(), store_loc(), test_surf_proc(), tv_edges(), tv_edges_conn(), tv_edges_conn_propmask(), tv_pick_proc(), tv_roigbl_proc(), tv_roipnt_proc(), tv_set_overlay(), tv_string2_col(), tv_strings(), and tv_terrain_fill3().

00248 {
00249     Tv_draw *draw;
00250 
00251     if (tv)
00252     {
00253         draw = (Tv_draw *) ts_ralloc(Tv_draw);
00254         draw->overlay_on = tv->overlay_on;
00255         draw->color = tv->color;
00256         draw->op = tv->op;
00257         draw->linewidth = tv->linewidth;
00258         draw->linestyle = tv->linestyle;
00259         (void) strncpy(draw->font_name, tv->font_name, STRING128);
00260         /* Ensure tv->font_name is NULL terminated */
00261         draw->font_name[STRING128 - 1] = '\0';
00262 
00263         tv->draw = ref_addtostart(tv->draw, (void *) draw, (int) rfree);
00264     }
00265 }

Here is the call graph for this function:

void tv_set_color Tv tv,
Tina_pixel  color
 

Definition at line 147 of file drawTv_props.c.

References Tina_pixel, Tv, and tv_color_set().

Referenced by centredot(), col_choice_proc(), conic2_draw_col(), conic3_draw_col(), density_list_overlayer(), display_stereo_match(), draw_corr_match_edgels(), draw_leftcross(), draw_match_list_col(), draw_rightcross(), draw_sample_inner(), draw_sample_outer(), draw_triangle3_fill(), epi_left_up(), epi_right_up(), export_inner_proc(), export_outer_proc(), export_proc(), geom_col_draw(), input_poly_proc(), legend(), match_list_cycle_draw(), match_list_draw(), model_fulldraw(), model_left_up(), mono_pick_mlist_cordraw(), mono_show_stored_corners(), order_left_up(), order_right_up(), paxis_draw(), paxis_set_end(), paxis_show(), pick_corr_match_draw(), pick_model_matches(), pick_scene_matches(), picklist_match_string_draw(), pl_axes_plot(), pl_ctr_plot(), pl_graph_plot(), pl_scatter_plot(), plot_rightpix(), plot_tvpix(), pmove_frame_put(), pnt_list_show(), raster_left_up(), raster_right_up(), raxis_draw(), raxis_set_end(), raxis_show(), redraw_splines(), scene_fulldraw(), scene_left_up(), spline_insert_point(), spline_mark_point(), spline_remove_point(), spline_replace_up(), sroi_polygon_label(), stereo_corr_match_draw(), trans_model_proc(), tv_edges(), tv_edges_conn(), tv_edges_conn_propmask(), tv_points_between_col(), tv_polyroi_proc(), tv_roigbl_proc(), and tv_roipnt_proc().

00148 {
00149     tv_color_set(tv, color);
00150 }

Here is the call graph for this function:

void* tv_set_drawdata Tv tv,
void *  newdrawdata
 

Definition at line 389 of file drawTv_props.c.

References tv::drawdata, and Tv.

00390 {
00391     void   *olddrawdata = NULL;
00392 
00393     if (tv)
00394     {
00395         olddrawdata = tv->drawdata;
00396         tv->drawdata = newdrawdata;
00397     }
00398     return (olddrawdata);
00399 }

int tv_set_linestyle Tv tv,
int  style
 

Definition at line 204 of file drawTv_props.c.

References tv::linestyle, Tv, tv::tv_screen, and tv_screen_set_linestyle().

00205 {
00206     int     oldstyle = 0;
00207 
00208     if (tv && tv->tv_screen)
00209     {
00210         oldstyle = tv->linestyle;
00211         tv->linestyle = style;
00212         tv_screen_set_linestyle(tv->tv_screen, style);
00213     }
00214     return (oldstyle);
00215 }

Here is the call graph for this function:

int tv_set_linewidth Tv tv,
int  width
 

Definition at line 184 of file drawTv_props.c.

References tv::linewidth, Tv, tv::tv_screen, and tv_screen_set_linewidth().

Referenced by line_width_choice_proc(), smm_go_to_proc(), smm_matcher_proc(), and transform_proc().

00185 {
00186     int     oldwidth = 0;
00187 
00188     if (tv)
00189     {
00190         oldwidth = tv->linewidth;
00191         tv->linewidth = width;
00192         tv_screen_set_linewidth(tv->tv_screen, width);
00193     }
00194     return (oldwidth);
00195 }

Here is the call graph for this function:

int tv_set_op Tv tv,
int  op
 

Definition at line 162 of file drawTv_props.c.

References tv::op, tv::overlay_on, Tv, tv::tv_screen, and tv_screen_set_op().

Referenced by centredot(), terrain_fulldraw(), and tv_points_between_col().

00163 {
00164     int     oldop = 0;
00165 
00166     if (tv && tv->tv_screen)
00167     {
00168         oldop = tv->op;
00169         tv->op = op;
00170         if (!tv->overlay_on)
00171         {
00172             tv_screen_set_op(tv->tv_screen, op);
00173         }
00174     }
00175     return (oldop);
00176 }

Here is the call graph for this function:

void tv_set_overlay Tv tv  ) 
 

Definition at line 268 of file drawTv_props.c.

References tv::cmap_data_visible, cmap_data_visible::overlay_mask, tv::overlay_on, rop_xor, Tv, tv_save_draw(), tv::tv_screen, tv_screen_set_color(), tv_screen_set_linewidth(), and tv_screen_set_op().

Referenced by conn_roi(), draw_circle_plot(), draw_line_plot(), draw_line_up(), draw_roi_plot(), epi_left_down(), epi_right_down(), mask_size_point_d(), mask_size_start_d(), model_left_down(), mono_pick_mlist_cordraw(), order_left_down(), order_right_down(), paxis_set_start(), pick_mlist_cordraw(), pmove_frame_get(), pnt_place_down(), raster_left_down(), raster_right_down(), raxis_set_start(), rmove_frame_get(), scene_left_down(), seq_skeldraw(), set_start_down(), set_tal_down(), skeldraw(), spline_replace_down(), stereo_corner_proc(), store_loc(), tv_imzoom_proc(), tv_pick_proc(), tv_polyroi_proc(), tv_roi_proc(), tv_roigbl_proc(), tv_roipnt_proc(), tv_zoom2_proc(), tv_zoom3_proc(), tv_zoomaf_proc(), and tv_zoomgr_proc().

00269 {
00270     if (tv && tv->tv_screen && tv->cmap_data_visible)
00271     {
00272         tv_save_draw(tv);
00273         tv->overlay_on = true;
00274         tv_screen_set_linewidth(tv->tv_screen, 0);
00275         tv_screen_set_op(tv->tv_screen, rop_xor);
00276         tv_screen_set_color(tv->tv_screen, tv->cmap_data_visible->overlay_mask);
00277     }
00278 }

Here is the call graph for this function:

void tv_set_paint_mode Tv tv,
int  mode
 

Definition at line 414 of file drawTv_props.c.

References tv::paint_mode, and Tv.

Referenced by paint_proc().

00415 {
00416     if (tv == NULL)
00417         return;
00418 
00419     tv->paint_mode = mode;
00420 }

int tv_set_zoomlevel Tv tv,
int  zoomlevel
 

Definition at line 402 of file drawTv_props.c.

References Tv, and tv::zoomlevel.

Referenced by col_tv_blue_make(), col_tv_green_make(), col_tv_red_make(), imcal2_tv_make(), imcalc_graph_tv_make(), imcalc_tv_make(), imcmem_tv_make(), left_tv_make(), model_tv_make(), mono_tv_make(), right_tv_make(), scene_tv_make(), seq_tv_make(), simple_tv_make(), terrain_tv(), threed_init(), xcoreg_tv_make(), ycoreg_tv_make(), and zcoreg_tv_make().

00403 {
00404     int     oldzoomlevel = 0;
00405 
00406     if (tv)
00407     {
00408         oldzoomlevel = tv->zoomlevel;
00409         tv->zoomlevel = zoomlevel;
00410     }
00411     return (oldzoomlevel);
00412 }


Variable Documentation

void(*)( ) tv_set_backdraw(Tv * tv, void (*newbackdraw) ( ))
 

Definition at line 81 of file drawTv_props.h.

void(*)( ) tv_set_fulldraw(Tv * tv, void (*newfulldraw) ( ))
 

Definition at line 79 of file drawTv_props.h.

void(*)( ) tv_set_skeldraw(Tv * tv, void (*newskeldraw) ( ))
 

Definition at line 80 of file drawTv_props.h.


Generated on Thu Nov 12 02:21:09 2009 for Tools by doxygen 1.3.6