enc_image_bundle.h (1530B)
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_ENC_IMAGE_BUNDLE_H_ 7 #define LIB_JXL_ENC_IMAGE_BUNDLE_H_ 8 9 #include <jxl/cms_interface.h> 10 11 #include "lib/jxl/base/data_parallel.h" 12 #include "lib/jxl/base/rect.h" 13 #include "lib/jxl/base/status.h" 14 #include "lib/jxl/color_encoding_internal.h" 15 #include "lib/jxl/image.h" 16 #include "lib/jxl/image_bundle.h" 17 18 namespace jxl { 19 20 Status ApplyColorTransform(const ColorEncoding& c_current, 21 float intensity_target, const Image3F& color, 22 const ImageF* black, const Rect& rect, 23 const ColorEncoding& c_desired, 24 const JxlCmsInterface& cms, ThreadPool* pool, 25 Image3F* out); 26 27 // Does color transformation from in.c_current() to c_desired if the color 28 // encodings are different, or nothing if they are already the same. 29 // If color transformation is done, stores the transformed values into store and 30 // sets the out pointer to store, else leaves store untouched and sets the out 31 // pointer to &in. 32 // Returns false if color transform fails. 33 Status TransformIfNeeded(const ImageBundle& in, const ColorEncoding& c_desired, 34 const JxlCmsInterface& cms, ThreadPool* pool, 35 ImageBundle* store, const ImageBundle** out); 36 37 } // namespace jxl 38 39 #endif // LIB_JXL_ENC_IMAGE_BUNDLE_H_