Doxygen
image.h
浏览该文件的文档.
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 
22 #include "types.h"
23 #include "qcstring.h"
24 
25 /** Class representing a bitmap image generated by doxygen. */
26 class Image
27 {
28  public:
29  Image(uint w,uint h);
30  ~Image();
31 
32  void setPixel(uint x,uint y,uchar val);
33  uchar getPixel(uint x,uint y) const;
34  void writeChar(uint x,uint y,char c,uchar fg);
35  void writeString(uint x,uint y,const QCString &s,uchar fg);
36  void drawHorzLine(uint y,uint xs,uint xe,uchar colIndex,uint mask);
37  void drawHorzArrow(uint y,uint xs,uint xe,uchar colIndex,uint mask);
38  void drawVertLine(uint x,uint ys,uint ye,uchar colIndex,uint mask);
39  void drawVertArrow(uint x,uint ys,uint ye,uchar colIndex,uint mask);
40  void drawRect(uint x,uint y,uint width,uint height,uchar colIndex,uint mask);
41  void fillRect(uint x,uint y,uint width,uint height,uchar colIndex,uint mask);
42  bool save(const QCString &fileName,int mode=0);
43  friend uint stringLength(const QCString &s);
44  uint width() const { return m_width; }
45  uint height() const { return m_height; }
46  uchar *data() const { return m_data; }
47  static uint stringLength(const QCString &s);
48 
49  private:
50  uint m_width;
51  uint m_height;
52  uchar *m_data;
53 };
54 
55 /** Class representing a bitmap image colored based on hue/sat/gamma settings. */
57 {
58  public:
59  ColoredImage(uint width,uint height,
60  const uchar *greyLevels,const uchar *alphaLevels,
61  int saturation,int hue,int gamma);
63  bool save(const QCString &fileName);
64  static void hsl2rgb(double h,double s,double l,
65  double *pRed,double *pGreen,double *pBlue);
66  private:
70  bool m_hasAlpha;
71 };
72 
73 #endif
ColoredImage::ColoredImage
ColoredImage(uint width, uint height, const uchar *greyLevels, const uchar *alphaLevels, int saturation, int hue, int gamma)
Definition: image.cpp:476
ColoredImage::hsl2rgb
static void hsl2rgb(double h, double s, double l, double *pRed, double *pGreen, double *pBlue)
Definition: image.cpp:412
ColoredImage::m_width
uint m_width
Definition: image.h:67
Image::writeString
void writeString(uint x, uint y, const QCString &s, uchar fg)
Definition: image.cpp:300
Image::m_height
uint m_height
Definition: image.h:67
ColoredImage::m_height
uint m_height
Definition: image.h:68
types.h
This file contains a number of basic enums and types.
ColoredImage::~ColoredImage
~ColoredImage()
Definition: image.cpp:504
Image::drawRect
void drawRect(uint x, uint y, uint width, uint height, uchar colIndex, uint mask)
Definition: image.cpp:367
Image::stringLength
friend uint stringLength(const QCString &s)
Definition: image.cpp:314
Image::m_width
uint m_width
Definition: image.h:66
Image::drawVertLine
void drawVertLine(uint x, uint ys, uint ye, uchar colIndex, uint mask)
Definition: image.cpp:347
Image::fillRect
void fillRect(uint x, uint y, uint width, uint height, uchar colIndex, uint mask)
Definition: image.cpp:375
ColoredImage::m_hasAlpha
bool m_hasAlpha
Definition: image.h:70
Image::m_data
uchar * m_data
Definition: image.h:68
Image::~Image
~Image()
Definition: image.cpp:244
qcstring.h
Image::getPixel
uchar getPixel(uint x, uint y) const
Definition: image.cpp:255
uint
unsigned uint
Definition: qcstring.h:40
Image
Class representing a bitmap image generated by doxygen.
Definition: image.h:26
Image::height
uint height() const
Definition: image.h:61
uchar
unsigned char uchar
Definition: qcstring.h:38
Image::data
uchar * data() const
Definition: image.h:62
Image::save
bool save(const QCString &fileName, int mode=0)
Definition: image.cpp:384
Image::drawHorzLine
void drawHorzLine(uint y, uint xs, uint xe, uchar colIndex, uint mask)
Definition: image.cpp:326
Image::Image
Image(uint w, uint h)
Definition: image.cpp:209
Image::writeChar
void writeChar(uint x, uint y, char c, uchar fg)
Definition: image.cpp:263
ColoredImage::m_data
uchar * m_data
Definition: image.h:69
Image::drawVertArrow
void drawVertArrow(uint x, uint ys, uint ye, uchar colIndex, uint mask)
Definition: image.cpp:356
Image::width
uint width() const
Definition: image.h:60
ColoredImage
Class representing a bitmap image colored based on hue/sat/gamma settings.
Definition: image.h:56
ColoredImage::save
bool save(const QCString &fileName)
Definition: image.cpp:509
Image::drawHorzArrow
void drawHorzArrow(uint y, uint xs, uint xe, uchar colIndex, uint mask)
Definition: image.cpp:336
Image::setPixel
void setPixel(uint x, uint y, uchar val)
Definition: image.cpp:249
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108