Skip to content

Commit

Permalink
[WIP] Implement ICCProfile type and reader
Browse files Browse the repository at this point in the history
  • Loading branch information
kimikage committed Apr 17, 2024
1 parent 1f66fc0 commit 7cda361
Show file tree
Hide file tree
Showing 50 changed files with 3,491 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
79 changes: 79 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: CI
on:
push:
branches: main
tags: ['*']
pull_request:
workflow_dispatch:
concurrency:
# Skip intermediate builds: always.
# Cancel intermediate builds: only if it is a pull request build.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
timeout-minutes: 60
permissions: # needed to allow julia-actions/cache to proactively delete old caches that it has created
actions: write
contents: read
strategy:
fail-fast: false
matrix:
version:
- '1.6'
- '1'
- 'nightly'
os:
- ubuntu-latest
- windows-latest
- macos-latest
arch:
- x64
include:
- os: ubuntu-latest
version: '1'
arch: x86
- os: ubuntu-latest
version: '1.3'
arch: x64
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/cache@v1
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v4
with:
files: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}

docs:
name: Documentation
runs-on: ubuntu-latest
permissions:
actions: write # needed to allow julia-actions/cache to proactively delete old caches that it has created
contents: write
statuses: write
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: '1'
- uses: julia-actions/cache@v1
- name: Configure doc environment
shell: julia --project=docs --color=yes {0}
run: |
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-docdeploy@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
19 changes: 19 additions & 0 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: CompatHelper
on:
schedule:
- cron: 11 4 * * *
workflow_dispatch:
jobs:
CompatHelper:
permissions:
pull-requests: write
contents: write
runs-on: ubuntu-latest
steps:
- name: Pkg.add("CompatHelper")
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
- name: CompatHelper.main()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
run: julia -e 'using CompatHelper; CompatHelper.main()'
31 changes: 31 additions & 0 deletions .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: TagBot
on:
issue_comment:
types:
- created
workflow_dispatch:
inputs:
lookback:
default: "3"
permissions:
actions: read
checks: read
contents: write
deployments: read
issues: read
discussions: read
packages: read
pages: read
pull-requests: read
repository-projects: read
security-events: read
statuses: read
jobs:
TagBot:
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
runs-on: ubuntu-latest
steps:
- uses: JuliaRegistries/TagBot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
ssh: ${{ secrets.DOCUMENTER_KEY }}
35 changes: 35 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name = "ColorProfiles"
uuid = "b638e392-9ff0-4b7a-a644-061760c28f55"
version = "0.1.0"

[deps]
ColorTypes = "3da002f7-5984-5a60-b8a6-cbb66c0b333f"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
FixedPointNumbers = "53c48c17-4a7d-5ca2-90c5-79b7896eea93"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"

[weakdeps]
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
MD5 = "6ac74813-4b46-53a4-afec-0b5dc9d7885c"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"

[extensions]
ColorProfilesFileIOExt = ["FileIO", "UUIDs"]
ColorProfilesMD5Ext = ["MD5"]

[compat]
ColorTypes = "0.11"
FileIO = "1"
FixedPointNumbers = "0.8"
Requires = "1"
julia = "1"

