H3D API  2.4.1
FreeImageLoader.h
Go to the documentation of this file.
1 // Copyright 2004-2019, SenseGraphics AB
3 //
4 // This file is part of H3D API.
5 //
6 // H3D API is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
10 //
11 // H3D API is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with H3D API; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 //
20 // A commercial license is also available. Please contact us at
21 // www.sensegraphics.com for more information.
22 //
23 //
28 //
30 #ifndef __FREEIMAGELOADER_H__
31 #define __FREEIMAGELOADER_H__
32 
33 #include <H3D/H3DImageLoaderNode.h>
34 
35 #ifdef HAVE_FREEIMAGE
36 
38 
39 namespace H3D {
51  class H3DAPI_API FreeImageLoader : public H3DImageLoaderNode {
52  public:
55  type_name = "FreeImageLoader";
56  }
57 
61  virtual Image *loadImage( const string &url ) {
62  return H3DUtil::loadFreeImage( url );
63  }
64 
72  virtual Image *loadImage( istream &is ) {
73  return H3DUtil::loadFreeImage( is );
74  }
75 
78  static bool supportsFileType( const string &url );
79 
82  static bool supportsStreamType( istream &is );
83 
84  static H3DNodeDatabase database;
85 
88  };
89 }
90 
91 #endif // HAVE_FREEIMAGE
92 #endif
Header file for H3DImageLoaderNode, the abstract base class for all image loaders nodes for different...
FreeImageLoader uses the FreeImage library to load the images.
Definition: FreeImageLoader.h:51
virtual Image * loadImage(const string &url)
Load the image using the FreeImage library.
Definition: FreeImageLoader.h:61
static FileReaderRegistration reader_registration
Register this node to the H3DSoundFileNodes available.
Definition: FreeImageLoader.h:87
FreeImageLoader()
Constructor.
Definition: FreeImageLoader.h:54
virtual Image * loadImage(istream &is)
Load an image from an istream.
Definition: FreeImageLoader.h:72
H3DImageLoaderNode is a virtual base class for classes that read an image file format such as PNG or ...
Definition: H3DImageLoaderNode.h:48
H3DUTIL_API Image * loadFreeImage(const std::string &url)
H3D API namespace.
Definition: Anchor.h:38
Class used to register a class to the registered file readers.
Definition: H3DImageLoaderNode.h:62
The H3DNodeDatabase contains a mapping between a name of a Node and the constructor for the Node with...
Definition: H3DNodeDatabase.h:194