![]() |
ProtoTracer
1.0
Real-time 3D rendering and animation engine
|
Represents an image-based material with support for transformations and palette adjustments. More...
#include <Image.h>
Public Member Functions | |
Image (const uint8_t *data, const uint8_t *rgbColors, unsigned int xPixels, unsigned int yPixels, uint8_t colors) | |
Constructs an Image material. | |
~Image () | |
Destructor for Image . | |
void | SetData (const uint8_t *data) |
Sets the image data. | |
void | SetColorPalette (const uint8_t *rgbColors) |
Sets the color palette. | |
void | SetSize (Vector2D size) |
Sets the size of the image. | |
void | SetPosition (Vector2D offset) |
Sets the position offset of the image. | |
void | SetRotation (float angle) |
Sets the rotation angle of the image. | |
void | SetHueAngle (float hueAngle) |
Sets the hue adjustment angle of the image. | |
RGBColor | GetRGB (const Vector3D &position, const Vector3D &normal, const Vector3D &uvw) override |
Calculates the RGB color at a specific position. | |
![]() | |
virtual | ~Material ()=default |
Virtual destructor for proper cleanup in derived classes. | |
Public Attributes | |
Vector2D | size |
The size of the image. | |
Vector2D | offset |
The offset position of the image. | |
float | angle = 0.0f |
The rotation angle of the image in degrees. | |
float | hueAngle = 0.0f |
The hue adjustment angle of the image. | |
unsigned int | xPixels = 0 |
The width of the image in pixels. | |
unsigned int | yPixels = 0 |
The height of the image in pixels. | |
const uint8_t * | data |
Pointer to the image data. | |
const uint8_t * | rgbColors |
Pointer to the color palette. | |
uint8_t | colors |
The number of colors in the palette. | |
Additional Inherited Members | |
![]() | |
enum | Method { Base , Add , Subtract , Multiply , Divide , Darken , Lighten , Screen , Overlay , SoftLight , Replace , EfficientMask , Bypass } |
Defines blending methods for combining colors. More... | |
Represents an image-based material with support for transformations and palette adjustments.
Image | ( | const uint8_t * | data, |
const uint8_t * | rgbColors, | ||
unsigned int | xPixels, | ||
unsigned int | yPixels, | ||
uint8_t | colors | ||
) |
|
overridevirtual |
Calculates the RGB color at a specific position.
position | 3D position in the image. |
normal | Normal vector at the position. |
uvw | Texture coordinates at the position. |
Implements Material.
Reimplemented in UVMap.
Definition at line 35 of file Image.cpp.
References angle, colors, data, hueAngle, RGBColor::HueShift(), Mathematics::Map(), offset, rgbColors, Vector2D::Rotate(), size, Vector2D::X, Vector3D::X, xPixels, Vector2D::Y, Vector3D::Y, and yPixels.
float angle = 0.0f |
The rotation angle of the image in degrees.
Definition at line 27 of file Image.h.
Referenced by GetRGB(), and SetRotation().
uint8_t colors |
The number of colors in the palette.
Definition at line 33 of file Image.h.
Referenced by GetRGB(), UVMap::GetRGB(), and Image().
float hueAngle = 0.0f |
The hue adjustment angle of the image.
Definition at line 28 of file Image.h.
Referenced by GetRGB(), UVMap::GetRGB(), and SetHueAngle().
Vector2D offset |
The offset position of the image.
Definition at line 26 of file Image.h.
Referenced by GetRGB(), and SetPosition().
Pointer to the color palette.
Definition at line 32 of file Image.h.
Referenced by GetRGB(), UVMap::GetRGB(), Image(), and SetColorPalette().
Vector2D size |
The size of the image.
Definition at line 25 of file Image.h.
Referenced by GetRGB(), UVMap::GetRGB(), SetSize(), and UVMap::UVMap().
The width of the image in pixels.
Definition at line 29 of file Image.h.
Referenced by GetRGB(), UVMap::GetRGB(), and Image().
The height of the image in pixels.
Definition at line 30 of file Image.h.
Referenced by GetRGB(), UVMap::GetRGB(), and Image().