/src/imagemagick/MagickCore/resample-private.h
Line | Count | Source |
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 image resampling private methods. |
17 | | */ |
18 | | #ifndef MAGICKCORE_RESAMPLE_PRIVATE_H |
19 | | #define MAGICKCORE_RESAMPLE_PRIVATE_H |
20 | | |
21 | | #include "MagickCore/thread-private.h" |
22 | | |
23 | | #if defined(__cplusplus) || defined(c_plusplus) |
24 | | extern "C" { |
25 | | #endif |
26 | | |
27 | | static inline ResampleFilter **DestroyResampleFilterTLS(ResampleFilter **filter) |
28 | 1.90k | { |
29 | 1.90k | ssize_t |
30 | 1.90k | i; |
31 | | |
32 | 3.81k | for (i=0; i < (ssize_t) GetMagickResourceLimit(ThreadResource); i++) |
33 | 1.90k | if (filter[i] != (ResampleFilter *) NULL) |
34 | 1.90k | filter[i]=DestroyResampleFilter(filter[i]); |
35 | 1.90k | filter=(ResampleFilter **) RelinquishMagickMemory(filter); |
36 | 1.90k | return(filter); |
37 | 1.90k | } distort.c:DestroyResampleFilterTLS Line | Count | Source | 28 | 1.90k | { | 29 | 1.90k | ssize_t | 30 | 1.90k | i; | 31 | | | 32 | 3.81k | for (i=0; i < (ssize_t) GetMagickResourceLimit(ThreadResource); i++) | 33 | 1.90k | if (filter[i] != (ResampleFilter *) NULL) | 34 | 1.90k | filter[i]=DestroyResampleFilter(filter[i]); | 35 | 1.90k | filter=(ResampleFilter **) RelinquishMagickMemory(filter); | 36 | 1.90k | return(filter); | 37 | 1.90k | } |
Unexecuted instantiation: draw.c:DestroyResampleFilterTLS Unexecuted instantiation: effect.c:DestroyResampleFilterTLS Unexecuted instantiation: enhance.c:DestroyResampleFilterTLS Unexecuted instantiation: fx.c:DestroyResampleFilterTLS Unexecuted instantiation: resize.c:DestroyResampleFilterTLS Unexecuted instantiation: visual-effects.c:DestroyResampleFilterTLS |
38 | | |
39 | | static inline ResampleFilter **AcquireResampleFilterTLS(const Image *image, |
40 | | const VirtualPixelMethod method,const MagickBooleanType interpolate, |
41 | | ExceptionInfo *exception) |
42 | 1.90k | { |
43 | 1.90k | ssize_t |
44 | 1.90k | i; |
45 | | |
46 | 1.90k | ResampleFilter |
47 | 1.90k | **filter; |
48 | | |
49 | 1.90k | size_t |
50 | 1.90k | number_threads; |
51 | | |
52 | 1.90k | number_threads=(size_t) GetMagickResourceLimit(ThreadResource); |
53 | 1.90k | filter=(ResampleFilter **) AcquireQuantumMemory(number_threads, |
54 | 1.90k | sizeof(*filter)); |
55 | 1.90k | if (filter == (ResampleFilter **) NULL) |
56 | 1.90k | ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); |
57 | 1.90k | (void) memset(filter,0,number_threads*sizeof(*filter)); |
58 | 3.81k | for (i=0; i < (ssize_t) number_threads; i++) |
59 | 1.90k | { |
60 | 1.90k | filter[i]=AcquireResampleFilter(image,exception); |
61 | 1.90k | if (method != UndefinedVirtualPixelMethod) |
62 | 0 | (void) SetResampleFilterVirtualPixelMethod(filter[i],method); |
63 | 1.90k | if (interpolate != MagickFalse) |
64 | 0 | SetResampleFilter(filter[i],PointFilter); |
65 | 1.90k | } |
66 | 1.90k | return(filter); |
67 | 1.90k | } distort.c:AcquireResampleFilterTLS Line | Count | Source | 42 | 1.90k | { | 43 | 1.90k | ssize_t | 44 | 1.90k | i; | 45 | | | 46 | 1.90k | ResampleFilter | 47 | 1.90k | **filter; | 48 | | | 49 | 1.90k | size_t | 50 | 1.90k | number_threads; | 51 | | | 52 | 1.90k | number_threads=(size_t) GetMagickResourceLimit(ThreadResource); | 53 | 1.90k | filter=(ResampleFilter **) AcquireQuantumMemory(number_threads, | 54 | 1.90k | sizeof(*filter)); | 55 | 1.90k | if (filter == (ResampleFilter **) NULL) | 56 | 1.90k | ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); | 57 | 1.90k | (void) memset(filter,0,number_threads*sizeof(*filter)); | 58 | 3.81k | for (i=0; i < (ssize_t) number_threads; i++) | 59 | 1.90k | { | 60 | 1.90k | filter[i]=AcquireResampleFilter(image,exception); | 61 | 1.90k | if (method != UndefinedVirtualPixelMethod) | 62 | 0 | (void) SetResampleFilterVirtualPixelMethod(filter[i],method); | 63 | 1.90k | if (interpolate != MagickFalse) | 64 | 0 | SetResampleFilter(filter[i],PointFilter); | 65 | 1.90k | } | 66 | 1.90k | return(filter); | 67 | 1.90k | } |
Unexecuted instantiation: draw.c:AcquireResampleFilterTLS Unexecuted instantiation: effect.c:AcquireResampleFilterTLS Unexecuted instantiation: enhance.c:AcquireResampleFilterTLS Unexecuted instantiation: fx.c:AcquireResampleFilterTLS Unexecuted instantiation: resize.c:AcquireResampleFilterTLS Unexecuted instantiation: visual-effects.c:AcquireResampleFilterTLS |
68 | | |
69 | | #if defined(__cplusplus) || defined(c_plusplus) |
70 | | } |
71 | | #endif |
72 | | |
73 | | #endif |