SCM Library
Spherical Cube Map rendering library
 All Classes Files Functions Variables Friends Pages
scm-task.hpp
Go to the documentation of this file.
1 // Copyright (C) 2011-2012 Robert Kooima
2 //
3 // LIBSCM is free software; you can redistribute it and/or modify it under the
4 // terms of the GNU General Public License as published by the Free Software
5 // Foundation; either version 2 of the License, or (at your option) any later
6 // version.
7 //
8 // This program is distributed in the hope that it will be useful, but WITH-
9 // OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 // more details.
12 
13 #ifndef SCM_TASK_HPP
14 #define SCM_TASK_HPP
15 
16 #include <GL/glew.h>
17 #include <tiffio.h>
18 
19 #include "scm-item.hpp"
20 
21 //------------------------------------------------------------------------------
22 
23 class scm_file;
24 class scm_cache;
25 
26 //------------------------------------------------------------------------------
27 
33 
34 struct scm_task : public scm_item
35 {
36  scm_task();
37  scm_task(int, long long);
38  scm_task(int, long long, uint64, int, int, int, GLuint, scm_cache *);
39 
40  void make_page(int, int);
41  bool load_page(const char *, TIFF *);
42  void dump_page();
43 
44  uint64 o;
45  int n;
46  int c;
47  int b;
48  GLuint u;
49  bool d;
50  void *p;
52 };
53 
54 //------------------------------------------------------------------------------
56 
57 GLuint scm_internal_form(uint16 c, uint16 b);
58 GLuint scm_external_form(uint16 c, uint16 b);
59 GLuint scm_external_type(uint16 c, uint16 b);
60 GLsizei scm_pixel_size (uint16 c, uint16 b);
61 
62 //------------------------------------------------------------------------------
63 
64 #endif
An scm_item is a reference to a specific page in a specific SCM file.
Definition: scm-item.hpp:24
GLuint scm_external_type(uint16 c, uint16 b)
Select an OpenGL data type.
Definition: scm-task.cpp:171
int c
Page channel per pixel.
Definition: scm-task.hpp:46
void make_page(int, int)
Upload the pixel buffer to the OpenGL texture object.
Definition: scm-task.cpp:65
An scm_task represents a page load task, as executed by a loader thread.
Definition: scm-task.hpp:34
GLuint scm_internal_form(uint16 c, uint16 b)
Select an OpenGL internal texture format.
Definition: scm-task.cpp:113
GLuint u
Pixel unpack buffer object.
Definition: scm-task.hpp:48
bool load_page(const char *, TIFF *)
Load a page. On success, mark the buffer as dirty.
Definition: scm-task.cpp:101
An scm_file encapsulates an open SCM data file.
Definition: scm-file.hpp:37
scm_cache * C
Destination cache.
Definition: scm-task.hpp:51
int n
Page size.
Definition: scm-task.hpp:45
void dump_page()
Discard the pixel buffer.
Definition: scm-task.cpp:84
int b
Page bits per channel.
Definition: scm-task.hpp:47
GLsizei scm_pixel_size(uint16 c, uint16 b)
Return the storage size for an OpenGL pixel.
Definition: scm-task.cpp:184
uint64 o
SCM TIFF file offset of this page.
Definition: scm-task.hpp:44
bool d
Pixel unpack buffer dirty flag.
Definition: scm-task.hpp:49
GLuint scm_external_form(uint16 c, uint16 b)
Select an OpenGL external texture format.
Definition: scm-task.cpp:146
void * p
Pixel unpack buffer map address.
Definition: scm-task.hpp:50
An scm_cache is a virtual texture, demand-paged with threaded data access, represented as a single la...
Definition: scm-cache.hpp:35