Skip to content

Commit

Permalink
BINDINGS/C++: Added image::mirror() (closes #212)
Browse files Browse the repository at this point in the history
  • Loading branch information
HappySeaFox committed May 15, 2024
1 parent e1fbce3 commit 4b55f0a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/bindings/sail-c++/image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,13 @@ SailPixelFormat image::closest_pixel_format(const sail::save_features &save_feat
return sail_closest_pixel_format(d->sail_image->pixel_format, save_features.pixel_formats().data(), save_features.pixel_formats().size());
}

sail_status_t image::mirror(SailOrientation orientation)
{
SAIL_TRY(sail_mirror(d->sail_image, orientation));

return SAIL_OK;
}

bool image::can_convert(SailPixelFormat input_pixel_format, SailPixelFormat output_pixel_format)
{
return sail_can_convert(input_pixel_format, output_pixel_format);
Expand Down
11 changes: 11 additions & 0 deletions src/bindings/sail-c++/image.h
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,17 @@ class SAIL_EXPORT image
*/
SailPixelFormat closest_pixel_format(const sail::save_features &save_features) const;

/*
* Mirrors the image horizontally or vertically.
*
* Only SAIL_ORIENTATION_MIRRORED_HORIZONTALLY and SAIL_ORIENTATION_MIRRORED_VERTICALLY
* values are accepted. When mirroring horizontally, the image pixel size must be a multiple of 8,
* e.g. 8, 16, 24 etc.
*
* Returns SAIL_OK on success.
*/
sail_status_t mirror(SailOrientation orientation);

/*
* Returns true if the conversion or updating functions can convert or update from the input
* pixel format to the output pixel format.
Expand Down

0 comments on commit 4b55f0a

Please sign in to comment.