MagickCore
7.1.2-29
Convert, Edit, Or Compose Bitmap Images
Toggle main menu visibility
Loading...
Searching...
No Matches
color-private.h
1
/*
2
Copyright @ 1999 ImageMagick Studio LLC, a non-profit organization
3
dedicated to making software imaging solutions freely available.
4
5
You may not use this file except in compliance with the License. You may
6
obtain a copy of the License at
7
8
https://imagemagick.org/license/
9
10
Unless required by applicable law or agreed to in writing, software
11
distributed under the License is distributed on an "AS IS" BASIS,
12
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
See the License for the specific language governing permissions and
14
limitations under the License.
15
16
MagickCore private image color methods.
17
*/
18
#ifndef MAGICKCORE_COLOR_PRIVATE_H
19
#define MAGICKCORE_COLOR_PRIVATE_H
20
21
#include "MagickCore/image.h"
22
#include "MagickCore/image-private.h"
23
24
#if defined(__cplusplus) || defined(c_plusplus)
25
extern
"C"
{
26
#endif
27
28
extern
MagickPrivate MagickBooleanType
29
ColorComponentGenesis(
void
),
30
IsEquivalentAlpha(
const
Image *,
const
PixelInfo *,
const
PixelInfo *),
31
IsEquivalentIntensity(
const
Image *,
const
PixelInfo *,
const
PixelInfo *);
32
33
extern
MagickPrivate
void
34
ColorComponentTerminus(
void
);
35
36
static
inline
MagickBooleanType GetColorRange(
const
char
*color,
37
PixelInfo *start,PixelInfo *stop,ExceptionInfo *exception)
38
{
39
char
40
start_color[MagickPathExtent] =
"white"
,
41
stop_color[MagickPathExtent] =
"black"
;
42
43
MagickBooleanType
44
status;
45
46
if
(color == (
const
char
*) NULL)
47
return
(MagickFalse);
48
if
(*color !=
'\0'
)
49
{
50
char
51
*p;
52
53
(void) CopyMagickString(start_color,color,MagickPathExtent);
54
for
(p=start_color; (*p !=
'-'
) && (*p !=
'\0'
); p++)
55
if
(*p ==
'('
)
56
{
57
for
(p++; (*p !=
')'
) && (*p !=
'\0'
); p++);
58
if
(*p ==
'\0'
)
59
break
;
60
}
61
if
(*p ==
'-'
)
62
(void) CopyMagickString(stop_color,p+1,MagickPathExtent);
63
*p=
'\0'
;
64
}
65
status=QueryColorCompliance(start_color,AllCompliance,start,exception);
66
if
(status == MagickFalse)
67
return
(status);
68
return
(QueryColorCompliance(stop_color,AllCompliance,stop,exception));
69
}
70
71
static
inline
double
GetFuzzyColorDistance(
const
Image *p,
const
Image *q)
72
{
73
/*
74
Variance-style combined fuzz.
75
*/
76
if
(q == (
const
Image *) NULL)
77
return
(p->fuzz*p->fuzz);
78
return
(p->fuzz*p->fuzz+q->fuzz*q->fuzz);
79
}
80
81
#if defined(__cplusplus) || defined(c_plusplus)
82
}
83
#endif
84
85
#endif
MagickCore
color-private.h
Generated by
1.17.0