ok played around abit,
for all who need get_pixel again until (i hope) its implemented again.
workaround to get the pixels raw data (putpixel can be similar done):
i added a member to image-class (since getpixelb is private ) :
void Image::get_pixel_raw(int p_x, int p_y, uint8_t * p_dst, uint32_t &p_pixelsize)
{
uint32_t pixel_size = get_format_pixel_size(format);
if (p_pixelsize != pixel_size)
{
ERR_PRINT("Image.get_pixel_raw: pixelSize different");
ERR_FAIL();
}
PoolVector<uint8_t>::Read r = data.read();
_get_pixelb(p_x, p_y, pixel_size, r.ptr(), p_dst);
}
and use it like this:
uint32_t pixelSize = img.get_format_pixel_size(Image::FORMAT_RGBA8);
// TODO: create my "GRAY16" format again, to be able to load geoData
if (img.get_format() != Image::FORMAT_RGBA8)
{
ERR_PRINT("Only RGBA8 supported yet")
ERR_FAIL();
}
int width = img.get_width();
int height = img.get_height();
union sPixel { struct sPixelRGBA { uint8_t r; uint8_t g; uint8_t b; uint8_t a; } values; uint8_t data[4]; };
sPixel pixel;
PoolVector<real_t>::Write w = heights.write();
for (int y = 0; y < height; y++)
{
for (int x = 0; x < width; x++)
{
img.get_pixel_raw(x, y,pixel.data, pixelSize);
w[getVectorIndex(x, y)] = pixel.values.r;
}
}
but be aware of: https://github.com/godotengine/godot/issues/8158