~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Tina4/src/draw/paint/tv_mice.c

Version: ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /**@(#)
  2 **/
  3 #include <stdio.h>
  4 #include <tina/sys.h>
  5 #include <tina/sysfuncs.h>
  6 #include <tina/math.h>
  7 #include <tina/vision.h>
  8 #include <tina/tv.h>
  9 #include <tina/tvfuncs.h>
 10 #include <tina/draw.h>
 11 #include <tina/drawfuncs.h>
 12 
 13 /* ARGSUSED Quieten Lint */
 14 static void ipos_print(Tv * tv, Ipos pos)
 15 {
 16     format("cursor at:\n");
 17     format("screen   : %10d%10d\n", ipos_x(pos), ipos_y(pos));
 18 }
 19 
 20 static void pos2_print(Tv * tv, Ipos pos)
 21 {
 22     Vec2    p = {Vec2_id};
 23 
 24     p = tv_backproj2(tv, pos);
 25     format("cursor at:\n");
 26     format("2D       :   %10.3f%10.3f\n", vec2_x(p), vec2_y(p));
 27 }
 28 
 29 static void pos3_print(Tv * tv, Ipos pos)
 30 {
 31     Vec3    p = {Vec3_id};
 32 
 33     p = tv_backproj3(tv, pos);
 34     format("cursor at:\n");
 35     format("3D       :   %10.3f%10.3f%10.3f\n",
 36            vec3_x(p), vec3_y(p), vec3_z(p));
 37 }
 38 
 39 Tv_mouse pos_mouse(void)
 40 {
 41     return (mouse_define(MOUSE_NAME, "position mouse",
 42                          LEFT_NAME, "ipos",
 43                          LEFT_DOWN, ipos_print,
 44                          MIDDLE_NAME, "pos2D",
 45                          MIDDLE_DOWN, pos2_print,
 46                          RIGHT_NAME, "pos3D",
 47                          RIGHT_DOWN, pos3_print,
 48                          NULL));
 49 }
 50 
 51 static void pixel_print(Tv * tv, Ipos pos)
 52 {
 53     format("pixel: %10d\n", tv_get_pixel(tv, pos));
 54 }
 55 
 56 Tv_mouse pixel_mouse(void)
 57 {
 58     return (mouse_define(MOUSE_NAME, "Pixel mouse",
 59                          LEFT_NAME, "pixel",
 60                          LEFT_DOWN, pixel_print,
 61                          NULL));
 62 }
 63 
 64 static void grey_print(Tv * tv, Ipos pos)
 65 {
 66     format("grey: %10d\n", tv_get_grey(tv, pos));
 67 }
 68 
 69 Tv_mouse grey_mouse(void)
 70 {
 71     return (mouse_define(MOUSE_NAME, "Grey mouse",
 72                          LEFT_NAME, "grey",
 73                          LEFT_DOWN, grey_print,
 74                          NULL));
 75 }
 76 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.