libjxl

FORK: libjxl patches used on blog
git clone https://git.neptards.moe/blog/libjxl.git
Log | Files | Refs | Submodules | README | LICENSE

simple_render_pipeline.h (1178B)


      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_SIMPLE_RENDER_PIPELINE_H_
      7 #define LIB_JXL_RENDER_PIPELINE_SIMPLE_RENDER_PIPELINE_H_
      8 
      9 #include <stdint.h>
     10 
     11 #include "lib/jxl/render_pipeline/render_pipeline.h"
     12 
     13 namespace jxl {
     14 
     15 // A RenderPipeline that is "obviously correct"; it may use potentially large
     16 // amounts of memory and be slow. It is intended to be used mostly for testing
     17 // purposes.
     18 class SimpleRenderPipeline : public RenderPipeline {
     19   std::vector<std::pair<ImageF*, Rect>> PrepareBuffers(
     20       size_t group_id, size_t thread_id) override;
     21 
     22   Status ProcessBuffers(size_t group_id, size_t thread_id) override;
     23 
     24   Status PrepareForThreadsInternal(size_t num, bool use_group_ids) override;
     25 
     26   // Full frame buffers. Both X and Y dimensions are padded by
     27   // kRenderPipelineXOffset.
     28   std::vector<ImageF> channel_data_;
     29   size_t processed_passes_ = 0;
     30 
     31  private:
     32   Rect MakeChannelRect(size_t group_id, size_t channel);
     33 };
     34 
     35 }  // namespace jxl
     36 
     37 #endif  // LIB_JXL_RENDER_PIPELINE_SIMPLE_RENDER_PIPELINE_H_