-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathscm-task.hpp
64 lines (50 loc) · 2.13 KB
/
scm-task.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// Copyright (C) 2011-2012 Robert Kooima
//
// LIBSCM is free software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the Free Software
// Foundation; either version 2 of the License, or (at your option) any later
// version.
//
// This program is distributed in the hope that it will be useful, but WITH-
// OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
#ifndef SCM_TASK_HPP
#define SCM_TASK_HPP
#include <GL/glew.h>
#include <tiffio.h>
#include "scm-item.hpp"
//------------------------------------------------------------------------------
class scm_file;
class scm_cache;
//------------------------------------------------------------------------------
/// 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.
struct scm_task : public scm_item
{
scm_task();
scm_task(int, long long);
scm_task(int, long long, uint64, int, int, int, GLuint, scm_cache *);
void make_page(int, int);
bool load_page(const char *, TIFF *);
void dump_page();
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
};
//------------------------------------------------------------------------------
/// @file
GLuint scm_internal_form(uint16 c, uint16 b);
GLuint scm_external_form(uint16 c, uint16 b);
GLuint scm_external_type(uint16 c, uint16 b);
GLsizei scm_pixel_size (uint16 c, uint16 b);
//------------------------------------------------------------------------------
#endif