#ifndef SVEXTRA_H #define SVEXTRA_H // James Davis - jedavis@cs.stanford.edu // Additions to the simple video library in // /usr/people/4Dgifts/examples/dmedia/video/simplevideo // Note that we need the svPriv.h private header file // Also note that the default headers sgi ships arent // C++ smart, so you'll have to add the extern "C" junk to // them yourself. Ive done that locally in /usr/common/lib // #include #include #include #include // ------ // svGetFrame() doesnt set the width and height correctly when we've been // messing around with the capture size. This call will fix these fields // based on the current camera settings. Uses svGetCaptureSize() void svFixImageSize(svImage *img); // ------ // Just rolls svGetFrame() and svFixImageSize() into one function void svBetterGetFrame(svImage *img); // ------ // Get the current frame capture size settings. If you call just before // or after getting a frame, one would expect it to do the right thing. void svGetCaptureSize(int *x, int *y); // ------ // Set the frame size you wish to capture. My indycam defaulted to 640x480 // This routine calls svGetFrame() once to make sure some things in // sv are inited properly. It also sets the zoom factor to 1/2 if you // make the frame smaller than 320x240. void svSetCaptureSize(int xsize, int ysize); // ------ // You can use this to avoid the zooming in svSetCaptureSize() void svSetCaptureSizeNoZoom(int x, int y); // ------ // This sets the zoom size on the capture. Ive found only (1,1) and // (1,2) to be meaningful, but didnt test exhaustively. (1,2) shinks // everything into a 320x240 window. You shouldnt need to use this, // since svSetCaptureSize calls it for you when relevant. // At some point I found that using svFrameCount(1) helped make // something work, but all seems fine without it now. void svSetCaptureZoom(int numerator, int denominator); // ------ // View the image in an old window, rather than creating a new window // like svViewImage() int svViewImageInWindow(svImage *image, long win); #endif