github.com/switchupcb/yaegi@v0.10.2/stdlib/go1_16_image_draw.go (about)

     1  // Code generated by 'yaegi extract image/draw'. DO NOT EDIT.
     2  
     3  // +build go1.16,!go1.17
     4  
     5  package stdlib
     6  
     7  import (
     8  	"image"
     9  	"image/color"
    10  	"image/draw"
    11  	"reflect"
    12  )
    13  
    14  func init() {
    15  	Symbols["image/draw/draw"] = map[string]reflect.Value{
    16  		// function, constant and variable definitions
    17  		"Draw":           reflect.ValueOf(draw.Draw),
    18  		"DrawMask":       reflect.ValueOf(draw.DrawMask),
    19  		"FloydSteinberg": reflect.ValueOf(&draw.FloydSteinberg).Elem(),
    20  		"Over":           reflect.ValueOf(draw.Over),
    21  		"Src":            reflect.ValueOf(draw.Src),
    22  
    23  		// type definitions
    24  		"Drawer":    reflect.ValueOf((*draw.Drawer)(nil)),
    25  		"Image":     reflect.ValueOf((*draw.Image)(nil)),
    26  		"Op":        reflect.ValueOf((*draw.Op)(nil)),
    27  		"Quantizer": reflect.ValueOf((*draw.Quantizer)(nil)),
    28  
    29  		// interface wrapper definitions
    30  		"_Drawer":    reflect.ValueOf((*_image_draw_Drawer)(nil)),
    31  		"_Image":     reflect.ValueOf((*_image_draw_Image)(nil)),
    32  		"_Quantizer": reflect.ValueOf((*_image_draw_Quantizer)(nil)),
    33  	}
    34  }
    35  
    36  // _image_draw_Drawer is an interface wrapper for Drawer type
    37  type _image_draw_Drawer struct {
    38  	IValue interface{}
    39  	WDraw  func(dst draw.Image, r image.Rectangle, src image.Image, sp image.Point)
    40  }
    41  
    42  func (W _image_draw_Drawer) Draw(dst draw.Image, r image.Rectangle, src image.Image, sp image.Point) {
    43  	W.WDraw(dst, r, src, sp)
    44  }
    45  
    46  // _image_draw_Image is an interface wrapper for Image type
    47  type _image_draw_Image struct {
    48  	IValue      interface{}
    49  	WAt         func(x int, y int) color.Color
    50  	WBounds     func() image.Rectangle
    51  	WColorModel func() color.Model
    52  	WSet        func(x int, y int, c color.Color)
    53  }
    54  
    55  func (W _image_draw_Image) At(x int, y int) color.Color {
    56  	return W.WAt(x, y)
    57  }
    58  func (W _image_draw_Image) Bounds() image.Rectangle {
    59  	return W.WBounds()
    60  }
    61  func (W _image_draw_Image) ColorModel() color.Model {
    62  	return W.WColorModel()
    63  }
    64  func (W _image_draw_Image) Set(x int, y int, c color.Color) {
    65  	W.WSet(x, y, c)
    66  }
    67  
    68  // _image_draw_Quantizer is an interface wrapper for Quantizer type
    69  type _image_draw_Quantizer struct {
    70  	IValue    interface{}
    71  	WQuantize func(p color.Palette, m image.Image) color.Palette
    72  }
    73  
    74  func (W _image_draw_Quantizer) Quantize(p color.Palette, m image.Image) color.Palette {
    75  	return W.WQuantize(p, m)
    76  }