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