Panda3D
texturePeeker.I
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file texturePeeker.I
10  * @author drose
11  * @date 2008-08-26
12  */
13 
14 /**
15  * Returns true if the TexturePeeker was able to initialize itself and is
16  * ready to return texel colors.
17  */
18 INLINE bool TexturePeeker::
19 is_valid() const {
20  return !_image.is_null();
21 }
22 
23 /**
24  * Returns the width of the texture image that is contributing to the
25  * TexturePeeker's information. This may be either the Texture's full width,
26  * or its simple ram image's width.
27  */
28 INLINE int TexturePeeker::
29 get_x_size() const {
30  return _x_size;
31 }
32 
33 /**
34  * Returns the height of the texture image that is contributing to the
35  * TexturePeeker's information. This may be either the Texture's full height,
36  * or its simple ram image's height.
37  */
38 INLINE int TexturePeeker::
39 get_y_size() const {
40  return _y_size;
41 }
42 
43 /**
44  * Returns the depth of the texture image that is contributing to the
45  * TexturePeeker's information.
46  */
47 INLINE int TexturePeeker::
48 get_z_size() const {
49  return _z_size;
50 }
51 
52 /**
53  * Returns whether a given coordinate is inside of the texture dimensions.
54  */
55 INLINE bool TexturePeeker::
56 has_pixel(int x, int y) const {
57  return x >= 0 && y >= 0 && x < _x_size && y < _y_size;
58 }
constexpr bool is_null() const
Returns true if the PointerTo is a NULL pointer, false otherwise.
Definition: pointerToVoid.I:27
int get_z_size() const
Returns the depth of the texture image that is contributing to the TexturePeeker's information.
Definition: texturePeeker.I:48
int get_y_size() const
Returns the height of the texture image that is contributing to the TexturePeeker's information.
Definition: texturePeeker.I:39
bool has_pixel(int x, int y) const
Returns whether a given coordinate is inside of the texture dimensions.
Definition: texturePeeker.I:56
bool is_valid() const
Returns true if the TexturePeeker was able to initialize itself and is ready to return texel colors.
Definition: texturePeeker.I:19
int get_x_size() const
Returns the width of the texture image that is contributing to the TexturePeeker's information.
Definition: texturePeeker.I:29