OpendTect-6_4  6.4
odimage.h
Go to the documentation of this file.
1 #ifndef odimage_h
2 #define odimage_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: K. Tingdahl
9  Date: August 2010
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "basicmod.h"
16 
17 #include "color.h"
18 #include "ptrman.h"
19 #include "uistring.h"
20 
21 namespace OD
22 {
23 
29 {
30 public:
31  virtual ~RGBImage() {}
32 
33  virtual char nrComponents() const = 0;
38  virtual bool hasAlpha() const;
39  virtual bool setSize(int,int) = 0;
40  virtual int getSize(bool xdir) const = 0;
41  virtual Color get(int,int) const = 0;
42  virtual bool set(int,int,const Color&) = 0;
43  virtual void clear(const Color&) = 0;
44 
45  virtual int bufferSize() const;
46  virtual void fill(unsigned char*) const;
52  virtual bool put(const unsigned char*,bool xdir_slowest=true,
53  bool with_opacity=false);
58  virtual bool blendWith(const RGBImage& sourceimage,
59  bool blendtransparency = false,
60  unsigned char blendtransparencyval = 0,
61  bool blendequaltransparency = false,
62  bool with_opacity=false);
76  virtual bool putFromBitmap(const unsigned char* bitmap,
77  const unsigned char* mask = 0);
78 
79  virtual const unsigned char* getData() const { return 0; }
80  virtual unsigned char* getData() { return 0; }
81 };
82 
88 {
89 public:
90 
91  static RGBImage* loadRGBImage(const char* fnm,uiString& errmsg);
94 
95 private:
96 
97  virtual RGBImage* loadImage(const char*, uiString&) const = 0;
99 
100 public:
101 
102  static void setImageLoader(RGBImageLoader*);
105 
106  virtual ~RGBImageLoader();
107 
108 };
109 
110 }; // namespace OD
111 
112 #endif
#define mExpClass(module)
Definition: commondefs.h:160
virtual unsigned char * getData()
Definition: odimage.h:80
void clear(std::ios &)
Definition: uistring.h:89
Definition: ptrman.h:79
Class To load image files, and return the image data in RGBImage object.
Definition: odimage.h:87
OpendTect.
Definition: commontypes.h:29
Color is an RGB color object, with a transparancy. The storage is in a 4-byte integer, similar to Qt.
Definition: color.h:26
Class for Red, Green, Blue image.
Definition: odimage.h:28
virtual const unsigned char * getData() const
Definition: odimage.h:79
virtual ~RGBImage()
Definition: odimage.h:31
static PtrMan< RGBImageLoader > imageloader_
Definition: odimage.h:98

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019