00001 #ifndef VGRAPH_H
00002 #define VGRAPH_H
00003
00004
00005
00006
00007
00008
00009 #include "liqbase.h"
00010 #include "liqcell.h"
00011
00012
00013
00014 typedef unsigned int vcolor;
00015
00016
00017
00018
00019 #define vcolor_YUV(y,u,v) ((unsigned int)( (((unsigned int)(v))<<16) | (((unsigned int)(u))<<8) | (((unsigned int)(y))) ) )
00020
00021 typedef
00022 struct vgraph
00023 {
00024 int usagecount;
00025
00026
00027 liqcliprect *cliprect;
00028 liqimage *target;
00029
00030 int scalex;
00031 int scaley;
00032
00033 int scalew;
00034 int scaleh;
00035
00036
00037 liqcell *window;
00038
00039
00040 unsigned int backcolor;
00041 unsigned int pencolor;
00042 unsigned int penthick;
00043
00044 liqfont *font;
00045
00046 int scaleaspectlock;
00047
00048 }
00049 vgraph;
00050
00051
00052 vgraph *vgraph_new();
00053 vgraph *vgraph_hold( vgraph *self);
00054 void vgraph_release( vgraph *self);
00055
00056
00057 int vgraph_settarget( vgraph *self, liqimage *target );
00058 int vgraph_setwindow( vgraph *self, liqcell *window);
00059 void vgraph_convert_target2window( vgraph *self, int tx,int ty, int *wx, int *wy);
00060 void vgraph_convert_window2target( vgraph *self, int wx,int wy, int *tx, int *ty);
00061 void vgraph_setcliprect( vgraph *self, liqcliprect *cliprect );
00062 liqcliprect *vgraph_getcliprect( vgraph *self);
00063
00064
00065
00066 int vgraph_setscaleaspectlock(vgraph *self,int newscaleaspectlock);
00067 int vgraph_getscaleaspectlock(vgraph *self);
00068
00069
00070 int vgraph_setbackcolor( vgraph *self, vcolor backcolor );
00071 int vgraph_setpencolor( vgraph *self, vcolor pencolor );
00072 int vgraph_setpenthick( vgraph *self, int penthick );
00073 int vgraph_setfont( vgraph *self, liqfont *font);
00074 int vgraph_drawclear( vgraph *self );
00075 int vgraph_drawpoint( vgraph *self, int x, int y );
00076 int vgraph_drawline( vgraph *self, int x, int y, int ex,int ey );
00077 int vgraph_drawbox( vgraph *self, int x, int y, int w,int h );
00078 int vgraph_drawrect( vgraph *self, int x, int y, int w,int h );
00079 int vgraph_drawcircle( vgraph *self, int x, int y, int radius );
00080 int vgraph_drawellipse( vgraph *self, int x, int y, int rx,int ry );
00081 int vgraph_drawtext( vgraph *self, int x, int y, char *text );
00082 int vgraph_drawsketch( vgraph *self, int x, int y, int w,int h , liqsketch *sketch );
00083 int vgraph_drawimage( vgraph *self, int x, int y, int w,int h , liqimage *image );
00084 int vgraph_drawcell( vgraph *self, int x, int y, int w,int h , liqcell *cell );
00085
00086 #endif