Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 24751 → Rev 24752

/trunk/Scribus/scribus/rawimage.cpp
6,10 → 6,6
*/
#include "rawimage.h"
 
RawImage::RawImage()
{
}
 
RawImage::RawImage( int width, int height, int channels )
{
create(width, height, channels);
25,9 → 21,9
m_width = width;
m_height = height;
m_channels = channels;
int finalSize=width * height * channels;
int finalSize = width * height * channels;
resize(finalSize);
return (size()==finalSize);
return (size() == finalSize);
}
 
uchar *RawImage::scanLine(int row)
60,52 → 56,52
{
for (int i = 0; i < height(); i++)
{
ptr = (QRgb *)img.scanLine(i);
ptr = (QRgb *) img.scanLine(i);
src = scanLine(i);
for (int j = 0; j < width(); j++)
{
*ptr++ = qRgba(src[0],src[1],src[2],src[3]);
*ptr++ = qRgba(src[0], src[1], src[2], src[3]);
src += chans;
}
}
return img;
}
else
 
for (int i = 0; i < height(); i++)
{
for (int i = 0; i < height(); i++)
ptr = (QRgb *) img.scanLine(i);
src = scanLine(i);
for (int j = 0; j < width(); j++)
{
ptr = (QRgb *)img.scanLine(i);
src = scanLine(i);
for (int j = 0; j < width(); j++)
if (chans > 1)
{
if (chans > 1)
if (cmyk)
{
if (cmyk)
ck = src[3];
cr = 255 - qMin(255, src[0] + ck);
cg = 255 - qMin(255, src[1] + ck);
cb = 255 - qMin(255, src[2] + ck);
if (chans > 4)
{
ck = src[3];
cr = 255 - qMin(255, src[0] + ck);
cg = 255 - qMin(255, src[1] + ck);
cb = 255 - qMin(255, src[2] + ck);
if (chans > 4)
{
ca = src[4];
*ptr++ = qRgba(cr,cg,cb,ca);
}
else
*ptr++ = qRgba(cr,cg,cb,255);
ca = src[4];
*ptr++ = qRgba(cr, cg, cb, ca);
}
else
{
if (chans > 3)
*ptr++ = qRgba(src[0],src[1],src[2],src[3]);
else
*ptr++ = qRgba(src[0],src[1],src[2],255);
}
*ptr++ = qRgba(cr, cg, cb, 255);
}
else
*ptr++ = qRgba(src[0],src[0],src[0],255);
src += chans;
{
if (chans > 3)
*ptr++ = qRgba(src[0], src[1], src[2], src[3]);
else
*ptr++ = qRgba(src[0], src[1], src[2], 255);
}
}
else
*ptr++ = qRgba(src[0], src[0], src[0], 255);
src += chans;
}
}
 
return img;
}
/trunk/Scribus/scribus/rawimage.h
15,7 → 15,7
class SCRIBUS_API RawImage : public QByteArray
{
public:
RawImage();
RawImage() = default;
RawImage( int width, int height, int channels);
~RawImage();
 
/trunk/Scribus/scribus/scimagestructs.cpp
18,8 → 18,6
const QDataStream::Version dsVersion = QDataStream::Qt_4_0;
}
 
const qint32 ExifValues::dsVersion = 1;
 
QDataStream & operator<< (QDataStream& stream, const ExifValues & exif)
{
stream << static_cast<qint32>(exif.width) << static_cast<qint32>(exif.height) << static_cast<qint32>(exif.orientation)
65,8 → 63,6
thumbnail = QImage();
}
 
const qint32 ImageInfoRecord::iirVersion = 1;
 
ImageInfoRecord::ImageInfoRecord()
{
init();
/trunk/Scribus/scribus/scimagestructs.h
124,14 → 124,14
 
// Remember to increment this version number and update
// the QDataStream operators if this class in changed.
static const qint32 dsVersion;
static constexpr qint32 dsVersion { 1 };
 
int width;
int height;
int orientation;
float ExposureTime;
float ApertureFNumber;
int ISOequivalent;
int width { 0 };
int height { 0 };
int orientation { 1 };
float ExposureTime { 0.0f };
float ApertureFNumber { 0.0f };
int ISOequivalent { 0 };
QString cameraName;
QString cameraVendor;
QString comment;
142,7 → 142,7
QImage thumbnail;
};
 
typedef enum
enum ImageTypeEnum
{
ImageTypeJPG = 0,
ImageTypeTIF = 1,
152,9 → 152,9
ImageTypeJPG2K = 5,
ImageTypeOther = 6,
ImageType7 = 7
} ImageTypeEnum;
};
 
typedef enum
enum ColorSpaceEnum
{
ColorSpaceRGB = 0,
ColorSpaceCMYK = 1,
161,7 → 161,7
ColorSpaceGray = 2,
ColorSpaceDuotone = 3,
ColorSpaceMonochrome = 4
} ColorSpaceEnum;
};
 
class ImageInfoRecord
{
171,27 → 171,27
 
// Remember to increment this version number and update
// the serialization routines if this class in changed.
static const int iirVersion;
static constexpr int iirVersion { 1 };
 
bool canSerialize() const;
bool serialize(ScImageCacheProxy & cache) const;
bool deserialize(const ScImageCacheProxy & cache);
 
ImageTypeEnum type; /* 0 = jpg, 1 = tiff, 2 = psd, 3 = eps/ps, 4 = pdf, 5 = jpg2000, 6 = other */
int xres;
int yres;
int BBoxX;
int BBoxH;
ColorSpaceEnum colorspace; /* 0 = RGB 1 = CMYK 2 = Grayscale 3 = Duotone */
bool valid;
bool isRequest;
bool progressive;
bool isEmbedded;
bool exifDataValid;
int lowResType; /* 0 = full Resolution, 1 = 72 dpi, 2 = 36 dpi */
double lowResScale;
int numberOfPages;
int actualPageNumber;
ImageTypeEnum type { ImageTypeOther }; /* 0 = jpg, 1 = tiff, 2 = psd, 3 = eps/ps, 4 = pdf, 5 = jpg2000, 6 = other */
int xres { 72 };
int yres { 72 };
int BBoxX { 0 };
int BBoxH { 0 };
ColorSpaceEnum colorspace { ColorSpaceRGB }; /* 0 = RGB 1 = CMYK 2 = Grayscale 3 = Duotone */
bool valid { false };
bool isRequest { false };
bool progressive { false };
bool isEmbedded { false };
bool exifDataValid { false };
int lowResType { 1 }; /* 0 = full Resolution, 1 = 72 dpi, 2 = 36 dpi */
double lowResScale { 1.0 };
int numberOfPages { 1 };
int actualPageNumber { 0 };
QMap<QString, FPointArray> PDSpathData;
QMap<int, ImageLoadRequest> RequestProps;
QString clipPath;
/trunk/Scribus/scribus/scraction.cpp
113,10 → 113,6
m_fakeToggle = false;
}
 
ScrAction::~ScrAction()
{
}
 
void ScrAction::triggeredToTriggeredData()
{
if (m_actionType == ScrAction::DataInt)
/trunk/Scribus/scribus/scraction.h
94,7 → 94,7
\param extraQString extra QString value
*/
ScrAction(QKeySequence accel, QObject *parent, QVariant data = QVariant());
~ScrAction();
~ScrAction() = default;
/*!
\author Craig Bradney
/trunk/Scribus/scribus/scribusdoc.h
1454,9 → 1454,9
int previewVisual {0};
struct OpenNodesList
{
int type;
ScPage *page;
PageItem *item;
int type { -1 };
ScPage* page { nullptr };
PageItem *item { nullptr };
};
QList<OpenNodesList> OpenNodes;
QTimer *CurTimer {nullptr};