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
00029
00030 int scalex;
00031 int scaley;
00032
00033 int scalew;
00034 int scaleh;
00035
00036
00037
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 int windowx;
00050 int windowy;
00051 int windoww;
00052 int windowh;
00053
00054 int targetx;
00055 int targety;
00056 int targetw;
00057 int targeth;
00058
00059 }
00060 vgraph;
00061
00062
00063 vgraph *vgraph_new();
00064 vgraph *vgraph_hold( vgraph *self);
00065 void vgraph_release( vgraph *self);
00066
00067
00068 int vgraph_settarget( vgraph *self, liqimage *target );
00069 int vgraph_settarget_coord( vgraph *self, int x,int y, int w,int h );
00070 int vgraph_setwindow( vgraph *self, liqcell *window);
00071 int vgraph_setwindow_coord( vgraph *self, int x,int y, int w,int h );
00072 void vgraph_convert_target2window( vgraph *self, int tx,int ty, int *wx, int *wy);
00073 void vgraph_convert_window2target( vgraph *self, int wx,int wy, int *tx, int *ty);
00074 void vgraph_setcliprect( vgraph *self, liqcliprect *cliprect );
00075 liqcliprect *vgraph_getcliprect( vgraph *self);
00076
00077
00078
00079 int vgraph_setscaleaspectlock(vgraph *self,int newscaleaspectlock);
00080 int vgraph_getscaleaspectlock(vgraph *self);
00081
00082
00083 int vgraph_setbackcolor( vgraph *self, vcolor backcolor );
00084 int vgraph_setpencolor( vgraph *self, vcolor pencolor );
00085 int vgraph_setpenthick( vgraph *self, int penthick );
00086 int vgraph_setfont( vgraph *self, liqfont *font);
00087 int vgraph_drawclear( vgraph *self );
00088 int vgraph_drawpoint( vgraph *self, int x, int y );
00089 int vgraph_drawline( vgraph *self, int x, int y, int ex,int ey );
00090 int vgraph_drawbox( vgraph *self, int x, int y, int w,int h );
00091 int vgraph_drawrect( vgraph *self, int x, int y, int w,int h );
00092 int vgraph_drawcircle( vgraph *self, int x, int y, int radius );
00093 int vgraph_drawellipse( vgraph *self, int x, int y, int rx,int ry );
00094 int vgraph_drawtext( vgraph *self, int x, int y, char *text );
00095 int vgraph_drawsketch( vgraph *self, int x, int y, int w,int h , liqsketch *sketch );
00096 int vgraph_drawimage( vgraph *self, int x, int y, int w,int h , liqimage *image );
00097 int vgraph_drawcell( vgraph *self, int x, int y, int w,int h , liqcell *cell );
00098
00099
00100 int vgraph_pget( vgraph *self, int x, int y, unsigned char *grey,unsigned char *u,unsigned char *v);
00101
00102 #endif