[Mplayer-cvslog] CVS: main/libvo font_load.c,1.2,1.3 font_load.h,1.2,1.3
GEREOFFY
arpi_esp at users.sourceforge.net
Sun Mar 25 22:37:24 CEST 2001
Update of /cvsroot/mplayer/main/libvo
In directory usw-pr-cvs1:/tmp/cvs-serv23050
Modified Files:
font_load.c font_load.h
Log Message:
font alpha resampling, see -ffactor
Index: font_load.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/font_load.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** font_load.c 2001/03/25 19:10:52 1.2
--- font_load.c 2001/03/25 20:37:22 1.3
***************
*** 33,37 ****
}
! font_desc_t* read_font_desc(char* fname){
unsigned char sor[1024];
unsigned char sor2[1024];
--- 33,37 ----
}
! font_desc_t* read_font_desc(char* fname,float factor){
unsigned char sor[1024];
unsigned char sor2[1024];
***************
*** 174,177 ****
--- 174,196 ----
printf("font: Missing bitmap(s) for sub-font #%d\n",i);
return NULL;
+ }
+ if(factor!=1.0f){
+ // re-sample alpha
+ int f=factor*256.0f;
+ int size=desc->pic_a[i]->w*desc->pic_a[i]->h;
+ int j;
+ printf("font: resampling alpha by factor %5.3f (%d) ",factor,f);fflush(stdout);
+ for(j=0;j<size;j++){
+ int x=desc->pic_a[i]->bmp[j];
+ int y=desc->pic_b[i]->bmp[j];
+
+ x=((x*f*(255-y))>>16)+y;
+ //x=(x*f)>>8;if(x<y) x=y;
+
+ if(x<0) x=0; else
+ if(x>255) x=255;
+ desc->pic_a[i]->bmp[j]=x;
+ }
+ printf("DONE!\n");
}
if(!desc->height) desc->height=desc->pic_a[i]->h;
Index: font_load.h
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/font_load.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** font_load.h 2001/03/25 19:10:52 1.2
--- font_load.h 2001/03/25 20:37:22 1.3
***************
*** 21,23 ****
raw_file* load_raw(char *name);
! font_desc_t* read_font_desc(char* fname);
--- 21,23 ----
raw_file* load_raw(char *name);
! font_desc_t* read_font_desc(char* fname,float factor);
_______________________________________________
Mplayer-cvslog mailing list
Mplayer-cvslog at lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-cvslog
More information about the MPlayer-cvslog
mailing list