Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
jpx_decode_utils.h
Go to the documentation of this file.
1// Copyright 2014 The PDFium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7#ifndef CORE_FXCODEC_JPX_JPX_DECODE_UTILS_H_
8#define CORE_FXCODEC_JPX_JPX_DECODE_UTILS_H_
9
10#include <stdint.h>
11
12#include "core/fxcrt/span.h"
13
14#if defined(USE_SYSTEM_LIBOPENJPEG2)
15#include <openjpeg.h>
16#else
17#include "third_party/libopenjpeg/openjpeg.h"
18#endif
19
20namespace fxcodec {
21
22struct DecodeData {
23 DecodeData() = default;
24 explicit DecodeData(pdfium::span<const uint8_t> data);
25
26 const uint8_t* src_data = nullptr;
27 OPJ_SIZE_T src_size = 0;
28 OPJ_SIZE_T offset = 0;
29};
30
31/* Wrappers for C-style callbacks. */
32OPJ_SIZE_T opj_read_from_memory(void* p_buffer,
33 OPJ_SIZE_T nb_bytes,
34 void* p_user_data);
35OPJ_OFF_T opj_skip_from_memory(OPJ_OFF_T nb_bytes, void* p_user_data);
36OPJ_BOOL opj_seek_from_memory(OPJ_OFF_T nb_bytes, void* p_user_data);
37
38} // namespace fxcodec
39
40#endif // CORE_FXCODEC_JPX_JPX_DECODE_UTILS_H_
#define CHECK_LE(x, y)
Definition check_op.h:14
static void Sycc420ToRgbForTesting(opj_image_t *img)
static constexpr uint8_t kMaxResolutionsToSkip
bool Decode(pdfium::span< uint8_t > dest_buf, uint32_t pitch, bool swap_rgb, uint32_t component_count)
JpxImageInfo GetInfo() const
#define UNSAFE_BUFFERS(...)
#define UNSAFE_TODO(...)
pdfium::CheckedNumeric< uint32_t > FX_SAFE_UINT32
OPJ_BOOL opj_seek_from_memory(OPJ_OFF_T nb_bytes, void *p_user_data)
OPJ_SIZE_T opj_read_from_memory(void *p_buffer, OPJ_SIZE_T nb_bytes, void *p_user_data)
OPJ_OFF_T opj_skip_from_memory(OPJ_OFF_T nb_bytes, void *p_user_data)
#define CHECK(cvref)
DecodeData(pdfium::span< const uint8_t > data)
const uint8_t * src_data