Skip to content

Commit

Permalink
fix image 8 to 32 bit conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
daid committed Nov 5, 2023
1 parent bb9467e commit 1b410ab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/sp2/graphics/image/convert.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace sp::image {

namespace detail {
template<typename DST, typename SRC> struct PixelConvertInfo;
template<typename SRC, typename DST> struct PixelConvertInfo;
template<> struct PixelConvertInfo<uint32_t, uint8_t> { static inline uint8_t conv(uint32_t in) { return ((in & 0xFF) + ((in >> 8) & 0xFF) + ((in >> 16) & 0xFF)) / 3; } };
template<> struct PixelConvertInfo<uint8_t, uint32_t> { static inline uint32_t conv(uint8_t in) { return 0xFF000000 | in | (in << 8) | (in << 16); } };
}
Expand All @@ -17,7 +17,7 @@ template<typename DST, typename SRC> ImageBase<DST> convert(const ImageBase<SRC>
auto src = input.getPtr();
auto dst = output.getPtr();
for(int n=0; n<input.getSize().x*input.getSize().y; n++)
*dst++ = detail::PixelConvertInfo<DST, SRC>::conv(*src++);
*dst++ = detail::PixelConvertInfo<SRC, DST>::conv(*src++);
return output;
}

Expand Down

1 comment on commit 1b410ab

@daid-tinyci
Copy link

@daid-tinyci daid-tinyci bot commented on 1b410ab Feb 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TinyCI build failure:

[cmake ../template/ -G Ninja -DCMAKE_MODULE_PATH=../cmake/ -DCMAKE_BUILD_TYPE=Debug] returned [1]:


-- The CXX compiler identification is GNU 12.2.0

-- Detecting C compiler ABI info

-- Detecting C compiler ABI info - done

-- Check for working C compiler: /usr/bin/cc - skipped

-- Detecting C compile features

-- Detecting C compile features - done

-- Detecting CXX compiler ABI info

-- Detecting CXX compiler ABI info - done

-- Check for working CXX compiler: /usr/bin/c++ - skipped

-- Detecting CXX compile features

-- Detecting CXX compile features - done

-- Found Git: /usr/bin/git (found version "2.39.2") 

CMake Warning (dev) at /usr/share/cmake-3.25/Modules/FetchContent.cmake:1279 (message):

  The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is

  not set.  The policy's OLD behavior will be used.  When using a URL

  download, the timestamps of extracted files should preferably be that of

  the time of extraction, otherwise code that depends on the extracted

  contents might not be rebuilt if the URL changes.  The OLD behavior

  preserves the timestamps from the archive instead, but this is usually not

  what you want.  Update your project to the NEW behavior or specify the

  DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this

  robustness issue.

Call Stack (most recent call first):

  /data/tinyci_build/daid/SeriousProton2/SeriousProton2.include.cmake:84 (FetchContent_Declare)

  /data/tinyci_build/daid/SeriousProton2/cmake/FindSeriousProton2.cmake:30 (include)

  CMakeLists.txt:7 (find_package)

This warning is for project developers.  Use -Wno-dev to suppress it.



-- Configuring done

-- Generating done

CMake Error:

  Running



   '/usr/bin/ninja' '-C' '/data/tinyci_build/daid/SeriousProton2/_build_native_debug/_deps/json-subbuild' '-t' 'recompact'



  failed with:



   ninja: warning: bad deps log signature or version; starting over



  ninja: error: failed recompaction: No such file or directory







CMake Generate step failed.  Build files cannot be regenerated correctly.



CMake Error at /usr/share/cmake-3.25/Modules/FetchContent.cmake:1604 (message):

  CMake step for json failed: 1

Call Stack (most recent call first):

  /usr/share/cmake-3.25/Modules/FetchContent.cmake:1756:EVAL:2 (__FetchContent_directPopulate)

  /usr/share/cmake-3.25/Modules/FetchContent.cmake:1756 (cmake_language)

  /data/tinyci_build/daid/SeriousProton2/SeriousProton2.include.cmake:87 (FetchContent_Populate)

  /data/tinyci_build/daid/SeriousProton2/cmake/FindSeriousProton2.cmake:30 (include)

  CMakeLists.txt:7 (find_package)





-- Configuring incomplete, errors occurred!

See also "/data/tinyci_build/daid/SeriousProton2/_build_native_debug/CMakeFiles/CMakeOutput.log".

See also "/data/tinyci_build/daid/SeriousProton2/_build_native_debug/CMakeFiles/CMakeError.log".

Please sign in to comment.