2#ifndef _aspose_system_drawing_image_h_ 
    3#define _aspose_system_drawing_image_h_ 
    5#include "system/object.h" 
    6#include "system/nullable.h" 
    7#include "system/idisposable.h" 
    8#include "system/details/array_view.h" 
    9#include "drawing/imaging/image_attributes.h" 
   10#include "drawing/imaging/image_format.h" 
   11#include "drawing/imaging/image_codec_info.h" 
   12#include "drawing/imaging/encoder_parameters.h" 
   13#include "drawing/imaging/encoder_value.h" 
   14#include "drawing/imaging/pixel_format.h" 
   15#include "drawing/imaging/color_palette.h" 
   16#include "drawing/imaging/frame_dimension.h" 
   17#include "drawing/rotate_flip_type.h" 
   18#include "drawing/graphics_unit.h" 
   19#include "drawing/size.h" 
   20#include "drawing/rectangle_f.h" 
   21#include "system/io/stream.h" 
   22#include "system/string.h" 
   23#include "imaging/image_flags.h" 
   24#include "imaging/property_item.h" 
   27#if defined(ASPOSECPPLIB_BEING_BUILT) || defined(ASPOSECPP_SKIA_EXTERNAL_USAGE) 
   28#include <core/SkImage.h> 
   29#include <core/SkData.h> 
   30#include <core/SkEncodedImageFormat.h> 
   31#include <encode/SkTIFFImageEncoder.h> 
   34#define ASPOSE_DUMMY_META_FILE 
   37ASPOSECPP_3RD_PARTY_CLASS(SkBitmap);
 
   39ASPOSECPP_3RD_PARTY_CLASS(SkCanvas);
 
   41ASPOSECPP_3RD_PARTY_CLASS(SkData);
 
   43ASPOSECPP_3RD_PARTY_CLASS(SkMatrix);
 
   45ASPOSECPP_3RD_PARTY_CLASS(SkTIFFImageEncoder)
 
   47ASPOSECPP_3RD_PARTY_CLASS(SkRWStream);
 
   49ASPOSECPP_3RD_PARTY_STRUCT(SkImageInfo);
 
   51ASPOSECPP_3RD_PARTY_STRUCT(SkRect);
 
   53#if defined(ASPOSECPPLIB_BEING_BUILT) || !defined(ASPOSECPP_SKIA_EXTERNAL_USAGE) 
   54ASPOSECPP_3RD_PARTY_ENUM_CLASS(SkEncodedImageFormat);
 
   56ASPOSECPP_3RD_PARTY_ENUM(SkFilterQuality);
 
   58ASPOSECPP_3RD_PARTY_ENUM_CLASS(SkBlendMode);
 
   61template <
