Skip to content

Commit 8cd0164

Browse files
authored
Change license from MIT to BSD 3-Clause (#50)
- Align the license with the other Team CharLS projects. - Use .hpp for all header files - Rename factory into codec_factory
1 parent 56fe11d commit 8cd0164

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+238
-240
lines changed

.clang-format

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Copyright (c) Victor Derks.
2-
# SPDX-License-Identifier: MIT
1+
# Copyright (c) Team CharLS.
2+
# SPDX-License-Identifier: BSD-3-Clause
33

44
BasedOnStyle: LLVM
55
Language: Cpp
@@ -39,4 +39,4 @@ SpaceAfterTemplateKeyword: false
3939
SpaceBeforeCpp11BracedList: false
4040
KeepEmptyLinesAtTheStartOfBlocks: false
4141
MaxEmptyLinesToKeep: 2
42-
NamespaceIndentation: None
42+
NamespaceIndentation: None

.clang-tidy

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// Copyright (c) Victor Derks.
2-
// SPDX-License-Identifier: MIT
1+
# Copyright (c) Team CharLS.
2+
# SPDX-License-Identifier: BSD-3-Clause
33

44
# The approach for using clang tidy is to enable all warnings unless it adds no practical value to the Netpbm WIC Codec project
55
# Having all warnings enables helps to find problems when new code is added to the project. Some warnings are however

.editorconfig

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Copyright (c) Victor Derks.
2-
# SPDX-License-Identifier: MIT
1+
# Copyright (c) Team CharLS.
2+
# SPDX-License-Identifier: BSD-3-Clause
33

44
root = true
55

.gitattributes

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Copyright (c) Victor Derks
2-
# SPDX-License-Identifier: MIT
1+
# Copyright (c) Team CharLS.
2+
# SPDX-License-Identifier: BSD-3-Clause
33

44
# Set default behavior to automatically normalize line endings.
55
* text=auto

.github/dependabot.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Copyright (c) Victor Derks.
2-
# SPDX-License-Identifier: MIT
1+
# Copyright (c) Team CharLS.
2+
# SPDX-License-Identifier: BSD-3-Clause
33

44
version: 2
55

.github/workflows/msbuild.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Copyright (c) Victor Derks.
2-
# SPDX-License-Identifier: MIT
1+
# Copyright (c) Team CharLS.
2+
# SPDX-License-Identifier: BSD-3-Clause
33

44
name: Build and test
55

.gitignore

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Copyright (c) Victor Derks.
2-
# SPDX-License-Identifier: MIT
1+
# Copyright (c) Team CharLS.
2+
# SPDX-License-Identifier: BSD-3-Clause
33

44
bin/
55
.vscode/
@@ -12,4 +12,4 @@ packages/
1212

1313
*.user
1414
*.aps
15-
*.binlog
15+
*.binlog

LICENSE.md

+25-17
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,29 @@
1-
MIT License
1+
BSD 3-Clause License
22

3-
Copyright (c) 2021 Victor Derks
3+
Copyright (c) 2021 Team CharLS
4+
All rights reserved.
45

5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
118

12-
The above copyright notice and this permission notice shall be included in all
13-
copies or substantial portions of the Software.
9+
1. Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
1411

15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
12+
2. Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
3. Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

cpp.hint

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright (c) Team CharLS.
2+
// SPDX-License-Identifier: BSD-3-Clause
3+
14
// Hint files help the Visual Studio IDE interpret Visual C++ identifiers
25
// such as names of functions and macros.
36
// For more information see https://go.microsoft.com/fwlink/?linkid=865984

default.ruleset

-3
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,16 @@
33
<IncludeAll Action="Error" />
44
<Rules AnalyzerId="Microsoft.Analyzers.NativeCodeAnalysis" RuleNamespace="Microsoft.Rules.Native">
55
<Rule Id="C26429" Action="None" />
6-
<Rule Id="C26435" Action="None" />
76
<Rule Id="C26446" Action="None" />
87
<Rule Id="C26459" Action="None" />
98
<Rule Id="C26466" Action="None" />
109
<Rule Id="C26472" Action="None" />
11-
<Rule Id="C26478" Action="None" />
1210
<Rule Id="C26481" Action="None" />
1311
<Rule Id="C26482" Action="None" />
1412
<Rule Id="C26485" Action="None" />
1513
<Rule Id="C26490" Action="None" />
1614
<Rule Id="C26491" Action="None" />
1715
<Rule Id="C26494" Action="None" />
1816
<Rule Id="C26821" Action="None" />
19-
<Rule Id="C28290" Action="None" />
2017
</Rules>
2118
</RuleSet>

default.ruleset.md

+1-10
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ Most of these rules\warning are based on the C++ Core Guidelines.
1111
- C26429: Use a not_null to indicate that "null" is not a valid value
1212
**Rationale**: Prefast attributes (\_In_, etc.) are better than gsl::not_null.
1313

14-
- C26435: Function '' should specify exactly one of 'virtual', 'override', or 'final' (c.128).
15-
**Rationale**: False warning in Visual Studio 2022 Version 17.5.0 Preview 1.0.
16-
1714
- C26446: Prefer to use gsl::at() instead of unchecked subscript operator.
1815
**Rationale**: gsl:at() cannot be used as gsl project is by design not included. MSVC STL in debug mode already checks access.
1916

@@ -26,9 +23,6 @@ Most of these rules\warning are based on the C++ Core Guidelines.
2623
- C26472: Don't use static_cast for arithmetic conversions
2724
**Rationale**: can only be solved with gsl::narrow_cast
2825

29-
- C26478: Don't use std::move on constant variables. (es.56).
30-
**Rationale**: false warnings (VS 2022 17.7.0 Preview 3.0)
31-
3226
- C26481: Do not pass an array as a single pointer.
3327
**Rationale**: gsl::span is not available.
3428

@@ -45,8 +39,5 @@ Most of these rules\warning are based on the C++ Core Guidelines.
4539
**Rationale**: many false warnings due to output parameters. Other analyzers are better
4640
as they check if the variable is used before initialized.
4741

48-
- C26821: For '', consider using gsl::span instead of std::span to guarantee runtime bounds safety (gsl.view)
42+
- C26821: For '', consider using gsl::span instead of std::span to guarantee runtime bounds safety (gsl.view)
4943
**Rationale**: preference is to use types from the std namespace.
50-
51-
- C28290: The annotation for function '{ctor}' contains more Externals than the actual number of parameters.
52-
**Rationale**: false warnings (VS 2022 17.4.0)

netpbm-wic-codec.sln.DotSettings

+2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
22
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClangTidyBugproneBranchClone/@EntryIndexedValue">DO_NOT_SHOW</s:String>
3+
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClangTidyBugproneEmptyCatch/@EntryIndexedValue">DO_NOT_SHOW</s:String>
34
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassCanBeFinal/@EntryIndexedValue">DO_NOT_SHOW</s:String>
45
<s:Boolean x:Key="/Default/UserDictionary/Words/=anymap/@EntryIndexedValue">True</s:Boolean>
56
<s:Boolean x:Key="/Default/UserDictionary/Words/=bugprone/@EntryIndexedValue">True</s:Boolean>
7+
<s:Boolean x:Key="/Default/UserDictionary/Words/=charls/@EntryIndexedValue">True</s:Boolean>
68
<s:Boolean x:Key="/Default/UserDictionary/Words/=CLSID/@EntryIndexedValue">True</s:Boolean>
79
<s:Boolean x:Key="/Default/UserDictionary/Words/=cppcoreguidelines/@EntryIndexedValue">True</s:Boolean>
810
<s:Boolean x:Key="/Default/UserDictionary/Words/=defacto/@EntryIndexedValue">True</s:Boolean>

src/buffered_stream_reader.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// Copyright (c) Victor Derks.
2-
// SPDX-License-Identifier: MIT
1+
// Copyright (c) Team CharLS.
2+
// SPDX-License-Identifier: BSD-3-Clause
33

44
module;
55

@@ -8,7 +8,7 @@ module;
88

99
module buffered_stream_reader;
1010

11-
import <win.h>;
11+
import <win.hpp>;
1212

1313
import errors;
1414
import util;

src/buffered_stream_reader.ixx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
// Copyright (c) Victor Derks.
2-
// SPDX-License-Identifier: MIT
1+
// Copyright (c) Team CharLS.
2+
// SPDX-License-Identifier: BSD-3-Clause
33

44
module;
55

66
#include "intellisense.hpp"
77

88
export module buffered_stream_reader;
99

10-
import <win.h>;
10+
import <win.hpp>;
1111
import std;
1212
import winrt;
1313

src/class_factory.ixx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
// Copyright (c) Victor Derks.
2-
// SPDX-License-Identifier: MIT
1+
// Copyright (c) Team CharLS.
2+
// SPDX-License-Identifier: BSD-3-Clause
33

44
export module class_factory;
55

6-
import <win.h>;
6+
import <win.hpp>;
77
import winrt;
88

99
import errors;

src/dll_main.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
// Copyright (c) Victor Derks.
2-
// SPDX-License-Identifier: MIT
1+
// Copyright (c) Team CharLS.
2+
// SPDX-License-Identifier: BSD-3-Clause
33

44
#include "macros.hpp"
5-
#include "version.h"
5+
#include "version.hpp"
66

77
import std;
8-
import <win.h>;
8+
import <win.hpp>;
99
import winrt;
1010

1111
import netpbm_bitmap_decoder;
@@ -30,7 +30,7 @@ void register_general_decoder_settings(const GUID& class_id, const GUID& wic_cat
3030
{
3131
const wstring sub_key = LR"(SOFTWARE\Classes\CLSID\)" + guid_to_string(class_id);
3232
registry::set_value(sub_key, L"ArbitrationPriority", 10);
33-
registry::set_value(sub_key, L"Author", L"Victor Derks");
33+
registry::set_value(sub_key, L"Author", L"Team CharLS");
3434
registry::set_value(sub_key, L"ColorManagementVersion", L"1.0.0.0");
3535
registry::set_value(sub_key, L"ContainerFormat", guid_to_string(id::container_format_netpbm).c_str());
3636
registry::set_value(sub_key, L"Description", L"Netpbm Codec");
@@ -42,7 +42,7 @@ void register_general_decoder_settings(const GUID& class_id, const GUID& wic_cat
4242
registry::set_value(sub_key, L"SupportChromaKey", 0U);
4343
registry::set_value(sub_key, L"SupportLossless", 1U);
4444
registry::set_value(sub_key, L"SupportMultiframe", 0U);
45-
registry::set_value(sub_key, L"Vendor", guid_to_string(id::vendor_victor_derks).c_str());
45+
registry::set_value(sub_key, L"Vendor", guid_to_string(id::vendor_team_charls).c_str());
4646
registry::set_value(sub_key, L"Version", VERSION);
4747

4848
const wstring formats_sub_key{sub_key + LR"(\Formats\)"};
@@ -103,7 +103,7 @@ void register_decoder()
103103
{
104104
array formats{&GUID_WICPixelFormat2bppGray, &GUID_WICPixelFormat4bppGray, &GUID_WICPixelFormat8bppGray,
105105
&GUID_WICPixelFormat16bppGray, &GUID_WICPixelFormat24bppRGB};
106-
register_general_decoder_settings(id::netpbm_decoder, CATID_WICBitmapDecoders, L"Netpbm Decoder", formats);
106+
register_general_decoder_settings(id::netpbm_decoder, CATID_WICBitmapDecoders, L"Team CharLS Netpbm Decoder", formats);
107107

108108
const wstring sub_key{LR"(SOFTWARE\Classes\CLSID\)" + guid_to_string(id::netpbm_decoder)};
109109

@@ -200,7 +200,7 @@ HRESULT __stdcall DllUnregisterServer()
200200
try
201201
{
202202
TRACE("netpbm-wic-codec::DllUnregisterServer\n");
203-
// Note: keep the .pgm file registration intact.
203+
// Note: keep the file registrations intact.
204204
return unregister(id::netpbm_decoder, CATID_WICBitmapDecoders);
205205
}
206206
catch (...)

src/errors.ixx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
// Copyright (c) Victor Derks.
2-
// SPDX-License-Identifier: MIT
1+
// Copyright (c) Team CharLS.
2+
// SPDX-License-Identifier: BSD-3-Clause
33

44
module;
55

66
#include "intellisense.hpp"
77

88
export module errors;
99

10-
import <win.h>;
10+
import <win.hpp>;
1111

1212
export {
1313

src/guids.ixx

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
// Copyright (c) Victor Derks.
2-
// SPDX-License-Identifier: MIT
1+
// Copyright (c) Team CharLS.
2+
// SPDX-License-Identifier: BSD-3-Clause
33

44
export module guids;
55

6-
import <win.h>;
6+
import <win.hpp>;
77

88
export namespace id {
99

@@ -13,7 +13,7 @@ constexpr GUID netpbm_decoder{0x6891bbe, 0xcc02, 0x4bb2, {0x9c, 0xf0, 0x30, 0x3f
1313
// {70ab66f5-cd48-43a1-aa29-10131b7f4ff1}
1414
constexpr GUID container_format_netpbm{0x70ab66f5, 0xcd48, 0x43a1, {0xaa, 0x29, 0x10, 0x13, 0x1b, 0x7f, 0x4f, 0xf1}};
1515

16-
// {87a8e9f4-8aac-4667-bcfd-56535c80a269}
17-
constexpr GUID vendor_victor_derks{0x87a8e9f4, 0x8aac, 0x4667, {0xbc, 0xfd, 0x56, 0x53, 0x5c, 0x80, 0xa2, 0x69}};
16+
// {8adbe21c-a720-424e-b238-45ad1052b98c}
17+
constexpr GUID vendor_team_charls{0x8adbe21c, 0xa720, 0x424e, {0xb2, 0x38, 0x45, 0xad, 0x10, 0x52, 0xb9, 0x8c}};
1818

1919
}

src/intellisense.hpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
// Copyright (c) Victor Derks.
2-
// SPDX-License-Identifier: MIT
1+
// Copyright (c) Team CharLS.
2+
// SPDX-License-Identifier: BSD-3-Clause
33

44
#pragma once
55

6-
// Include explicit headers as workaround that IntelliSense in VS 2022 17.12 fails to parse #import <win.h>
6+
// Include explicit headers as workaround that IntelliSense (VS 2022 17.12)
7+
// and ReSharper (2024.2.5) fail to parse #import <win.hpp>
78
#if defined(__INTELLISENSE__) || defined(__RESHARPER__)
9+
// ReSharper disable once CppInconsistentNaming
810
#define _AMD64_
911
#include <combaseapi.h>
1012
#include <libloaderapi.h>

src/macros.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// Copyright (c) Victor Derks.
2-
// SPDX-License-Identifier: MIT
1+
// Copyright (c) Team CharLS.
2+
// SPDX-License-Identifier: BSD-3-Clause
33

44
#pragma once
55

src/netpbm-wic-codec.def

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
; Copyright (c) Team CharLS.
2+
; SPDX-License-Identifier: BSD-3-Clause
3+
14
EXPORTS
25
DllCanUnloadNow PRIVATE
36
DllGetClassObject PRIVATE
47
DllRegisterServer PRIVATE
5-
DllUnregisterServer PRIVATE
8+
DllUnregisterServer PRIVATE

src/netpbm-wic-codec.rc

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
// Copyright (c) Victor Derks
2-
// SPDX-License-Identifier: MIT
1+
// Copyright (c) Team CharLS.
2+
// SPDX-License-Identifier: BSD-3-Clause
33

44
#pragma code_page(65001)
55

6-
#include "version.h"
6+
#include "version.hpp"
77

88
#include <winres.h>
99

@@ -13,10 +13,10 @@ VS_VERSION_INFO VERSIONINFO
1313
FILEVERSION VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH, 0
1414
PRODUCTVERSION VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH, 0
1515
FILEFLAGSMASK 0x3fL
16-
#ifdef _DEBUG
17-
FILEFLAGS 0x1L
18-
#else
16+
#ifdef NDEBUG
1917
FILEFLAGS 0x0L
18+
#else
19+
FILEFLAGS 0x1L
2020
#endif
2121
FILEOS 0x40004L
2222
FILETYPE 0x2L
@@ -26,11 +26,11 @@ BEGIN
2626
BEGIN
2727
BLOCK "000004b0"
2828
BEGIN
29-
VALUE "CompanyName", "Victor Derks"
29+
VALUE "CompanyName", "Team CharLS"
3030
VALUE "FileDescription", L"Netpbm WIC codec"
3131
VALUE "FileVersion", VERSION
3232
VALUE "InternalName", L"netpbm-wic-codec.dll"
33-
VALUE "LegalCopyright", L"Copyright (c) Victor Derks"
33+
VALUE "LegalCopyright", L"Copyright (c) Team CharLS"
3434
VALUE "OriginalFilename", L"netpbm-wic-codec.dll"
3535
VALUE "ProductName", L"Netpbm WIC codec"
3636
VALUE "ProductVersion", VERSION

0 commit comments

Comments
 (0)