OpendTect  6.3
uirgbarray.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: B. Bril & H. Huck
8  Date: 08/09/06
9 ________________________________________________________________________
10 
11 -*/
12 
13 #include "uibasemod.h"
14 #include "odimage.h"
15 
16 mFDQtclass(QImage)
17 
18 
19 mExpClass(uiBase) uiRGBArray : public OD::RGBImage
20 { mODTextTranslationClass(uiRGBArray)
21 public:
22 
23  uiRGBArray(bool withalpha);
24  uiRGBArray(const OD::RGBImage&);
25  uiRGBArray(const char* filename);
26  virtual ~uiRGBArray();
27 
28  virtual Color get(int,int) const;
29  virtual bool set(int,int,const Color&);
30 
31  virtual unsigned char* getData();
32  virtual const unsigned char* getData() const;
33 
34  virtual char nrComponents() const { return withalpha_ ? 4 : 3; }
35  virtual int getSize(bool xdir) const;
36  virtual bool setSize(int,int);
37 
38  bool reSize(int,int);
39  void clear(const Color&);
40  void enableAlpha( bool yn ) { withalpha_ = yn; }
41 
42  bool save(const char* fnm,const char* fmt=0,
43  int quality=-1) const;
44 
45  const mQtclass(QImage&) qImage() const { return *qimg_; }
46  mQtclass(QImage&) qImage() { return *qimg_; }
47 
48 protected:
49 
50  mQtclass(QImage*) qimg_;
51  bool withalpha_;
52 
53 };
54 
55 
56 mExpClass(uiBase) uiRGBImageLoader : public OD::RGBImageLoader
58 public:
59 
60  static void initClass();
61 
62 private:
64  OD::RGBImage* loadImage(const char*,uiString&) const;
65 };
#define mExpClass(module)
Definition: commondefs.h:157
#define mQtclass(cls)
Definition: commondefs.h:232
#define mODTextTranslationClass(clss)
Definition: uistring.h:37
virtual void setSize(const uiSize &)
void clear(std::ios &)
void set(T &_to, const F &fr)
template based type conversion
Definition: convert.h:27
Definition: uistring.h:88
Definition: uirgbarray.h:56
#define mFDQtclass(cls)
Definition: commondefs.h:231
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
static void initClass()

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