Panda3D
Loading...
Searching...
No Matches
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 */
18INLINE bool TexturePeeker::
19is_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 */
29get_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 */
39get_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 */
48get_z_size() const {
49 return _z_size;
50}
51
52/**
53 * Returns whether a given coordinate is inside of the texture dimensions.
54 */
55INLINE bool TexturePeeker::
56has_pixel(int x, int y) const {
57 return x >= 0 && y >= 0 && x < _x_size && y < _y_size;
58}
59
60/**
61 * Returns whether a given coordinate is inside of the texture dimensions.
62 */
63INLINE bool TexturePeeker::
64has_pixel(int x, int y, int z) const {
65 return x >= 0 && y >= 0 && z >= 0 && x < _x_size && y < _y_size && z < _z_size;
66}
constexpr bool is_null() const
Returns true if the PointerTo is a NULL pointer, false otherwise.
int get_y_size() const
Returns the height of the texture image that is contributing to the TexturePeeker's information.
int get_z_size() const
Returns the depth of the texture image that is contributing to the TexturePeeker's information.
bool is_valid() const
Returns true if the TexturePeeker was able to initialize itself and is ready to return texel colors.
bool has_pixel(int x, int y) const
Returns whether a given coordinate is inside of the texture dimensions.
int get_x_size() const
Returns the width of the texture image that is contributing to the TexturePeeker's information.