29 #ifndef __IMAGETEXTURE_H__
30 #define __IMAGETEXTURE_H__
91 Types< MFString, MFImageLoader > > {
95 virtual void update();
101 const vector< string > &urls,
107 vector< string > urls;
114 CBData():texture(NULL), image(NULL){}
131 static void *loadImageThreadFunc(
void * );
138 Inst< SFNode > _metadata = 0,
139 Inst< MFString > _url = 0,
140 Inst< SFBool > _repeatS = 0,
141 Inst< SFBool > _repeatT = 0,
142 Inst< SFBool > _scaleToP2 = 0,
143 Inst< SFImage > _image = 0,
144 Inst< MFImageLoader > _imageLoader = 0,
145 Inst< SFTextureProperties > _textureProperties = 0,
146 Inst< SFString > _loadInThread = 0,
147 Inst< SFBool > _canShare = 0 );
152 virtual void render();
156 virtual void postRender();
160 virtual void preRender();
164 virtual void enableTexturing();
168 virtual void disableTexturing();
172 virtual GLuint getTextureId();
176 virtual GLuint getTextureUnit();
180 virtual GLenum getTextureTarget();
184 virtual int getTextureWidth();
188 virtual int getTextureHeight();
192 virtual int getTextureDepth();
197 virtual void setTextureId( GLuint
id );
200 virtual void setTextureUnit( GLint unit );
203 virtual void setTextureTarget( GLenum target );
207 virtual void setTextureWidth(
int _width );
211 virtual void setTextureHeight(
int _height );
215 virtual void setTextureDepth(
int _depth );
219 virtual bool makeResident ();
223 virtual void makeNonResident ();
227 virtual bool isResident ();
231 virtual GLuint64 getTextureHandle();
235 virtual void invalidateTextureHandle ();
239 virtual void inUse ();
242 virtual Image* renderToImage (
H3DInt32 _width,
H3DInt32 _height,
bool output_float_texture =
false );
248 virtual std::pair<H3DInt32,H3DInt32> getDefaultSaveDimensions ();
253 virtual GLint glInternalFormat(
Image *i );
295 void removeSharedImage ();
298 bool addSharedImage ( std::vector < std::string > _urls );
301 bool texturePropertiesMatching(
const ImageTexture* wrapped_image );
320 typedef std::map < std::vector < std::string >,
SharedImage > ImageDatabase;
Header file for H3DImageLoaderNode, the abstract base class for all image loaders nodes for different...
Contains the MFNode class.
Header file for X3DTexture2DNode, X3D scene-graph node.
Header file for X3DUrlObject, X3D scene-graph node.
CouldNotLoadImage is thrown when not any of the urls could be read with any of the image loaders in a...
Definition: ImageTexture.h:63
SFImage is overridden to update the value from the url and imageLoader fields of the ImageTexture.
Definition: ImageTexture.h:91
CBData cb_data
data used for the callback function.
Definition: ImageTexture.h:123
ThreadFuncData thread_data
data used for the thread function
Definition: ImageTexture.h:120
The ImageTexture node defines a texture map by specifying an image file and general parameters for ma...
Definition: ImageTexture.h:58
H3DUniquePtr< MFImageLoader > imageLoader
The ImageLoader nodes to use to read the image files.
Definition: ImageTexture.h:261
H3DUniquePtr< SFBool > canShare
Share image data for URLs that are the same.
Definition: ImageTexture.h:284
H3DUniquePtr< H3DUtil::SimpleThread > load_thread
The thread used for downloading images when load_images_in_separate_thread is true.
Definition: ImageTexture.h:305
static ImageDatabase image_database
The shared texture database.
Definition: ImageTexture.h:323
static H3DNodeDatabase database
The H3DNodeDatabase for this node.
Definition: ImageTexture.h:287
H3DUniquePtr< SFString > loadInThread
Specifies the thread to use to load the image texture.
Definition: ImageTexture.h:274
ImageTexture * wrapped_image
Pointer to the shared texture currently in use, or NULL.
Definition: ImageTexture.h:316
TypedMFNode< H3DImageLoaderNode > MFImageLoader
A MFNode containing ImageLoader.
Definition: ImageTexture.h:66
CallbackCode
Return code for callback functions.
Definition: Scene.h:228
A template modifier class for adding type checking on the routes to any Field class.
Definition: TypedField.h:84
Template to make sure that the Nodes that are added to a MFNode are of a specified Node type.
Definition: MFNode.h:221
This abstract node type is the base type for all node types which specify 2D sources for texture imag...
Definition: X3DTexture2DNode.h:46
This abstract interface is inherited by all nodes that contain data located on the World Wide Web,...
Definition: X3DUrlObject.h:51
H3D_API_EXCEPTION(Vec2dNormalizeError)
H3D API namespace.
Definition: Anchor.h:38
The H3DNodeDatabase contains a mapping between a name of a Node and the constructor for the Node with...
Definition: H3DNodeDatabase.h:194
struct for storing input needed for the callback function.
Definition: ImageTexture.h:113
struct for storing input needed to the thread function
Definition: ImageTexture.h:105
A shared texture.
Definition: ImageTexture.h:308
int use_count
Number of images referencing this shared texture.
Definition: ImageTexture.h:312