Codota Logo
PNGEncodeParam$Gray.getBackgroundGray
Code IndexAdd Codota to your IDE (free)

How to use
getBackgroundGray
method
in
org.apache.batik.ext.awt.image.codec.png.PNGEncodeParam$Gray

Best Java code snippets using org.apache.batik.ext.awt.image.codec.png.PNGEncodeParam$Gray.getBackgroundGray (Showing top 4 results out of 315)

  • Common ways to obtain PNGEncodeParam$Gray
private void myMethod () {
PNGEncodeParam$Gray p =
  • Codota Iconnew PNGEncodeParam.Gray()
  • Smart code suggestions by Codota
}
origin: org.apache.xmlgraphics/batik-codec

private void writeBKGD() throws IOException {
  if (param.isBackgroundSet()) {
    ChunkStream cs = new ChunkStream("bKGD");
    switch (colorType) {
    case PNG_COLOR_GRAY:
    case PNG_COLOR_GRAY_ALPHA:
      int gray = ((PNGEncodeParam.Gray)param).getBackgroundGray();
      cs.writeShort(gray);
      break;
    case PNG_COLOR_PALETTE:
      int index =
        ((PNGEncodeParam.Palette)param).getBackgroundPaletteIndex();
      cs.writeByte(index);
      break;
    case PNG_COLOR_RGB:
    case PNG_COLOR_RGB_ALPHA:
      int[] rgb = ((PNGEncodeParam.RGB)param).getBackgroundRGB();
      cs.writeShort(rgb[0]);
      cs.writeShort(rgb[1]);
      cs.writeShort(rgb[2]);
      break;
    }
    cs.writeToStream(dataOutput);
    cs.close();
  }
}
origin: fr.avianey.apache-xmlgraphics/batik

private void writeBKGD() throws IOException {
  if (param.isBackgroundSet()) {
    ChunkStream cs = new ChunkStream("bKGD");
    switch (colorType) {
    case PNG_COLOR_GRAY:
    case PNG_COLOR_GRAY_ALPHA:
      int gray = ((PNGEncodeParam.Gray)param).getBackgroundGray();
      cs.writeShort(gray);
      break;
    case PNG_COLOR_PALETTE:
      int index =
        ((PNGEncodeParam.Palette)param).getBackgroundPaletteIndex();
      cs.writeByte(index);
      break;
    case PNG_COLOR_RGB:
    case PNG_COLOR_RGB_ALPHA:
      int[] rgb = ((PNGEncodeParam.RGB)param).getBackgroundRGB();
      cs.writeShort(rgb[0]);
      cs.writeShort(rgb[1]);
      cs.writeShort(rgb[2]);
      break;
    }
    cs.writeToStream(dataOutput);
    cs.close();
  }
}
origin: liuyueyi/quick-media

private void writeBKGD() throws IOException {
  if (param.isBackgroundSet()) {
    ChunkStream cs = new ChunkStream("bKGD");
    switch (colorType) {
    case PNG_COLOR_GRAY:
    case PNG_COLOR_GRAY_ALPHA:
      int gray = ((PNGEncodeParam.Gray)param).getBackgroundGray();
      cs.writeShort(gray);
      break;
    case PNG_COLOR_PALETTE:
      int index =
        ((PNGEncodeParam.Palette)param).getBackgroundPaletteIndex();
      cs.writeByte(index);
      break;
    case PNG_COLOR_RGB:
    case PNG_COLOR_RGB_ALPHA:
      int[] rgb = ((PNGEncodeParam.RGB)param).getBackgroundRGB();
      cs.writeShort(rgb[0]);
      cs.writeShort(rgb[1]);
      cs.writeShort(rgb[2]);
      break;
    }
    cs.writeToStream(dataOutput);
    cs.close();
  }
}
origin: apache/batik

private void writeBKGD() throws IOException {
  if (param.isBackgroundSet()) {
    ChunkStream cs = new ChunkStream("bKGD");
    switch (colorType) {
    case PNG_COLOR_GRAY:
    case PNG_COLOR_GRAY_ALPHA:
      int gray = ((PNGEncodeParam.Gray)param).getBackgroundGray();
      cs.writeShort(gray);
      break;
    case PNG_COLOR_PALETTE:
      int index =
        ((PNGEncodeParam.Palette)param).getBackgroundPaletteIndex();
      cs.writeByte(index);
      break;
    case PNG_COLOR_RGB:
    case PNG_COLOR_RGB_ALPHA:
      int[] rgb = ((PNGEncodeParam.RGB)param).getBackgroundRGB();
      cs.writeShort(rgb[0]);
      cs.writeShort(rgb[1]);
      cs.writeShort(rgb[2]);
      break;
    }
    cs.writeToStream(dataOutput);
    cs.close();
  }
}
org.apache.batik.ext.awt.image.codec.pngPNGEncodeParam$GraygetBackgroundGray

Javadoc

Returns the suggested gray level of the background.

If the background gray level has not previously been set, or has been unset, an IllegalStateException will be thrown.

Popular methods of PNGEncodeParam$Gray

  • <init>
    Constructs an instance of PNGEncodeParam.Gray.
  • getBitDepth
  • getBitShift
    Returns the desired bit shift for a grayscale image. If the bit shift has not previously been set, o
  • getTransparentGray
    Returns the gray value to be used to denote transparency. If the transparent gray value has not prev
  • isBitDepthSet
    Returns true if the bit depth has been set.
  • isBitShiftSet
    Returns true if the bit shift has been set.
  • setBackgroundGray
    Sets the suggested gray level of the background. The 'bKGD' chunk will encode this information.
  • setTransparentGray
    Sets the gray value to be used to denote transparency. Setting this attribute will cause the alpha c

Popular in Java

  • Creating JSON documents from java classes using gson
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • FileOutputStream (java.io)
    A file output stream is an output stream for writing data to aFile or to a FileDescriptor. Whether
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • JTextField (javax.swing)
  • IsNull (org.hamcrest.core)
    Is the value null?
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now