[Prev][Next][Index][Thread]

Re: This is fun!



> 
> Made some changes to Scott's qcam.c, and I believe Scott will have a lot 
> of fun with people sending him patches to do various things.
> 
> PGM files don't have to be greyscaled to 255 levels, so that cuts out a 
> lot of multiplication...  just output 15 or 63 for greyscale levels.
> 

I tried it at first, and I had a lot of problems to I scaled it to 255, 
just to be safe.  It appears my problems were elsewhere in the code, so 
I'll change it back.  Thanks, you probably bumped the speed up a few 
more percent.

> Secondly... I cloned qc_writepgm() and made a qc_writepgm_p5, the 
> RAWBITS format of PGM.  xv seems to like the files so I'll post the 
> function here.  If anything, the disk space used by PGM files is cut by 
> quite a bit.
> 
> Heat of the hack... I feel good.  This is so much fun.  Makes the camera 
> useful again.
> 
> void qc_writepgm_p5(FILE *f,unsigned char *scan,int x, int y, int bpp)
[snip]

Ooh, *bad* timing :-).  I just finished changing my qc_writepgm routine 
so it always uses raw PGM, and as soon as I finish, yours shows up in 
my mailbox.  The reason I changed mine:  qc_writepgm was using 60% of 
the CPU time in the entire program.  This is after I discovered that 
usleep(1) takes over 1000 times as long as usleep(0) and fixed my 
timing loops.  I'll release a new version of my program later tonight 
that *should* be ~4 times as fast as the last version.  I hope to have 
a few more features as well, but I'll have to see what I can get done 
in the next hour or two.


Scott.


References: