Open CASCADE Technology  7.5.0
Public Member Functions | Static Public Member Functions

Image_AlienPixMap Class Reference

Image class that support file reading/writing operations using auxiliary image library. Supported image formats: More...

#include <Image_AlienPixMap.hxx>

Inheritance diagram for Image_AlienPixMap:
Inheritance graph
[legend]

Public Member Functions

 Image_AlienPixMap ()
 Empty constructor. More...
 
virtual ~Image_AlienPixMap ()
 Destructor. More...
 
bool Load (const TCollection_AsciiString &theFileName)
 Read image data from file. More...
 
bool Load (std::istream &theStream, const TCollection_AsciiString &theFileName)
 Read image data from stream. More...
 
bool Load (const Standard_Byte *theData, Standard_Size theLength, const TCollection_AsciiString &theFileName)
 Read image data from memory buffer. More...
 
bool Save (const TCollection_AsciiString &theFileName)
 Write image data to file using file extension to determine compression format. More...
 
virtual bool InitTrash (Image_Format thePixelFormat, const Standard_Size theSizeX, const Standard_Size theSizeY, const Standard_Size theSizeRowBytes=0) override
 Initialize image plane with required dimensions. thePixelFormat - if specified pixel format doesn't supported by image library than nearest supported will be used instead! theSizeRowBytes - may be ignored by this class and required alignemnt will be used instead! More...
 
virtual bool InitCopy (const Image_PixMap &theCopy) override
 Initialize by copying data. More...
 
virtual void Clear () override
 Method correctly deallocate internal buffer. More...
 
bool AdjustGamma (const Standard_Real theGammaCorr)
 Performs gamma correction on image. theGamma - gamma value to use; a value of 1.0 leaves the image alone. More...
 
- Public Member Functions inherited from Image_PixMap
Image_Format Format () const
 
void SetFormat (const Image_Format thePixelFormat)
 Override pixel format specified by InitXXX() methods. Will throw exception if pixel size of new format is not equal to currently initialized format. Intended to switch formats indicating different interpretation of the same data (e.g. ImgGray and ImgAlpha). More...
 
Standard_Size Width () const
 
Standard_Size Height () const
 
Standard_Size SizeX () const
 
Standard_Size SizeY () const
 
Standard_Real Ratio () const
 
bool IsEmpty () const
 
 Image_PixMap ()
 Empty constructor. Initialize the NULL image plane. More...
 
virtual ~Image_PixMap ()
 Destructor. More...
 
Quantity_ColorRGBA PixelColor (const Standard_Integer theX, const Standard_Integer theY, const Standard_Boolean theToLinearize=Standard_False) const
 Returns the pixel color. This function is relatively slow. Beware that this method takes coordinates in opposite order in contrast to ::Value() and ::ChangeValue(). More...
 
void SetPixelColor (const Standard_Integer theX, const Standard_Integer theY, const Quantity_Color &theColor, const Standard_Boolean theToDeLinearize=Standard_False)
 Sets the pixel color. This function is relatively slow. Beware that this method takes coordinates in opposite order in contrast to ::Value() and ::ChangeValue(). More...
 
void SetPixelColor (const Standard_Integer theX, const Standard_Integer theY, const Quantity_ColorRGBA &theColor, const Standard_Boolean theToDeLinearize=Standard_False)
 Sets the pixel color. This function is relatively slow. Beware that this method takes coordinates in opposite order in contrast to ::Value() and ::ChangeValue(). More...
 
bool InitZero (Image_Format thePixelFormat, const Standard_Size theSizeX, const Standard_Size theSizeY, const Standard_Size theSizeRowBytes=0, const Standard_Byte theValue=0)
 Initialize image plane with required dimensions. Buffer will be zeroed (black color for most formats). More...
 
bool IsTopDown () const
 Returns TRUE if image data is stored from Top to the Down. By default Bottom Up order is used instead (topmost scanlines starts from the bottom in memory). which is most image frameworks naturally support. More...
 
