21 #include <SDL_thread.h>
23 #include "scm-queue.hpp"
24 #include "scm-guard.hpp"
26 #include "scm-sample.hpp"
30 typedef std::vector<SDL_Thread *> thread_v;
31 typedef std::vector<SDL_Thread *>::iterator thread_i;
51 virtual bool get_page_status(uint64)
const;
52 virtual uint64 get_page_offset(uint64)
const;
53 virtual void get_page_bounds(uint64,
float&,
float&)
const;
54 virtual float get_page_sample(
const double *);
56 virtual uint32 get_w()
const {
return w; }
57 virtual uint32 get_h()
const {
return h; }
58 virtual uint16 get_c()
const {
return c; }
59 virtual uint16 get_b()
const {
return b; }
61 const char *get_path()
const {
return path.c_str(); }
62 const char *get_name()
const {
return name.c_str(); }
64 uint64
find_page(
long long,
double&,
double&)
const;
100 float tofloat(
const void *, uint64)
const;
101 void fromfloat(
const void *, uint64,
float)
const;
103 uint64 toindex(uint64)
const;
105 friend int loader(
void *);
112 TIFF *, uint64,
int,
int,
int,
int,
void *);
void activate(scm_cache *)
Launch all loader threads for this file.
Definition: scm-file.cpp:130
An scm_task represents a page load task, as executed by a loader thread.
Definition: scm-task.hpp:34
An scm_file encapsulates an open SCM data file.
Definition: scm-file.hpp:37
bool is_active() const
Return true if loader threads are active on this file.
Definition: scm-file.cpp:163
uint64 find_page(long long, double &, double &) const
Seek the deepest page at this location (x, y) of root page a. Return the file offset of this page and...
Definition: scm-file.cpp:319
bool scm_load_page(const char *, long long, TIFF *, uint64, int, int, int, int, void *)
Load a page from a TIFF file.
Definition: scm-file.cpp:535
void deactivate()
Command all loader threads to exit.
Definition: scm-file.cpp:144
bool add_need(scm_task &)
Insert a new loader task into the needs queue.
Definition: scm-file.cpp:170
friend int loader(void *)
Service page load requests.
Definition: scm-file.cpp:573
An scm_sample samples an SCM TIFF file.
Definition: scm-sample.hpp:42
scm_file(const std::string &name)
Construct a file table entry.
Definition: scm-file.cpp:30
An scm_cache is a virtual texture, demand-paged with threaded data access, represented as a single la...
Definition: scm-cache.hpp:35