Interface MapImage
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumHow colors that maps cannot show are approximated. -
Method Summary
Modifier and TypeMethodDescriptionintcolumns()Returns how many maps wide the image is, counting a partly filled last column.intheight()Returns the height in pixels.bytepixel(int x, int y) Returns one pixel.byte[]pixels()Returns a copy of the pixels, row by row.introws()Returns how many maps high the image is, counting a partly filled last row.tile(int column, int row) Cuts the map-sized piece at a column and row of maps.Converts the image back to colors, for previews.intwidth()Returns the width in pixels.
-
Method Details
-
width
int width()Returns the width in pixels.- Returns:
- the width in pixels
- Since:
- 0.1.0
-
height
int height()Returns the height in pixels.- Returns:
- the height in pixels
- Since:
- 0.1.0
-
pixel
byte pixel(int x, int y) Returns one pixel.- Parameters:
x- the column,0towidth - 1y- the row,0toheight - 1- Returns:
- the map pixel
- Since:
- 0.1.0
-
pixels
byte[] pixels()Returns a copy of the pixels, row by row.- Returns:
- a copy of the pixels, row by row
- Since:
- 0.1.0
-
columns
int columns()Returns how many maps wide the image is, counting a partly filled last column.- Returns:
- how many maps wide the image is, counting a partly filled last column
- Since:
- 0.1.0
-
rows
int rows()Returns how many maps high the image is, counting a partly filled last row.- Returns:
- how many maps high the image is, counting a partly filled last row
- Since:
- 0.1.0
-
tile
Cuts the map-sized piece at a column and row of maps.Pieces on the right and bottom edges are padded with transparent pixels when the image is not a multiple of 128 pixels.
-
toBufferedImage
BufferedImage toBufferedImage()Converts the image back to colors, for previews.- Returns:
- a picture of the same size, with transparent pixels left transparent
- Since:
- 0.1.0
-