image.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  *
4  *
5  *
6  * Copyright (C) 1997-2015 by Dimitri van Heesch.
7  *
8  * Permission to use, copy, modify, and distribute this software and its
9  * documentation under the terms of the GNU General Public License is hereby
10  * granted. No representations are made about the suitability of this software
11  * for any purpose. It is provided "as is" without express or implied warranty.
12  * See the GNU General Public License for more details.
13  *
14  * Documents produced by Doxygen are derivative works derived from the
15  * input used in their production; they are not affected by this license.
16  *
17  */
18 
19 #ifndef _IMAGE_H
20 #define _IMAGE_H
21 #include <qglobal.h>
22 
23 /** Class representing a bitmap image generated by doxygen. */
24 class Image
25 {
26  public:
27  Image(int w,int h);
28  ~Image();
29 
30  void setPixel(int x,int y,uchar val);
31  uchar getPixel(int x,int y) const;
32  void writeChar(int x,int y,char c,uchar fg);
33  void writeString(int x,int y,const char *s,uchar fg);
34  void drawHorzLine(int y,int xs,int xe,uchar colIndex,uint mask);
35  void drawHorzArrow(int y,int xs,int xe,uchar colIndex,uint mask);
36  void drawVertLine(int x,int ys,int ye,uchar colIndex,uint mask);
37  void drawVertArrow(int x,int ys,int ye,uchar colIndex,uint mask);
38  void drawRect(int x,int y,int width,int height,uchar colIndex,uint mask);
39  void fillRect(int x,int y,int width,int height,uchar colIndex,uint mask);
40  bool save(const char *fileName,int mode=0);
41  friend uint stringLength(const char *s);
42  uint getWidth() const { return width; }
43  uint getHeight() const { return height; }
44  uchar *getData() const { return data; }
45  static uint stringLength(const char *s);
46 
47  private:
48  int width;
49  int height;
51 };
52 
53 /** Class representing a bitmap image colored based on hue/sat/gamma settings. */
55 {
56  public:
57  ColoredImage(int width,int height,
58  const uchar *greyLevels,const uchar *alphaLevels,
59  int saturation,int hue,int gamma);
60  ~ColoredImage();
61  bool save(const char *fileName);
62  static void hsl2rgb(double h,double s,double l,
63  double *pRed,double *pGreen,double *pBlue);
64  private:
65  int m_width;
66  int m_height;
68  bool m_hasAlpha;
69 };
70 
71 #endif
uint getHeight() const
Definition: image.h:43
void writeChar(int x, int y, char c, uchar fg)
Definition: image.cpp:264
void fillRect(int x, int y, int width, int height, uchar colIndex, uint mask)
Definition: image.cpp:374
void setPixel(int x, int y, uchar val)
Definition: image.cpp:250
~Image()
Definition: image.cpp:245
int height
Definition: image.h:49
void drawHorzArrow(int y, int xs, int xe, uchar colIndex, uint mask)
Definition: image.cpp:335
void drawHorzLine(int y, int xs, int xe, uchar colIndex, uint mask)
Definition: image.cpp:325
friend uint stringLength(const char *s)
Definition: image.cpp:314
bool m_hasAlpha
Definition: image.h:68
int width
Definition: image.h:48
bool save(const char *fileName, int mode=0)
Definition: image.cpp:383
static QStrList * l
Definition: config.cpp:1044
unsigned char uchar
Definition: nybbler.cc:11
void writeString(int x, int y, const char *s, uchar fg)
Definition: image.cpp:301
fileName
Definition: dumpTree.py:9
void drawRect(int x, int y, int width, int height, uchar colIndex, uint mask)
Definition: image.cpp:366
uchar * data
Definition: image.h:50
double gamma(double KE, const simb::MCParticle *part)
uchar * m_data
Definition: image.h:67
Image(int w, int h)
Definition: image.cpp:210
void drawVertArrow(int x, int ys, int ye, uchar colIndex, uint mask)
Definition: image.cpp:355
uchar * getData() const
Definition: image.h:44
Definition: image.h:24
int m_width
Definition: image.h:65
void drawVertLine(int x, int ys, int ye, uchar colIndex, uint mask)
Definition: image.cpp:346
list x
Definition: train.py:276
uint getWidth() const
Definition: image.h:42
static constexpr double ys
Definition: Units.h:103
unsigned uint
Definition: qglobal.h:351
static QCString * s
Definition: config.cpp:1042
int m_height
Definition: image.h:66
uchar getPixel(int x, int y) const
Definition: image.cpp:256
void hsl2rgb(double h, double s, double l, double *pRed, double *pGreen, double *pBlue)
Definition: wizard.cpp:211