@@ -188,39 +188,99 @@ type Sharpen struct {
188188
189189// Options represents the supported image transformation options.
190190type Options struct {
191- Height int
192- Width int
193- AreaHeight int
194- AreaWidth int
195- Top int
196- Left int
197- Quality int
198- Compression int
199- Zoom int
200- Crop bool
201- SmartCrop bool // Deprecated, use: bimg.Options.Gravity = bimg.GravitySmart
202- Enlarge bool
203- Embed bool
204- Flip bool
205- Flop bool
206- Force bool
207- NoAutoRotate bool
208- NoProfile bool
209- Interlace bool
210- StripMetadata bool
211- Trim bool
212- Lossless bool
213- Extend Extend
214- Rotate Angle
215- Background Color
216- Gravity Gravity
217- Watermark Watermark
218- WatermarkImage WatermarkImage
219- Type ImageType
220- Interpolator Interpolator
221- Interpretation Interpretation
222- GaussianBlur GaussianBlur
223- Sharpen Sharpen
224- Threshold float64
225- OutputICC string
191+ Height int
192+ Width int
193+ AreaHeight int
194+ AreaWidth int
195+ Top int
196+ Left int
197+ Quality int
198+ Compression int
199+ Zoom int
200+ Crop bool
201+ SmartCrop bool // Deprecated, use: bimg.Options.Gravity = bimg.GravitySmart
202+ Enlarge bool
203+ Embed bool
204+ Flip bool
205+ Flop bool
206+ Force bool
207+ NoAutoRotate bool
208+ NoProfile bool
209+ Interlace bool
210+ StripMetadata bool
211+ Trim bool
212+ Lossless bool
213+ Composite bool
214+ Extend Extend
215+ Rotate Angle
216+ Background Color
217+ Gravity Gravity
218+ Watermark Watermark
219+ WatermarkImage WatermarkImage
220+ Type ImageType
221+ Interpolator Interpolator
222+ Interpretation Interpretation
223+ GaussianBlur GaussianBlur
224+ Sharpen Sharpen
225+ BlendMode BlendMode
226+ Threshold float64
227+ OutputICC string
228+ CompositeLayers []* Image
226229}
230+
231+ // BlendMode represents the blend mode used when compositing.
232+ // See: https://jcupitt.github.io/libvips/API/current/libvips-conversion.html#VipsBlendMode
233+ type BlendMode int
234+
235+ const (
236+ // BlendModeClear where the second object is drawn, the first is removed
237+ BlendModeClear BlendMode = C .VIPS_BLEND_MODE_CLEAR
238+ // BlendModeSource the second object is drawn as if nothing were below
239+ BlendModeSource BlendMode = C .VIPS_BLEND_MODE_SOURCE
240+ // BlendModeOver the image shows what you would expect if you held two semi-transparent slides on top of each other
241+ BlendModeOver BlendMode = C .VIPS_BLEND_MODE_OVER
242+ // BlendModeIn the first object is removed completely, the second is only drawn where the first was
243+ BlendModeIn BlendMode = C .VIPS_BLEND_MODE_IN
244+ // BlendModeOut the second is drawn only where the first isn't
245+ BlendModeOut BlendMode = C .VIPS_BLEND_MODE_OUT
246+ // BlendModeAtop this leaves the first object mostly intact, but mixes both objects in the overlapping area
247+ BlendModeAtop BlendMode = C .VIPS_BLEND_MODE_ATOP
248+ // BlendModeDest leaves the first object untouched, the second is discarded completely
249+ BlendModeDest BlendMode = C .VIPS_BLEND_MODE_DEST
250+ // BlendModeDestOver like OVER, but swaps the arguments
251+ BlendModeDestOver BlendMode = C .VIPS_BLEND_MODE_DEST_OVER
252+ // BlendModeDestIn like IN, but swaps the arguments
253+ BlendModeDestIn BlendMode = C .VIPS_BLEND_MODE_DEST_IN
254+ // BlendModeDestOut like OUT, but swaps the arguments
255+ BlendModeDestOut BlendMode = C .VIPS_BLEND_MODE_DEST_OUT
256+ // BlendModeDestAtop like ATOP, but swaps the arguments
257+ BlendModeDestAtop BlendMode = C .VIPS_BLEND_MODE_DEST_ATOP
258+ // BlendModeXOR something like a difference operator
259+ BlendModeXOR BlendMode = C .VIPS_BLEND_MODE_XOR
260+ // BlendModeAdd a bit like adding the two images
261+ BlendModeAdd BlendMode = C .VIPS_BLEND_MODE_ADD
262+ // BlendModeSaturate a bit like the darker of the two
263+ BlendModeSaturate BlendMode = C .VIPS_BLEND_MODE_SATURATE
264+ // BlendModeMultiply at least as dark as the darker of the two inputs
265+ BlendModeMultiply BlendMode = C .VIPS_BLEND_MODE_MULTIPLY
266+ // BlendModeScreen at least as light as the lighter of the inputs
267+ BlendModeScreen BlendMode = C .VIPS_BLEND_MODE_SCREEN
268+ // BlendModeOverlay multiplies or screens colors, depending on the lightness
269+ BlendModeOverlay BlendMode = C .VIPS_BLEND_MODE_OVERLAY
270+ // BlendModeDarken the darker of each component
271+ BlendModeDarken BlendMode = C .VIPS_BLEND_MODE_DARKEN
272+ // BlendModeLighten the lighter of each component
273+ BlendModeLighten BlendMode = C .VIPS_BLEND_MODE_LIGHTEN
274+ // BlendModeColorDodge brighten first by a factor second
275+ BlendModeColorDodge BlendMode = C .VIPS_BLEND_MODE_COLOUR_DODGE
276+ // BlendModeColorBurn darken first by a factor of second
277+ BlendModeColorBurn BlendMode = C .VIPS_BLEND_MODE_COLOUR_BURN
278+ // BlendModeHardLight multiply or screen, depending on lightness
279+ BlendModeHardLight BlendMode = C .VIPS_BLEND_MODE_HARD_LIGHT
280+ // BlendModeSoftLight darken or lighten, depending on lightness
281+ BlendModeSoftLight BlendMode = C .VIPS_BLEND_MODE_SOFT_LIGHT
282+ // BlendModeDifference difference of the two
283+ BlendModeDifference BlendMode = C .VIPS_BLEND_MODE_DIFFERENCE
284+ // BlendModeExclusion somewhat like DIFFERENCE, but lower-contrast
285+ BlendModeExclusion BlendMode = C .VIPS_BLEND_MODE_EXCLUSION
286+ )
0 commit comments