Class MemoryPaletted8Image

    • Field Detail

      • palette

        private Palette palette
        This image's palette.
      • maxSampleValue

        private int maxSampleValue
    • Constructor Detail

      • MemoryPaletted8Image

        public MemoryPaletted8Image​(int width,
                                    int height)
        Create an image of byte channels. Image data will be completely in memory, so memory requirements are width * height * numChannels bytes. Note that the data will not be initialized, so you should not assume anything about its content.
        Parameters:
        width - the horizontal resolution, must be non-zero and positive
        height - the vertical resolution, must be non-zero and positive
        Throws:
        IllegalArgumentException - if any of the parameters are smaller than 1
      • MemoryPaletted8Image

        public MemoryPaletted8Image​(int width,
                                    int height,
                                    Palette palette)
    • Method Detail

      • checkPalette

        public static void checkPalette​(Palette palette)
      • 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
      • getTypeDescription

        public String getTypeDescription()
      • setPalette

        public void setPalette​(Palette palette)
        Sets this image's palette to a new value.
        Specified by:
        setPalette in interface PalettedImage
        Parameters:
        palette - the new palette for this image
        See Also:
        getPalette()