summaryrefslogtreecommitdiffstats
path: root/core/io/image.cpp
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2024-02-05 10:38:32 +0200
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2024-02-05 10:38:32 +0200
commit19f1d5afa9bb123a3d42cfd029e9d7862b3d5126 (patch)
tree87b410da9c765dcef318b8b317b14240f3be3725 /core/io/image.cpp
parentb4e2a24c1f62088b3f7ce0197afc90832fc25009 (diff)
downloadredot-engine-19f1d5afa9bb123a3d42cfd029e9d7862b3d5126.tar.gz
[TextServer / Font] Do not duplicate images to prevent unnecessary embedding.
Diffstat (limited to 'core/io/image.cpp')
-rw-r--r--core/io/image.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/core/io/image.cpp b/core/io/image.cpp
index 9aa7c9794a..e1f37f161f 100644
--- a/core/io/image.cpp
+++ b/core/io/image.cpp
@@ -3300,6 +3300,18 @@ void Image::set_pixel(int p_x, int p_y, const Color &p_color) {
_set_color_at_ofs(data.ptrw(), ofs, p_color);
}
+const uint8_t *Image::ptr() const {
+ return data.ptr();
+}
+
+uint8_t *Image::ptrw() {
+ return data.ptrw();
+}
+
+int64_t Image::data_size() const {
+ return data.size();
+}
+
void Image::adjust_bcs(float p_brightness, float p_contrast, float p_saturation) {
ERR_FAIL_COND_MSG(!_can_modify(format), "Cannot adjust_bcs in compressed or custom image formats.");