Skip to content

Commit

Permalink
BINDINGS/C++: Added image::bits_per_pixel() class method
Browse files Browse the repository at this point in the history
  • Loading branch information
HappySeaFox committed Oct 26, 2023
1 parent 42d4c30 commit 06f9ffb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/bindings/c++/image-c++.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,11 @@ SailPixelFormat image::pixel_format() const
return d->sail_image->pixel_format;
}

unsigned image::bits_per_pixel() const
{
return sail_bits_per_pixel(pixel_format());
}

double image::gamma() const
{
return d->sail_image->gamma;
Expand Down
7 changes: 7 additions & 0 deletions src/bindings/c++/image-c++.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,13 @@ class SAIL_EXPORT image
*/
SailPixelFormat pixel_format() const;

/*
* Returns the number of bits per pixel (depth) of the image.
* For example, for SAIL_PIXEL_FORMAT_RGB 24 is returned.
* Returns 0 on unknown pixel format.
*/
unsigned bits_per_pixel() const;

/*
* Returns the image gamma.
*
Expand Down

0 comments on commit 06f9ffb

Please sign in to comment.