aboutsummaryrefslogtreecommitdiff
path: root/dep/g3dlite/include/G3D/Image4.h
diff options
context:
space:
mode:
Diffstat (limited to 'dep/g3dlite/include/G3D/Image4.h')
-rw-r--r--dep/g3dlite/include/G3D/Image4.h46
1 files changed, 20 insertions, 26 deletions
diff --git a/dep/g3dlite/include/G3D/Image4.h b/dep/g3dlite/include/G3D/Image4.h
index 21d7f1e79b1..95e96d484ce 100644
--- a/dep/g3dlite/include/G3D/Image4.h
+++ b/dep/g3dlite/include/G3D/Image4.h
@@ -1,24 +1,23 @@
/**
- @file Image4.h
+ \file G3D/Image4.h
- @maintainer Morgan McGuire, http://graphics.cs.williams.edu
+ \maintainer Morgan McGuire, http://graphics.cs.williams.edu
- @created 2007-01-31
- @edited 2007-01-31
+ \created 2007-01-31
+ \edited 2011-08-11
*/
-#ifndef G3D_IMAGE4_H
-#define G3D_IMAGE4_H
+#ifndef G3D_Image4_h
+#define G3D_Image4_h
#include "G3D/platform.h"
#include "G3D/Map2D.h"
#include "G3D/Color4.h"
-#include "G3D/GImage.h"
namespace G3D {
-typedef ReferenceCountedPointer<class Image4> Image4Ref;
+typedef shared_ptr<class Image4> Image4Ref;
/**
RGBA image with 32-bit floating point storage for each channel.
@@ -26,30 +25,27 @@ typedef ReferenceCountedPointer<class Image4> Image4Ref;
Whenever a method needs to convert from RGB to RGBA, A=1 is assumed.
Bilinear interpolation on Image4 is about 8x faster than on
- Image4uint8 due to the large cost of converting int->float on modern
+ Image4unorm8 due to the large cost of converting int->float on modern
machines.
- @sa G3D::Image4uint8, G3D::GImage.
+ @sa G3D::Image4unorm8, G3D::GImage.
*/
class Image4 : public Map2D<Color4, Color4> {
public:
typedef Image4 Type;
- typedef ReferenceCountedPointer<class Image4> Ref;
- typedef Color4 Storage;
- typedef Color4 Compute;
+ typedef shared_ptr<class Image4> Ref;
protected:
Image4(int w, int h, WrapMode wrap);
- void copyGImage(const class GImage& im);
void copyArray(const Color1* src, int w, int h);
void copyArray(const Color3* src, int w, int h);
void copyArray(const Color4* src, int w, int h);
- void copyArray(const Color1uint8* src, int w, int h);
- void copyArray(const Color3uint8* src, int w, int h);
- void copyArray(const Color4uint8* src, int w, int h);
+ void copyArray(const Color1unorm8* src, int w, int h);
+ void copyArray(const Color3unorm8* src, int w, int h);
+ void copyArray(const Color4unorm8* src, int w, int h);
public:
@@ -61,24 +57,22 @@ public:
/** Creates a 0 x 0 image. */
static Ref createEmpty(WrapMode wrap = WrapMode::ERROR);
- static Ref fromFile(const std::string& filename, WrapMode wrap = WrapMode::ERROR, GImage::Format fmt = GImage::AUTODETECT);
+ static Ref fromFile(const std::string& filename, WrapMode wrap = WrapMode::ERROR);
- static Ref fromArray(const class Color1uint8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR);
- static Ref fromArray(const class Color3uint8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR);
- static Ref fromArray(const class Color4uint8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR);
+ static Ref fromArray(const class Color1unorm8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR);
+ static Ref fromArray(const class Color3unorm8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR);
+ static Ref fromArray(const class Color4unorm8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR);
static Ref fromArray(const class Color1* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR);
static Ref fromArray(const class Color3* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR);
static Ref fromArray(const class Color4* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR);
- static Ref fromImage4uint8(const ReferenceCountedPointer<class Image4uint8>& im);
-
- static Ref fromGImage(const class GImage& im, WrapMode wrap = WrapMode::ERROR);
+ static Ref fromImage4unorm8(const shared_ptr<class Image4unorm8>& im);
/** Loads from any of the file formats supported by G3D::GImage. */
- void load(const std::string& filename, GImage::Format fmt = GImage::AUTODETECT);
+ void load(const std::string& filename);
/** Saves in any of the formats supported by G3D::GImage. */
- void save(const std::string& filename, GImage::Format fmt = GImage::AUTODETECT);
+ void save(const std::string& filename);
};
} // G3D