summaryrefslogtreecommitdiff
path: root/core/io/image.cpp
AgeCommit message (Collapse)Author
2023-04-24Expose more compression formats in Image and fix compress checkNinni Pipping
Check for compressing ASTC checked if the function for BPTC was present (cherry picked from commit cf64e2fa479ce548713c589d9c3252e5ac36a6d3)
2023-01-30Refactor high quality texture importJuan Linietsky
* Only two texture import modes for low/high quality now: * S3TC/BPTC * ETC2/ASTC * Makes sense given this is the general preferred and most compatible combination in most platforms. * Removed lossy_quality from VRAM texture compression options. It was unused everywhere. * Added a new "high_quality" option to texture import. When enabled, it uses BPTC/ASTC (BC7/ASTC4x4) instead of S3TC/ETC2 (DXT1-5/ETC2,ETCA). * Changed MacOS export settings so required texture formats depend on the architecture selected. This solves the following problems: * Makes it simpler to import textures as high quality, without having to worry about the specific format used. * As the editor can now run on platforms such as web, Mac OS with Apple Silicion and Android, it should no longer be assumed that S3TC/BPTC is available by default for it.
2023-01-05One Copyright Update to rule them allRémi Verschelde
As many open source projects have started doing it, we're removing the current year from the copyright notice, so that we don't need to bump it every year. It seems like only the first year of publication is technically relevant for copyright notices, and even that seems to be something that many companies stopped listing altogether (in a version controlled codebase, the commits are a much better source of date of publication than a hardcoded copyright statement). We also now list Godot Engine contributors first as we're collectively the current maintainers of the project, and we clarify that the "exclusive" copyright of the co-founders covers the timespan before opensourcing (their further contributions are included as part of Godot Engine contributors). Also fixed "cf." Frenchism - it's meant as "refer to / see".
2022-12-21Fix crashed when compressing empty image data.stmSi
2022-12-20Merge pull request #65376 from reduz/astc-supportRémi Verschelde
Implement basic ASTC support
2022-12-20Implement basic ASTC supportJuan Linietsky
Implements basic ASTC support: * Only 4x4 and 8x8 block sizes. * Other block sizes are too complex to handle for Godot image compression handling. May be implemented sometime in the future. The need for ASTC is mostly for the following use cases: * Implement a high quality compression option for textures on mobile and M1 Apple hardware. * For this, the 4x4 is sufficient, since it uses the same size as BPTC. ASTC supports a lot of block sizes, but the benefit of supporting most of them is slim, while the implementation complexity in Godot is very high. Supporting only 4x4 (and 8x8) solves the real problem, which is lack of a BPTC alternative on hardware where it's missing. Note: This does not yet support encoding on import, an ASTC encoder will need to be added.
2022-12-02ETCPAK expects BGRA data for ETCBastiaan Olij
2022-11-22Merge pull request #64284 from kleonc/image-rotate90-in-placeRémi Verschelde
`Image` Fix `rotate_90`/`rotate_180` methods
2022-11-02Merge pull request #66017 from Mickeon/rename-image-copy-rectRémi Verschelde
Rename Image's `get_rect` to `get_region`
2022-11-01Rename Image's `get_rect` to `get_region`Micky
Also renames its parameter to from "rect" to "region".
2022-11-01Fix Image::bump_map_to_normal_map incorrectly keeping mipmap flagdzil123
2022-10-24Fix crash when calling `fill` method on an empty `Image`Yuri Rubinsky
2022-10-14Make some Image methods statickobewi
2022-10-07Fix MSVC warnings, rename shadowed variables, fix uninitialized values, ↵bruvzg
change warnings=all to use /W4.
2022-09-29Use `constexpr` in the conditions with template parameters and `sizeof`s to ↵bruvzg
suppress C4127 warnings.
2022-09-04Replace Rect2(i) has_no_area with has_areaAaron Franke
2022-09-01Replace Vector2(i) with Size2(i) for methods returning a sizeJohan Aires Rastén
2022-08-11`Image` Fix `rotate_90`/`rotate_180` methodskleonc
2022-08-08Merge pull request #62861 from samdze/image-size-vector2iRémi Verschelde
Make Image.get_size() return a Vector2i instead of a Vector2
2022-07-19Merge pull request #63005 from Chaosus/image_rotateRémi Verschelde
Implement `rotate_90/rotate_180` functions to `Image`
2022-07-18Use integer types in Image and ImageTexture methodsFireForge
- Image.blit_rect() - Image.blit_rect_mask() - Image.blend_rect() - Image.blend_rect_mask() - Image.fill_rect() - Image.get_used_rect() - Image.get_rect() - ImageTexture.set_size_override()
2022-07-15Implement `rotate_90/rotate_180` functions to `Image`Yuri Rubinsky
2022-07-09Make Image.get_size() return a Vector2i instead of a Vector2Samuele Zolfanelli
2022-07-08Add static methods for creating Image and ImageTexturekobewi
2022-06-23Restore the openexr grayscale property.K. S. Ernest (iFire) Lee
2022-06-23For in-engine processing allow saving openexr to a buffer.K. S. Ernest (iFire) Lee
2022-06-21Add support for saving WebP imagesAaron Franke
2022-06-21Implement Running Godot as Movie Writerreduz
* Allows running the game in "movie writer" mode. * It ensures entirely stable framerate, so your run can be saved stable and with proper sound (which is impossible if your CPU/GPU can't sustain doing this in real-time). * If disabling vsync, it can save movies faster than the game is run, but if you want to control the interaction it can get difficult. * Implements a simple, default MJPEG writer. This new features has two main use cases, which have high demand: * Saving game videos in high quality and ensuring the frame rate is *completely* stable, always. * Using Godot as a tool to make movies and animations (which is ideal if you want interaction, or creating them procedurally. No other software is as good for this). **Note**: This feature **IS NOT** for capturing real-time footage. Use something like OBS, SimpleScreenRecorder or FRAPS to achieve that, as they do a much better job at intercepting the compositor than Godot can probably do using Vulkan or OpenGL natively. If your game runs near real-time when capturing, you can still use this feature but it will play no sound (sound will be saved directly). Usage: $ godot --write-movie movie.avi [scene_file.tscn] Missing: * Options for configuring video writing via GLOBAL_DEF * UI Menu for launching with this mode from the editor. * Add to list of command line options. * Add a feature tag to override configurations when movie writing (fantastic for saving videos with highest quality settings).
2022-05-16Merge pull request #60126 from Calinou/image-improve-error-messagesRémi Verschelde
2022-05-11Fix invalid memory usage when using Image.convertHaoyu Qiu
2022-04-19Merge pull request #50175 from kleonc/image-blit-blend-fix-rectsHugo Locurcio
`Image.blit_rect/blend_rect` Fix rects calculations for negative arguments
2022-04-13Color: Rename `to_srgb`/`to_linear` to include base color spaceRémi Verschelde
This helps reduce confusion around sRGB <> Linear conversions by making both input and output color spaces explicit.
2022-04-11Improve error messages when creating Images from codeHugo Locurcio
The rationale behind the expected number of bytes is now displayed in clear (width, height, format, number of mipmaps expected if any).
2022-03-30Add PortableCompressedTexturereduz
* Resource that allows saving textures embedded in scenes or standalone. * Supports only formats that are portable: Lossy, Lossles or BasisUniversal This is something I wanted to add for a long time. I made it now because @fire requires it for importing GLTF2 files with embedded textures, but also this will allow saving Godot scenes as standalone binary files that will run in all platforms (because textures will load everywhere). This is ideal when you want to distribute individual standalone assets online in games that can be built from Godot scenes.
2022-03-28String: Remove TTR and DTR defines in non-tools buildRémi Verschelde
This ensures we don't use TTR in runtime code, as it's specifically meant to source translations for the editor.
2022-03-17Unify TextServer built-in module and GDExtension code.bruvzg
2022-03-09Change some math macros to constexprkobewi
Changes `MAX`, `MIN`, `ABS`, `CLAMP` and `SIGN`.
2022-02-04Faster CVTT by reducing quality.K. S. Ernest (iFire) Lee
Make BC6 and BC7 CVTT faster while still having better quality than DXT5.
2022-02-04Cleanup and move char functions to the `char_utils.h` header.bruvzg
2022-01-22Pad etcpak input to 4x4 blocks. Fixes #49981Lyuma
2022-01-14Remove support for PVRTC texture encoding and decodingHugo Locurcio
On the only platform where PVRTC is supported (iOS), ETC2 generally supersedes PVRTC in every possible way. The increased memory usage is not really a problem thanks to modern iOS' devices processing power being higher than its Android counterparts.
2022-01-03Update copyright statements to 2022Rémi Verschelde
Happy new year to the wonderful Godot community!
2021-11-26Fix `Image.blit_rect/blend_rect()` for negative `p_dest` pointkleonc
2021-11-23Image Use memcpy() in fill(), fill_rect(), _put_pixelb(), _get_pixelb()kleonc
Co-authored-by: Lightning_A <aaronjrecord@gmail.com>
2021-11-23Add Image::fill_rect methodkleonc
2021-10-25Fixed implicit conversion of uint32_t to uint8_t in `image`Anton Christoffersson
2021-09-29Use functions defined in the their classes.Anilforextra
2021-06-28Validate image formats, check if resize_to_po2 failedPaweł Fertyk
2021-06-27Fix Image.adjust_bcs crash when image format is invalidHaoyu Qiu
2021-06-19Rename `instance()`->`instantiate()` when it's a verbLightning_A