* @brief Set the value of a single pixel in an image. * * @param[out] img The output image; must use F32 texture components. * @param x The pixel x coordinate. * @param y The pixel y coordinate. * @param pixel The pixel color value to write. */
| 1390 | * @param pixel The pixel color value to write. |
| 1391 | */ |
| 1392 | static void image_set_pixel_u8( |
| 1393 | astcenc_image& img, |
| 1394 | size_t x, |
| 1395 | size_t y, |
| 1396 | vint4 pixel |
| 1397 | ) { |
| 1398 | // We should never escape bounds |
| 1399 | assert(x < img.dim_x); |
| 1400 | assert(y < img.dim_y); |
| 1401 | assert(img.data_type == ASTCENC_TYPE_U8); |
| 1402 | |
| 1403 | uint8_t* data = static_cast<uint8_t*>(img.data[0]); |
| 1404 | pack_and_store_low_bytes(pixel, data + (4 * img.dim_x * y) + (4 * x)); |
| 1405 | } |
| 1406 | |
| 1407 | /** |
| 1408 | * @brief Create a copy of @c input with forced unit-length normal vectors. |
no test coverage detected