func (rgc *RasterGraphicContext) GetDPI() float64 {
	return rgc.DPI
}
GetDPI returns the resolution of the Image GraphicContext
package drawing
import (
	"errors"
	"image"
	"image/color"
	"math"
	"github.com/golang/freetype/raster"
	"github.com/golang/freetype/truetype"
	"golang.org/x/image/draw"
	"golang.org/x/image/font"
	"golang.org/x/image/math/fixed"
)
func NewRasterGraphicContext(img draw.Image) (*RasterGraphicContext, error) {
	var painter Painter
	switch selectImage := img.(type) {
	case *image.RGBA:
		painter = raster.NewRGBAPainter(selectImage)
	default:
		return nil, errors.New("NewRasterGraphicContext() :: invalid image type")
	}
	return NewRasterGraphicContextWithPainter(img, painter), nil
}
func NewRasterGraphicContextWithPainter(img draw.Image, painter Painter) *RasterGraphicContext {
	width, height := img.Bounds().Dx(), img.Bounds().Dy()
	return &RasterGraphicContext{
		NewStackGraphicContext(),
		img,
		painter,
		raster.NewRasterizer(width, height),
		raster.NewRasterizer(width, height),
		&truetype.GlyphBuf{},
		DefaultDPI,
	}
}
type RasterGraphicContext struct {
	*StackGraphicContext
	img              draw.Image
	painter          Painter
	fillRasterizer   *raster.Rasterizer
	strokeRasterizer *raster.Rasterizer
	glyphBuf         *truetype.GlyphBuf
	DPI              float64
}
func (rgc *RasterGraphicContext) SetDPI(dpi float64) {
	rgc.DPI = dpi
	rgc.recalc()
}