void SetTopDown (const bool theIsTopDown)
 Setup scanlines order in memory - top-down or bottom-up. Drawers should explicitly specify this value if current state IsTopDown() was ignored! More...
 
Standard_Size TopDownInc () const
 Returns +1 if scanlines ordered in Top->Down order in memory and -1 otherwise. More...
 
const Standard_ByteData () const
 
Standard_ByteChangeData ()
 
const Standard_ByteRow (const Standard_Size theRow) const
 
Standard_ByteChangeRow (const Standard_Size theRow)
 
Standard_Size SizePixelBytes () const
 
Standard_Size SizeRowBytes () const
 
Standard_Size RowExtraBytes () const
 
Standard_Size MaxRowAligmentBytes () const
 Compute the maximal row alignment for current row size. More...
 
Standard_Size SizeBytes () const
 
template<typename ColorType_t >
const ColorType_t & Value (const Standard_Size theRow, const Standard_Size theCol) const
 Access image pixel with specified color type. This method does not perform any type checks - use on own risk (check Format() before)! More...
 
template<typename ColorType_t >
ColorType_t & ChangeValue (const Standard_Size theRow, const Standard_Size theCol)
 Access image pixel with specified color type. This method does not perform any type checks - use on own risk (check Format() before)! More...
 
const Standard_ByteRawValue (Standard_Size theRow, Standard_Size theCol) const
 Access image pixel as raw data pointer. This method does not perform any type checks - use on own risk (check Format() before)! More...
 
Standard_ByteChangeRawValue (Standard_Size theRow, Standard_Size theCol)
 Access image pixel as raw data pointer. This method does not perform any type checks - use on own risk (check Format() before)! More...
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor. More...
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing. More...
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter. More...
 
virtual ~Standard_Transient ()
 Destructor must be virtual. More...
 
virtual void Delete () const
 Memory deallocator for transient classes. More...
 
virtual const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object. More...
 
Standard_Boolean IsInstance (const opencascade::handle< Standard_Type > &theType) const
 Returns a true value if this is an instance of Type. More...
 
Standard_Boolean IsInstance (const Standard_CString theTypeName) const
 Returns a true value if this is an instance of TypeName. More...
 
Standard_Boolean IsKind (const opencascade::handle< Standard_Type > &theType) const
 Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
Standard_Boolean IsKind (const Standard_CString theTypeName) const
 Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
Standard_TransientThis () const
 Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero. More...
 
Standard_Integer GetRefCount () const
 Get the reference counter of this object. More...
 
void IncrementRefCounter () const
 Increments the reference counter of this object. More...
 
Standard_Integer DecrementRefCounter () const
 Decrements the reference counter of this object; returns the decremented value. More...
 

Static Public Member Functions

static bool IsTopDownDefault ()
 Return default rows order used by underlying image library. More...
 
- Static Public Member Functions inherited from Image_PixMap
static bool IsBigEndianHost ()
 Determine Big-Endian at runtime. More...
 
static bool SwapRgbaBgra (Image_PixMap &theImage)
 Auxiliary method for swapping bytes between RGB and BGR formats. This method modifies the image data but does not change pixel format! Method will fail if pixel format is not one of the following: More...
 
static void ToBlackWhite (Image_PixMap &theImage)
 Convert image to Black/White. More...
 
static const Handle< NCollection_BaseAllocator > & DefaultAllocator ()
 Return default image data allocator. More...
 
static Standard_Size SizePixelBytes (const Image_Format thePixelFormat)
 
- Static Public Member Functions inherited from Standard_Transient
static const char * get_type_name ()
 Returns a type descriptor about this object. More...
 
static const opencascade::handle< Standard_Type > & get_type_descriptor ()
 Returns type descriptor of Standard_Transient class. More...
 

Additional Inherited Members

- Public Types inherited from Image_PixMap
typedef Image_Format ImgFormat
 
