Class MemoryGray8Image

    • Constructor Detail

      • MemoryGray8Image

        public MemoryGray8Image​(int width,
                                int height)
        Creates a new MemoryGray8Image object with the specified resolution. Simply gives 1 (for one channel) and the two resolution arguments to the super constructor (of the parent class MemoryByteChannelImage).
        Parameters:
        width - the horizontal resolution, must be non-zero and positive
        height - the vertical resolution, must be non-zero and positive
    • Method Detail

      • createCompatibleImage

        public PixelImage createCompatibleImage​(int width,
                                                int height)
        Description copied from interface: PixelImage
        Creates an instance of the same class as this one, with width and height given by the arguments.
        Specified by:
        createCompatibleImage in interface PixelImage
        Specified by:
        createCompatibleImage in class MemoryByteChannelImage
        Parameters:
        width - the horizontal resolution of the new image
        height - the vertical resolution of the new image
        Returns:
        the new image
      • getImageType

        public Class getImageType()
        Description copied from interface: PixelImage
        If there is a single interface or class that describes the image data type of this class, the Class object associated with that interface (or class) is returned (or null otherwise). This Class object, if available for two image objects, can be used to find out if they are compatible. Example: MemoryGray8Image returns net.sourceforge.jiu.data.Gray8Image.class.
        Specified by:
        getImageType in interface PixelImage
      • isBlack

        public boolean isBlack​(int x,
                               int y)
        Description copied from interface: GrayImage
        Returns if the pixel specified by the location in the arguments is black.
        Specified by:
        isBlack in interface GrayImage
        Parameters:
        x - the horizontal location of the pixel
        y - the vertical location of the pixel
      • isWhite

        public boolean isWhite​(int x,
                               int y)
        Description copied from interface: GrayImage
        Returns if the pixel specified by the location in the arguments is white.
        Specified by:
        isWhite in interface GrayImage
        Parameters:
        x - the horizontal location of the pixel
        y - the vertical location of the pixel
      • putBlack

        public void putBlack​(int x,
                             int y)
        Description copied from interface: GrayImage
        Sets a pixel to black (minimum intensity value).
        Specified by:
        putBlack in interface GrayImage
        Parameters:
        x - horizontal position of the pixel's location
        y - vertical position of the pixel's location
      • putWhite

        public void putWhite​(int x,
                             int y)
        Description copied from interface: GrayImage
        Sets a pixel to white (maximum intensity value).
        Specified by:
        putWhite in interface GrayImage
        Parameters:
        x - horizontal position of the pixel's location
        y - vertical position of the pixel's location