[extras]
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
MD5 = "6ac74813-4b46-53a4-afec-0b5dc9d7885c"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Downloads", "FileIO", "MD5", "Test"]
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@
# ColorProfiles.jl
ICC profile reader
[![Docs Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://kimikage.github.io/ColorProfiles.jl/stable)
[![Docs Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://kimikage.github.io/ColorProfiles.jl/dev)
[![CI](https://github.com/kimikage/ColorProfiles.jl/workflows/CI/badge.svg)](https://github.com/kimikage/ColorProfiles.jl/actions?query=workflow%3ACI)
[![Codecov](https://codecov.io/gh/kimikage/ColorProfiles.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/kimikage/ColorProfiles.jl)

ColorProfiles provides the types to represent ICC profile data and a reader for
ICC profiles. This package supports the ICC Profile
[version 4.4.0.0](https://www.color.org/v4spec.xalter) (ICC.1:2022-05) and
version 2 (ICC.1:2001-04).

Note that ColorProfiles.jl does NOT provide features for color management
itself.
7 changes: 7 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
MD5 = "6ac74813-4b46-53a4-afec-0b5dc9d7885c"

[compat]
Documenter = "1"
27 changes: 27 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using Documenter, ColorProfiles
using FileIO, MD5

makedocs(
clean = false,
warnonly = true, # FIXME
checkdocs = :exports,
modules=[ColorProfiles, ProfileClasses],
format=Documenter.HTML(prettyurls = get(ENV, "CI", nothing) == "true",
assets=["assets/favicon.ico"]),
sitename="ColorProfiles",
pages=[
"Introduction" => "index.md",
"Loader/Saver" => "loader-saver.md",
"Basic Types" => "basic-types.md",
"Tags" => "tags.md",
"Tagged Types" => "tagged-types.md",
"Type Mapping" => "type-mapping.md",
"Utilities" => "utilities.md",
]
)

deploydocs(
repo="github.com/kimikage/ColorProfiles.jl.git",
devbranch = "main",
push_preview = true
)
Binary file added docs/src/assets/favicon.ico
Binary file not shown.
36 changes: 36 additions & 0 deletions docs/src/assets/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
69 changes: 69 additions & 0 deletions docs/src/basic-types.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Basic Types

## Signature
```@docs
ColorProfiles.Signature
```

## Basic Number Types

```@docs
ColorProfiles.Position
ColorProfiles.Response16
ColorProfiles.UQ16f16
ColorProfiles.UQ1f15
ColorProfiles.UQ8f8
```

## Enumeration types and constants

### CMM types
```@autodocs
Modules = [CMMTypes]
Order = [:module, :type, :constant]
```

### Profile/device classes
```@autodocs
Modules = [ProfileClasses]
Order = [:module, :type, :constant]
```

### Color Spaces
```@autodocs
Modules = [ColorSpaces]
Order = [:module, :type, :constant]
```

### Platforms
```@autodocs
Modules = [Platforms]
Order = [:module, :type, :constant]
```

### Manufacturers
```@autodocs
Modules = [Manufacturers]
Order = [:module, :type, :constant]
```

### Device models
```@autodocs
Modules = [DeviceModels]
Order = [:module, :type, :constant]
```

### Rendering intents
```@autodocs
Modules = [RenderingIntents]
Order = [:module, :type, :constant]
```

### Standard Illuminants
```@docs
StandardIlluminants
StandardIlluminant
IlluminantD50
IlluminantD65
IlluminantE
```
14 changes: 14 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# ColorProfiles

ColorProfiles provides the types to represent ICC profile data and a reader for
ICC profiles. This package supports the ICC Profile
[version 4.4.0.0](https://www.color.org/v4spec.xalter) (ICC.1:2022-05) and
version 2 (ICC.1:2001-04).

Note that ColorProfiles does NOT provides features for color management.

## Installation

## Basic Usage

See [Loader/Saver](@ref) for more details.
30 changes: 30 additions & 0 deletions docs/src/loader-saver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Loader/Saver

!!! warning
ColorProfiles assumes that the profile data to be loaded is valid and
appropriate. Attempting to load a maliciously crafted profile may use up
memory and CPU resources.


## Loader
ColorProfiles will create different instances of tags, even if they share the
same data.

```@docs
read_icc_profile
```

### Embedded Profile Loader
```@docs
read_icc_profile_in_jpeg
```

## Saver

Currently, saver is not implemented.

## FileIO extension

```@docs
add_icc_profile_format
```
7 changes: 7 additions & 0 deletions docs/src/tagged-types.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Tagged Types

content types for tags.

```@autodocs
Modules = [TaggedTypes]
```
5 changes: 5 additions & 0 deletions docs/src/tags.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Tags

```@autodocs
Modules = [Tags]
```
Loading

0 comments on commit 7cda361

Please sign in to comment.