libjxl

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

common.cc (625B)


      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 #include "plugins/gimp/common.h"
      7 
      8 namespace jxl {
      9 
     10 JpegXlGimpProgress::JpegXlGimpProgress(const char *message) {
     11   cur_progress = 0;
     12   max_progress = 100;
     13 
     14   gimp_progress_init_printf("%s\n", message);
     15 }
     16 
     17 void JpegXlGimpProgress::update() {
     18   gimp_progress_update(static_cast<float>(++cur_progress) /
     19                        static_cast<float>(max_progress));
     20 }
     21 
     22 void JpegXlGimpProgress::finished() { gimp_progress_update(1.0); }
     23 
     24 }  // namespace jxl