MCPcopy Create free account
hub / github.com/ARM-software/astc-encoder / image_set_pixel_u8

Function image_set_pixel_u8

Source/astcenccli_toplevel.cpp:1392–1405  ·  view source on GitHub ↗

* @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. */

Source from the content-addressed store, hash-verified

1390 * @param pixel The pixel color value to write.
1391 */
1392static 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.

Callers 1

print_diagnostic_imageFunction · 0.85

Calls 1

pack_and_store_low_bytesFunction · 0.70

Tested by

no test coverage detected