1 // Copyright (c) the JPEG XL Project Authors. All rights reserved. 2 // 3 // Use of this source code is governed by a BSD-style 4 // license that can be found in the LICENSE file. 5 6 #ifndef LIB_JXL_RENDER_PIPELINE_STAGE_XYB_H_ 7 #define LIB_JXL_RENDER_PIPELINE_STAGE_XYB_H_ 8 #include <math.h> 9 #include <stdint.h> 10 #include <stdio.h> 11 12 #include <algorithm> 13 #include <utility> 14 #include <vector> 15 16 #include "lib/jxl/dec_xyb.h" 17 #include "lib/jxl/render_pipeline/render_pipeline_stage.h" 18 19 namespace jxl { 20 21 // Converts the color channels from XYB to the specified output encoding. 22 std::unique_ptr<RenderPipelineStage> GetXYBStage( 23 const OutputEncodingInfo& output_encoding_info); 24 25 // Gets a stage to convert with fixed point arithmetic from XYB to sRGB8 and 26 // write to a uint8 buffer. 27 std::unique_ptr<RenderPipelineStage> GetFastXYBTosRGB8Stage( 28 uint8_t* rgb, size_t stride, size_t width, size_t height, bool rgba, 29 bool has_alpha, size_t alpha_c); 30 } // namespace jxl 31 32 #endif // LIB_JXL_RENDER_PIPELINE_STAGE_XYB_H_ 33