From 4d64e4cd434426234a5c313c151cd79b6afc299e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juha=20Vehvil=C3=A4inen?= Date: Sat, 6 Jul 2002 17:50:18 +0000 Subject: *** empty log message *** svn path=/trunk/Framestein/; revision=27 --- Patches/vframe.h | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 Patches/vframe.h (limited to 'Patches/vframe.h') diff --git a/Patches/vframe.h b/Patches/vframe.h new file mode 100644 index 0000000..232b166 --- /dev/null +++ b/Patches/vframe.h @@ -0,0 +1,66 @@ +#ifndef __VFRAME_H +#define __VFRAME_H + +#include "plugin.h" + +struct vframeimage +{ + char bitsname[40]; // name of shared memory to image data + // use this, not f.bits! + _frame f; // image header, see Plugins\plugin.h +}; + +LPVOID openframedatabyid( int id, + HANDLE *hvf, HANDLE *hbits, + LPVOID *memvf, LPVOID *membits, + struct vframeimage **vfp ) +{ + char s[80]; + + if(*membits!=NULL) smfree(hbits, *membits); + if(*memvf!=NULL) smfree(hvf, *memvf); + + *membits=NULL; + + itoa(id, s, 10); + + *memvf = smopen(hvf, s); + if(*memvf!=NULL) + { + *vfp = *memvf; + + *membits = smopen(hbits, ((struct vframeimage *)*vfp)->bitsname); + if(*membits==NULL) + { + printf("membits open error.\n"); + smfree(hvf, *memvf); + } else { + } + } + return(*membits); +} + +float max16 = 2<<14; +float max32 = 2<<23; + +__inline float colortosample16(short c) +{ + return(c / max16); +} + +__inline float colortosample32(long c) +{ + return(c / max32); +} + +__inline short sampletocolor16(float s) +{ + return(s * max16); +} + +__inline long sampletocolor32(float s) +{ + return(s * max32); +} + +#endif -- cgit v1.2.1