summaryrefslogtreecommitdiffstats
path: root/core/image.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Reorganized core/ directory, it was too fatty alreadyreduz2020-11-071-3608/+0
| | | | | | -Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
* Add `Image.load_bmp_from_buffer()` for run-time BMP image loadingHugo Locurcio2020-10-201-1/+14
| | | | | This partially addresses https://github.com/godotengine/godot-proposals/issues/676.
* Implement 3D textures as import and resource format.reduz2020-09-091-0/+76
|
* Image: Improve error messages for invalid creation sizeRémi Verschelde2020-07-031-4/+8
|
* Merge pull request #38920 from paulherman/tgaRémi Verschelde2020-06-301-0/+8
|\ | | | | Expose loading TGA images in Image.
| * Expose loading TGA images in Image.Paul Herman2020-05-211-0/+8
| |
* | Fix upscaling image with bilinear interpolation option specifiedMaganty Rushyendra2020-06-191-13/+14
| | | | | | | | | | Fix error in calculation of 4 nearest points in source image when resizing image with bilinear interpolation.
* | Merge pull request #39200 from azagaya/fix-blend-2Rémi Verschelde2020-06-071-12/+10
|\ \ | | | | | | Fixing wrong blending rect methods
| * | Fixing wrong blending rect methodsazagaya2020-05-311-12/+10
| | | | | | | | | | | | | | | | | | | | | | | | Using Color.blend function instead of custom code Fixed clang_format Removed unnecessary help
* | | Expose `Image.save_png_to_buffer` methodAndrii Doroshenko (Xrayez)2020-05-201-0/+1
| | |
* | | Style: Remove unnecessary semicolons from `core`Rémi Verschelde2020-05-191-2/+2
| |/ |/| | | | | | | | | | | | | | | | | Semicolons are not necessary after function definitions or control flow blocks, and having some code use them makes things inconsistent (and occasionally can mess up `clang-format`'s formatting). Removing them is tedious work though, I had to do this manually (regex + manual review) as I couldn't find a tool for that. All other code folders would need to get the same treatment.
* | Remove HQ2X and the `Image.expand_2x_hq2x()` methodHugo Locurcio2020-05-161-44/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | As of Godot 3.0, HQ2X is no longer used to upscale the editor theme and icons on hiDPI displays, which limited its effective uses. HQ2X was also used to upscale the project theme when the "Use Hidpi" project setting was enabled, but results were often less than ideal. The new StyleBoxFlat and SVG support also make HQ2X less important to have as a core feature. This decreases binary sizes slightly (-150 KB on most platforms, -212 KB on WebAssembly release). This partially addresses #12419.
* | Merge pull request #38717 from madmiraal/fix-image-uninitialized-warningRémi Verschelde2020-05-151-3/+3
|\ \ | | | | | | Silence 'w' may be used uninitialized in image.cpp warning.
| * | Silence 'w' may be used uninitialized in image.cpp warning.Marcel Admiraal2020-05-141-3/+3
| | | | | | | | | | | | Rename `w` to the more meaningful `data_write`
* | | Style: Enforce braces around if blocks and loopsRémi Verschelde2020-05-141-115/+200
| | | | | | | | | | | | | | | Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
* | | Style: Enforce separation line between function definitionsRémi Verschelde2020-05-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I couldn't find a tool that enforces it, so I went the manual route: ``` find -name "thirdparty" -prune \ -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \ -o -name "*.glsl" > files perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files) misc/scripts/fix_style.sh -c ``` This adds a newline after all `}` on the first column, unless they are followed by `#` (typically `#endif`). This leads to having lots of places with two lines between function/class definitions, but clang-format then fixes it as we enforce max one line of separation. This doesn't fix potential occurrences of function definitions which are indented (e.g. for a helper class defined in a .cpp), but it's better than nothing. Also can't be made to run easily on CI/hooks so we'll have to be careful with new code. Part of #33027.
* | | Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde2020-05-141-209/+0
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
* | Enforce use of bool literals instead of integersRémi Verschelde2020-05-141-7/+7
| | | | | | | | | | Using clang-tidy's `modernize-use-bool-literals`. https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-bool-literals.html
* | Port member initialization from constructor to declaration (C++11)Rémi Verschelde2020-05-141-11/+0
| | | | | | | | | | | | | | | | | | | | Using `clang-tidy`'s `modernize-use-default-member-init` check and manual review of the changes, and some extra manual changes that `clang-tidy` failed to do. Also went manually through all of `core` to find occurrences that `clang-tidy` couldn't handle, especially all initializations done in a constructor without using initializer lists.
* | New lightmapperJuan Linietsky2020-05-101-0/+4
| | | | | | | | | | | | | | -Added LocalVector (needed it) -Added stb_rect_pack (It's pretty cool, we could probably use it for other stuff too) -Fixes and changes all around the place -Added library for 128 bits fixed point (required for Delaunay3D)
* | Style: clang-format: Disable AllowShortCaseLabelsOnASingleLineRémi Verschelde2020-05-101-132/+367
| | | | | | | | Part of #33027.
* | Style: clang-format: Disable AllowShortIfStatementsOnASingleLineRémi Verschelde2020-05-101-2/+4
| | | | | | | | | | | | | | Part of #33027, also discussed in #29848. Enforcing the use of brackets even on single line statements would be preferred, but `clang-format` doesn't have this functionality yet.
* | Fix square image resizeVasiliy Makarov2020-04-181-0/+3
| | | | | | | | Fixes #37980
* | Replace NULL with nullptrlupoDharkael2020-04-021-26/+26
|/
* some typo in method binds fixedThakee Nathees2020-04-011-1/+1
|
* Fix some -Wmaybe-uninitialized warningsRémi Verschelde2020-03-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Namely: ``` modules/basis_universal/register_types.cpp: In function 'Ref<Image> basis_universal_unpacker(const Vector<unsigned char>&)': modules/basis_universal/register_types.cpp:266:15: warning: 'imgfmt' may be used uninitialized in this function [-Wmaybe-uninitialized] 266 | image->create(info.m_width, info.m_height, info.m_total_levels > 1, imgfmt, gpudata); | ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ modules/basis_universal/register_types.cpp:255:39: warning: 'format' may be used uninitialized in this function [-Wmaybe-uninitialized] 255 | bool ret = tr.transcode_image_level(ptr, size, 0, i, dst + ofs, level.m_total_blocks - i, format); | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` ``` servers/visual_server.cpp: In member function 'Error VisualServer::_surface_set_data(Array, uint32_t, uint32_t*, uint32_t, Vector<unsigned char>&, int, Vector<unsigned char>&, int, AABB&, Vector<AABB>&)': servers/visual_server.cpp:636:15: warning: 'iw' may be used uninitialized in this function [-Wmaybe-uninitialized] 636 | copymem(&iw[i * 2], &v, 2); | ^ ``` ``` core/image.cpp: In member function 'Error Image::generate_mipmap_roughness(Image::RoughnessChannel, const Ref<Image>&)': core/image.cpp:1683:11: warning: 'roughness' may be used uninitialized in this function [-Wmaybe-uninitialized] 1683 | float roughness; | ^~~~~~~~~ ```
* Force mipmaps off when importing RGBA4444 texturesclayjohn2020-02-291-0/+2
|
* PoolVector is gone, replaced by VectorJuan Linietsky2020-02-181-209/+124
| | | | | Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are sugar for `Vector<Type>`.
* Remove deprecated Color::grayHanif Bin Ariffin2020-02-121-1/+1
| | | | | | It was marked to be removed in Godot 3.1. Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
* Added normalmap guided roughness mipmap generator, and a global roughness ↵Juan Linietsky2020-02-111-29/+247
| | | | limiter.
* Several fixes to GIProbesJuan Linietsky2020-02-111-0/+13
|
* Rewritten StreamTexture for better code reuse, added basis universal supportJuan Linietsky2020-02-111-48/+143
|
* Custom material support seems complete.Juan Linietsky2020-02-111-1/+15
|
* Remove duplicate WARN_PRINT macro.Marcel Admiraal2020-02-051-1/+1
|
* Fixes invalid writes in Image operationsHaoyu Qiu2020-01-281-1/+5
|
* Fix AtlasPacker ignoring semi-transparent pixelsEric Rybicki2020-01-201-2/+1
| | | | Fixes #33106
* Fallback to RGBA4444 for textures with alpha set to ETC compressionclayjohn2020-01-021-16/+16
|
* Update copyright statements to 2020Rémi Verschelde2020-01-011-2/+2
| | | | | | | | | | | Happy new year to the wonderful Godot community! We're starting a new decade with a well-established, non-profit, free and open source game engine, and tons of further improvements in the pipeline from hundreds of contributors. Godot will keep getting better, and we're looking forward to all the games that the community will keep developing and releasing with it.
* Fix some crashes, overflows and using variables without valuesRafał Mikrut2019-11-011-2/+3
|
* Fixed uinitialized variable in srgb_to_linear tableHanif Bin Ariffin2019-10-301-1/+1
| | | | | | Old array's size was actually 255. Fixes #33133
* Fix some crashes and using null pointersRafał Mikrut2019-10-281-2/+6
|
* Added some obvious errors explanationsqarmin2019-09-251-20/+20
|
* Modify outdated comments and error messages regarding indexed imagesAndrii Doroshenko (Xrayez)2019-08-261-6/+6
| | | | | Godot doesn't support indexed images anymore (FORMAT_INDEXED), so those are removed to avoid any confusion.
* Replace 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG' in 'core/' and 'editor/'Braden Bodily2019-08-171-50/+15
| | | | | | | | | Condensed some if and ERR statements. Added dots to end of error messages Couldn't figure out EXPLAINC. These files gave me trouble: core/error_macros.h, core/io/file_access_buffered_fa.h (where is it?), core/os/memory.cpp, drivers/png/png_driver_common.cpp, drivers/xaudio2/audio_driver_xaudio2.cpp (where is it?)
* Fix image offset when upscaling with LanczosDavide Busterna2019-08-151-12/+9
|
* Add Image.save_exr()Marc Gilleron2019-08-071-0/+10
|
* Changed some code showed in LGTM and Coverageqarmin2019-07-201-30/+24
|
* Added release function to PoolVector::Access.Ibrahn Sahir2019-07-061-5/+5
| | | | | | For clarity, assign-to-release idiom for PoolVector::Read/Write replaced with a function call. Existing uses replaced (or removed if already handled by scope)
* Merge pull request #29980 from Dentrax/directed-by-qarminRémi Verschelde2019-07-011-0/+2
|\ | | | | Fix some editor crashes
| * fix some crashesFurkan Türkal2019-07-011-0/+2
| |