Class Image

java.lang.Object
com.example.breeze_seas.Image

public class Image extends Object
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
    Constructor
    Description
    Image(String compressedBase64)
    Creates a new image object and automatically generates a new image ID.
    Image(String imageId, String compressedBase64)
    Creates an image object from existing database data.
  • Method Summary

    Modifier and Type
    Method
    Description
    android.graphics.Bitmap
    Returns the bitmap representation of the image for display.
    Returns the compressed Base64 representation of the image.
    android.graphics.Bitmap
    Returns the decoded bitmap image data.
    Returns the image ID.
    void
    setCompressedBase64(String compressedBase64)
    Sets the compressed Base64 representation of the image and refreshes the decoded bitmap data.
    void
    setImageData(android.graphics.Bitmap imageData)
    Sets the decoded bitmap image data.
    void
    setImageId(String imageId)
    Sets the image ID.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Image

      public Image(String imageId, String compressedBase64)
      Creates an image object from existing database data.
      Parameters:
      imageId - the unique ID of the image document
      compressedBase64 - the compressed Base64 image string
    • Image

      public Image(String compressedBase64)
      Creates a new image object and automatically generates a new image ID.
      Parameters:
      compressedBase64 - the compressed Base64 image string
  • Method Details

    • getImageId

      public String getImageId()
      Returns the image ID.
      Returns:
      the image ID
    • setImageId

      public void setImageId(String imageId)
      Sets the image ID.
      Parameters:
      imageId - the new image ID
    • getCompressedBase64

      public String getCompressedBase64()
      Returns the compressed Base64 representation of the image.
      Returns:
      the compressed Base64 image string
    • setCompressedBase64

      public void setCompressedBase64(String compressedBase64)
      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 null if unavailable
    • getImageData

      public android.graphics.Bitmap getImageData()
      Returns the decoded bitmap image data.
      Returns:
      the bitmap image data, or null if unavailable
    • setImageData

      public void setImageData(android.graphics.Bitmap imageData)
      Sets the decoded bitmap image data.
      Parameters:
      imageData - the bitmap to store