mirror of
https://github.com/team-charls/charls
synced 2025-03-28 21:03:13 +00:00
Add missing #include <optional> to charls.ixx (#311)
This commit is contained in:
parent
19afb35985
commit
1127459953
9
.gitattributes
vendored
9
.gitattributes
vendored
@ -1,3 +1,6 @@
|
||||
# Copyright (c) Team CharLS.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
# Set default behavior to automatically normalize line endings.
|
||||
* text=auto
|
||||
|
||||
@ -17,8 +20,8 @@
|
||||
*.pgm binary
|
||||
|
||||
# Export ignore all files that are only needed for git and CI (used when downloading the repository as a zip file).
|
||||
.github export-ignore
|
||||
.gitattributes export-ignore
|
||||
.gitignore export-ignore
|
||||
.travis.yml export-ignore
|
||||
.appveyor.yml export-ignore
|
||||
azure-pipelines.yml export-ignore
|
||||
appveyor.yml export-ignore
|
||||
azure-pipelines.yml export-ignore
|
||||
|
10
.gitignore
vendored
10
.gitignore
vendored
@ -1,4 +1,5 @@
|
||||
# GIT ignore file for CharLS
|
||||
# Copyright (c) Team CharLS.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
.vscode/
|
||||
.vs/
|
||||
@ -19,12 +20,5 @@ vcpkg_installed/
|
||||
*.aps
|
||||
*.sqlite
|
||||
|
||||
# NuGet Packages
|
||||
*.nupkg
|
||||
# The packages folder can be ignored because of Package Restore
|
||||
**/packages/*
|
||||
# except build/, which is used as an MSBuild target.
|
||||
!**/packages/build/
|
||||
|
||||
# Ignore Coverity build folder
|
||||
cov-int/
|
||||
|
@ -130,31 +130,32 @@ sense to define a good naming convention. Not all JPEG-LS names are good C++ var
|
||||
|
||||
### Supported C++ language
|
||||
|
||||
CharLS currently targets C++17 on the main branch. This will be done until December 2025 (5 years after the release of C++20)
|
||||
|
||||
#### Features currently not available (C++17)
|
||||
|
||||
* nodiscard attribute
|
||||
* maybe_unused attribute
|
||||
* Inline variables
|
||||
* Guaranteed copy elision
|
||||
* constexpr if-statements
|
||||
* __has_include
|
||||
* std::byte
|
||||
* clamp ?
|
||||
CharLS currently targets C++17 on the main branch. Upgrading to C++20 will be done when C++20 is used in
|
||||
mainstream C++ development.
|
||||
|
||||
#### Features currently not available (C++20)
|
||||
|
||||
The following features are available in C++20 (usable after 2023), or in dual language support mode.
|
||||
The following features are available in C++20, or in dual language support mode.
|
||||
|
||||
* endian
|
||||
* \<span>
|
||||
* modules
|
||||
* [[likely]] and [[unlikely]]
|
||||
* std::countl_zero
|
||||
|
||||
#### Features currently not available (C++23)
|
||||
|
||||
The following features are available in C++23, or in dual language support mode.
|
||||
|
||||
* std::byteswap
|
||||
* import std;
|
||||
* std::to_underlying
|
||||
* std::unreachable
|
||||
|
||||
### Portable Anymap Format
|
||||
|
||||
The de facto standard used by the JPEG standard to deliver test files is the Portable Anymap Format.
|
||||
This format has been made populair by the netpbm project. It is an extreme simple format and only
|
||||
This format has been made popular by the netpbm project. It is an extreme simple format and only
|
||||
designed to make it easy to exchange images on many platforms.
|
||||
It consists of the following variants
|
||||
|
||||
|
@ -12,6 +12,7 @@ module;
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
#include <optional>
|
||||
|
||||
export module charls;
|
||||
|
||||
|
@ -458,7 +458,8 @@ void jpeg_stream_reader::read_preset_coding_parameters()
|
||||
void jpeg_stream_reader::read_oversize_image_dimension()
|
||||
{
|
||||
// Note: The JPEG-LS standard supports a 2,3 or 4 bytes for the size.
|
||||
check_minimal_segment_size(2);
|
||||
constexpr size_t pc_and_dimension_bytes{2};
|
||||
check_minimal_segment_size(pc_and_dimension_bytes);
|
||||
const uint8_t dimension_size{read_uint8()};
|
||||
|
||||
uint32_t height;
|
||||
@ -466,19 +467,19 @@ void jpeg_stream_reader::read_oversize_image_dimension()
|
||||
switch (dimension_size)
|
||||
{
|
||||
case 2:
|
||||
check_segment_size(sizeof(uint16_t) * 2 + 2);
|
||||
check_segment_size(pc_and_dimension_bytes + sizeof(uint16_t) * 2);
|
||||
height = read_uint16();
|
||||
width = read_uint16();
|
||||
break;
|
||||
|
||||
case 3:
|
||||
check_segment_size((sizeof(uint16_t) + 1) * 2 + 2);
|
||||
check_segment_size(pc_and_dimension_bytes + (sizeof(uint16_t) + 1) * 2);
|
||||
height = read_uint24();
|
||||
width = read_uint24();
|
||||
break;
|
||||
|
||||
case 4:
|
||||
check_segment_size(sizeof(uint32_t) * 2 + 2);
|
||||
check_segment_size(pc_and_dimension_bytes + sizeof(uint32_t) * 2);
|
||||
height = read_uint32();
|
||||
width = read_uint32();
|
||||
break;
|
||||
@ -494,22 +495,24 @@ void jpeg_stream_reader::read_oversize_image_dimension()
|
||||
|
||||
void jpeg_stream_reader::read_mapping_table_specification()
|
||||
{
|
||||
check_minimal_segment_size(3);
|
||||
constexpr size_t pc_table_id_entry_size_bytes{3};
|
||||
check_minimal_segment_size(pc_table_id_entry_size_bytes);
|
||||
const uint8_t table_id{read_uint8()};
|
||||
const uint8_t entry_size{read_uint8()};
|
||||
|
||||
add_mapping_table(table_id, entry_size, segment_data_.subspan(3));
|
||||
add_mapping_table(table_id, entry_size, segment_data_.subspan(pc_table_id_entry_size_bytes));
|
||||
skip_remaining_segment_data();
|
||||
}
|
||||
|
||||
|
||||
void jpeg_stream_reader::read_mapping_table_continuation()
|
||||
{
|
||||
check_minimal_segment_size(3);
|
||||
constexpr size_t pc_table_id_entry_size_bytes{3};
|
||||
check_minimal_segment_size(pc_table_id_entry_size_bytes);
|
||||
const uint8_t table_id{read_uint8()};
|
||||
const uint8_t entry_size{read_uint8()};
|
||||
|
||||
extend_mapping_table(table_id, entry_size, segment_data_.subspan(3));
|
||||
extend_mapping_table(table_id, entry_size, segment_data_.subspan(pc_table_id_entry_size_bytes));
|
||||
skip_remaining_segment_data();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user