typename T> 
class sk_sp;
 
   63namespace System { 
namespace Drawing {
 
  202        virtual ASPOSECPP_SHARED_API 
const SkBitmap* 
GetSkBitmap() 
const = 0;
 
  217        static const int s_default_save_quality = 80;
 
  250        virtual ASPOSECPP_SHARED_API sk_sp<SkData> 
GetRawBytes(SkEncodedImageFormat encoder_type, 
int quality) = 0;
 
  260                                                int pixel_format = 32, 
int quality = s_default_save_quality);
 
  287        static ASPOSECPP_SHARED_API SkEncodedImageFormat 
CheckOutputFormat(SkEncodedImageFormat encoded_format);
 
  302        virtual void Draw(SkCanvas* sk_canvas, 
const SkRect& dest_rect, 
const SkRect&src_rect, SkMatrix* matrix, SkFilterQuality quality, SkBlendMode blend_mode) 
const = 0;
 
  310        virtual void Draw(SkCanvas* sk_canvas, 
const SkRect& dest_rect, SkMatrix* matrix, SkFilterQuality quality, SkBlendMode blend_mode) 
const = 0;
 
  319        virtual void Draw(SkCanvas* sk_canvas, 
ArrayPtr<PointF> dest_points, 
const SkRect& src_rect, SkMatrix* matrix, SkFilterQuality quality, SkBlendMode blend_mode) 
const = 0;
 
  328        virtual void Draw(SkCanvas* sk_canvas, 
const System::Details::ArrayView<PointF>& dest_points, 
const SkRect& src_rect, SkMatrix* matrix, SkFilterQuality quality, SkBlendMode blend_mode) 
const = 0;
 
  343        float m_horizontal_resolution = 96.f; 
 
  345        float m_vertical_resolution = 96.f; 
 
  348        std::unique_ptr<SkRWStream> m_stream;
 
  349        std::unique_ptr<SkTIFFImageEncoder> m_tiff_encoder;
 
  355        static const int16_t s_tiff_tag_compression = 0x103;
 
Represents a GDI+ bitmap image. Objects of this class should only be allocated using System::MakeObje...
Definition: bitmap.h:64
 
Represents a drawing surface. Objects of this class should only be allocated using System::MakeObject...
Definition: graphics.h:68
 
A base class for System::Drawing::Bitmap and System::Drawing::Metafile classes providing basic functi...
Definition: image.h:72
 
SharedPtr< Image > GetThumbnailImage(int thumbWidth, int thumbHeight, Image::GetThumbnailImageAbort callback, IntPtr callbackData)
Gets a thumbnail for this System::Drawing::Image object.
 
void Dispose() override
Releases all resources aquired by the current object.
Definition: image.h:199
 
virtual int32_t get_Flags() const
Returns a bit-wise combination of ImageFlags enum values that represents the attributes of the image.
 
static SaveOptions ParseEncoderParameters(const Imaging::EncoderParametersPtr &encoder_params)
Converts a set of encoder parameters into a SaveOptions structure.
 
void Save(const SharedPtr< System::IO::Stream > &stream, const Imaging::ImageFormatPtr &format)
Saves the image represented by the current object to the specified stream in the specified format.
 
static SkEncodedImageFormat CheckOutputFormat(SkEncodedImageFormat encoded_format)
Checks if the specified format is among supported.
 
static SkBitmap ConvertToGrayscale(const SkBitmap &src_bitmap)
Converts 32bpp image to 8bpp grayscale image.
 
virtual const SkBitmap * GetSkBitmap() const =0
Returns an underlying SkBitmap object.
 
static SharedPtr< Image > FromStream(const SharedPtr< System::IO::Stream > &stream, bool use_embedded_color_management=false, bool validate_image_data=true)
Creates an Image object from the specified stream.
 
System::MulticastDelegate< bool()> GetThumbnailImageAbort
A callback to cancel GetThumbnailImage execution.
Definition: image.h:205
 
virtual void set_Palette(Imaging::ColorPalettePtr value)
Sets the color palette used by the image represented by the current object.
 
void Save(const String &filename, const Imaging::ImageFormatPtr &format)
Saves the image represented by the current object to the specified file in the specified format.
 
virtual sk_sp< SkData > GetRawBytes(SkEncodedImageFormat encoder_type, int quality)=0
Saves an image represented by the current object in the specified format using the specified image qu...
 
virtual void Draw(SkCanvas *sk_canvas, ArrayPtr< PointF > dest_points, const SkRect &src_rect, SkMatrix *matrix, SkFilterQuality quality, SkBlendMode blend_mode) const =0
Draws the specified region of the image to the specified region on the specified canvas....
 
int SelectActiveFrame(const Imaging::FrameDimensionPtr &dimension, int frameIndex)
Selects the specified frame.
 
static SharedPtr< Bitmap > FromHbitmap(IntPtr hbitmap)
Constructs a Bitmap object from the specified GDI bitmap.
 
float get_HorizontalResolution() const
Returns the horizontal resolution of the image represented by the current object in pixels per inch.
 
virtual ArrayPtr< SharedPtr< Imaging::PropertyItem > > get_PropertyItems() const
Gets all the property items(pieces of metadata) stored in this image.
 
virtual std::unique_ptr< SkCanvas > GetDrawingCanvas() const =0
Returns the drawing canvas object.
 
virtual void Draw(SkCanvas *sk_canvas, const SkRect &dest_rect, SkMatrix *matrix, SkFilterQuality quality, SkBlendMode blend_mode) const =0
Draws the the image to the specified region on the specified canvas. The source image is scaled and t...
 
int GetFrameCount(const Imaging::FrameDimensionPtr &dimension)
Returns the number of frames of the specified frame dimension.
 
void SaveAdd(const SharedPtr< Image > &image, const Imaging::EncoderParametersPtr &encoder_params)
Adds a frame to the file or stream specified in a previous call to the Save() method.
 
static bool IsWmf(const System::SharedPtr< System::IO::Stream > &stream)
Determines if the data in the specified stream starts with the WMF format marker.
 
virtual int get_Width() const =0
Returns the width of the image in pixels.
 
ArrayPtr< Guid > get_FrameDimensionsList() const
Returns an array of GUIDs that represent the dimensions of frames within the image represented by the...
 
static SharedPtr< Image > FromFile(const String &filename, bool use_embedded_color_management=false)
Creates an Image object from the specified file.
 
RectangleF GetBounds(GraphicsUnit &page_unit)
Returns the image bounds in the specified measurement units.
 
virtual void Draw(SkCanvas *sk_canvas, const SkRect &dest_rect, const SkRect &src_rect, SkMatrix *matrix, SkFilterQuality quality, SkBlendMode blend_mode) const =0
Draws the specified region of the image to the specified region on the specified canvas....
 
virtual ArrayPtr< int > get_PropertyIdList() const
Gets IDs of the property items stored in this image.
 
static SkEncodedImageFormat CheckOutputFormat(const Imaging::ImageCodecInfoPtr &encoder)
Checks if the specified encoder is supported and returns a SkEncodedFormat value that represents an i...
 
void Save(const String &filename)
Saves the image represented by the current object to the specified file in PNG format.
 
virtual System::SharedPtr< System::Object > get_Tag() const
Gets an object that provides additional data about the image.
 
virtual void RotateFlip(RotateFlipType rotate_flip_type)
Rotate image to multiple of 90 degrees and flip.
 
virtual int get_Height() const =0
Returns the height of the image in pixels.
 
virtual const SkEncodedImageFormat GetSkEncodedFormat() const =0
Returns an underlying SkEncodedFormat object.
 
void InternalSave(const SharedPtr< System::IO::Stream > &stream, SkEncodedImageFormat encoder_type, Imaging::EncoderValue encoder_value=Imaging::EncoderValue::CompressionLZW, int pixel_format=32, int quality=s_default_save_quality)
Saves the image represented by the current object to the specified stream in the specified format.
 
void SaveAdd(const Imaging::EncoderParametersPtr &encoder_params)
Adds a frame to the file or stream specified in a previous call to the Save() method.
 
static bool IsAlphaPixelFormat(Imaging::PixelFormat pixfmt)
Determines if the specified pixel format contains alpha information.
 
void InternalSave(const SharedPtr< IO::Stream > &stream, SkEncodedImageFormat encoder_type, const SaveOptions &options)
Saves the image represented by the current object to the specified stream in the specified format.
 
void Save(const SharedPtr< System::IO::Stream > &stream, const Imaging::ImageCodecInfoPtr &encoder, const Imaging::EncoderParametersPtr &encoder_params)
Saves the image represented by the current object to the specified stream using the specified encoder...
 
float get_VerticalResolution() const
Returns the vertical resolution of the image represented by the current object in pixels per inch.
 
virtual Imaging::PixelFormat get_PixelFormat() const =0
Returns the pixel format of the image represented by the current object.
 
virtual void set_Tag(const System::SharedPtr< System::Object > tag)
Sets an object that provides additional data about the image.
 
virtual Imaging::ImageFormatPtr get_RawFormat() const =0
Returns the file format of the image represented by the current object.
 
virtual Imaging::ColorPalettePtr get_Palette() const
Returns the color palette used by the image represented by the current object.
 
static int GetPixelFormatSize(Imaging::PixelFormat pixfmt)
Returns the number of bits used to represent the color depth in the specified pixel format.
 
Size get_Size() const
Returns a Size object that represents the width and height of the image in pixels.
 
virtual SharedPtr< Image > Clone()=0
Creates a copy of the current object.
 
void Save(const String &filename, const Imaging::ImageCodecInfoPtr &encoder, const Imaging::EncoderParametersPtr &encoder_params)
Saves the image represented by the current object to the specified file using the specified encoder a...
 
SkEncodedImageFormat CheckOutputFormat(const Imaging::ImageFormatPtr &image_format) const
Checks if the specified image format is supported and returns a SkEncodedFormat value that represents...
 
virtual bool IsMultiImage() const
Returns whether the original format is a multi-image.
 
virtual void Draw(SkCanvas *sk_canvas, const System::Details::ArrayView< PointF > &dest_points, const SkRect &src_rect, SkMatrix *matrix, SkFilterQuality quality, SkBlendMode blend_mode) const =0
Draws the specified region of the image to the specified region on the specified canvas....
 
virtual Imaging::PixelFormat GetOriginalFormat() const =0
Returns the original image format.
 
static bool IsEmf(const System::SharedPtr< System::IO::Stream > &stream)
Determines if the data in the specified stream starts with the EMF format marker.
 
Imaging::ColorPalettePtr m_palette
The color palette used by the image represented by the current object.
Definition: image.h:341
 
void InternalSavePage(const SkBitmap *bitmap, const SaveOptions &options)
Saves the bitmap as a part of a multipage image.
 
Represents a rectangular area of an image defined as single-precision floating point X and Y coordina...
Definition: rectangle_f.h:15
 
Represents a pair of integer values that represent width and height of an image. This type should be ...
Definition: size.h:14
 
Represents a brush that uses an image to fill the interior of a shape. Objects of this class should o...
Definition: texture_brush.h:38
 
Defines method that releases resources owned by the current object. Objects of this class should only...
Definition: idisposable.h:30
 
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
 
String class used across the library. Is a substitute for C# System.String when translating code....
Definition: string.h:122
 
@ Bitmap
Defines color adjustment information for Bitmap objects.
 
EncoderValue
Specifies the parameter value passed to a JPEG or TIFF image encoder.
Definition: encoder_value.h:10
 
@ CompressionLZW
The LZW compression method.
 
ImageFlags
Represents attributes of the pixel data represented by an Image object.
Definition: image_flags.h:9
 
PixelFormat
Specifies the color data format of a pixel.
Definition: pixel_format.h:17
 
RotateFlipType
Specifies the type of rotation and/or flipping operation.
Definition: rotate_flip_type.h:7
 
GraphicsUnit
Represents a unit of measure.
Definition: graphics_unit.h:10
 
Definition: db_command.h:9
 
Structure that represents save options.
Definition: image.h:225
 
Nullable< Imaging::EncoderValue > Flag
Specifies the parameter value passed to a JPEG or TIFF image encoder.
Definition: image.h:229
 
Nullable< int > PixelFormat
The amount bits per pixel.
Definition: image.h:233
 
Nullable< int > Quality
The quality level used when encoding an image.
Definition: image.h:227
 
Nullable< Imaging::EncoderValue > Compression
The compression type.
Definition: image.h:231