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#if defined(USE_SYSTEM_LIBOPENJPEG2)
13#include <openjpeg.h>
14#else
15#include "third_party/libopenjpeg/openjpeg.h"
16#endif
17
18namespace fxcodec {
19
20struct DecodeData {
21 DecodeData(const uint8_t* data, OPJ_SIZE_T size)
22 : src_data(data), src_size(size), offset(0) {}
23
24 const uint8_t* src_data;
25 OPJ_SIZE_T src_size;
26 OPJ_SIZE_T offset;
27};
28
29/* Wrappers for C-style callbacks. */
30OPJ_SIZE_T opj_read_from_memory(void* p_buffer,
31 OPJ_SIZE_T nb_bytes,
32 void* p_user_data);
33OPJ_OFF_T opj_skip_from_memory(OPJ_OFF_T nb_bytes, void* p_user_data);
34OPJ_BOOL opj_seek_from_memory(OPJ_OFF_T nb_bytes, void* p_user_data);
35
36} // namespace fxcodec
37
38#endif // CORE_FXCODEC_JPX_JPX_DECODE_UTILS_H_
ScopedOpjImageData r
ScopedOpjImageData g
ScopedOpjImageData b
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
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)
DecodeData(const uint8_t *data, OPJ_SIZE_T size)
const uint8_t * src_data