Doxygen
Loading...
Searching...
No Matches
image.h
Go to the documentation of this file.
1/******************************************************************************
2 *
3 * Copyright (C) 1997-2022 by Dimitri van Heesch.
4 *
5 * Permission to use, copy, modify, and distribute this software and its
6 * documentation under the terms of the GNU General Public License is hereby
7 * granted. No representations are made about the suitability of this software
8 * for any purpose. It is provided "as is" without express or implied warranty.
9 * See the GNU General Public License for more details.
10 *
11 * Documents produced by Doxygen are derivative works derived from the
12 * input used in their production; they are not affected by this license.
13 *
14 */
15
16#ifndef IMAGE_H
17#define IMAGE_H
18
19#include <memory>
20#include <cstdint>
21#include "types.h"
22#include "qcstring.h"
23#include "construct.h"
24
25/** Class representing a bitmap image generated by doxygen. */
26class Image
27{
28 public:
29 Image(uint32_t w,uint32_t h);
32
33 void setPixel(uint32_t x,uint32_t y,uint8_t val);
34 uint8_t getPixel(uint32_t x,uint32_t y) const;
35 void writeChar(uint32_t x,uint32_t y,char c,uint8_t fg);
36 void writeString(uint32_t x,uint32_t y,const QCString &s,uint8_t fg);
37 void drawHorzLine(uint32_t y,uint32_t xs,uint32_t xe,uint8_t colIndex,uint32_t mask);
38 void drawHorzArrow(uint32_t y,uint32_t xs,uint32_t xe,uint8_t colIndex,uint32_t mask);
39 void drawVertLine(uint32_t x,uint32_t ys,uint32_t ye,uint8_t colIndex,uint32_t mask);
40 void drawVertArrow(uint32_t x,uint32_t ys,uint32_t ye,uint8_t colIndex,uint32_t mask);
41 void drawRect(uint32_t x,uint32_t y,uint32_t width,uint32_t height,uint8_t colIndex,uint32_t mask);
42 void fillRect(uint32_t x,uint32_t y,uint32_t width,uint32_t height,uint8_t colIndex,uint32_t mask);
43 bool save(const QCString &fileName);
44 friend uint32_t stringLength(const QCString &s);
45 uint32_t width() const;
46 uint32_t height() const;
47 static uint32_t stringLength(const QCString &s);
48
49 private:
50 struct Private;
51 std::unique_ptr<Private> p;
52};
53
54/** Class representing a bitmap image colored based on hue/sat/gamma settings. */
56{
57 public:
58 ColoredImage(uint32_t width,uint32_t height,
59 const uint8_t *greyLevels,const uint8_t *alphaLevels,
60 int saturation,int hue,int gamma);
63
64 bool save(const QCString &fileName);
65 static void hsl2rgb(double h,double s,double l,
66 double *pRed,double *pGreen,double *pBlue);
67 private:
68 struct Private;
69 std::unique_ptr<Private> p;
70};
71
72#endif
static void hsl2rgb(double h, double s, double l, double *pRed, double *pGreen, double *pBlue)
Definition image.cpp:368
ColoredImage(uint32_t width, uint32_t height, const uint8_t *greyLevels, const uint8_t *alphaLevels, int saturation, int hue, int gamma)
Definition image.cpp:432
std::unique_ptr< Private > p
Definition image.h:69
bool save(const QCString &fileName)
Definition image.cpp:460
void drawVertLine(uint32_t x, uint32_t ys, uint32_t ye, uint8_t colIndex, uint32_t mask)
Definition image.cpp:309
void setPixel(uint32_t x, uint32_t y, uint8_t val)
Definition image.cpp:213
std::unique_ptr< Private > p
Definition image.h:51
void drawHorzLine(uint32_t y, uint32_t xs, uint32_t xe, uint8_t colIndex, uint32_t mask)
Definition image.cpp:289
void drawVertArrow(uint32_t x, uint32_t ys, uint32_t ye, uint8_t colIndex, uint32_t mask)
Definition image.cpp:318
uint32_t width() const
Definition image.cpp:208
void fillRect(uint32_t x, uint32_t y, uint32_t width, uint32_t height, uint8_t colIndex, uint32_t mask)
Definition image.cpp:336
uint32_t height() const
Definition image.cpp:209
void drawHorzArrow(uint32_t y, uint32_t xs, uint32_t xe, uint8_t colIndex, uint32_t mask)
Definition image.cpp:299
void drawRect(uint32_t x, uint32_t y, uint32_t width, uint32_t height, uint8_t colIndex, uint32_t mask)
Definition image.cpp:328
void writeString(uint32_t x, uint32_t y, const QCString &s, uint8_t fg)
Definition image.cpp:263
bool save(const QCString &fileName)
Definition image.cpp:346
void writeChar(uint32_t x, uint32_t y, char c, uint8_t fg)
Definition image.cpp:223
uint8_t getPixel(uint32_t x, uint32_t y) const
Definition image.cpp:218
static uint32_t stringLength(const QCString &s)
friend uint32_t stringLength(const QCString &s)
Definition image.cpp:277
Image(uint32_t w, uint32_t h)
Definition image.cpp:174
This is an alternative implementation of QCString.
Definition qcstring.h:101
#define NON_COPYABLE(cls)
Macro to help implementing the rule of 5 for a non-copyable & movable class.
Definition construct.h:37
This file contains a number of basic enums and types.