Nilorea Library
C utilities for networking, threading, graphics
Loading...
Searching...
No Matches
n_icc.h
Go to the documentation of this file.
1/*
2 * Nilorea Library
3 * Copyright (C) 2005-2026 Castagnier Mickael
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
14 * implied. See the License for the specific language governing
15 * permissions and limitations under the License.
16 *
17 * SPDX-License-Identifier: Apache-2.0
18 */
19
46
47#ifndef N_ICC_HEADER_GUARD
48#define N_ICC_HEADER_GUARD
49
50#ifdef __cplusplus
51extern "C" {
52#endif
53
58
59#include <stddef.h>
60
63#define N_ICC_MAX_BYTES (16u * 1024u * 1024u)
64
67#define N_ICC_HEAD_BYTES (N_ICC_MAX_BYTES + 1024u * 1024u)
68
74int n_icc_is_profile(const unsigned char* data, size_t len);
75
86int n_icc_from_buffer(const unsigned char* data, size_t len, unsigned char** icc, size_t* icc_len);
87
95int n_icc_from_file(const char* path, unsigned char** icc, size_t* icc_len);
96
100
101#ifdef __cplusplus
102}
103#endif
104
105#endif /* N_ICC_HEADER_GUARD */
int n_icc_from_file(const char *path, unsigned char **icc, size_t *icc_len)
Find the profile embedded in an image file.
Definition n_icc.c:366
int n_icc_from_buffer(const unsigned char *data, size_t len, unsigned char **icc, size_t *icc_len)
Find the profile embedded in an image file held in memory.
Definition n_icc.c:309
int n_icc_is_profile(const unsigned char *data, size_t len)
Does a buffer look like an ICC profile: at least a header, a size field no larger than the buffer,...
Definition n_icc.c:70