pdfOptimizer 3.0.1 API
iText.Pdfoptimizer.Handlers.Util.CsConverterUtil Class Reference

Helper class which encapsulates util method for color space converting. More...

Static Public Member Functions

static BitmapImagePixels  ConvertBitmapImage (BitmapImagePixels imagePixels, ColorConverter converter)
  Converts passed bitmap image bytes from one color space to another according to provided iText.Pdfoptimizer.Handlers.Util.Pixel.ColorConverter. More...
 
static BitmapImagePixels  ConvertBitmapImage (BitmapImagePixels imagePixels, ColorDecoder colorDecoder)
  Converts passed bitmap image bytes from one color to another according to provided iText.Pdfoptimizer.Handlers.Util.Decoders.ColorDecoder. More...
 
static BitmapImagePixels  ConvertBitmapImage (BitmapImagePixels imagePixels, ColorConverter converter, ColorDecoder colorDecoder)
  Converts passed bitmap image bytes from one color space to another according to provided iText.Pdfoptimizer.Handlers.Util.Pixel.ColorConverter and iText.Pdfoptimizer.Handlers.Util.Decoders.ColorDecoder. More...
 
static BitmapImagePixels  ExtractColorTableOfIndexedImage (PdfSpecialCs.Indexed indexedCs)
  Extracts color table from indexed color space instance. More...
 

Detailed Description

Helper class which encapsulates util method for color space converting.

Member Function Documentation

◆ ConvertBitmapImage() [1/3]

static BitmapImagePixels iText.Pdfoptimizer.Handlers.Util.CsConverterUtil.ConvertBitmapImage ( BitmapImagePixels  imagePixels,
ColorConverter  converter 
)
inlinestatic

Converts passed bitmap image bytes from one color space to another according to provided iText.Pdfoptimizer.Handlers.Util.Pixel.ColorConverter.

Converts passed bitmap image bytes from one color space to another according to provided iText.Pdfoptimizer.Handlers.Util.Pixel.ColorConverter . It is expected that source color space of the converter matches the color space of the image. Otherwise, the result of the method invocation may be unpredictable.

Parameters
imagePixels the bitmap image pixels to be converted
converter the converter for the image. It is expected that its source color space which can be identified via iText.Pdfoptimizer.Handlers.Util.Pixel.ColorConverter.GetSourceColorspace() matches the color space of the image (at least it has the same number of components as image does according to BitmapImagePixels.GetNumberOfComponents() method.
Returns
image pixels converted according to converter

◆ ConvertBitmapImage() [2/3]

static BitmapImagePixels iText.Pdfoptimizer.Handlers.Util.CsConverterUtil.ConvertBitmapImage ( BitmapImagePixels  imagePixels,
ColorConverter  converter,
ColorDecoder  colorDecoder 
)
inlinestatic

Converts passed bitmap image bytes from one color space to another according to provided iText.Pdfoptimizer.Handlers.Util.Pixel.ColorConverter and iText.Pdfoptimizer.Handlers.Util.Decoders.ColorDecoder.

Converts passed bitmap image bytes from one color space to another according to provided iText.Pdfoptimizer.Handlers.Util.Pixel.ColorConverter and iText.Pdfoptimizer.Handlers.Util.Decoders.ColorDecoder . It is expected that source color space of the converter matches the color space of the image. Otherwise, the result of the method invocation may be unpredictable.

Parameters
imagePixels the bitmap image pixels to be converted
converter the converter for the image. It is expected that its source color space which can be identified via iText.Pdfoptimizer.Handlers.Util.Pixel.ColorConverter.GetSourceColorspace() matches the color space of the image (at least it has the same number of components as image does according to BitmapImagePixels.GetNumberOfComponents() method.
colorDecoder

iText.Pdfoptimizer.Handlers.Util.Decoders.ColorDecoder

Returns
image pixels converted according to converter and colorDecoder

◆ ConvertBitmapImage() [3/3]

static BitmapImagePixels iText.Pdfoptimizer.Handlers.Util.CsConverterUtil.ConvertBitmapImage ( BitmapImagePixels  imagePixels,
ColorDecoder  colorDecoder 
)
inlinestatic

Converts passed bitmap image bytes from one color to another according to provided iText.Pdfoptimizer.Handlers.Util.Decoders.ColorDecoder.

Parameters
imagePixels the bitmap image pixels to be converted
colorDecoder

iText.Pdfoptimizer.Handlers.Util.Decoders.ColorDecoder

Returns
image pixels converted according colorDecoder

◆ ExtractColorTableOfIndexedImage()

static BitmapImagePixels iText.Pdfoptimizer.Handlers.Util.CsConverterUtil.ExtractColorTableOfIndexedImage ( PdfSpecialCs.Indexed  indexedCs )
inlinestatic

Extracts color table from indexed color space instance.

Parameters
indexedCs is an indexed color space instance
Returns
color table as BitmapImagePixels or null if indexedCs is not valid indexed color space instance