Package com.example.breeze_seas
Class Image
java.lang.Object
com.example.breeze_seas.Image
Represents an image stored by the application.
Each image has a unique image ID, a compressed Base64 string representation,
and a decoded Bitmap for display purposes.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionandroid.graphics.Bitmapdisplay()Returns the bitmap representation of the image for display.Returns the compressed Base64 representation of the image.android.graphics.BitmapReturns the decoded bitmap image data.Returns the image ID.voidsetCompressedBase64(String compressedBase64) Sets the compressed Base64 representation of the image and refreshes the decoded bitmap data.voidsetImageData(android.graphics.Bitmap imageData) Sets the decoded bitmap image data.voidsetImageId(String imageId) Sets the image ID.
-
Constructor Details
-
Image
Creates an image object from existing database data.- Parameters:
imageId- the unique ID of the image documentcompressedBase64- the compressed Base64 image string
-
Image
Creates a new image object and automatically generates a new image ID.- Parameters:
compressedBase64- the compressed Base64 image string
-
-
Method Details
-
getImageId
Returns the image ID.- Returns:
- the image ID
-
setImageId
Sets the image ID.- Parameters:
imageId- the new image ID
-
getCompressedBase64
Returns the compressed Base64 representation of the image.- Returns:
- the compressed Base64 image string
-
setCompressedBase64
Sets the compressed Base64 representation of the image and refreshes the decoded bitmap data.- Parameters:
compressedBase64- the new compressed Base64 image string
-
display
public android.graphics.Bitmap display()Returns the bitmap representation of the image for display.- Returns:
- the decoded bitmap, or
nullif unavailable
-
getImageData
public android.graphics.Bitmap getImageData()Returns the decoded bitmap image data.- Returns:
- the bitmap image data, or
nullif unavailable
-
setImageData
public void setImageData(android.graphics.Bitmap imageData) Sets the decoded bitmap image data.- Parameters:
imageData- the bitmap to store
-