26 #ifdef G4VIS_BUILD_OI_DRIVER
38 #include <Inventor/errors/SoDebugError.h>
39 #include <Inventor/elements/SoViewportRegionElement.h>
40 #include <Inventor/actions/SoGLRenderAction.h>
53 typedef unsigned char Uchar;
58 static int sWidth = 0;
59 static int sHeight = 0;
60 static float* sImage = 0;
61 static int getRGB(
unsigned int,
unsigned int,
double&,
double&,
double&);
82 SO_NODE_ADD_FIELD(fileName,(
"out.ps"));
122 SoGLRenderAction* aAction
129 if(!fEnabled)
return;
130 SbViewportRegion vpr = SoViewportRegionElement::get(aAction->getState());
131 const SbVec2s& win = vpr.getWindowSize();
135 SoDebugError::postInfo(
"SoImageWriter::GLRender",
"null area window !");
142 float* image =
new float[
s];
148 glReadPixels(x,y,w,h,GL_RGB,GL_FLOAT,image);
183 SoDebugError::postInfo(
"SoImageWriter::GLRender",
184 "can't open file \"%s\".",
fileName.getValue().getString());
339 float* pimag = sImage + 3 * (sWidth * (sHeight - 1 - aY) + aX);
340 aRed = *pimag;pimag++;
341 aGreen = *pimag;pimag++;
342 aBlue = *pimag;pimag++;
void clearColorBuffer(float, float, float)
void putImageInStream(unsigned int, unsigned int, GetRGB_Function)
typedef void(XMLCALL *XML_ElementDeclHandler)(void *userData
void openFileForWriting(const char *)
const G4ThreeVector const G4double const
virtual void GLRender(SoGLRenderAction *)
void setWindowSize(int, int)
void setBitsPerPixel(int)