Blame src/image.h

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