Tabnine Logo
PNGEncodeParam.filterRow
Code IndexAdd Tabnine to your IDE (free)

How to use
filterRow
method
in
org.apache.batik.ext.awt.image.codec.png.PNGEncodeParam

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

origin: liuyueyi/quick-media

int filterType = param.filterRow(currRow, prevRow,
                 filteredRows,
                 bytesPerRow, bpp);
origin: fr.avianey.apache-xmlgraphics/batik

int filterType = param.filterRow(currRow, prevRow,
                 filteredRows,
                 bytesPerRow, bpp);
origin: apache/batik

int filterType = param.filterRow(currRow, prevRow,
                 filteredRows,
                 bytesPerRow, bpp);
origin: org.apache.xmlgraphics/batik-codec

int filterType = param.filterRow(currRow, prevRow,
                 filteredRows,
                 bytesPerRow, bpp);
org.apache.batik.ext.awt.image.codec.pngPNGEncodeParamfilterRow

Javadoc

Performs filtering on a row of an image. This method may be overridden in order to provide a custom algorithm for choosing the filter type for a given row.

The method is supplied with the current and previous rows of the image. For the first row of the image, or of an interlacing pass, the previous row array will be filled with zeros as required by the PNG specification.

The method is also supplied with five scratch arrays. These arrays may be used within the method for any purpose. At method exit, the array at the index given by the return value of the method should contain the filtered data. The return value will also be used as the filter type.

The default implementation of the method performs a trial encoding with each of the filter types, and computes the sum of absolute values of the differences between the raw bytes of the current row and the predicted values. The index of the filter producing the smallest result is returned.

As an example, to perform only 'sub' filtering, this method could be implemented (non-optimally) as follows:

 
for (int i = bytesPerPixel; i < bytesPerRow + bytesPerPixel; i++) { 
int curr = currRow[i] & 0xff; 
int left = currRow[i - bytesPerPixel] & 0xff; 
scratchRow[PNG_FILTER_SUB][i] = (byte)(curr - left); 
} 
return PNG_FILTER_SUB; 

Popular methods of PNGEncodeParam

  • abs
    An abs() function for use by the Paeth predictor.
  • addPrivateChunk
    Adds a private chunk, in binary form, to the list of chunks to be stored with this image.
  • getChromaticity
    Returns the white point and primary chromaticities in CIE (x, y) space. See the documentation for th
  • getCompressedText
    Returns the text strings to be stored in compressed form with this image as an array of Strings. If
  • getDefaultEncodeParam
    Returns an instance of PNGEncodeParam.Palette,PNGEncodeParam.Gray, or PNGEncodeParam.RGB appropriate
  • getGamma
    Returns the file gamma value for the image. If the file gamma has not previously been set, or has be
  • getICCProfileData
    Returns the ICC profile data to be stored with this image. If the ICC profile has not previously bee
  • getInterlacing
    Returns true if Adam7 interlacing will be used.
  • getModificationTime
    Returns the modification time to be stored with this image. If the bit depth has not previously been
  • getNumPrivateChunks
    Returns the number of private chunks to be written to the output file.
  • getPaletteHistogram
    Returns the palette histogram to be stored with this image. If the histogram has not previously been
  • getPhysicalDimension
    Returns the physical dimension information to be stored with this image. If the physical dimension i
  • getPaletteHistogram,
  • getPhysicalDimension,
  • getPrivateChunkData,
  • getPrivateChunkType,
  • getSRGBIntent,
  • getSignificantBits,
  • getText,
  • isBackgroundSet,
  • isChromaticitySet

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getApplicationContext (Context)
  • findViewById (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • JTextField (javax.swing)
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Top Vim plugins
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