aboutsummaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authordan sinclair <dj2@everburning.com>2019-03-28 10:32:11 -0400
committerGitHub <noreply@github.com>2019-03-28 10:32:11 -0400
commit5fc7b6e796b9c6264e538a699ec3f50235a85449 (patch)
tree22c1772ce9b376e02541ed9cb24f693204eb4a45 /samples
parent7fa3e97ad0028fbac3ffeb7c47f19cfc4309fef5 (diff)
downloadamber-5fc7b6e796b9c6264e538a699ec3f50235a85449.tar.gz
Hide pipeline buffer formats (#420)
The default colour formats are only used in the pipeline class so this CL moves them into the anonymous namespace.
Diffstat (limited to 'samples')
-rw-r--r--samples/amber.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/samples/amber.cc b/samples/amber.cc
index 3b9e263..542a2e0 100644
--- a/samples/amber.cc
+++ b/samples/amber.cc
@@ -32,6 +32,8 @@
namespace {
+const char* kGeneratedColorBuffer = "framebuffer";
+
struct Options {
std::vector<std::string> input_filenames;
@@ -376,7 +378,7 @@ int main(int argc, const char** argv) {
if (!options.image_filename.empty()) {
amber::BufferInfo buffer_info;
- buffer_info.buffer_name = "framebuffer";
+ buffer_info.buffer_name = kGeneratedColorBuffer;
amber_options.extractions.push_back(buffer_info);
}
@@ -400,7 +402,7 @@ int main(int argc, const char** argv) {
bool usePNG = pos != std::string::npos &&
options.image_filename.substr(pos + 1) == "png";
for (const amber::BufferInfo& buffer_info : amber_options.extractions) {
- if (buffer_info.buffer_name == "framebuffer") {
+ if (buffer_info.buffer_name == kGeneratedColorBuffer) {
if (usePNG) {
result = png::ConvertToPNG(buffer_info.width, buffer_info.height,
buffer_info.values, &out_buf);
@@ -436,7 +438,7 @@ int main(int argc, const char** argv) {
std::cerr << options.buffer_filename << std::endl;
} else {
for (const amber::BufferInfo& buffer_info : amber_options.extractions) {
- if (buffer_info.buffer_name == "framebuffer")
+ if (buffer_info.buffer_name == kGeneratedColorBuffer)
continue;
buffer_file << buffer_info.buffer_name << std::endl;