<commit_before>package vips

/*
#cgo pkg-config: vips
#include "conversion.h"
*/
import "C"

type Extend int

const (
	ExtendBlack      = C.VIPS_EXTEND_BLACK
	ExtendCopy       = C.VIPS_EXTEND_COPY
	ExtendRepeat     = C.VIPS_EXTEND_REPEAT
	ExtendMirror     = C.VIPS_EXTEND_MIRROR
	ExtendWhite      = C.VIPS_EXTEND_WHITE
	ExtendBackground = C.VIPS_EXTEND_BACKGROUND
)

type Angle int

const (
	Angle0   = C.VIPS_ANGLE_D0
	Angle90  = C.VIPS_ANGLE_D90
	Angle180 = C.VIPS_ANGLE_D180
	Angle270 = C.VIPS_ANGLE_D270
)

type Direction int

const (
	DirectionHorizontal = C.VIPS_DIRECTION_HORIZONTAL
	DirectionVertical   = C.VIPS_DIRECTION_VERTICAL
)

func (in Image) Cast(format BandFormat) (*Image, error) {
	var out *C.struct__VipsImage
	e := C.cgo_vips_cast(in.vi, &out, C.VipsBandFormat(format))
	return imageError(out, e)
}

func (in Image) Copy() (*Image, error) {
	var out *C.struct__VipsImage
	e := C.cgo_vips_copy(in.vi, &out)
	return imageError(out, e)
}

func (in Image) Embed(left, top, width, height int, extend Extend) (*Image, error) {
	var out *C.struct__VipsImage
	e := C.cgo_vips_embed(in.vi, &out, C.int(left), C.int(top), C.int(width), C.int(height), C.int(extend))
	return imageError(out, e)
}

func (in Image) ExtractArea(left, top, width, height int) (*Image, error) {
	var out *C.struct__VipsImage
	e := C.cgo_vips_extract_area(in.vi, &out, C.int(left), C.int(top), C.int(width), C.int(height))
	return imageError(out, e)
}<commit_msg>Add Go types onto some VIPS enums.<commit_after>package vips

/*
#cgo pkg-config: vips
#include "conversion.h"
*/
import "C"

type Extend int

const (
	ExtendBlack      Extend = C.VIPS_EXTEND_BLACK
	ExtendCopy       Extend = C.VIPS_EXTEND_COPY
	ExtendRepeat     Extend = C.VIPS_EXTEND_REPEAT
	ExtendMirror     Extend = C.VIPS_EXTEND_MIRROR
	ExtendWhite      Extend = C.VIPS_EXTEND_WHITE
	ExtendBackground Extend = C.VIPS_EXTEND_BACKGROUND
)

type Angle int

const (
	Angle0   Angle = C.VIPS_ANGLE_D0
	Angle90  Angle = C.VIPS_ANGLE_D90
	Angle180 Angle = C.VIPS_ANGLE_D180
	Angle270 Angle = C.VIPS_ANGLE_D270
)

type Direction int

const (
	DirectionHorizontal Direction = C.VIPS_DIRECTION_HORIZONTAL
	DirectionVertical   Direction = C.VIPS_DIRECTION_VERTICAL
)

func (in Image) Cast(format BandFormat) (*Image, error) {
	var out *C.struct__VipsImage
	e := C.cgo_vips_cast(in.vi, &out, C.VipsBandFormat(format))
	return imageError(out, e)
}

func (in Image) Copy() (*Image, error) {
	var out *C.struct__VipsImage
	e := C.cgo_vips_copy(in.vi, &out)
	return imageError(out, e)
}

func (in Image) Embed(left, top, width, height int, extend Extend) (*Image, error) {
	var out *C.struct__VipsImage
	e := C.cgo_vips_embed(in.vi, &out, C.int(left), C.int(top), C.int(width), C.int(height), C.int(extend))
	return imageError(out, e)
}

func (in Image) ExtractArea(left, top, width, height int) (*Image, error) {
	var out *C.struct__VipsImage
	e := C.cgo_vips_extract_area(in.vi, &out, C.int(left), C.int(top), C.int(width), C.int(height))
	return imageError(out, e)
}
{'fraction_non_alphanumeric': 0.1233787828400399, 'fraction_numerical': 0.011972065181243765, 'mean_word_length': 4.591078066914498, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4849411', 'n_tokens_mistral': 1285, 'n_tokens_neox': 1248, 'n_words': 270}