![]() |
NDEVR
API Documentation
|
Stores information for painting pixels at a time into a 2D texture. More...
Public Member Functions | |
| MaterialRaster (const String &image_id, const RasterInfo &raster_info) | |
| Constructs a MaterialRaster with a given image identifier and raster configuration. | |
| virtual void | addImageBuffer (const Buffer< uint01 > &pixels, const Vector< 2, uint04 > &size, const Matrix< fltp08 > &camera_matrix) override |
| Adds an entire image buffer to the raster, mapping pixels through a camera matrix. | |
| void | addPixelInfo (const RGBColor &pixel, const Vector< 2, fltp08 > &location, uint04 weight) override |
| Adds pixel color data at a normalized floating-point location with a given weight. | |
| void | addPixelInfo (const RGBColor &pixel, const Vector< 2, uint04 > &location, uint08 weight) override |
| Adds pixel color data at an integer pixel location with a given weight. | |
| void | addPixelInfo (const Vector< 4, fltp04 > &pixel, const Vector< 2, fltp08 > &location, uint08 weight) override |
| Adds pixel color data (as normalized floats) at a normalized location with a weight. | |
| void | addPixelInfo (const Vector< 4, fltp04 > &pixel, const Vector< 2, uint04 > &location, uint08 weight) override |
| Adds pixel color data (as normalized floats) at an integer pixel location with a weight. | |
| virtual void | clearRaster () |
| Resets all accumulated color channel data and average counts to zero. | |
| Vector< 2, uint04 > | convertLocation (const Vector< 2, fltp08 > &location) const |
| Converts a normalized [0,1] floating-point location to an integer pixel coordinate, handling wrapping around the Y and X axes for spherical-style textures. | |
| uint04 | convertToIndex (const Vector< 2, uint04 > &location) const |
| Converts a 2D pixel coordinate to a linear buffer index. | |
| StringView | imageID () const override |
| Returns the image identifier for this raster. | |
| virtual void | setUnsetColor (RGBColor color) |
| Sets a fallback color for all pixels within the update bounds that have not received any pixel data (i.e., have zero contribution count). | |
| virtual void | updateImage () override |
| Commits accumulated pixel data to the image by averaging color channels, then uploads the result to the ImageFactory. | |
| Public Member Functions inherited from MaterialRasterBase | |
| MaterialRasterBase (const RasterInfo &raster_info) | |
| Constructs the base raster with the given raster configuration. | |
Static Public Member Functions | |
| static uint04 | Weight (const Vertex< 2, fltp08 > &location, fltp08 y_dist) |
| Computes a pixel contribution weight based on distance from the raster center. | |
Protected Attributes | |
| Buffer< uint08 > | m_color_channel_average_count |
| Total accumulated weight per pixel (divisor for averaging). | |
| Buffer< Vector< 3, uint08 > > | m_color_channels |
| Accumulated weighted RGB color values per pixel (used for averaging). | |
| String | m_image_id |
| The unique identifier for this raster's image resource. | |
| Buffer< uint01 > | m_pixels |
| Raw RGBA pixel buffer (4 bytes per pixel) uploaded to the ImageFactory. | |
| Bounds< 2, uint04 > | m_update_bounds |
| Bounding box of pixels that have been modified since the last update. | |
| Protected Attributes inherited from MaterialRasterBase | |
| RasterInfo | m_raster_info |
| The raster configuration settings. | |
Stores information for painting pixels at a time into a 2D texture.
Definition at line 109 of file MaterialRaster.h.
|
inline |
Constructs a MaterialRaster with a given image identifier and raster configuration.
Allocates internal buffers and registers the image with the default ImageFactory.
| [in] | image_id | The unique identifier for the raster image resource. |
| [in] | raster_info | The raster configuration specifying pixel size and other settings. |
Definition at line 117 of file MaterialRaster.h.
References MaterialRasterBase::MaterialRasterBase(), ImageFactory::addImageUncompressed(), ImageFactory::DefaultFactory(), m_color_channel_average_count, m_color_channels, m_image_id, m_pixels, m_update_bounds, and RasterInfo::pixel_size.
|
overridevirtual |
Adds an entire image buffer to the raster, mapping pixels through a camera matrix.
| [in] | pixels | Raw pixel data buffer. |
| [in] | size | Width and height of the source image in pixels. |
| [in] | camera_matrix | The camera projection/view matrix used to map source pixels onto the raster. |
Implements MaterialRasterBase.
|
inlineoverridevirtual |
Adds pixel color data at a normalized floating-point location with a given weight.
Converts the location to a pixel coordinate and delegates to the integer-location overload.
| [in] | pixel | The color to add. |
| [in] | location | The normalized [0,1] texture coordinate. |
| [in] | weight | The contribution weight for this pixel. |
Implements MaterialRasterBase.
Definition at line 219 of file MaterialRaster.h.
References addPixelInfo(), and convertLocation().
Referenced by addPixelInfo(), and addPixelInfo().
|
inlineoverridevirtual |
Adds pixel color data at an integer pixel location with a given weight.
Accumulates weighted color values and updates the dirty bounds.
| [in] | pixel | The color to add. |
| [in] | location | The pixel coordinate on the raster texture. |
| [in] | weight | The contribution weight for this pixel. |
Implements MaterialRasterBase.
Definition at line 232 of file MaterialRaster.h.
References Vector< t_dims, t_type >::as(), convertToIndex(), m_color_channel_average_count, m_color_channels, and m_update_bounds.
|
inlineoverridevirtual |
Adds pixel color data (as normalized floats) at a normalized location with a weight.
Converts the location and delegates to the integer-location overload.
| [in] | pixel | The RGBA color as floats in [0,1] range. |
| [in] | location | The normalized [0,1] texture coordinate. |
| [in] | weight | The contribution weight for this pixel. |
Implements MaterialRasterBase.
Definition at line 249 of file MaterialRaster.h.
References addPixelInfo(), and convertLocation().
|
inlineoverridevirtual |
Adds pixel color data (as normalized floats) at an integer pixel location with a weight.
If weight is max uint08, the pixel overwrites rather than accumulates.
| [in] | pixel | The RGBA color as floats in [0,1] range. |
| [in] | location | The pixel coordinate on the raster texture. |
| [in] | weight | The contribution weight. If Constant<uint08>::Max, the pixel value is set directly instead of being accumulated. |
Implements MaterialRasterBase.
Definition at line 261 of file MaterialRaster.h.
References convertToIndex(), m_color_channel_average_count, m_color_channels, and m_update_bounds.
Converts a normalized [0,1] floating-point location to an integer pixel coordinate, handling wrapping around the Y and X axes for spherical-style textures.
| [in] | location | The normalized texture coordinate in [0,1] range. |
Referenced by addPixelInfo(), and addPixelInfo().
Converts a 2D pixel coordinate to a linear buffer index.
| [in] | location | The 2D pixel coordinate (x, y). |
Definition at line 209 of file MaterialRaster.h.
References MaterialRasterBase::m_raster_info.
Referenced by addPixelInfo(), addPixelInfo(), setUnsetColor(), and updateImage().
|
inlineoverridevirtual |
Returns the image identifier for this raster.
Implements MaterialRasterBase.
Definition at line 130 of file MaterialRaster.h.
References m_image_id.
|
inlinevirtual |
Sets a fallback color for all pixels within the update bounds that have not received any pixel data (i.e., have zero contribution count).
| [in] | color | The fallback color to apply to unset pixels. |
Definition at line 144 of file MaterialRaster.h.
References RGBColor::b_pos, convertToIndex(), RGBColor::g_pos, m_color_channel_average_count, m_pixels, m_update_bounds, and RGBColor::r_pos.
Computes a pixel contribution weight based on distance from the raster center.
| [in] | location | The 2D position used to compute the weight (distance from center). |
| [in] | y_dist | A distance scaling factor (purpose unclear; may relate to vertical spread or sampling density). |
Definition at line 188 of file MaterialRaster.h.
References cast(), getMax(), and Vector< t_dims, t_type >::magnitudeSquared().