Class Texture
java.lang.Object
eu.svjatoslav.sixth.e3d.renderer.raster.texture.Texture
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A helper class that accumulates color values for a given area of a bitmap -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
detectDownscaleFactorForZoom
(double zoom) int
detectUpscaleFactorForZoom
(double zoom) downscaleBitmap
(TextureBitmap originalBitmap) Downscale given bitmap by factor of 2.getDownscaledBitmap
(int scaleFactor) getUpscaledBitmap
(int scaleFactor) Returns the bitmap that should be used for rendering at the given zoomgetZoomedBitmap
(double zoomLevel) Returns the bitmap that should be used for rendering at the given zoomvoid
Resets the cache of resampled bitmapsupscaleBitmap
(TextureBitmap originalBitmap) Upscales the given bitmap by a factor of 2
-
Field Details
-
-
graphics
-
-
Constructor Details
-
Texture
public Texture(int width, int height, int maxUpscale)
-
-
Method Details
-
detectDownscaleFactorForZoom
public int detectDownscaleFactorForZoom(double zoom) -
detectUpscaleFactorForZoom
public int detectUpscaleFactorForZoom(double zoom) -
downscaleBitmap
Downscale given bitmap by factor of 2.- Parameters:
originalBitmap
- Bitmap to downscale.- Returns:
- Downscaled bitmap.
-
getDownscaledBitmap
-
getUpscaledBitmap
Returns the bitmap that should be used for rendering at the given zoom- Parameters:
scaleFactor
- The upscale factor- Returns:
- The bitmap
-
getZoomedBitmap
Returns the bitmap that should be used for rendering at the given zoom- Parameters:
zoomLevel
- The zoom level- Returns:
- The bitmap
-
resetResampledBitmapCache
public void resetResampledBitmapCache()Resets the cache of resampled bitmaps -
upscaleBitmap
Upscales the given bitmap by a factor of 2- Parameters:
originalBitmap
- The bitmap to upscale- Returns:
- The upscaled bitmap
-