From 2c53e8b0e9be3de8b63d4166cc15db2addda3d8d Mon Sep 17 00:00:00 2001 From: Aaron Franke Date: Sat, 21 Nov 2020 02:42:29 -0500 Subject: Use Vector2i instead of Vector2 for Image get_pixelv and set_pixelv Co-authored-by: Andrii Doroshenko --- core/io/image.cpp | 12 ++++++------ core/io/image.h | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'core/io') diff --git a/core/io/image.cpp b/core/io/image.cpp index f3c87a0f2d..6dde25af32 100644 --- a/core/io/image.cpp +++ b/core/io/image.cpp @@ -2766,8 +2766,8 @@ Dictionary Image::_get_data() const { return d; } -Color Image::get_pixelv(const Point2 &p_src) const { - return get_pixel(p_src.x, p_src.y); +Color Image::get_pixelv(const Point2i &p_point) const { + return get_pixel(p_point.x, p_point.y); } Color Image::_get_color_at_ofs(const uint8_t *ptr, uint32_t ofs) const { @@ -2976,8 +2976,8 @@ Color Image::get_pixel(int p_x, int p_y) const { return _get_color_at_ofs(data.ptr(), ofs); } -void Image::set_pixelv(const Point2 &p_dst, const Color &p_color) { - set_pixel(p_dst.x, p_dst.y, p_color); +void Image::set_pixelv(const Point2i &p_point, const Color &p_color) { + set_pixel(p_point.x, p_point.y, p_color); } void Image::set_pixel(int p_x, int p_y, const Color &p_color) { @@ -3132,9 +3132,9 @@ void Image::_bind_methods() { ClassDB::bind_method(D_METHOD("_set_data", "data"), &Image::_set_data); ClassDB::bind_method(D_METHOD("_get_data"), &Image::_get_data); - ClassDB::bind_method(D_METHOD("get_pixelv", "src"), &Image::get_pixelv); + ClassDB::bind_method(D_METHOD("get_pixelv", "point"), &Image::get_pixelv); ClassDB::bind_method(D_METHOD("get_pixel", "x", "y"), &Image::get_pixel); - ClassDB::bind_method(D_METHOD("set_pixelv", "dst", "color"), &Image::set_pixelv); + ClassDB::bind_method(D_METHOD("set_pixelv", "point", "color"), &Image::set_pixelv); ClassDB::bind_method(D_METHOD("set_pixel", "x", "y", "color"), &Image::set_pixel); ClassDB::bind_method(D_METHOD("load_png_from_buffer", "buffer"), &Image::load_png_from_buffer); diff --git a/core/io/image.h b/core/io/image.h index c5ec74f02f..c4c84589e5 100644 --- a/core/io/image.h +++ b/core/io/image.h @@ -387,9 +387,9 @@ public: UsedChannels detect_used_channels(CompressSource p_source = COMPRESS_SOURCE_GENERIC); void optimize_channels(); - Color get_pixelv(const Point2 &p_src) const; + Color get_pixelv(const Point2i &p_point) const; Color get_pixel(int p_x, int p_y) const; - void set_pixelv(const Point2 &p_dst, const Color &p_color); + void set_pixelv(const Point2i &p_point, const Color &p_color); void set_pixel(int p_x, int p_y, const Color &p_color); void set_as_black(); -- cgit v1.2.3