SCM Library
Spherical Cube Map rendering library
 All Classes Files Functions Variables Friends Pages
scm-sample.hpp
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_SAMPLE_HPP
14 #define SCM_SAMPLE_HPP
15 
16 #include <string>
17 
18 #include <tiffio.h>
19 
20 //------------------------------------------------------------------------------
21 
22 class scm_file;
23 
24 //------------------------------------------------------------------------------
25 
41 
43 {
44 public:
45 
47  ~scm_sample();
48 
49  float get(const double *);
50 
51 private:
52 
53  float lookup(int, int) const;
54 
55  TIFF *tiff;
56  scm_file *file;
57 
58  double last_v[3]; // Sample cache last vector
59  float last_k; // Sample cache last value
60  uint64 last_o; // Sample cache last page offset
61  tsize_t last_i0; // Sample cache last strip
62  tsize_t last_i1; // Sample cache last strip
63  uint8 *last_p; // Sample cache last page buffer
64 };
65 
66 //------------------------------------------------------------------------------
67 
68 #endif
An scm_file encapsulates an open SCM data file.
Definition: scm-file.hpp:37
An scm_sample samples an SCM TIFF file.
Definition: scm-sample.hpp:42
scm_sample(scm_file *)
Create a new SCM TIFF file sampler.
Definition: scm-sample.cpp:29