com.aspose.imaging.fileformats.jpeg
Class JpegImage

java.lang.Object
  extended by com.aspose.imaging.DisposableObject
      extended by com.aspose.imaging.DataStreamSupporter
          extended by com.aspose.imaging.Image
              extended by com.aspose.imaging.RasterImage
                  extended by com.aspose.imaging.fileformats.jpeg.JpegImage
All Implemented Interfaces:
IObjectWithBounds

public final class JpegImage
extends RasterImage

A jpeg image.


Constructor Summary
JpegImage(Bitmap bitmap, ImageFormat imageFormat)
           Initializes a new instance of the JpegImage class.
 
Method Summary
 void flush()
           Flushes all cached data to disk.
 int getBitsPerPixel()
           Gets the image bits per pixel count.
 int getHeight()
           Gets the image height.
 double getHorizontalResolution()
           Gets the horizontal resolution, in pixels per inch, of this Image.
 java.lang.String getImageLoaderDescriptorName()
           Gets the name of the image loader descriptor.
 double getVerticalResolution()
           Gets the vertical resolution, in pixels per inch, of this Image.
 int getWidth()
           Gets the image width.
protected  Color[] loadPixelsInternal(Rectangle rectangle)
           Loads pixels (format specific method).
 void resize(int newWidth, int newHeight, int resizeType)
           Resizes the image.
 void rotateFlip(int rotateFlipType)
           Rotates, flips, or rotates and flips the image.
protected  void savePixelsInternal(Rectangle rectangle, Color[] pixels)
           Saves pixels (format specific method).
 void setHorizontalResolution(double value)
           Sets the horizontal resolution, in pixels per inch, of this RasterImage.
 void setResolution(double dpiX, double dpiY)
           Sets the resolution for this RasterImage.
 void setVerticalResolution(double value)
           Sets the vertical resolution, in pixels per inch, of this RasterImage.
 void update()
           Updates the native image (makes dirty).
 
Methods inherited from class com.aspose.imaging.RasterImage
getPixel, loadPixels, readScanLine, releaseManagedResources, rotateFlip, savePixels, setPalette, setPixel, writeScanLine
 
Methods inherited from class com.aspose.imaging.Image
canLoad, canLoad, canLoad, canLoad, canSave, create, getBounds, getContainer, getFileFormat, getFileFormat, getFitRectangle, getFitRectangle, getFittingRectangle, getFittingRectangle, getPalette, getSize, getUseCompactPalette, load, load, onCompactPaletteUsageChanged, onPaletteChanged, onPaletteChanging, resize, save, save, save, setContainer, setPalette, setUseCompactPalette
 
Methods inherited from class com.aspose.imaging.DataStreamSupporter
getDataStreamContainer, onDataStreamContainerChanging, save, save, setDataStreamContainer
 
Methods inherited from class com.aspose.imaging.DisposableObject
dispose, getDisposed, releaseUnmanagedResources, verifyNotDisposed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JpegImage

public JpegImage(Bitmap bitmap,
                 ImageFormat imageFormat)

Initializes a new instance of the JpegImage class.

Parameters:
bitmap - The bitmap.
imageFormat - The image format.
Method Detail

flush

public void flush()

Flushes all cached data to disk.

Overrides:
flush in class DataStreamSupporter

getBitsPerPixel

public int getBitsPerPixel()

Gets the image bits per pixel count.

Value: The image bits per pixel count.

Specified by:
getBitsPerPixel in class Image

getHeight

public int getHeight()

Gets the image height.

Value: The image height.

Specified by:
getHeight in interface IObjectWithBounds
Specified by:
getHeight in class Image

getHorizontalResolution

public double getHorizontalResolution()

Gets the horizontal resolution, in pixels per inch, of this Image.

Value: The horizontal resolution.


Note by default this value is always 96 since different platforms cannot return the screen resolution. You may consider using the SetResolution method for updating both resolution values in single call.

Overrides:
getHorizontalResolution in class RasterImage

getImageLoaderDescriptorName

public java.lang.String getImageLoaderDescriptorName()

Gets the name of the image loader descriptor.

Value: The name of the image loader descriptor.


This value is used later for proper image deserialization, thus specify valid registered descriptor here. During deserialization each descriptor type name is validated against this value.

Specified by:
getImageLoaderDescriptorName in class Image

getVerticalResolution

public double getVerticalResolution()

Gets the vertical resolution, in pixels per inch, of this Image.

Value: The vertical resolution.


Note by default this value is always 96 since different platforms cannot return the screen resolution. You may consider using the SetResolution method for updating both resolution values in single call.

Overrides:
getVerticalResolution in class RasterImage

getWidth

public int getWidth()

Gets the image width.

Value: The image width.

Specified by:
getWidth in interface IObjectWithBounds
Specified by:
getWidth in class Image

loadPixelsInternal

protected Color[] loadPixelsInternal(Rectangle rectangle)

Loads pixels (format specific method).

Specified by:
loadPixelsInternal in class RasterImage
Parameters:
rectangle - The rectangle to load pixels from.
Returns:
The loaded pixels array.

resize

public void resize(int newWidth,
                   int newHeight,
                   int resizeType)

Resizes the image.

Overrides:
resize in class RasterImage
Parameters:
newWidth - The new width.
newHeight - The new height.
resizeType - The resize type.

rotateFlip

public void rotateFlip(int rotateFlipType)

Rotates, flips, or rotates and flips the image.

Overrides:
rotateFlip in class RasterImage
Parameters:
rotateFlipType - Type of the rotate flip.

savePixelsInternal

protected void savePixelsInternal(Rectangle rectangle,
                                  Color[] pixels)

Saves pixels (format specific method).

Specified by:
savePixelsInternal in class RasterImage
Parameters:
rectangle - The rectangle to save pixels to.
pixels - The pixels array.

setHorizontalResolution

public void setHorizontalResolution(double value)
Description copied from class: RasterImage

Sets the horizontal resolution, in pixels per inch, of this RasterImage.

Value: The horizontal resolution.


Note by default this value is always 96 since different platforms cannot return the screen resolution. You may consider using the SetResolution method for updating both resolution values in single call.

Overrides:
setHorizontalResolution in class RasterImage

setResolution

public void setResolution(double dpiX,
                          double dpiY)

Sets the resolution for this RasterImage.

Overrides:
setResolution in class RasterImage
Parameters:
dpiX - The horizontal resolution, in dots per inch, of the RasterImage.
dpiY - The vertical resolution, in dots per inch, of the RasterImage.

setVerticalResolution

public void setVerticalResolution(double value)
Description copied from class: RasterImage

Sets the vertical resolution, in pixels per inch, of this RasterImage.

Value: The vertical resolution.


Note by default this value is always 96 since different platforms cannot return the screen resolution. You may consider using the SetResolution method for updating both resolution values in single call.

Overrides:
setVerticalResolution in class RasterImage

update

public void update()

Updates the native image (makes dirty).