Skip to content

Commit 6f15fbc

Browse files
Better const correctness for image_load_from_memory.
1 parent 440f084 commit 6f15fbc

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

image/examples/example_image_io.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ int main(int, char**)
5050
{
5151
// Load image from binary data
5252
const auto input_image_path = std::filesystem::path(tc::img::examples::image_data_path) / "portrait.jpg";
53-
auto bin_img = tc::img::image_load_as_binary(input_image_path);
53+
const auto bin_img = tc::img::image_load_as_binary(input_image_path);
5454

5555
// Create image data from binary image data
5656
auto [img_data, width, height, channels] = tc::img::image_load_from_memory(bin_img.data(), bin_img.size());

image/include/teiacare/image/image_io.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ auto image_load(
5757
* \return Tuple containing the decoded image data and dimensions (data, width, height, channels)
5858
*/
5959
auto image_load_from_memory(
60-
uint8_t* memory_data,
60+
const uint8_t* memory_data,
6161
std::size_t memory_data_size) -> std::tuple<std::vector<uint8_t>, int, int, int>;
6262

6363
/*!

image/src/image_io.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ auto image_load(const std::filesystem::path& image_path) -> std::tuple<std::vect
6969
return create_image_data(image_data, width, height, channels);
7070
}
7171

72-
auto image_load_from_memory(uint8_t* memory_data, std::size_t memory_data_size) -> std::tuple<std::vector<uint8_t>, int, int, int>
72+
auto image_load_from_memory(const uint8_t* memory_data, std::size_t memory_data_size) -> std::tuple<std::vector<uint8_t>, int, int, int>
7373
{
7474
int width, height, channels;
7575
constexpr int channels_count = 3;

0 commit comments

Comments
 (0)