Skip to content

Commit

Permalink
BINDINGS/C++: Revert "BINDINGS/C++: Remove image::pixels_size()"
Browse files Browse the repository at this point in the history
This reverts commit d2c23a6.
  • Loading branch information
HappySeaFox committed Oct 26, 2023
1 parent 3dc595f commit 7100faa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/bindings/c++/image-c++.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ image& image::operator=(const sail::image &image)
set_meta_data(image.meta_data());
set_iccp(image.iccp());
set_source_image(image.source_image());
set_pixels(image.pixels(), image.d->pixels_size);
set_pixels(image.pixels(), image.pixels_size());

return *this;
}
Expand Down Expand Up @@ -251,6 +251,11 @@ const void* image::scan_line(unsigned i) const
return reinterpret_cast<const char *>(pixels()) + i * bytes_per_line();
}

std::size_t image::pixels_size() const
{
return d->pixels_size;
}

void image::set_resolution(const sail::resolution &resolution)
{
d->resolution = resolution;
Expand Down
5 changes: 5 additions & 0 deletions src/bindings/c++/image-c++.h
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,11 @@ class SAIL_EXPORT image
*/
const void* scan_line(unsigned i) const;

/*
* Returns the size of the pixel data in bytes.
*/
std::size_t pixels_size() const;

/*
* Sets a new resolution.
*/
Expand Down

0 comments on commit 7100faa

Please sign in to comment.