00001 #ifndef COIN_SOOFFSCREENRENDERER_H
00002 #define COIN_SOOFFSCREENRENDERER_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include <Inventor/SbViewportRegion.h>
00028 #include <Inventor/SbColor.h>
00029 #include <Inventor/lists/SbList.h>
00030 #include <Inventor/SbString.h>
00031 #include <Inventor/SbName.h>
00032
00033 #include <stdio.h>
00034
00035 class SoBase;
00036 class SoGLRenderAction;
00037 class SoNode;
00038 class SoPath;
00039
00040
00041
00042
00043 class SoOffscreenRendererP;
00044
00045
00046 class COIN_DLL_API SoOffscreenRenderer {
00047 public:
00048 enum Components {
00049 LUMINANCE = 1,
00050 LUMINANCE_TRANSPARENCY = 2,
00051 RGB = 3,
00052 RGB_TRANSPARENCY = 4
00053 };
00054
00055 SoOffscreenRenderer(const SbViewportRegion & viewportregion);
00056 SoOffscreenRenderer(SoGLRenderAction * action);
00057 ~SoOffscreenRenderer();
00058
00059 static float getScreenPixelsPerInch(void);
00060 static SbVec2s getMaximumResolution(void);
00061 void setComponents(const Components components);
00062 Components getComponents(void) const;
00063 void setViewportRegion(const SbViewportRegion & region);
00064 const SbViewportRegion & getViewportRegion(void) const;
00065 void setBackgroundColor(const SbColor & color);
00066 const SbColor & getBackgroundColor(void) const;
00067 void setGLRenderAction(SoGLRenderAction * action);
00068 SoGLRenderAction * getGLRenderAction(void) const;
00069 SbBool render(SoNode * scene);
00070 SbBool render(SoPath * scene);
00071 unsigned char * getBuffer(void) const;
00072
00073 SbBool writeToRGB(FILE * fp) const;
00074 SbBool writeToPostScript(FILE * fp) const;
00075 SbBool writeToPostScript(FILE * fp, const SbVec2f & printsize) const;
00076
00077 SbBool writeToRGB(const char * filename) const;
00078 SbBool writeToPostScript(const char * filename) const;
00079 SbBool writeToPostScript(const char * filename, const SbVec2f & printsize) const;
00080
00081 SbBool isWriteSupported(const SbName & filetypeextension) const;
00082 int getNumWriteFiletypes(void) const;
00083 void getWriteFiletypeInfo(const int idx,
00084 SbList <SbName> & extlist,
00085 SbString & fullname,
00086 SbString & description);
00087 SbBool writeToFile(const SbString & filename, const SbName & filetypeextension) const;
00088
00089 private:
00090 friend class SoOffscreenRendererP;
00091 class SoOffscreenRendererP * pimpl;
00092 };
00093
00094 #endif // !COIN_SOOFFSCREENRENDERER_H