OpendTect  6.3
odimage.h
Go to the documentation of this file.
1 #pragma once
2 
3 /*+
4 ________________________________________________________________________
5 
6  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
7  Author: K. Tingdahl
8  Date: August 2010
9 ________________________________________________________________________
10 
11 -*/
12 
13 #include "basicmod.h"
14 
15 #include "color.h"
16 #include "ptrman.h"
17 #include "uistring.h"
18 
19 namespace OD
20 {
21 
27 {
28 public:
29  virtual ~RGBImage() {}
30 
31  virtual char nrComponents() const = 0;
36  virtual bool hasAlpha() const;
37  virtual bool setSize(int,int) = 0;
38  virtual int getSize(bool xdir) const = 0;
39  virtual Color get(int,int) const = 0;
40  virtual bool set(int,int,const Color&) = 0;
41  virtual void clear(const Color&) = 0;
42 
43  virtual int bufferSize() const;
44  virtual void fill(unsigned char*) const;
50  virtual bool put(const unsigned char*,bool xdir_slowest=true,
51  bool with_opacity=false);
56  virtual bool blendWith(const RGBImage& sourceimage,
57  bool blendtransparency = false,
58  unsigned char blendtransparencyval = 0,
59  bool blendequaltransparency = false,
60  bool with_opacity=false);
74  virtual bool putFromBitmap(const unsigned char* bitmap,
75  const unsigned char* mask = 0);
76 
77  virtual const unsigned char* getData() const { return 0; }
78  virtual unsigned char* getData() { return 0; }
79 };
80 
86 {
87 public:
88 
89  static RGBImage* loadRGBImage(const char* fnm,uiString& errmsg);
92 
93 private:
94 
95  virtual RGBImage* loadImage(const char*, uiString&) const = 0;
97 
98 public:
99 
100  static void setImageLoader(RGBImageLoader*);
103 
104  virtual ~RGBImageLoader();
105 
106 };
107 
108 }; // namespace OD
#define mExpClass(module)
Definition: commondefs.h:157
virtual unsigned char * getData()
Definition: odimage.h:78
void clear(std::ios &)
Definition: uistring.h:88
Definition: ptrman.h:115
Class To load image files, and return the image data in RGBImage object.
Definition: odimage.h:85
OpendTect.
Definition: commontypes.h:25
Color is an RGB color object, with a transparancy. The storage is in a 4-byte integer, similar to Qt.
Definition: color.h:24
Class for Red, Green, Blue image.
Definition: odimage.h:26
virtual const unsigned char * getData() const
Definition: odimage.h:77
virtual ~RGBImage()
Definition: odimage.h:29
static PtrMan< RGBImageLoader > imageloader_
Definition: odimage.h:96

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