-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BINDINGS/C++: Added ostream for common enums [closes #177]
- Loading branch information
1 parent
b8996aa
commit 443124e
Showing
6 changed files
with
146 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* This file is part of SAIL (https://github.com/smoked-herring/sail) | ||
Copyright (c) 2022 Dmitry Baryshev | ||
The MIT License | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
*/ | ||
|
||
#include "sail-c++.h" | ||
|
||
std::ostream& operator<<(std::ostream &os, SailPixelFormat pixel_format) | ||
{ | ||
os << sail_pixel_format_to_string(pixel_format); | ||
return os; | ||
} | ||
|
||
std::ostream& operator<<(std::ostream &os, SailChromaSubsampling chroma_subsampling) | ||
{ | ||
os << sail_chroma_subsampling_to_string(chroma_subsampling); | ||
return os; | ||
} | ||
|
||
std::ostream& operator<<(std::ostream &os, SailOrientation orientation) | ||
{ | ||
os << sail_orientation_to_string(orientation); | ||
return os; | ||
} | ||
|
||
std::ostream& operator<<(std::ostream &os, SailCompression compression) | ||
{ | ||
os << sail_compression_to_string(compression); | ||
return os; | ||
} | ||
|
||
std::ostream& operator<<(std::ostream &os, SailMetaData meta_data) | ||
{ | ||
os << sail_meta_data_to_string(meta_data); | ||
return os; | ||
} | ||
|
||
std::ostream& operator<<(std::ostream &os, SailResolutionUnit resolution_unit) | ||
{ | ||
os << sail_resolution_unit_to_string(resolution_unit); | ||
return os; | ||
} | ||
|
||
std::ostream& operator<<(std::ostream &os, SailCodecFeature codec_feature) | ||
{ | ||
os << sail_codec_feature_to_string(codec_feature); | ||
return os; | ||
} |
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,47 @@ | ||
/* This file is part of SAIL (https://github.com/smoked-herring/sail) | ||
Copyright (c) 2022 Dmitry Baryshev | ||
The MIT License | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
*/ | ||
|
||
#ifndef SAIL_OSTREAM_CPP_H | ||
#define SAIL_OSTREAM_CPP_H | ||
|
||
#include <ostream> | ||
|
||
#ifdef SAIL_BUILD | ||
#include "common.h" | ||
#include "export.h" | ||
#else | ||
#include <sail-common/common.h> | ||
#include <sail-common/export.h> | ||
#endif | ||
|
||
SAIL_EXPORT std::ostream& operator<<(std::ostream &os, SailPixelFormat pixel_format); | ||
SAIL_EXPORT std::ostream& operator<<(std::ostream &os, SailChromaSubsampling chroma_subsampling); | ||
SAIL_EXPORT std::ostream& operator<<(std::ostream &os, SailOrientation orientation); | ||
SAIL_EXPORT std::ostream& operator<<(std::ostream &os, SailCompression compression); | ||
SAIL_EXPORT std::ostream& operator<<(std::ostream &os, SailMetaData meta_data); | ||
SAIL_EXPORT std::ostream& operator<<(std::ostream &os, SailResolutionUnit resolution_unit); | ||
SAIL_EXPORT std::ostream& operator<<(std::ostream &os, SailCodecFeature codec_feature); | ||
|
||
#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
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