-
Notifications
You must be signed in to change notification settings - Fork 23
/
WandProperties.hsc
136 lines (118 loc) · 4.99 KB
/
WandProperties.hsc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
{-# LANGUAGE CPP #-}
{-# LANGUAGE ForeignFunctionInterface #-}
module Graphics.ImageMagick.MagickWand.FFI.WandProperties
where
import Foreign
import Foreign.C.String
import Foreign.C.Types
import Graphics.ImageMagick.MagickWand.FFI.Types
foreign import ccall "MagickDeleteOption" magickDeleteOption
:: Ptr MagickWand
-> CString -- ^ the key
-> IO MagickBooleanType
-- | MagickGetOption() returns a value associated with a wand
-- and the specified key. Use MagickRelinquishMemory() to free
-- the value when you are finished with it.
foreign import ccall "MagickGetOption" magickGetOption
:: Ptr MagickWand
-> CString -- ^ the key
-> IO CString
-- | MagickSetOption() associates one or options with the wand
-- (e.g. MagickSetOption(wand,"jpeg:perserve","yes")).
foreign import ccall "MagickSetOption" magickSetOption
:: Ptr MagickWand
-> CString -- ^ the key
-> CString -- ^ the value
-> IO MagickBooleanType
-- | MagickGetOptions() returns all the option names that match the
-- specified pattern associated with a wand. Use MagickGetOption()
-- to return the value of a particular option. Use MagickRelinquishMemory()
-- to free the value when you are finished with it.
foreign import ccall "MagickGetOptions" magickGetOptions
:: Ptr MagickWand
-> CString -- ^ the pattern
-> Ptr CSize
-> IO (Ptr CString)
-- | MagickDeleteImageProperty() deletes a wand property.
foreign import ccall "MagickDeleteImageProperty" magickDeleteImageProperty
:: Ptr MagickWand
-> CString -- ^ the property
-> IO MagickBooleanType
-- | MagickGetImageProperty() returns a value associated with the
-- specified property. Use MagickRelinquishMemory() to free the value
-- when you are finished with it.
foreign import ccall "MagickGetImageProperty" magickGetImageProperty
:: Ptr MagickWand
-> CString -- ^ the property
-> IO CString
-- | MagickGetImageProperties() returns all the property names that
-- match the specified pattern associated with a wand. Use
-- MagickGetImageProperty() to return the value of a particular property.
-- Use MagickRelinquishMemory() to free the value when you are finished
-- with it.
foreign import ccall "MagickGetImageProperties" magickGetImageProperties
:: Ptr MagickWand
-> CString -- ^ the pattern
-> Ptr CSize
-> IO (Ptr CString)
-- | MagickSetImageProperty() associates a property with an image.
foreign import ccall "MagickSetImageProperty" magickSetImageProperty
:: Ptr MagickWand
-> CString -- ^ the property
-> CString -- ^ the value
-> IO MagickBooleanType
-- | MagickGetImageProfile() returns the named image profile.
foreign import ccall "MagickGetImageProfile" magickGetImageProfile
:: Ptr MagickWand
-> CString -- ^ the profile name
-> Ptr CSize -- ^ the profile length
-> IO (Ptr Word8)
-- | MagickRemoveImageProfile() removes the named image profile and
-- returns it.
foreign import ccall "MagickRemoveImageProfile" magickRemoveImageProfile
:: Ptr MagickWand
-> CString -- ^ the profile name
-> Ptr CSize -- ^ the profile length
-> IO (Ptr Word8)
-- | MagickSetImageProfile() adds a named profile to the magick wand.
-- If a profile with the same name already exists, it is replaced.
-- This method differs from the MagickProfileImage() method in that
-- it does not apply any CMS color profiles.
foreign import ccall "MagickSetImageProfile" magickSetImageProfile
:: Ptr MagickWand
-> CString -- ^ the profile name
-> Ptr Word8 -- ^ the profile
-> CSize -- ^ the profile length
-> IO MagickBooleanType
-- | MagickGetImageProfiles() returns all the profile names that match
-- the specified pattern associated with a wand. Use
-- MagickGetImageProfile() to return the value of a particular property.
-- Use MagickRelinquishMemory() to free the value when you are finished
-- with it.
foreign import ccall "MagickGetImageProfiles" magickGetImageProfiles
:: Ptr MagickWand
-> CString -- ^ the pattern
-> Ptr CSize
-> IO (Ptr CString)
-- | MagickSetResolution() sets the image resolution.
foreign import ccall "MagickSetImageResolution" magickSetImageResolution
:: Ptr MagickWand
-> CDouble -- ^ x resolution
-> CDouble -- ^ y resolution
-> IO MagickBooleanType
-- | MagickGetResolution() gets the image resolution.
foreign import ccall "MagickGetImageResolution" magickGetImageResolution
:: Ptr MagickWand
-> Ptr CDouble -- ^ x resolution
-> Ptr CDouble -- ^ y resolution
-> IO MagickBooleanType
-- | MagickGetImageArtifacts() returns all the artifact names
-- that match the specified pattern associated with a wand.
-- Use MagickGetImageProperty() to return the value of a
-- particular artifact. Use MagickRelinquishMemory() to free
-- the value when you are finished with it.
foreign import ccall "MagickGetImageArtifacts" magickGetImageArtifacts
:: Ptr MagickWand
-> CString -- ^ the pattern
-> Ptr CSize
-> IO (Ptr CString)