SCM Library
Spherical Cube Map rendering library
 All Classes Files Functions Variables Friends Pages
Public Member Functions | Public Attributes | List of all members
scm_task Struct Reference

An scm_task represents a page load task, as executed by a loader thread. More...

#include <scm-task.hpp>

Inheritance diagram for scm_task:
scm_item

Public Member Functions

 scm_task (int, long long)
 Construct a load task. More...
 
 scm_task (int, long long, uint64, int, int, int, GLuint, scm_cache *)
 Construct a load task. Map the PBO to provide a destination for the loader. More...
 
void make_page (int, int)
 Upload the pixel buffer to the OpenGL texture object. More...
 
bool load_page (const char *, TIFF *)
 Load a page. On success, mark the buffer as dirty. More...
 
void dump_page ()
 Discard the pixel buffer. More...
 
- Public Member Functions inherited from scm_item
 scm_item ()
 Initialize an invalid SCM page reference.
 
 scm_item (int f, long long i)
 Initialize a valid SCM page reference.
 
bool is_valid () const
 Return true if this is a valid SCM page reference.
 
bool operator< (const scm_item &that) const
 Determine the order of two SCM page references.
 

Public Attributes

uint64 o
 SCM TIFF file offset of this page.
 
int n
 Page size.
 
int c
 Page channel per pixel.
 
int b
 Page bits per channel.
 
GLuint u
 Pixel unpack buffer object.
 
bool d
 Pixel unpack buffer dirty flag.
 
void * p
 Pixel unpack buffer map address.
 
scm_cacheC
 Destination cache.
 
- Public Attributes inherited from scm_item
int f
 File index.
 
long long i
 Page index.
 

Detailed Description

An scm_task represents a page load task, as executed by a loader thread.

It encapsulates all of the parameters of the page to be loaded and includes the OpenGL state necessary to perform an asynchronous upload of the loaded data.

Constructor & Destructor Documentation

scm_task::scm_task ( int  f,
long long  i 
)

Construct a load task.

Parameters
fFile index
iPage index
scm_task::scm_task ( int  f,
long long  i,
uint64  o,
int  n,
int  c,
int  b,
GLuint  u,
scm_cache C 
)

Construct a load task. Map the PBO to provide a destination for the loader.

Parameters
fFile index
iPage index
oTIFF offset
nPage size in pixels
cPage channels per pixel
bPage bits per channel
uPixel buffer object
CDestination cache

Member Function Documentation

void scm_task::make_page ( int  x,
int  y 
)

Upload the pixel buffer to the OpenGL texture object.

Parameters
xLocation of upper-left pixel
yLocation of upper-left pixel
bool scm_task::load_page ( const char *  name,
TIFF *  T 
)

Load a page. On success, mark the buffer as dirty.

This method is called by a loader thread and exists solely to marshal the entensive argument list of the global function scm_load_page.

Parameters
nameTIFF name (used for generating error pages)
TTIFF pointer
void scm_task::dump_page ( )

Discard the pixel buffer.

This used when a load task was created but its data should not be uploaded to VRAM. This may be because the task could not be added to the load queue, because the loader thread failed, or because the page was rejected for cache inertion due priority.


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