SCM Library
Spherical Cube Map rendering library
|
An scm_task represents a page load task, as executed by a loader thread. More...
#include <scm-task.hpp>
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... | |
![]() | |
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_cache * | C |
Destination cache. | |
![]() | |
int | f |
File index. | |
long long | i |
Page index. | |
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.
scm_task::scm_task | ( | int | f, |
long long | i | ||
) |
Construct a load task.
f | File index |
i | Page 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.
f | File index |
i | Page index |
o | TIFF offset |
n | Page size in pixels |
c | Page channels per pixel |
b | Page bits per channel |
u | Pixel buffer object |
C | Destination cache |
void scm_task::make_page | ( | int | x, |
int | y | ||
) |
Upload the pixel buffer to the OpenGL texture object.
x | Location of upper-left pixel |
y | Location 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.
name | TIFF name (used for generating error pages) |
T | TIFF 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.