// See cairo_image_surface_get_data().
//
// C API documentation: http://cairographics.org/manual/cairo-Image-Surfaces.html#cairo-image-surface-get-data
430259
func (i *ImageSurface) Data() []byte {
	buf := C.cairo_image_surface_get_data(i.Ptr)
	return C.GoBytes(unsafe.Pointer(buf), C.int(i.GetStride()*i.GetHeight()))
}
1041639
func (c *Client) GetImage(ctx context.Context, ref string) (Image, error) {
	i, err := c.ImageService().Get(ctx, ref)
	if err != nil {
		return nil, err
	}
	return NewImage(c, i), nil
}
879780
func Convert_v1_ImageLayerData_To_image_ImageLayerData(in *v1.ImageLayerData, out *image.ImageLayerData, s conversion.Scope) error {
	return autoConvert_v1_ImageLayerData_To_image_ImageLayerData(in, out, s)
}
647537
func LoadTexture(renderer *sdl.Renderer, file string) (*sdl.Texture, error) {
	_renderer := (*C.SDL_Renderer)(unsafe.Pointer(renderer))
	_file := C.CString(file)
	defer C.free(unsafe.Pointer(_file))
	_surface := C.IMG_LoadTexture(_renderer, _file)
	if _surface == nil {
		return nil, GetError()
	}
	return (*sdl.Texture)(unsafe.Pointer(_surface)), nil
}
137500
func (s *Server) Get(params imageserver.Params) (*imageserver.Image, error) {
	src, err := params.Get(Param)
	if err != nil {
		return nil, err
	}
	params = imageserver.Params{Param: src}
	return s.Server.Get(params)
}
472891
func (surface *Surface) GetAlphaMod() (alpha uint8, err error) {
	_alpha := (*C.Uint8)(unsafe.Pointer(&alpha))
	if C.SDL_GetSurfaceAlphaMod(surface.cptr(), _alpha) != 0 {
		return alpha, GetError()
	}
	return alpha, nil
}
302028
func (l *Layer0) GetMetadata(id string) (map[string]string, error) {
	id = l.realID(id)
	return l.Driver.GetMetadata(id)
}
57423
func (surface *Surface) GetDevice() *Device {
	ret := wrapDevice(C.cairo_surface_get_device(surface.Ptr))
	if err := surface.status(); err != nil {
		panic(err)
	}
	return ret
}
756315
func (surface *Surface) GetFontOptions(options *FontOptions) {
	C.cairo_surface_get_font_options(surface.Ptr, options.Ptr)
	if err := surface.status(); err != nil {
		panic(err)
	}
}
358252
func LoadData(image string) (Module, error) {
	var mod Module
	cstr := C.CString(image)
	defer C.free(unsafe.Pointer(cstr))
	err := result(C.cuModuleLoadData(&mod.mod, unsafe.Pointer(cstr)))
	return mod, err
}
512254
func (c *images) Get(name string, options v1.GetOptions) (result *image.Image, err error) {
	result = &image.Image{}
	err = c.client.Get().
		Resource("images").
		Name(name).
		VersionedParams(&options, scheme.ParameterCodec).
		Do().
		Into(result)
	return
}
575053
func getData(v interface{}, data *C.pn_data_t) {
	if data != nil && C.pn_data_size(data) > 0 {
		C.pn_data_rewind(data)
		C.pn_data_next(data)
		unmarshal(v, data)
	}
	return
}
273368
func (j *Js) Getdata() map[string]interface{} {
	if m, ok := (j.data).(map[string]interface{}); ok {
		return m
	}
	return nil
}
380417
func (surface *XlibSurface) GetScreen() unsafe.Pointer {
	ret := unsafe.Pointer(C.cairo_xlib_surface_get_screen(surface.Ptr))
	if err := surface.status(); err != nil {
		panic(err)
	}
	return ret
}
852922
func (d Docker) GetImage(name string) (builder.Image, error) {
	img, err := d.Daemon.GetImage(name)
	if err != nil {
		return nil, err
	}
	return imgWrap{img}, nil
}
1333297
func (surface *Surface) Flush() {
	C.cairo_surface_flush(surface.Ptr)
	if err := surface.status(); err != nil {
		panic(err)
	}
}
419427
func PictureDataFromPicture(pic Picture) *PictureData {
	if pd, ok := pic.(*PictureData); ok {
		return pd
	}

	bounds := pic.Bounds()
	pd := MakePictureData(bounds)

	if pic, ok := pic.(PictureColor); ok {
		for y := math.Floor(bounds.Min.Y); y < bounds.Max.Y; y++ {
			for x := math.Floor(bounds.Min.X); x < bounds.Max.X; x++ {
				// this together with the Floor is a trick to get all of the pixels
				at := V(
					math.Max(x, bounds.Min.X),
					math.Max(y, bounds.Min.Y),
				)
				col := pic.Color(at)
				pd.Pix[pd.Index(at)] = color.RGBA{
					R: uint8(col.R * 255),
					G: uint8(col.G * 255),
					B: uint8(col.B * 255),
					A: uint8(col.A * 255),
				}
			}
		}
	}

	return pd
}