- Public Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object. More...
 
- Static Public Attributes inherited from Image_PixMap
static const Image_Format ImgUNKNOWN = Image_Format_UNKNOWN
 
static const Image_Format ImgGray = Image_Format_Gray
 
static const Image_Format ImgAlpha = Image_Format_Alpha
 
static const Image_Format ImgRGB = Image_Format_RGB
 
static const Image_Format ImgBGR = Image_Format_BGR
 
static const Image_Format ImgRGB32 = Image_Format_RGB32
 
static const Image_Format ImgBGR32 = Image_Format_BGR32
 
static const Image_Format ImgRGBA = Image_Format_RGBA
 
static const Image_Format ImgBGRA = Image_Format_BGRA
 
static const Image_Format ImgGrayF = Image_Format_GrayF
 
static const Image_Format ImgAlphaF = Image_Format_AlphaF
 
static const Image_Format ImgRGBF = Image_Format_RGBF
 
static const Image_Format ImgBGRF = Image_Format_BGRF
 
static const Image_Format ImgRGBAF = Image_Format_RGBAF
 
static const Image_Format ImgBGRAF = Image_Format_BGRAF
 
- Protected Attributes inherited from Image_PixMap
Image_PixMapData myData
 data buffer More...
 
Image_Format myImgFormat
 pixel format More...
 

Detailed Description

Image class that support file reading/writing operations using auxiliary image library. Supported image formats:

Constructor & Destructor Documentation

◆ Image_AlienPixMap()

Image_AlienPixMap::Image_AlienPixMap ( )

Empty constructor.

◆ ~Image_AlienPixMap()

virtual Image_AlienPixMap::~Image_AlienPixMap ( )
virtual

Destructor.

Member Function Documentation

◆ AdjustGamma()

bool Image_AlienPixMap::AdjustGamma ( const Standard_Real  theGammaCorr)

Performs gamma correction on image. theGamma - gamma value to use; a value of 1.0 leaves the image alone.

◆ Clear()

virtual void Image_AlienPixMap::Clear ( )
overridevirtual

Method correctly deallocate internal buffer.

Reimplemented from Image_PixMap.

◆ InitCopy()

virtual bool Image_AlienPixMap::InitCopy ( const Image_PixMap theCopy)
overridevirtual

Initialize by copying data.

Reimplemented from Image_PixMap.

◆ InitTrash()

virtual bool Image_AlienPixMap::InitTrash ( Image_Format  thePixelFormat,
const Standard_Size  theSizeX,
const Standard_Size  theSizeY,
const Standard_Size  theSizeRowBytes = 0 
)
overridevirtual

Initialize image plane with required dimensions. thePixelFormat - if specified pixel format doesn't supported by image library than nearest supported will be used instead! theSizeRowBytes - may be ignored by this class and required alignemnt will be used instead!

Reimplemented from Image_PixMap.

◆ IsTopDownDefault()

static bool Image_AlienPixMap::IsTopDownDefault ( )
static

Return default rows order used by underlying image library.

◆ Load() [1/3]

bool Image_AlienPixMap::Load ( const TCollection_AsciiString theFileName)
inline

Read image data from file.

◆ Load() [2/3]

bool Image_AlienPixMap::Load ( std::istream &  theStream,
const TCollection_AsciiString theFileName 
)

Read image data from stream.

◆ Load() [3/3]

bool Image_AlienPixMap::Load ( const Standard_Byte theData,
Standard_Size  theLength,
const TCollection_AsciiString theFileName 
)

Read image data from memory buffer.

Parameters
theDatamemory pointer to read from; when NULL, function will attempt to open theFileName file
theLengthmemory buffer length
theFileNameoptional file name

◆ Save()

bool Image_AlienPixMap::Save ( const TCollection_AsciiString theFileName)

Write image data to file using file extension to determine compression format.


The documentation for this class was generated from the following file: