-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use future boost::gil 1.68 IO extensions instead of homegrown hack
Starting with boost 1.68 boost::gil integrates IO support for grayscale-alpha png images, so prefer their implementation instead of our hacky gilext code.
- Loading branch information
1 parent
a5eae27
commit b489721
Showing
5 changed files
with
89 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#ifndef GILEXT_PNG_IO_V2_COMPAT_H | ||
#define GILEXT_PNG_IO_V2_COMPAT_H | ||
|
||
namespace boost { namespace gil { | ||
|
||
struct png_tag {}; | ||
|
||
template< typename Tag> | ||
struct image_read_settings {}; | ||
|
||
template< typename String | ||
, typename Image | ||
, typename FormatTag | ||
> | ||
inline | ||
void read_image( const String& file_name | ||
, Image& image | ||
, const FormatTag& tag | ||
) | ||
{ boost::gil::png_read_image(file_name, image); } | ||
|
||
template< typename String | ||
, typename Image | ||
, typename FormatTag | ||
> | ||
inline | ||
void read_and_convert_image( const String& file_name | ||
, Image& image | ||
, const FormatTag& tag | ||
) | ||
{ boost::gil::png_read_and_convert_image(file_name, image); } | ||
} } | ||
|
||
template< typename String | ||
, typename View | ||
, typename FormatTag | ||
> | ||
inline | ||
void write_view( const String& file_name | ||
, const View& view | ||
, const FormatTag& tag | ||
) | ||
{ boost::gil::png_write_view( file_name, view); } | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters