LIBJXL

resizable_parallel_runner_cxx.h
Go to the documentation of this file.
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
11
12#ifndef JXL_RESIZABLE_PARALLEL_RUNNER_CXX_H_
13#define JXL_RESIZABLE_PARALLEL_RUNNER_CXX_H_
14
15#include <memory>
16
17#include "jxl/resizable_parallel_runner.h"
18
19#if !(defined(__cplusplus) || defined(c_plusplus))
20#error \
21 "This a C++ only header. Use jxl/jxl_resizable_parallel_runner.h from C" \
22 "sources."
23#endif
24
27 struct JxlResizableParallelRunnerDestroyStruct {
29 void operator()(void* runner) { JxlResizableParallelRunnerDestroy(runner); }
30};
31
37 typedef std::unique_ptr<void, JxlResizableParallelRunnerDestroyStruct>
38 JxlResizableParallelRunnerPtr;
39
53 static inline JxlResizableParallelRunnerPtr JxlResizableParallelRunnerMake(
54 const JxlMemoryManager* memory_manager) {
55 return JxlResizableParallelRunnerPtr(
56 JxlResizableParallelRunnerCreate(memory_manager));
57}
58
59#endif // JXL_RESIZABLE_PARALLEL_RUNNER_CXX_H_
resizable_parallel_runner.h
implementation using std::thread of a resizeable JxlParallelRunner.
JxlResizableParallelRunnerDestroy
JXL_THREADS_EXPORT void JxlResizableParallelRunnerDestroy(void *runner_opaque)
JxlResizableParallelRunnerCreate
JXL_THREADS_EXPORT void * JxlResizableParallelRunnerCreate(const JxlMemoryManager *memory_manager)
JxlResizableParallelRunnerPtr
std::unique_ptr< void, JxlResizableParallelRunnerDestroyStruct > JxlResizableParallelRunnerPtr
Definition: resizable_parallel_runner_cxx.h:38
JxlMemoryManagerStruct
Definition: memory_manager.h:48
JxlResizableParallelRunnerDestroyStruct
Definition: resizable_parallel_runner_cxx.h:27
JxlResizableParallelRunnerDestroyStruct::operator()
void operator()(void *runner)
Calls JxlResizableParallelRunnerDestroy() on the passed runner.
Definition: resizable_parallel_runner_cxx.h:29