/usr/include/scribus/scpainterex_ps2.h is in scribus-dev 1.4.6+dfsg-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 | /*
For general Scribus (>=1.3.2) copyright and licensing information please refer
to the COPYING file provided with the program. Following this notice may exist
a copyright and/or license notice that predates the release of Scribus 1.3.2
for which a new license (GPL+exception) is in place.
*/
/* This file is part of the KDE project
Copyright (C) 2001, 2002, 2003 The Karbon Developers
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
/* Adapted for Scribus 22.08.2003 by Franz Schmid */
/* Adapted for Scribus 15.01.2006 by Jean Ghali */
#ifndef __SCPAINTEREX_PS2_H__
#define __SCPAINTEREX_PS2_H__
// libart wrapper
#include <QGlobalStatic>
#include <QColor>
#include <QFont>
#include <QMatrix>
#include <QList>
#include <QPixmap>
#include <QStack>
#include <QTextStream>
#include "scribusapi.h"
#include "scconfig.h"
#include "colormgmt/sccolormgmtengine.h"
#include "fpoint.h"
#include "fpointarray.h"
#include "vgradient.h"
#include "scpainterexbase.h"
class ScribusDoc;
class ScPs2OutputParams
{
public:
ScPs2OutputParams(ScribusDoc* doc = NULL);
ScPainterExBase::ColorMode colorMode;
ScribusDoc* document;
bool reloadImages;
int resolution;
bool useProfiles;
bool toGray;
bool mirrorH;
bool mirrorV;
QString outputProfile;
ScColorProfile hProfile;
ScColorTransform rgbToOutputColorTransform;
ScColorTransform rgbToOutputImageTransform;
ScColorTransform cmykToOutputColorTransform;
ScColorTransform cmykToOutputImageTransform;
};
class SCRIBUS_API ScPainterEx_Ps2 : public ScPainterExBase
{
public:
ScPainterEx_Ps2( QIODevice* iodev, QRect& rect, ScPs2OutputParams& options );
virtual ~ScPainterEx_Ps2();
virtual int supportedColorModes() { return (int) (rgbMode|cmykMode); }
virtual ColorMode preferredColorMode() { return m_colorMode; }
virtual void setPreferredColorMode(ScPainterEx_Ps2::ColorMode colorMode) { m_colorMode = colorMode; }
virtual ImageMode imageMode();
virtual void begin();
virtual void end();
virtual void clear();
virtual void clear( ScColorShade & );
// matrix manipulation
virtual void setWorldMatrix( const QMatrix & );
virtual const QMatrix worldMatrix();
virtual void translate( double, double );
virtual void rotate( double );
virtual void scale( double, double );
// drawing
virtual void moveTo( const double &, const double & );
virtual void lineTo( const double &, const double & );
virtual void curveTo( FPoint p1, FPoint p2, FPoint p3 );
virtual void newPath();
virtual void closePath();
virtual void fillTextPath();
virtual void strokeTextPath();
virtual void fillPath();
virtual void strokePath();
virtual void setFillRule( bool fillRule );
virtual bool fillRule() { return m_fillRule; }
virtual void setFillMode( int fill );
virtual int fillMode() { return m_fillMode; }
virtual void setGradient( VGradientEx::Type mode, FPoint orig, FPoint vec, FPoint foc = FPoint(0,0));
virtual void setPattern ( ScPattern* pattern, QMatrix& patternTransform );
virtual void setClipPath();
virtual void drawImage( ScImage *image, ScPainterExBase::ImageMode mode );
virtual void drawRGBImage_ps2( ScImage *image );
virtual void drawCMYKImage_ps2( ScImage *image );
virtual bool hasAlphaChannel( ScImage* image );
virtual void setupPolygon(FPointArray *points, bool closed = true);
virtual void drawPolygon();
virtual void drawPolyLine();
virtual void drawLine(FPoint start, FPoint end);
virtual void drawRect(double, double, double, double);
// pen + brush
virtual ScColorShade pen();
virtual ScColorShade brush();
virtual void setPen( const ScColorShade & );
virtual void setPen( const ScColorShade &c, double w, Qt::PenStyle st, Qt::PenCapStyle ca, Qt::PenJoinStyle jo );
virtual void setPenOpacity( double op );
virtual void setLineWidth( double w);
virtual void setDash(const QVector<double>& array, double ofs);
virtual void setBrush( const ScColorShade & );
virtual void setBrushOpacity( double op );
virtual void setOpacity( double op );
virtual void setFont( const QFont &f );
virtual QFont font();
// stack management
virtual void save();
virtual void restore();
virtual void setRasterOp( int op );
protected:
virtual void writeRGBImageToStream_Ascii85 ( ScImage* image );
virtual void writeRGBImageToStream_AsciiHex ( ScImage* image );
virtual void writeCMYKImageToStream_Ascii85( ScImage* image );
virtual void writeCMYKImageToStream_AsciiHex( ScImage* image );
virtual void writeMaskToStream ( QImage* image );
private:
typedef enum {
Ascii85Encoding,
AsciiHexEncoding
} AsciiEncoding;
/* Output stream */
QTextStream m_stream;
ColorMode m_colorMode;
AsciiEncoding m_encoding;
/* Path bounding boxes*/
QRect m_pathBBox;
QRect m_clipBBox;
/* General output options */
ScPs2OutputParams m_options;
/* Basic drawing functions*/
void drawVPath( int mode );
void drawGradient( VGradientEx& gradient );
void drawLinearGradient( VGradientEx& gradient, const QRect& rect );
void drawLinearGradient_RGB( VGradientEx& gradient, const QRect& rect );
void drawLinearGradient_CMYK( VGradientEx& gradient, const QRect& rect );
void drawCircularGradient( VGradientEx& gradient, const QRect& rect );
void drawCircularGradient_RGB( VGradientEx& gradient, const QRect& rect );
void drawCircularGradient_CMYK( VGradientEx& gradient, const QRect& rect );
void getPathBoundingBox( FPointArray* points, QRect& r );
void transformPoint( const FPoint& in, FPoint& out );
void transformPoints( const FPoint* in, FPoint* out, uint length );
void putColor( ScColorShade& colorShade, bool doFill );
unsigned int m_width;
unsigned int m_height;
unsigned int m_x;
unsigned int m_y;
QMatrix m_pageTrans;
QMatrix m_matrix;
QFont m_font;
/* Filling */
ScColorShade m_fillColor;
double m_fillTrans;
bool m_fillRule;
int m_fillMode; // 0 = none, 1 = solid, 2 = gradient
int m_gradientMode; // 1 = linear, 2 = radial
/* Stroking */
ScColorShade m_strokeColor;
double m_strokeTrans;
double m_lineWidth;
/* Line End Style */
Qt::PenCapStyle m_lineEnd;
/* Line Join Style */
Qt::PenJoinStyle m_lineJoin;
/* The Dash Array */
QVector<double> m_array;
double m_offset;
/* Transformation Stack */
QStack<QMatrix> m_stack;
/* Zoom Factor of the Painter */
double m_zoomFactor;
/* Some data to describe state of drawing */
bool m_pathIsClosed;
bool m_drawingClosedPath;
/* Drawing surface dimensions */
double m_deviceDimX;
double m_deviceDimY;
/* Device resolutions */
double m_deviceResX;
double m_deviceResY;
/* Color conversion function */
void transformImage( QImage* image, uchar* data, int scan);
};
#endif
|