• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdegraphics API Reference
  • KDE Home
  • Contact Us
 

okular

  • Okular
  • TilesManager
Public Types | Public Member Functions | Static Public Member Functions | List of all members
Okular::TilesManager Class Reference

#include <tilesmanager_p.h>

Public Types

enum  TileLeaf { TerminalTile, PixmapTile }
 

Public Member Functions

 TilesManager (int pageNumber, int width, int height, Rotation rotation=Rotation0)
 
 ~TilesManager ()
 
void cleanupPixmapMemory (qulonglong numberOfBytes, const NormalizedRect &visibleRect, int visiblePageNumber)
 
bool hasPixmap (const NormalizedRect &rect)
 
int height () const
 
bool isRequesting (const NormalizedRect &rect, int pageWidth, int pageHeight) const
 
void markDirty ()
 
Rotation rotation () const
 
void setPixmap (const QPixmap *pixmap, const NormalizedRect &rect)
 
void setRequest (const NormalizedRect &rect, int pageWidth, int pageHeight)
 
void setRotation (Rotation rotation)
 
void setSize (int width, int height)
 
QList< Tile > tilesAt (const NormalizedRect &rect, TileLeaf tileLeaf)
 
qulonglong totalMemory () const
 
int width () const
 

Static Public Member Functions

static NormalizedRect fromRotatedRect (const NormalizedRect &rect, Rotation rotation)
 
static NormalizedRect toRotatedRect (const NormalizedRect &rect, Rotation rotation)
 

Detailed Description

Tiles management.

This class has direct access to all tiles and handles how they should be stored, deleted and retrieved. Each tiles manager only handles one page.

The tiles manager is a tree of tiles. At first the page is divided in a 4x4 grid of 16 tiles. Then each of these tiles can be recursively split in 4 subtiles so that we keep the size of each pixmap inside a safe interval.

Definition at line 98 of file tilesmanager_p.h.

Member Enumeration Documentation

enum Okular::TilesManager::TileLeaf
Enumerator
TerminalTile 

Return tiles without children.

PixmapTile 

Return only tiles with pixmap.

Definition at line 101 of file tilesmanager_p.h.

Constructor & Destructor Documentation

TilesManager::TilesManager ( int  pageNumber,
int  width,
int  height,
Rotation  rotation = Rotation0 
)

Definition at line 93 of file tilesmanager.cpp.

TilesManager::~TilesManager ( )

Definition at line 111 of file tilesmanager.cpp.

Member Function Documentation

void TilesManager::cleanupPixmapMemory ( qulonglong  numberOfBytes,
const NormalizedRect &  visibleRect,
int  visiblePageNumber 
)

Removes at least numberOfBytes bytes worth of tiles (least ranked tiles are removed first).

Set visibleRect to the visible region of the page. Set a visiblePageNumber if the current page is not visible. Visible tiles are not discarded.

Definition at line 449 of file tilesmanager.cpp.

NormalizedRect TilesManager::fromRotatedRect ( const NormalizedRect &  rect,
Rotation  rotation 
)
static

Returns a non rotated version of rect, which is rotated by rotation.

Definition at line 581 of file tilesmanager.cpp.

bool TilesManager::hasPixmap ( const NormalizedRect &  rect)

Checks whether all tiles intersecting with rect are available.

Returns false if at least one tile needs to be repainted (the tile is dirty).

Definition at line 325 of file tilesmanager.cpp.

int TilesManager::height ( ) const

Gets the height of the page in tiles manager.

Definition at line 152 of file tilesmanager.cpp.

bool TilesManager::isRequesting ( const NormalizedRect &  rect,
int  pageWidth,
int  pageHeight 
) const

Checks whether a given region has already been requested.

Definition at line 534 of file tilesmanager.cpp.

void TilesManager::markDirty ( )

Mark all tiles as dirty.

Definition at line 170 of file tilesmanager.cpp.

Rotation TilesManager::rotation ( ) const

Definition at line 165 of file tilesmanager.cpp.

void TilesManager::setPixmap ( const QPixmap *  pixmap,
const NormalizedRect &  rect 
)

Sets the pixmap of the tiles covered by rect (which represents the location of pixmap on the page).

pixmap may cover an area which contains multiple tiles. So each tile we get a cropped part of the pixmap.

Also it checks the dimensions of the given parameters against the current request as to avoid setting pixmaps of late requests.

Definition at line 188 of file tilesmanager.cpp.

void TilesManager::setRequest ( const NormalizedRect &  rect,
int  pageWidth,
int  pageHeight 
)

Sets a region to be requested so the tiles manager knows which pixmaps to expect and discard those not useful anymore (late pixmaps)

Definition at line 539 of file tilesmanager.cpp.

void TilesManager::setRotation ( Rotation  rotation)

Inform the new rotation of the page.

Definition at line 157 of file tilesmanager.cpp.

void TilesManager::setSize ( int  width,
int  height 
)

Inform the new size of the page and mark all tiles to repaint.

Definition at line 136 of file tilesmanager.cpp.

QList< Tile > TilesManager::tilesAt ( const NormalizedRect &  rect,
TileLeaf  tileLeaf 
)

Returns a list of all tiles intersecting with rect.

As to avoid requests of big areas, each traversed tile is checked for its size and split if necessary.

Parameters
tileLeafIndicate the type of tile to return

Definition at line 358 of file tilesmanager.cpp.

NormalizedRect TilesManager::toRotatedRect ( const NormalizedRect &  rect,
Rotation  rotation 
)
static

Returns a rotated NormalizedRect given a rotation.

Definition at line 606 of file tilesmanager.cpp.

qulonglong TilesManager::totalMemory ( ) const

The total memory consumed by the tiles manager.

Definition at line 444 of file tilesmanager.cpp.

int TilesManager::width ( ) const

Gets the width of the page in tiles manager.

Definition at line 147 of file tilesmanager.cpp.


The documentation for this class was generated from the following files:
  • tilesmanager_p.h
  • tilesmanager.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:45:03 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

okular

Skip menu "okular"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdegraphics API Reference

Skip menu "kdegraphics API Reference"
  •     libkdcraw
  •     libkexiv2
  •     libkipi
  •     libksane
  • okular

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal