krita/ui

KisImagePyramid Class Reference

#include <kis_image_pyramid.h>

Inheritance diagram for KisImagePyramid:

List of all members.

Public Member Functions

 KisImagePyramid (qint32 pyramidHeight)
virtual ~KisImagePyramid ()
void alignSourceRect (QRect &rect, qreal scale)
QImage convertToQImage (qreal scale, qint32 unscaledX, qint32 unscaledY, qint32 unscaledWidth, qint32 unscaledHeight)
QImage convertToQImage (qreal scale, const QRect &unscaledRect, enum Qt::TransformationMode transformMode)
void drawFromOriginalImage (QPainter &gc, const QRect &imageRect, const QRectF &viewportRect, qint32 borderWidth, QPainter::RenderHints renderHints)
void drawImage (qreal scale, QPainter &gc, const QPoint &topLeftScaled, const QRect &unscaledSourceRect)
KisImagePatch getNearestPatch (qreal scaleX, qreal scaleY, const QRect &requestedRect, qint32 borderWidth)
void setDirty (const QRect &rc)
void setImage (KisImageWSP newImage)
void setImageSize (qint32 w, qint32 h)
void setMonitorProfile (const KoColorProfile *monitorProfile)

Detailed Description

Definition at line 32 of file kis_image_pyramid.h.


Constructor & Destructor Documentation

KisImagePyramid::KisImagePyramid ( qint32  pyramidHeight  ) 

Definition at line 88 of file kis_image_pyramid.cpp.

KisImagePyramid::~KisImagePyramid (  )  [virtual]

Definition at line 95 of file kis_image_pyramid.cpp.


Member Function Documentation

void KisImagePyramid::alignSourceRect ( QRect rect,
qreal  scale 
) [virtual]

Some backends cannot work with arbitrary areas due to scaling stuff.

That's why KisPrescaledProjection asks a backend to align an image rect before any operations.

Assume that KisImage pixels are always positive It allows us to use binary op-s for aligning

Here is a workaround of Qt's QRect::right()/bottom() "historical reasons". It should be one pixel smaller than actual right/bottom position

Reimplemented from KisProjectionBackend.

Definition at line 276 of file kis_image_pyramid.cpp.

QImage KisImagePyramid::convertToQImage ( qreal  scale,
qint32  unscaledX,
qint32  unscaledY,
qint32  unscaledWidth,
qint32  unscaledHeight 
)
QImage KisImagePyramid::convertToQImage ( qreal  scale,
const QRect unscaledRect,
enum Qt::TransformationMode  transformMode 
)

Render the projection onto a QImage.

Color profiling accurs here

void KisImagePyramid::drawFromOriginalImage ( QPainter gc,
const QRect imageRect,
const QRectF viewportRect,
qint32  borderWidth,
QPainter::RenderHints  renderHints 
) [virtual]

Draws a piece of original image onto 's canvas - area in KisImage pixels where to read from - area in canvas pixels where to write to If and don't agree, the image will be scaled has the same meaning as in getNearestPatch - hints, transmitted to QPainter during darwing.

Implements KisProjectionBackend.

Definition at line 346 of file kis_image_pyramid.cpp.

void KisImagePyramid::drawImage ( qreal  scale,
QPainter gc,
const QPoint topLeftScaled,
const QRect unscaledSourceRect 
)

Draw the projection onto a QPainter.

Color profiling accurs here

KisImagePatch KisImagePyramid::getNearestPatch ( qreal  scaleX,
qreal  scaleY,
const QRect requestedRect,
qint32  borderWidth 
) [virtual]

Get a patch from a backend that can draw a on some QPainter in future.

and are the scales of planned drawing, btw, it doesn't mean that an QImage inside the patch will have these scales - it'll have the nearest suitable scale or even original scale (e.g. KisProjectionCache)

If is non-zero, will be axpended by pixels to all directions and image of this rect will actually be written to the patch's QImage. That is done to eliminate border effects in smooth scaling.

Implements KisProjectionBackend.

Definition at line 307 of file kis_image_pyramid.cpp.

void KisImagePyramid::setDirty ( const QRect rc  )  [virtual]

Updates (in KisImage pixels) from the base image.

Implements KisProjectionBackend.

Definition at line 145 of file kis_image_pyramid.cpp.

void KisImagePyramid::setImage ( KisImageWSP  image  )  [virtual]

Those methods are related to KisPrescaledProjection's equivalents.

Implements KisProjectionBackend.

Definition at line 127 of file kis_image_pyramid.cpp.

void KisImagePyramid::setImageSize ( qint32  w,
qint32  h 
) [virtual]

Implements KisProjectionBackend.

Definition at line 138 of file kis_image_pyramid.cpp.

void KisImagePyramid::setMonitorProfile ( const KoColorProfile *  monitorProfile  )  [virtual]

If you change pixel size here, don't forget to change it in optimized function downsamplePixels()

Implements KisProjectionBackend.

Definition at line 100 of file kis_image_pyramid.cpp.


The documentation for this class was generated from the following files: