📄 render_do.c.svn-base
字号:
switch (data_p->ins_type) { case INS_MC: // printf("MC "); break; case INS_BTN: // printf("BTN "); break; case INS_DTX: case INS_STX: { struct RGBA tcolor; struct Matrix cmat; struct Matrix tmat; struct Matrix *cmat1; int ti; struct RECT bb; struct DefineText text; struct DefineText *text1; struct TextRecord *trecord; text1 = NULL; trecord = NULL; text1=((stx_ins_t*)data_p)->text_p; cmat1=&cmat; transformBoundingBox(&bb,gd.adjust,&(data_p->boundary), 1); bb.Xmin = bb.Xmin >> FRAC_BITS; bb.Ymin = bb.Ymin >> FRAC_BITS; bb.Xmax = (bb.Xmax + FRAC - 1) >> FRAC_BITS; bb.Ymax = (bb.Ymax + FRAC - 1) >> FRAC_BITS; idrect.Xmin=bb.Xmin; idrect.Ymin=bb.Ymin; idrect.Xmax=bb.Xmax; idrect.Ymax=bb.Ymax; if((data_p->pic_dirty)|| gmaskflag) { struct DefineShape cshape; int y; struct spin *s; unsigned long *p; save=1; if((data_p->pic_p)) { free(data_p->pic_p->sp); data_p->pic_p->sp=0; free(data_p->pic_p->pp); data_p->pic_p->pp=0; free(data_p->pic_p); data_p->pic_p=0; } if(!gmaskflag) { s=malloc((bb.Ymax-bb.Ymin+1)*sizeof(struct spin)); p=malloc((bb.Ymax-bb.Ymin+1)*(bb.Xmax-bb.Xmin+1)*sizeof(unsigned long)); bzero(s,(bb.Ymax-bb.Ymin+1)*sizeof(struct spin)); bzero(p,(bb.Ymax-bb.Ymin+1)*(bb.Xmax-bb.Xmin+1)*sizeof(unsigned long)); struct savearea *sa=malloc(sizeof(struct savearea)); sa->sp=s; sa->pp=p; sa->fillflag=0; sa->bound.Xmin=bb.Xmin; sa->bound.Ymin=bb.Ymin; sa->bound.Xmax=bb.Xmax; sa->bound.Ymax=bb.Ymax; idrect.Xmin=bb.Xmin; idrect.Ymin=bb.Ymin; idrect.Xmax=bb.Xmax; idrect.Ymax=bb.Ymax; //printf("idrect1 xmin is %ld ymin is %ld xmax is %ld ymax is %ld\n",idrect.Xmin,idrect.Ymin,idrect.Xmax,idrect.Ymax); data_p->pic_p=sa; currentpic=sa; for(y=idrect.Ymin;y<=idrect.Ymax;y++) { currentpic->sp[y-idrect.Ymin].x1=0; currentpic->sp[y-idrect.Ymin].x2=idrect.Xmax-idrect.Xmin; } } if(text1->TextRecordsP) trecord=(text1->TextRecordsP); tmat=MatrixMulti(&(text1->TextMatrix),&(data_p->ab_matrix)); while(trecord) { if(trecord->Flags&0x04) tcolor=trecord->TextColor; for(ti=0;ti<(trecord->GlyphCount);ti=ti+1) { if(trecord->GlyphEntries[ti].Shape.ShapeRecordsP==NULL) continue; // printf("-----------------------------record is NULL------------------\n"); cmat = MatrixMulti(&tmat ,&(trecord->GlyphEntries[ti].GlyphMatrix)); shapedef.getStyles = 0; if (cxformflag==2) { if(!(trecord->Flags&0x04)) setForegroundColor(&gd,getColor(cxf1,tcolor)); else setForegroundColor(&gd,getColor(cxf1,trecord->TextColor)); //setForegroundColor(gd,getColor(cxf1,trecord->TextColor)); } else { if(!(trecord->Flags&0x04)) setForegroundColor(&gd,tcolor); else setForegroundColor(&gd,trecord->TextColor); } shapeexecute(&gd,&(trecord->GlyphEntries[ti].Shape),cmat1,(cxformflag==1?&cxf:0)); // shapeexecute(&gd,&(trecord->GlyphEntries[ti].Shape),cmat1,0); } trecord=trecord->NextP; } if(!gmaskflag) docopy(&gd,node_p); //data_p->pic_p=0; currentpic=0; data_p->pic_dirty=0; save=0; } else { docopy(&gd,node_p); } //printf("to static text\n"); } // printf("STX "); break; case INS_MRH: { // printf("to morphing shape..................................................\n"); struct DefineShape mshape; struct RECT bb; mshape=*(((mrp_ins_t *)(data_p))->shape_p); //shapeexecute(&gd,&mshape,&(data_p->ab_matrix),0); transformBoundingBox(&bb, gd.adjust, &(data_p->boundary), 1); bb.Xmin = bb.Xmin >> FRAC_BITS; bb.Ymin = bb.Ymin >> FRAC_BITS; bb.Xmax = (bb.Xmax + FRAC - 1) >> FRAC_BITS; bb.Ymax = (bb.Ymax + FRAC - 1) >> FRAC_BITS; idrect.Xmin=bb.Xmin; idrect.Ymin=bb.Ymin; idrect.Xmax=bb.Xmax; idrect.Ymax=bb.Ymax; // if(data_p->pic_dirty) // printf("pic is dirty...................\n"); // else // printf("pic is not dirty .....................\n"); if((data_p->pic_dirty)|| gmaskflag) { // printf("to shape\n"); int y; // struct DefineShape cshape; struct spin *s; unsigned short *p; save=1; if((data_p->pic_p)) { free(data_p->pic_p->sp); free(data_p->pic_p->pp); free(data_p->pic_p); data_p->pic_p=0; } if(!gmaskflag) { //printf("to again draw node\n"); s=malloc((bb.Ymax-bb.Ymin+1)*sizeof(struct spin)); // printf("long is %ld\n",(bb.Ymax-bb.Ymin+2)*(bb.Xmax-bb.Xmin+1)*sizeof(unsigned long)); p=malloc((bb.Ymax-bb.Ymin+1)*(bb.Xmax-bb.Xmin+1)*sizeof(unsigned long)); //printf("to again draw node11\n"); bzero(s,(bb.Ymax-bb.Ymin+1)*sizeof(struct spin)); bzero(p,(bb.Ymax-bb.Ymin+1)*(bb.Xmax-bb.Xmin+1)*sizeof(unsigned long)); struct savearea *sa=malloc(sizeof(struct savearea)); sa->sp=s; sa->pp=p; sa->fillflag=0; sa->bound.Xmin=bb.Xmin; sa->bound.Ymin=bb.Ymin; sa->bound.Xmax=bb.Xmax; //printf("xmax is %ld\n",sa->bound.Xmax); //printf("point is %p",&(sa->bound)); sa->bound.Ymax=bb.Ymax; idrect.Xmin=bb.Xmin; idrect.Ymin=bb.Ymin; idrect.Xmax=bb.Xmax; idrect.Ymax=bb.Ymax; //printf("idrect begin xmin is %ld ymin is %ld xmax is %ld ymax is %ld\n",idrect.Xmin,idrect.Ymin,idrect.Xmax,idrect.Ymax); //printf("cliprect2 xmin is %ld ymin is %ld xmax is %ld ymax is %ld\n",gd.clip_rect.Xmin,gd.clip_rect.Ymin,gd.clip_rect.Xmax,gd.clip_rect.Ymax); data_p->pic_p=sa; currentpic=sa; for(y=idrect.Ymin;y<=idrect.Ymax;y++) { currentpic->sp[y-idrect.Ymin].x1=0; currentpic->sp[y-idrect.Ymin].x2=idrect.Xmax-idrect.Xmin; } } // drawbox(gd); // cshape=*((struct DefineShape *)(data_p->define_p)); shapedef.getStyles = 1; //printf("before draw\n"); shapeexecute(&gd,&mshape,&(data_p->ab_matrix),(cxformflag==1?&cxf:0)); //printf("after draw\n"); if(!gmaskflag) docopy(&gd,node_p); currentpic=0; data_p->pic_dirty=0; save=0; } else { docopy(&gd,node_p); } /*struct DefineShape mshape; mshape=*(((mrp_ins_t *)(data_p))->shape_p); shapeexecute(&gd,&mshape,&(data_p->ab_matrix),0);*/ } break; case INS_SHP: { struct RECT bb; transformBoundingBox(&bb, gd.adjust, &(data_p->boundary), 1); bb.Xmin = bb.Xmin >> FRAC_BITS; bb.Ymin = bb.Ymin >> FRAC_BITS; bb.Xmax = (bb.Xmax + FRAC - 1) >> FRAC_BITS; bb.Ymax = (bb.Ymax + FRAC - 1) >> FRAC_BITS; idrect.Xmin=bb.Xmin; idrect.Ymin=bb.Ymin; idrect.Xmax=bb.Xmax; idrect.Ymax=bb.Ymax; //printf("bb xmin is %ld ymin is %ld xmax is %ld ymax is %ld\n",bb.Xmin,bb.Ymin,bb.Xmax,bb.Ymax); if((data_p->pic_dirty)|| gmaskflag) { // printf("to shape\n"); int y; struct DefineShape cshape; struct spin *s; unsigned short *p; save=1; if((data_p->pic_p)) { free(data_p->pic_p->sp); free(data_p->pic_p->pp); free(data_p->pic_p); data_p->pic_p=0; } if(gmaskflag) printf("mask character id is %ld\n",def_p->CharacterID); //printf("to again draw node\n"); if(!gmaskflag) { // printf("to new malloc\n"); s=malloc((bb.Ymax-bb.Ymin+1)*sizeof(struct spin)); // printf("long is %ld\n",(bb.Ymax-bb.Ymin+2)*(bb.Xmax-bb.Xmin+1)*sizeof(unsigned long)); p=malloc((bb.Ymax-bb.Ymin+1)*(bb.Xmax-bb.Xmin+1)*sizeof(unsigned long)); //printf("to again draw node11\n"); bzero(s,(bb.Ymax-bb.Ymin+1)*sizeof(struct spin)); bzero(p,(bb.Ymax-bb.Ymin+1)*(bb.Xmax-bb.Xmin+1)*sizeof(unsigned long)); struct savearea *sa=malloc(sizeof(struct savearea)); sa->sp=s; sa->pp=p; // printf("malloc pp is %p\n",sa->pp); sa->fillflag=0; sa->bound.Xmin=bb.Xmin; sa->bound.Ymin=bb.Ymin; sa->bound.Xmax=bb.Xmax; sa->bound.Ymax=bb.Ymax; idrect.Xmin=bb.Xmin; idrect.Ymin=bb.Ymin; idrect.Xmax=bb.Xmax; idrect.Ymax=bb.Ymax; //printf("idrect begin xmin is %ld ymin is %ld xmax is %ld ymax is %ld\n",idrect.Xmin,idrect.Ymin,idrect.Xmax,idrect.Ymax); //printf("cliprect2 xmin is %ld ymin is %ld xmax is %ld ymax is %ld\n",gd.clip_rect.Xmin,gd.clip_rect.Ymin,gd.clip_rect.Xmax,gd.clip_rect.Ymax); data_p->pic_p=sa; currentpic=sa; for(y=idrect.Ymin;y<=idrect.Ymax;y++) { currentpic->sp[y-idrect.Ymin].x1=0; currentpic->sp[y-idrect.Ymin].x2=idrect.Xmax-idrect.Xmin; } } // drawbox(gd); cshape=*((struct DefineShape *)(data_p->define_p)); shapedef.getStyles = 1; /* if(def_p->CharacterID==1||def_p->CharacterID==2||def_p->CharacterID==4) { if(cxformflag==1) printf("cxform is true true true...........................................\n"); } printf("rm is %f ",cxf.RedMultTerm); printf("gm is %f ",cxf.GreenMultTerm); printf("bm is %f ",cxf.BlueMultTerm); printf("am is %f ",cxf.AlphaMultTerm); printf("ra is %ld ",cxf.RedAddTerm); printf("ga is %ld ",cxf.GreenAddTerm); printf("ba is %ld ",cxf.BlueAddTerm); printf("aa is %ld \n",cxf.AlphaAddTerm); */ //printf("before draw\n"); shapeexecute(&gd,&cshape,&(data_p->ab_matrix),(cxformflag==1?&cxf:0)); //printf("after draw\n"); if(!gmaskflag) docopy(&gd,node_p); currentpic=0; data_p->pic_dirty=0; save=0; } else { docopy(&gd,node_p); } } break; }; }};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -