// GLGetDrawableSize returns the size of a window's underlying drawable in pixels (for use with glViewport).
// (https://wiki.libsdl.org/SDL_GL_GetDrawableSize)
496535
func (window *Window) GLGetDrawableSize() (w, h int32) {
	var _w, _h C.int
	C.SDL_GL_GetDrawableSize(window.cptr(), &_w, &_h)
	return int32(_w), int32(_h)
}
1084465
func DecodeRGBToSize(data []byte, width, height int) (m *RGBImage, err error) {
	pix, err := webpDecodeRGBToSize(data, width, height)
	if err != nil {
		return
	}
	m = &RGBImage{
		XPix:    pix,
		XStride: 3 * width,
		XRect:   image.Rect(0, 0, width, height),
	}
	return
}
745543
func (d Display) Size() Size {
	return Size{Height: *d.o.Size.Height, Width: *d.o.Size.Width}
}
1002847
func (f *Fpdf) GetDrawColor() (int, int, int) {
	return f.color.draw.ir, f.color.draw.ig, f.color.draw.ib
}
1009381
func (d *Datastore) GetSize(k ds.Key) (int, error) {
	o, ok := d.buffer[k]
	if ok {
		if o.delete {
			return -1, ds.ErrNotFound
		}
		return len(o.value), nil
	}

	return d.child.GetSize(k)
}
273230
func (v *Widget) GetSizeRequest() (width int, height int) {
	var w, h C.gint
	C.gtk_widget_get_size_request(v.GWidget, &w, &h)
	return int(w), int(h)
}
142953
func (w *Window) SetFramebufferSizeCallback(cbfun FramebufferSizeCallback) (previous FramebufferSizeCallback) {
	previous = w.fFramebufferSizeHolder
	w.fFramebufferSizeHolder = cbfun
	if cbfun == nil {
		C.glfwSetFramebufferSizeCallback(w.data, nil)
	} else {
		C.glfwSetFramebufferSizeCallbackCB(w.data)
	}
	panicError()
	return previous
}
227321
func goWindowSizeCB(window unsafe.Pointer, width, height C.int) {
	w := windows.get((*C.GLFWwindow)(window))
	w.fSizeHolder(w, int(width), int(height))
}
1307954
func GetSize(fd int) (width, height int, err error) {
	var info consoleScreenBufferInfo
	_, _, e := syscall.Syscall(procGetConsoleScreenBufferInfo.Addr(), 2, uintptr(fd), uintptr(unsafe.Pointer(&info)), 0)
	if e != 0 {
		return 0, 0, error(e)
	}
	return int(info.size.x), int(info.size.y), nil
}
122631
func (s *SubsetFontObj) GlyphIndexToPdfWidth(glyphIndex uint) uint {

	numberOfHMetrics := s.ttfp.NumberOfHMetrics()
	unitsPerEm := s.ttfp.UnitsPerEm()
	if glyphIndex >= numberOfHMetrics {
		glyphIndex = numberOfHMetrics - 1
	}

	width := s.ttfp.Widths()[glyphIndex]
	if unitsPerEm == 1000 {
		return width
	}
	return width * 1000 / unitsPerEm
}
577806
func (v *Window) GetDefaultSize() (width int, height int) {
	var cwidth, cheight C.gint
	C.gtk_window_get_default_size(WINDOW(v), &cwidth, &cheight)
	return int(cwidth), int(cheight)
}
1114087
func (surface *XlibSurface) GetWidth() int {
	ret := int(C.cairo_xlib_surface_get_width(surface.Ptr))
	if err := surface.status(); err != nil {
		panic(err)
	}
	return ret
}
1320806
func (b *PCMBuffer) Size() (numFrames int) {
	if b == nil || b.Format == nil {
		return 0
	}
	numChannels := b.Format.NumChannels
	if numChannels == 0 {
		numChannels = 1
	}
	switch b.DataType {
	case Integer:
		numFrames = len(b.Ints) / numChannels
	case Float:
		numFrames = len(b.Floats) / numChannels
	case Byte:
		sampleSize := int((b.Format.BitDepth-1)/8 + 1)
		numFrames = (len(b.Bytes) / sampleSize) / numChannels
	}
	return numFrames
}
918497
func onResize(window *glfw.Window, w, h int) {
	w, h = window.GetSize() // query window to get screen pixels
	width, height := window.GetFramebufferSize()
	gl.Viewport(0, 0, int32(width), int32(height))
	gl.MatrixMode(gl.PROJECTION)
	gl.LoadIdentity()
	gl.Ortho(0, float64(w), 0, float64(h), -1, 1)
	gl.MatrixMode(gl.MODELVIEW)
	gl.LoadIdentity()
	gl.ClearColor(1, 1, 1, 1)
}
1301913
func (image *Image) GetSize() (size uint64, err error) {
	if image.image == nil {
		return 0, RbdErrorImageNotOpen
	}

	if ret := C.rbd_get_size(image.image, (*C.uint64_t)(&size)); ret < 0 {
		return 0, RBDError(ret)
	}

	return size, nil
}
1165616
func (renderer *Renderer) GetDrawColor() (r, g, b, a uint8, err error) {
	ret := C.SDL_GetRenderDrawColor(
		renderer.cptr(),
		(*C.Uint8)(unsafe.Pointer(&r)),
		(*C.Uint8)(unsafe.Pointer(&g)),
		(*C.Uint8)(unsafe.Pointer(&b)),
		(*C.Uint8)(unsafe.Pointer(&a)))
	return r, g, b, a, errorFromInt(int(ret))
}
188234
func (window *Window) GetMaximumSize() (w, h int32) {
	var _w, _h C.int
	C.SDL_GetWindowMaximumSize(window.cptr(), &_w, &_h)
	return int32(_w), int32(_h)
}