OpendTect-6_4  6.4
uirgbarray.h
Go to the documentation of this file.
1 #ifndef uirgbarray_h
2 #define uirgbarray_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: B. Bril & H. Huck
9  Date: 08/09/06
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "uibasemod.h"
16 #include "odimage.h"
17 
18 mFDQtclass(QImage)
19 
20 
21 mExpClass(uiBase) uiRGBArray : public OD::RGBImage
22 { mODTextTranslationClass(uiRGBArray)
23 public:
24 
25  uiRGBArray(bool withalpha);
26  uiRGBArray(const OD::RGBImage&);
27  uiRGBArray(const char* filename);
28  virtual ~uiRGBArray();
29 
30  virtual Color get(int,int) const;
31  virtual bool set(int,int,const Color&);
32 
33  virtual unsigned char* getData();
34  virtual const unsigned char* getData() const;
35 
36  virtual char nrComponents() const { return withalpha_ ? 4 : 3; }
37  virtual int getSize(bool xdir) const;
38  virtual bool setSize(int,int);
39 
40  bool reSize(int,int);
41  void clear(const Color&);
42  void enableAlpha( bool yn ) { withalpha_ = yn; }
43 
44  bool save(const char* fnm,const char* fmt=0,
45  int quality=-1) const;
46 
47  const mQtclass(QImage&) qImage() const { return *qimg_; }
48  mQtclass(QImage&) qImage() { return *qimg_; }
49 
50 protected:
51 
52  mQtclass(QImage*) qimg_;
53  bool withalpha_;
54 
55 };
56 
57 
58 mExpClass(uiBase) uiRGBImageLoader : public OD::RGBImageLoader
60 public:
61 
62  static void initClass();
63 
64 private:
66  OD::RGBImage* loadImage(const char*,uiString&) const;
67 };
68 
69 #endif
#define mExpClass(module)
Definition: commondefs.h:160
#define mQtclass(cls)
Definition: commondefs.h:229
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
virtual void setSize(const uiSize &)
void clear(std::ios &)
void set(T &_to, const F &fr)
template based type conversion
Definition: convert.h:29
Definition: uistring.h:89
Definition: uirgbarray.h:58
#define mFDQtclass(cls)
Definition: commondefs.h:228
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
static void initClass()

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