Skip to content

Commit deaa9a1

Browse files
committed
doc: introduce jpeg_encode and jpeg_decode
1 parent 2b583f0 commit deaa9a1

File tree

2 files changed

+80
-1
lines changed

2 files changed

+80
-1
lines changed

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,44 @@
44
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://johnnychen94.github.io/JpegTurbo.jl/dev)
55
[![Build Status](https://github.com/johnnychen94/JpegTurbo.jl/actions/workflows/UnitTest.yml/badge.svg?branch=master)](https://github.com/johnnychen94/JpegTurbo.jl/actions/workflows/UnitTest.yml?query=branch%3Amaster)
66
[![Coverage](https://codecov.io/gh/johnnychen94/JpegTurbo.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/johnnychen94/JpegTurbo.jl)
7+
8+
JpegTurbo.jl is a Julia wrapper of the C library [libjpeg-turbo] that provides IO support for
9+
the JPEG image format.
10+
11+
The main functionality of this package consist of two functions: `jpeg_encode` and `jpeg_decode`.
12+
Check the [function references](https://johnnychen94.github.io/JpegTurbo.jl/dev/reference) for more
13+
details.
14+
15+
## API
16+
17+
`jpeg_encode` is used to compress 2D colorant matrix as JPEG image.
18+
19+
```julia
20+
jpeg_encode(filename::AbstractString, img; kwargs...) -> Int
21+
jpeg_encode(io::IO, img; kwargs...) -> Int
22+
jpeg_encode(img; kwargs...) -> Vector{UInt8}
23+
```
24+
25+
`jpeg_decode` is used to decompress JPEG image as 2D colorant matrix.
26+
27+
```julia
28+
jpeg_decode([T,] filename::AbstractString; kwargs...) -> Matrix{T}
29+
```
30+
31+
## Feature set
32+
33+
| function | filename | IOStream | in-memory buffer | pre-allocated output | multi-threads |
34+
| -------------------- | -------- | -------- | -------------------- | ------------------- | ------------- |
35+
| `jpeg_encode` | x | x | x | | x |
36+
| `jpeg_decode` | x | | | | x |
37+
| `ImageMagick.save` | x | x | x | | x |
38+
| `ImageMagick.load` | x | x | x | | x |
39+
| `QuartzImageIO.save` | x | x | x (`FileIO.Stream`) | | x |
40+
| `QuartzImageIO.load` | x | x | x (`FileIO.Stream`) | | x |
41+
42+
Notes:
43+
44+
- `x`: supported
45+
- empty: missing/unsupported yet
46+
47+
[libjpeg-turbo]: https://github.com/libjpeg-turbo/libjpeg-turbo

docs/src/index.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,41 @@
11
# JpegTurbo
22

3-
Documentation for [JpegTurbo](https://github.com/johnnychen94/JpegTurbo.jl).
3+
[JpegTurbo.jl](https://github.com/johnnychen94/JpegTurbo.jl) is a Julia wrapper of the C library
4+
[libjpeg-turbo](https://github.com/libjpeg-turbo/libjpeg-turbo) that provides IO support for the
5+
JPEG image format.
6+
7+
The main functionality of this package consist of two functions: `jpeg_encode` and `jpeg_decode`.
8+
Check the [function references](@Function-references) for more details.
9+
10+
## API
11+
12+
`jpeg_encode` is used to compress 2D colorant matrix as JPEG image.
13+
14+
```julia
15+
jpeg_encode(filename::AbstractString, img; kwargs...) -> Int
16+
jpeg_encode(io::IO, img; kwargs...) -> Int
17+
jpeg_encode(img; kwargs...) -> Vector{UInt8}
18+
```
19+
20+
`jpeg_decode` is used to decompress JPEG image as 2D colorant matrix.
21+
22+
```julia
23+
jpeg_decode([T,] filename::AbstractString; kwargs...) -> Matrix{T}
24+
```
25+
26+
## Feature set
27+
28+
| function | filename | IOStream | in-memory buffer | pre-allocated output | multi-threads |
29+
| -------------------- | -------- | -------- | -------------------- | ------------------- | ------------- |
30+
| `jpeg_encode` | x | x | x | | x |
31+
| `jpeg_decode` | x | | | | x |
32+
| `ImageMagick.save` | x | x | x | | x |
33+
| `ImageMagick.load` | x | x | x | | x |
34+
| `QuartzImageIO.save` | x | x | x (`FileIO.Stream`) | | x |
35+
| `QuartzImageIO.load` | x | x | x (`FileIO.Stream`) | | x |
36+
37+
Notes:
38+
39+
- `x`: supported
40+
- empty: missing/unsupported yet
41+

0 commit comments

Comments
 (0)