Tabnine Logo
PNGEncodeParam$Palette.getBackgroundPaletteIndex
Code IndexAdd Tabnine to your IDE (free)

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

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

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();
  }
}
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: 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: 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();
  }
}
org.apache.batik.ext.awt.image.codec.pngPNGEncodeParam$PalettegetBackgroundPaletteIndex

Javadoc

Returns the palette index of the suggested background color.

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

Popular methods of PNGEncodeParam$Palette

  • <init>
    Constructs an instance of PNGEncodeParam.Palette.
  • getPalette
    Returns the current RGB palette. If the palette has not previously been set, or has been unset, an I
  • getPaletteTransparency
    Returns the alpha values associated with each palette entry. If the palette transparency has not pre
  • isPaletteSet
    Returns true if a 'PLTE' chunk will be output.
  • setBackgroundPaletteIndex
    Sets the palette index of the suggested background color. The 'bKGD' chunk will encode this informat

Popular in Java

  • Start an intent from android
  • getSystemService (Context)
  • onCreateOptionsMenu (Activity)
  • getSharedPreferences (Context)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now