Documentation ¶
Overview ¶
edshot contains functions etc for analysing screenshots of the editor
Index ¶
- Constants
- func FindMap(img image.Image, x, y int) (rect image.Rectangle, err error)
- func FindMapRow(img image.Image, x, y int, grey color.Color) (minX, maxX int, err error)
- func FindMapTopAndBottom(img image.Image, x, y int, grey color.Color) (minY, maxY int, err error)
- func FindSelecters(img image.Image) (rect image.Rectangle, grey color.Color, err error)
- func GetMapColourTheme(img image.Image, r image.Rectangle) int
- func HashImage(img image.Image, bounds image.Rectangle) uint32
- func HashMapTiles(img image.Image, bounds image.Rectangle, positions []image.Point) (hashes []uint32)
- func LoadMap(filename string) (img image.Image, mapBounds image.Rectangle, selBounds image.Rectangle, e error)
Constants ¶
const ( PIXEL_SCALE = 2 // For hidpi SEL_TILE_WIDTH = 32 * PIXEL_SCALE SEL_TILE_HEIGHT = 32 * PIXEL_SCALE SEL_TILE_BORDER = PIXEL_SCALE PADDED_SEL_TILE_WIDTH = SEL_TILE_WIDTH + 2*SEL_TILE_BORDER PADDED_SEL_TILE_HEIGHT = SEL_TILE_HEIGHT + 2*SEL_TILE_BORDER SEL_COLUMNS = 6 SEL_ROWS = 6 MAP_TILE_WIDTH = 16 * PIXEL_SCALE MAP_TILE_HEIGHT = 15 * PIXEL_SCALE )
Variables ¶
This section is empty.
Functions ¶
func FindMap ¶
FindMap finds the extremities of the map portion of the snapshot. x and y should be on the left edge of the selecter area, approximately halfway down. The result has inclusive Min and exclusive Max.
func FindMapRow ¶
FindMapRow finds the extremities of the map portion of the snapshot. x and y should be on the left edge of the selecter area, approximately halfway down. The result has inclusive Min and exclusive Max.
func FindMapTopAndBottom ¶
func FindSelecters ¶
FindSelecters finds the extremities of the tile selecter area and also returns the colour of the window background. This is fairly easy because the region has a 1px black border. Each value in rect is the coordinate that the border falls on.
func GetMapColourTheme ¶
GetMapColourTheme samples a particular pixel from the selecter region (r) to determine the map's colour theme
Types ¶
This section is empty.