Skip to content
Myr

Merge pull request #1820 from jeffrbig2/resize2.14

Before adoption: this commit came in with the history the project adopted, so no landing records it.

stb_image_resize2 2.15 - couple small unusual asssert and warning workarounds

authored by Sean Barrett · committed by GitHub · parents f58f558, f6142a7 · Browse files · 1 file+6 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+6 added−3 removed

  • other:+6 added−3 removed

1 file+6 added−3 removed

modified:stb_image_resize2.h+6 added-3 removed
1/* stb_image_resize2 - v2.14 - public domain image resizing1/* stb_image_resize2 - v2.15 - public domain image resizing23 by Jeff Roberts (v2) and Jorge L Rodriguez4 http://github.com/nothings/stb5
322 unmodified lines
328 Aras Pranckevicius: bugfixes329 Nathan Reed: warning fixes for 1.0330331 REVISIONS332 2.15 (2025-07-17) fixed an assert in debug mode when using floats with input333 callbacks, work around GCC warning when adding to null ptr334 (thanks Johannes Spohr and Pyry Kovanen).335 2.14 (2025-05-09) fixed a bug using downsampling gather horizontal first, and 336 scatter with vertical first.337 2.13 (2025-02-27) fixed a bug when using input callbacks, turned off simd for 338 tiny-c, fixed some variables that should have been static,
4273 unmodified lines
4612 // if we have an input callback, call it to get the input data4613 if ( stbir_info->in_pixels_cb )4614 {4615 // call the callback with a temp buffer (that they can choose to use or not). the temp is just right aligned memory in the decode_buffer itself4613 input_data = stbir_info->in_pixels_cb( ( (char*) end_decode ) - ( width * input_sample_in_bytes ) + sizeof(float)*STBIR_INPUT_CALLBACK_PADDING, input_plane_data, width, spans->pixel_offset_for_input, row, stbir_info->user_data );4616 input_data = stbir_info->in_pixels_cb( ( (char*) end_decode ) - ( width * input_sample_in_bytes ) + ( ( stbir_info->input_type != STBIR_TYPE_FLOAT ) ? ( sizeof(float)*STBIR_INPUT_CALLBACK_PADDING ) : 0 ), input_plane_data, width, spans->pixel_offset_for_input, row, stbir_info->user_data );4617 }46184619 STBIR_PROFILE_START( decode );4620 // convert the pixels info the float decode_buffer, (we index from end_decode, so that when channels<effective_channels, we are right justified in the buffer)
2438 unmodified lines
70597060#ifdef STBIR__SEPARATE_ALLOCATIONS7061 #define STBIR__NEXT_PTR( ptr, size, ntype ) if ( alloced ) { void * p = STBIR_MALLOC( size, user_data); if ( p == 0 ) { stbir__free_internal_mem( info ); return 0; } (ptr) = (ntype*)p; }7062#else7060 #define STBIR__NEXT_PTR( ptr, size, ntype ) advance_mem = (void*) ( ( ((size_t)advance_mem) + 15 ) & ~15 ); if ( alloced ) ptr = (ntype*)advance_mem; advance_mem = ((char*)advance_mem) + (size);7063 #define STBIR__NEXT_PTR( ptr, size, ntype ) advance_mem = (void*) ( ( ((size_t)advance_mem) + 15 ) & ~15 ); if ( alloced ) ptr = (ntype*)advance_mem; advance_mem = (char*)(((size_t)advance_mem) + (size));7064#endif70657066 STBIR__NEXT_PTR( info, sizeof( stbir__info ), stbir__info );7067
3563 unmodified lines