1 // Copyright 2019 The Amber Authors. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 #ifndef SAMPLES_PPM_H_ 16 #define SAMPLES_PPM_H_ 17 18 #include <string> 19 #include <utility> 20 #include <vector> 21 22 #include "amber/amber.h" 23 #include "amber/result.h" 24 25 namespace ppm { 26 27 /// Converts the image of dimensions |width| and |height| and with pixels stored 28 /// in row-major order in |values| with format B8G8R8A8 into PPM format, 29 /// returning the PPM binary in |buffer|. 30 amber::Result ConvertToPPM(uint32_t width, 31 uint32_t height, 32 const std::vector<amber::Value>& values, 33 std::vector<uint8_t>* buffer); 34 35 } // namespace ppm 36 37 #endif // SAMPLES_PPM_H_ 38