-
Notifications
You must be signed in to change notification settings - Fork 0
/
ImageTexture.h
58 lines (38 loc) · 1.2 KB
/
ImageTexture.h
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
// Copyright (C) Kevin Suffern 2000-2007.
// Revised by mp77 at 2012
// This C++ code is for non-commercial purposes only.
// This C++ code is licensed under the GNU General Public License Version 2.
// See the file COPYING.txt for the full license.
#pragma once
#include "Image.h"
//#include "Mapping.h"
//#include "Texture.h"
class ImageTexture {
public:
ImageTexture(void);
ImageTexture(Image* _image_ptr);
ImageTexture(const ImageTexture& it);
ImageTexture&
operator= (const ImageTexture& rhs);
virtual
~ImageTexture(void) ;
virtual ColorRGB
get_color();
void
set_image(Image* _image_ptr);
void setU(int ru);
void setV(int rv);
public:
int index;
int hres; // horizontal resolution of the image
int vres; // vertical resolution of the image
Image* image_ptr; // the image
};
// ---------------------------------------------------------------- set_image
inline void
ImageTexture::set_image(Image* _image_ptr) {
image_ptr = _image_ptr;
hres = image_ptr->get_hres();
vres = image_ptr->get_vres();
}
// ---------------------------------------------------------------- set_mapping