Blame src/image.h

Packit 1c1d7e
/******************************************************************************
Packit 1c1d7e
 *
Packit 1c1d7e
 * 
Packit 1c1d7e
 *
Packit 1c1d7e
 *
Packit 1c1d7e
 * Copyright (C) 1997-2015 by Dimitri van Heesch.
Packit 1c1d7e
 *
Packit 1c1d7e
 * Permission to use, copy, modify, and distribute this software and its
Packit 1c1d7e
 * documentation under the terms of the GNU General Public License is hereby 
Packit 1c1d7e
 * granted. No representations are made about the suitability of this software 
Packit 1c1d7e
 * for any purpose. It is provided "as is" without express or implied warranty.
Packit 1c1d7e
 * See the GNU General Public License for more details.
Packit 1c1d7e
 *
Packit 1c1d7e
 * Documents produced by Doxygen are derivative works derived from the
Packit 1c1d7e
 * input used in their production; they are not affected by this license.
Packit 1c1d7e
 *
Packit 1c1d7e
 */
Packit 1c1d7e
Packit 1c1d7e
#ifndef _IMAGE_H
Packit 1c1d7e
#define _IMAGE_H
Packit 1c1d7e
#include <qglobal.h>
Packit 1c1d7e
Packit 1c1d7e
/** Class representing a bitmap image generated by doxygen. */
Packit 1c1d7e
class Image
Packit 1c1d7e
{
Packit 1c1d7e
  public:
Packit 1c1d7e
    Image(int w,int h);
Packit 1c1d7e
   ~Image();
Packit 1c1d7e
   
Packit 1c1d7e
    void setPixel(int x,int y,uchar val);
Packit 1c1d7e
    uchar getPixel(int x,int y) const;
Packit 1c1d7e
    void writeChar(int x,int y,char c,uchar fg);
Packit 1c1d7e
    void writeString(int x,int y,const char *s,uchar fg);
Packit 1c1d7e
    void drawHorzLine(int y,int xs,int xe,uchar colIndex,uint mask);
Packit 1c1d7e
    void drawHorzArrow(int y,int xs,int xe,uchar colIndex,uint mask);
Packit 1c1d7e
    void drawVertLine(int x,int ys,int ye,uchar colIndex,uint mask);
Packit 1c1d7e
    void drawVertArrow(int x,int ys,int ye,uchar colIndex,uint mask);
Packit 1c1d7e
    void drawRect(int x,int y,int width,int height,uchar colIndex,uint mask);
Packit 1c1d7e
    void fillRect(int x,int y,int width,int height,uchar colIndex,uint mask);
Packit 1c1d7e
    bool save(const char *fileName,int mode=0);
Packit 1c1d7e
    friend uint stringLength(const char *s);
Packit 1c1d7e
    uint getWidth() const { return width; }
Packit 1c1d7e
    uint getHeight() const { return height; }
Packit 1c1d7e
    uchar *getData() const { return data; }
Packit 1c1d7e
    static uint stringLength(const char *s);
Packit 1c1d7e
 
Packit 1c1d7e
  private:
Packit 1c1d7e
    int width;
Packit 1c1d7e
    int height;
Packit 1c1d7e
    uchar *data;
Packit 1c1d7e
};
Packit 1c1d7e
Packit 1c1d7e
/** Class representing a bitmap image colored based on hue/sat/gamma settings. */
Packit 1c1d7e
class ColoredImage
Packit 1c1d7e
{
Packit 1c1d7e
  public:
Packit 1c1d7e
    ColoredImage(int width,int height,
Packit 1c1d7e
           const uchar *greyLevels,const uchar *alphaLevels,
Packit 1c1d7e
           int saturation,int hue,int gamma);
Packit 1c1d7e
   ~ColoredImage();
Packit 1c1d7e
    bool save(const char *fileName);
Packit 1c1d7e
    static void hsl2rgb(double h,double s,double l,
Packit 1c1d7e
                        double *pRed,double *pGreen,double *pBlue);
Packit 1c1d7e
  private:
Packit 1c1d7e
    int m_width;
Packit 1c1d7e
    int m_height;
Packit 1c1d7e
    uchar *m_data;
Packit 1c1d7e
    bool m_hasAlpha;
Packit 1c1d7e
};
Packit 1c1d7e
Packit 1c1d7e
#endif