BRepExtrema_OverlappedSubShapes BRepExtrema_MapOfIntegerPackedMapOfInteger
ShapeConstruct_CompBezierCurves2dToBSplineCurve2d Convert_CompBezierCurves2dToBSplineCurve2d
ShapeConstruct_CompBezierCurves2dToBSplineCurve Convert_CompBezierCurves2dToBSplineCurve
+Image_PixMap::Img Image_Format_
[tcollection]
AdvApp2Var_SequenceOfNode
Image_AlienPixMap anImage;
bool isBigEndian = Image_PixMap::IsBigEndianHost();
const Standard_Size aSizeRowBytes = Standard_Size(winAttr.width) * 4;
- if (!anImage.InitTrash (isBigEndian ? Image_PixMap::ImgRGB32 : Image_PixMap::ImgBGR32,
+ if (!anImage.InitTrash (isBigEndian ? Image_Format_RGB32 : Image_Format_BGR32,
Standard_Size(winAttr.width), Standard_Size(winAttr.height), aSizeRowBytes))
{
return Standard_False;
Image_AlienPixMap anImage;
const Standard_Size aSizeRowBytes = Standard_Size(aBitmap.bmWidth) * 4;
- if (!anImage.InitTrash (Image_PixMap::ImgBGR32, Standard_Size(aBitmap.bmWidth), Standard_Size(aBitmap.bmHeight), aSizeRowBytes))
+ if (!anImage.InitTrash (Image_Format_BGR32, Standard_Size(aBitmap.bmWidth), Standard_Size(aBitmap.bmHeight), aSizeRowBytes))
{
return Standard_False;
}
{
return false;
}
- if (!myGlyphImg.InitWrapper (Image_PixMap::ImgAlpha, aBitmap.buffer,
+ if (!myGlyphImg.InitWrapper (Image_Format_Alpha, aBitmap.buffer,
aBitmap.width, aBitmap.rows, Abs (aBitmap.pitch)))
{
return false;
{
Standard_ProgramError_Raise_if (thePattern.IsNull(), "Null pointer to a hatch pattern image");
Standard_ProgramError_Raise_if (
- thePattern->SizeX() != 32 || thePattern->SizeY() != 32 || thePattern->Format() != Image_PixMap::ImgGray,
- "Hatch pattern must be a 32*32 bitmap (Image_PixMap::ImgGray format)");
+ thePattern->SizeX() != 32 || thePattern->SizeY() != 32 || thePattern->Format() != Image_Format_Gray,
+ "Hatch pattern must be a 32*32 bitmap (Image_Format_Gray format)");
const Standard_Size aByteSize = thePattern->SizeBytes();
Handle(NCollection_AlignedAllocator) anAllocator = new NCollection_AlignedAllocator (16);
Quantity_Color aColor = myImage->PixelColor (aColumn, aRow, anAlphaValue);
Standard_Boolean aBitOn = Standard_False;
- if (myImage->Format() == Image_PixMap::ImgAlpha)
+ if (myImage->Format() == Image_Format_Alpha)
{
aBitOn = anAlphaValue > theAlphaValue;
}
- else if (myImage->Format() == Image_PixMap::ImgGray)
+ else if (myImage->Format() == Image_Format_Gray)
{
aBitOn = aColor.Red() > theAlphaValue;
}
const Standard_Integer aLowerIndex = myBitMap->Lower();
myImage = new Image_PixMap();
- myImage->InitZero (Image_PixMap::ImgAlpha, aSize + myMargin * 2, aSize + myMargin * 2);
+ myImage->InitZero (Image_Format_Alpha, aSize + myMargin * 2, aSize + myMargin * 2);
for (Standard_Integer aRowIter = 0; aRowIter < myHeight; aRowIter++)
{
Standard_Byte* anImageRow = myImage->ChangeRow (aRowIter + aRowOffset);
if (!myImage.IsNull())
{
- if (myImage->Format() == Image_PixMap::ImgGray
- || myImage->Format() == Image_PixMap::ImgAlpha)
+ if (myImage->Format() == Image_Format_Gray
+ || myImage->Format() == Image_Format_Alpha)
{
myImageAlpha = myImage;
}
else
{
myImageAlpha = new Image_PixMap();
- myImageAlpha->InitZero (Image_PixMap::ImgAlpha, myImage->Width(), myImage->Height());
+ myImageAlpha->InitZero (Image_Format_Alpha, myImage->Width(), myImage->Height());
myImageAlpha->SetTopDown (Standard_False);
Quantity_Parameter anAlpha;
for (Standard_Size aRowIter = 0; aRowIter < myImage->Height(); aRowIter++)
//!
//! Default implementation generates unique ID although inheritors may re-initialize it.
//!
- //! Multiple Graphic3d_TextureRoot instancies with same ID
+ //! Multiple Graphic3d_TextureRoot instances with same ID
//! will be treated as single texture with different parameters
//! to optimize memory usage though this will be more natural
//! to use same instance of Graphic3d_TextureRoot when possible.
Standard_Size Revision() const { return myRevision; }
//! Update image revision.
- //! Can be used for signalling changes in the texture source (e.g. file update, pixmap update)
+ //! Can be used for signaling changes in the texture source (e.g. file update, pixmap update)
//! without re-creating texture source itself (e.g. preserving the unique id).
void UpdateRevision() { ++myRevision; }
TCollection_AsciiString myTexId; //!< unique identifier of this resource (for sharing)
Handle(Image_PixMap) myPixMap; //!< image pixmap - as one of the ways for defining the texture source
OSD_Path myPath; //!< image file path - as one of the ways for defining the texture source
- Standard_Size myRevision; //!< image revision - for signalling changes in the texture source (e.g. file update, pixmap update)
+ Standard_Size myRevision; //!< image revision - for signaling changes in the texture source (e.g. file update, pixmap update)
Graphic3d_TypeOfTexture myType; //!< texture type
};
Image_Color.hxx
Image_Diff.cxx
Image_Diff.hxx
+Image_Format.hxx
Image_PixMap.cxx
Image_PixMap.hxx
Image_PixMapData.hxx
#ifdef HAVE_FREEIMAGE
namespace
{
- static Image_PixMap::ImgFormat convertFromFreeFormat (FREE_IMAGE_TYPE theFormatFI,
- FREE_IMAGE_COLOR_TYPE theColorTypeFI,
- unsigned theBitsPerPixel)
+ static Image_Format convertFromFreeFormat (FREE_IMAGE_TYPE theFormatFI,
+ FREE_IMAGE_COLOR_TYPE theColorTypeFI,
+ unsigned theBitsPerPixel)
{
switch (theFormatFI)
{
- case FIT_RGBF: return Image_PixMap::ImgRGBF;
- case FIT_RGBAF: return Image_PixMap::ImgRGBAF;
- case FIT_FLOAT: return Image_PixMap::ImgGrayF;
+ case FIT_RGBF: return Image_Format_RGBF;
+ case FIT_RGBAF: return Image_Format_RGBAF;
+ case FIT_FLOAT: return Image_Format_GrayF;
case FIT_BITMAP:
{
switch (theColorTypeFI)
{
case FIC_MINISBLACK:
{
- return Image_PixMap::ImgGray;
+ return Image_Format_Gray;
}
case FIC_RGB:
{
if (Image_PixMap::IsBigEndianHost())
{
- return (theBitsPerPixel == 32) ? Image_PixMap::ImgRGB32 : Image_PixMap::ImgRGB;
+ return (theBitsPerPixel == 32) ? Image_Format_RGB32 : Image_Format_RGB;
}
else
{
- return (theBitsPerPixel == 32) ? Image_PixMap::ImgBGR32 : Image_PixMap::ImgBGR;
+ return (theBitsPerPixel == 32) ? Image_Format_BGR32 : Image_Format_BGR;
}
}
case FIC_RGBALPHA:
{
- return Image_PixMap::IsBigEndianHost() ? Image_PixMap::ImgRGBA : Image_PixMap::ImgBGRA;
+ return Image_PixMap::IsBigEndianHost() ? Image_Format_RGBA : Image_Format_BGRA;
}
default:
- return Image_PixMap::ImgUNKNOWN;
+ return Image_Format_UNKNOWN;
}
}
default:
- return Image_PixMap::ImgUNKNOWN;
+ return Image_Format_UNKNOWN;
}
}
- static FREE_IMAGE_TYPE convertToFreeFormat (Image_PixMap::ImgFormat theFormat)
+ static FREE_IMAGE_TYPE convertToFreeFormat (Image_Format theFormat)
{
switch (theFormat)
{
- case Image_PixMap::ImgGrayF:
- case Image_PixMap::ImgAlphaF:
+ case Image_Format_GrayF:
+ case Image_Format_AlphaF:
return FIT_FLOAT;
- case Image_PixMap::ImgRGBAF:
+ case Image_Format_RGBAF:
return FIT_RGBAF;
- case Image_PixMap::ImgRGBF:
+ case Image_Format_RGBF:
return FIT_RGBF;
- case Image_PixMap::ImgRGBA:
- case Image_PixMap::ImgBGRA:
- case Image_PixMap::ImgRGB32:
- case Image_PixMap::ImgBGR32:
- case Image_PixMap::ImgRGB:
- case Image_PixMap::ImgBGR:
- case Image_PixMap::ImgGray:
- case Image_PixMap::ImgAlpha:
+ case Image_Format_RGBA:
+ case Image_Format_BGRA:
+ case Image_Format_RGB32:
+ case Image_Format_BGR32:
+ case Image_Format_RGB:
+ case Image_Format_BGR:
+ case Image_Format_Gray:
+ case Image_Format_Alpha:
return FIT_BITMAP;
default:
return FIT_UNKNOWN;
// function : InitWrapper
// purpose :
// =======================================================================
-bool Image_AlienPixMap::InitWrapper (ImgFormat,
+bool Image_AlienPixMap::InitWrapper (Image_Format,
Standard_Byte*,
const Standard_Size,
const Standard_Size,
// purpose :
// =======================================================================
#ifdef HAVE_FREEIMAGE
-bool Image_AlienPixMap::InitTrash (ImgFormat thePixelFormat,
+bool Image_AlienPixMap::InitTrash (Image_Format thePixelFormat,
const Standard_Size theSizeX,
const Standard_Size theSizeY,
const Standard_Size /*theSizeRowBytes*/)
}
FIBITMAP* anImage = FreeImage_AllocateT (aFormatFI, (int )theSizeX, (int )theSizeY, aBitsPerPixel);
- Image_PixMap::ImgFormat aFormat = convertFromFreeFormat (FreeImage_GetImageType (anImage),
- FreeImage_GetColorType (anImage),
- FreeImage_GetBPP (anImage));
- if (thePixelFormat == Image_PixMap::ImgBGR32
- || thePixelFormat == Image_PixMap::ImgRGB32)
+ Image_Format aFormat = convertFromFreeFormat (FreeImage_GetImageType(anImage),
+ FreeImage_GetColorType(anImage),
+ FreeImage_GetBPP (anImage));
+ if (thePixelFormat == Image_Format_BGR32
+ || thePixelFormat == Image_Format_RGB32)
{
//FreeImage_SetTransparent (anImage, FALSE);
- aFormat = (aFormat == Image_PixMap::ImgBGRA) ? Image_PixMap::ImgBGR32 : Image_PixMap::ImgRGB32;
+ aFormat = (aFormat == Image_Format_BGRA) ? Image_Format_BGR32 : Image_Format_RGB32;
}
Image_PixMap::InitWrapper (aFormat, FreeImage_GetBits (anImage),
return true;
}
#else
-bool Image_AlienPixMap::InitTrash (ImgFormat thePixelFormat,
+bool Image_AlienPixMap::InitTrash (Image_Format thePixelFormat,
const Standard_Size theSizeX,
const Standard_Size theSizeY,
const Standard_Size theSizeRowBytes)
return false;
}
- Image_PixMap::ImgFormat aFormat = convertFromFreeFormat (FreeImage_GetImageType (anImage),
- FreeImage_GetColorType (anImage),
- FreeImage_GetBPP (anImage));
- if (aFormat == Image_PixMap::ImgUNKNOWN)
+ Image_Format aFormat = convertFromFreeFormat (FreeImage_GetImageType(anImage),
+ FreeImage_GetColorType(anImage),
+ FreeImage_GetBPP (anImage));
+ if (aFormat == Image_Format_UNKNOWN)
{
//anImage = FreeImage_ConvertTo24Bits (anImage);
TCollection_AsciiString aMessage = "Error: image file '";
SetTopDown (false);
}
- // FreeImage doesn't provide flexible format convertion API
- // so we should perform multiple convertions in some cases!
+ // FreeImage doesn't provide flexible format conversion API
+ // so we should perform multiple conversions in some cases!
FIBITMAP* anImageToDump = myLibImage;
switch (anImageFormat)
{
case FIF_PNG:
case FIF_BMP:
{
- if (Format() == Image_PixMap::ImgBGR32
- || Format() == Image_PixMap::ImgRGB32)
+ if (Format() == Image_Format_BGR32
+ || Format() == Image_Format_RGB32)
{
// stupid FreeImage treats reserved byte as alpha if some bytes not set to 0xFF
for (Standard_Size aRow = 0; aRow < SizeY(); ++aRow)
aTmpBitmap = aTmpBitmap24;
}
- // need convertion to image with pallete (requires 24bit bitmap)
+ // need conversion to image with palette (requires 24bit bitmap)
anImageToDump = FreeImage_ColorQuantize (aTmpBitmap, FIQ_NNQUANT);
if (aTmpBitmap != myLibImage)
{
}
case FIF_EXR:
{
- if (Format() == Image_PixMap::ImgGray
- || Format() == Image_PixMap::ImgAlpha)
+ if (Format() == Image_Format_Gray
+ || Format() == Image_Format_Alpha)
{
anImageToDump = FreeImage_ConvertToType (myLibImage, FIT_FLOAT);
}
- else if (Format() == Image_PixMap::ImgRGBA
- || Format() == Image_PixMap::ImgBGRA)
+ else if (Format() == Image_Format_RGBA
+ || Format() == Image_Format_BGRA)
{
anImageToDump = FreeImage_ConvertToType (myLibImage, FIT_RGBAF);
}
//! - *.jpg, *.jpe, *.jpeg - JPEG/JIFF (Joint Photographic Experts Group) lossy format (compressed with quality losses). YUV color space used (automatically converted from/to RGB).
//! - *.tif, *.tiff - TIFF (Tagged Image File Format).
//! - *.tga - TGA (Truevision Targa Graphic), lossless format.
-//! - *.gif - GIF (Graphical Interchange Format), lossy format. Color stored using pallete (up to 256 distinct colors).
+//! - *.gif - GIF (Graphical Interchange Format), lossy format. Color stored using palette (up to 256 distinct colors).
//! - *.exr - OpenEXR high dynamic-range format (supports float pixel formats).
class Image_AlienPixMap : public Image_PixMap
{
-
+ DEFINE_STANDARD_RTTIEXT(Image_AlienPixMap, Image_PixMap)
public:
//! Empty constructor.
//! 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!
- Standard_EXPORT virtual bool InitTrash (ImgFormat thePixelFormat,
+ Standard_EXPORT virtual bool InitTrash (Image_Format thePixelFormat,
const Standard_Size theSizeX,
const Standard_Size theSizeY,
const Standard_Size theSizeRowBytes = 0) Standard_OVERRIDE;
//! Wrapper initialization is disallowed for this class (will return false in any case)!
//! Use only copying and allocation initializers.
- Standard_EXPORT virtual bool InitWrapper (ImgFormat thePixelFormat,
+ Standard_EXPORT virtual bool InitWrapper (Image_Format thePixelFormat,
Standard_Byte* theDataPtr,
const Standard_Size theSizeX,
const Standard_Size theSizeY,
//! Built-in PPM export
Standard_EXPORT bool savePPM (const TCollection_AsciiString& theFileName) const;
-public:
-
- DEFINE_STANDARD_RTTIEXT(Image_AlienPixMap,Image_PixMap) // Type definition
-
};
DEFINE_STANDARD_HANDLE(Image_AlienPixMap, Image_PixMap)
{ 1, -1}, { 1, 0}, { 1, 1}
};
- static bool isSupportedFormat (const Image_PixMap::ImgFormat theFormat)
+ static bool isSupportedFormat (const Image_Format theFormat)
{
- return theFormat == Image_PixMap::ImgRGB
- || theFormat == Image_PixMap::ImgBGR
- || theFormat == Image_PixMap::ImgRGB32
- || theFormat == Image_PixMap::ImgBGR32
- || theFormat == Image_PixMap::ImgRGBA
- || theFormat == Image_PixMap::ImgBGRA;
+ return theFormat == Image_Format_RGB
+ || theFormat == Image_Format_BGR
+ || theFormat == Image_Format_RGB32
+ || theFormat == Image_Format_BGR32
+ || theFormat == Image_Format_RGBA
+ || theFormat == Image_Format_BGRA;
}
} // anonymous namespace
|| theDiffImage.SizeY() != myImageRef->SizeY()
|| !isSupportedFormat (theDiffImage.Format()))
{
- if (!theDiffImage.InitTrash (Image_PixMap::ImgRGB, myImageRef->SizeX(), myImageRef->SizeY()))
+ if (!theDiffImage.InitTrash (Image_Format_RGB, myImageRef->SizeX(), myImageRef->SizeY()))
{
return Standard_False;
}
}
Image_AlienPixMap aDiff;
- if (!aDiff.InitTrash (Image_PixMap::ImgRGB, myImageRef->SizeX(), myImageRef->SizeY())
+ if (!aDiff.InitTrash (Image_Format_RGB, myImageRef->SizeX(), myImageRef->SizeY())
|| !SaveDiffImage (aDiff))
{
return Standard_False;
--- /dev/null
+// Copyright (c) 2012-2017 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#ifndef _Image_Format_HeaderFile
+#define _Image_Format_HeaderFile
+
+//! This enumeration defines packed image plane formats
+enum Image_Format
+{
+ Image_Format_UNKNOWN = 0, //!< unsupported or unknown format
+ Image_Format_Gray = 1, //!< 1 byte per pixel, intensity of the color
+ Image_Format_Alpha, //!< 1 byte per pixel, transparency
+ Image_Format_RGB, //!< 3 bytes packed RGB image plane
+ Image_Format_BGR, //!< same as RGB but with different components order
+ Image_Format_RGB32, //!< 4 bytes packed RGB image plane (1 extra byte for alignment, may have undefined value)
+ Image_Format_BGR32, //!< same as RGB but with different components order
+ Image_Format_RGBA, //!< 4 bytes packed RGBA image plane
+ Image_Format_BGRA, //!< same as RGBA but with different components order
+ Image_Format_GrayF, //!< 1 float (4-bytes) per pixel (1-component plane), intensity of the color
+ Image_Format_AlphaF, //!< 1 float (4-bytes) per pixel (1-component plane), transparency
+ Image_Format_RGBF, //!< 3 floats (12-bytes) RGB image plane
+ Image_Format_BGRF, //!< same as RGBF but with different components order
+ Image_Format_RGBAF, //!< 4 floats (16-bytes) RGBA image plane
+ Image_Format_BGRAF, //!< same as RGBAF but with different components order
+};
+
+#endif // _Image_Format_HeaderFile
// purpose :
// =======================================================================
Image_PixMap::Image_PixMap()
-: myImgFormat (Image_PixMap::ImgGray)
+: myImgFormat (Image_Format_Gray)
{
//
}
Clear();
}
-Standard_Size Image_PixMap::SizePixelBytes (const Image_PixMap::ImgFormat thePixelFormat)
+Standard_Size Image_PixMap::SizePixelBytes (const Image_Format thePixelFormat)
{
switch (thePixelFormat)
{
- case ImgGrayF:
- case ImgAlphaF:
+ case Image_Format_GrayF:
+ case Image_Format_AlphaF:
return sizeof(float);
- case ImgRGBAF:
- case ImgBGRAF:
+ case Image_Format_RGBAF:
+ case Image_Format_BGRAF:
return sizeof(float) * 4;
- case ImgRGBF:
- case ImgBGRF:
+ case Image_Format_RGBF:
+ case Image_Format_BGRF:
return sizeof(float) * 3;
- case ImgRGBA:
- case ImgBGRA:
+ case Image_Format_RGBA:
+ case Image_Format_BGRA:
return 4;
- case ImgRGB32:
- case ImgBGR32:
+ case Image_Format_RGB32:
+ case Image_Format_BGR32:
return 4;
- case ImgRGB:
- case ImgBGR:
+ case Image_Format_RGB:
+ case Image_Format_BGR:
return 3;
- case ImgGray:
- case ImgAlpha:
+ case Image_Format_Gray:
+ case Image_Format_Alpha:
return 1;
- case ImgUNKNOWN:
+ case Image_Format_UNKNOWN:
return 1;
}
return 1;
// function : SetFormat
// purpose :
// =======================================================================
-void Image_PixMap::SetFormat (Image_PixMap::ImgFormat thePixelFormat)
+void Image_PixMap::SetFormat (Image_Format thePixelFormat)
{
if (myImgFormat == thePixelFormat)
{
// function : InitWrapper
// purpose :
// =======================================================================
-bool Image_PixMap::InitWrapper (Image_PixMap::ImgFormat thePixelFormat,
- Standard_Byte* theDataPtr,
- const Standard_Size theSizeX,
- const Standard_Size theSizeY,
- const Standard_Size theSizeRowBytes)
+bool Image_PixMap::InitWrapper (Image_Format thePixelFormat,
+ Standard_Byte* theDataPtr,
+ const Standard_Size theSizeX,
+ const Standard_Size theSizeY,
+ const Standard_Size theSizeRowBytes)
{
Clear();
myImgFormat = thePixelFormat;
// function : InitTrash
// purpose :
// =======================================================================
-bool Image_PixMap::InitTrash (Image_PixMap::ImgFormat thePixelFormat,
- const Standard_Size theSizeX,
- const Standard_Size theSizeY,
- const Standard_Size theSizeRowBytes)
+bool Image_PixMap::InitTrash (Image_Format thePixelFormat,
+ const Standard_Size theSizeX,
+ const Standard_Size theSizeY,
+ const Standard_Size theSizeRowBytes)
{
Clear();
myImgFormat = thePixelFormat;
// function : InitZero
// purpose :
// =======================================================================
-bool Image_PixMap::InitZero (Image_PixMap::ImgFormat thePixelFormat,
- const Standard_Size theSizeX,
- const Standard_Size theSizeY,
- const Standard_Size theSizeRowBytes,
- const Standard_Byte theValue)
+bool Image_PixMap::InitZero (Image_Format thePixelFormat,
+ const Standard_Size theSizeX,
+ const Standard_Size theSizeY,
+ const Standard_Size theSizeRowBytes,
+ const Standard_Byte theValue)
{
if (!InitTrash (thePixelFormat, theSizeX, theSizeY, theSizeRowBytes))
{
switch (myImgFormat)
{
- case ImgGrayF:
+ case Image_Format_GrayF:
{
const Standard_ShortReal& aPixel = Value<Standard_ShortReal> (theY, theX);
theAlpha = 1.0; // opaque
Quantity_Parameter (Standard_Real (aPixel)),
Quantity_TOC_RGB);
}
- case ImgAlphaF:
+ case Image_Format_AlphaF:
{
const Standard_ShortReal& aPixel = Value<Standard_ShortReal> (theY, theX);
theAlpha = aPixel;
return Quantity_Color (1.0, 1.0, 1.0, Quantity_TOC_RGB);
}
- case ImgRGBAF:
+ case Image_Format_RGBAF:
{
const Image_ColorRGBAF& aPixel = Value<Image_ColorRGBAF> (theY, theX);
theAlpha = aPixel.a();
Quantity_Parameter (aPixel.b()),
Quantity_TOC_RGB);
}
- case ImgBGRAF:
+ case Image_Format_BGRAF:
{
const Image_ColorBGRAF& aPixel = Value<Image_ColorBGRAF> (theY, theX);
theAlpha = aPixel.a();
Quantity_Parameter (aPixel.b()),
Quantity_TOC_RGB);
}
- case ImgRGBF:
+ case Image_Format_RGBF:
{
const Image_ColorRGBF& aPixel = Value<Image_ColorRGBF> (theY, theX);
theAlpha = 1.0; // opaque
Quantity_Parameter (aPixel.b()),
Quantity_TOC_RGB);
}
- case ImgBGRF:
+ case Image_Format_BGRF:
{
const Image_ColorBGRF& aPixel = Value<Image_ColorBGRF> (theY, theX);
theAlpha = 1.0; // opaque
Quantity_Parameter (aPixel.b()),
Quantity_TOC_RGB);
}
- case ImgRGBA:
+ case Image_Format_RGBA:
{
const Image_ColorRGBA& aPixel = Value<Image_ColorRGBA> (theY, theX);
theAlpha = Standard_Real (aPixel.a()) / 255.0;
Quantity_Parameter (Standard_Real (aPixel.b()) / 255.0),
Quantity_TOC_RGB);
}
- case ImgBGRA:
+ case Image_Format_BGRA:
{
const Image_ColorBGRA& aPixel = Value<Image_ColorBGRA> (theY, theX);
theAlpha = Standard_Real (aPixel.a()) / 255.0;
Quantity_Parameter (Standard_Real (aPixel.b()) / 255.0),
Quantity_TOC_RGB);
}
- case ImgRGB32:
+ case Image_Format_RGB32:
{
const Image_ColorRGB32& aPixel = Value<Image_ColorRGB32> (theY, theX);
theAlpha = 1.0; // opaque
Quantity_Parameter (Standard_Real (aPixel.b()) / 255.0),
Quantity_TOC_RGB);
}
- case ImgBGR32:
+ case Image_Format_BGR32:
{
const Image_ColorBGR32& aPixel = Value<Image_ColorBGR32> (theY, theX);
theAlpha = 1.0; // opaque
Quantity_Parameter (Standard_Real (aPixel.b()) / 255.0),
Quantity_TOC_RGB);
}
- case ImgRGB:
+ case Image_Format_RGB:
{
const Image_ColorRGB& aPixel = Value<Image_ColorRGB> (theY, theX);
theAlpha = 1.0; // opaque
Quantity_Parameter (Standard_Real (aPixel.b()) / 255.0),
Quantity_TOC_RGB);
}
- case ImgBGR:
+ case Image_Format_BGR:
{
const Image_ColorBGR& aPixel = Value<Image_ColorBGR> (theY, theX);
theAlpha = 1.0; // opaque
Quantity_Parameter (Standard_Real (aPixel.b()) / 255.0),
Quantity_TOC_RGB);
}
- case ImgGray:
+ case Image_Format_Gray:
{
const Standard_Byte& aPixel = Value<Standard_Byte> (theY, theX);
theAlpha = 1.0; // opaque
Quantity_Parameter (Standard_Real (aPixel) / 255.0),
Quantity_TOC_RGB);
}
- case ImgAlpha:
+ case Image_Format_Alpha:
{
const Standard_Byte& aPixel = Value<Standard_Byte> (theY, theX);
theAlpha = Standard_Real (aPixel) / 255.0;
return Quantity_Color (1.0, 1.0, 1.0, Quantity_TOC_RGB);
}
- case ImgUNKNOWN:
+ case Image_Format_UNKNOWN:
{
break;
}
switch (myImgFormat)
{
- case ImgGrayF:
+ case Image_Format_GrayF:
{
ChangeValue<Standard_ShortReal> (theY, theX) = theColor.r();
return;
}
- case ImgAlphaF:
+ case Image_Format_AlphaF:
{
ChangeValue<Standard_ShortReal> (theY, theX) = theColor.a();
return;
}
- case ImgRGBAF:
+ case Image_Format_RGBAF:
{
Image_ColorRGBAF& aPixel = ChangeValue<Image_ColorRGBAF> (theY, theX);
aPixel.r() = theColor.r();
aPixel.a() = theColor.a();
return;
}
- case ImgBGRAF:
+ case Image_Format_BGRAF:
{
Image_ColorBGRAF& aPixel = ChangeValue<Image_ColorBGRAF> (theY, theX);
aPixel.r() = theColor.r();
aPixel.a() = theColor.a();
return;
}
- case ImgRGBF:
+ case Image_Format_RGBF:
{
Image_ColorRGBF& aPixel = ChangeValue<Image_ColorRGBF> (theY, theX);
aPixel.r() = theColor.r();
aPixel.b() = theColor.b();
return;
}
- case ImgBGRF:
+ case Image_Format_BGRF:
{
Image_ColorBGRF& aPixel = ChangeValue<Image_ColorBGRF> (theY, theX);
aPixel.r() = theColor.r();
aPixel.b() = theColor.b();
return;
}
- case ImgRGBA:
+ case Image_Format_RGBA:
{
Image_ColorRGBA& aPixel = ChangeValue<Image_ColorRGBA> (theY, theX);
aPixel.r() = Standard_Byte(theColor.r() * 255.0f);
aPixel.a() = Standard_Byte(theColor.a() * 255.0f);
return;
}
- case ImgBGRA:
+ case Image_Format_BGRA:
{
Image_ColorBGRA& aPixel = ChangeValue<Image_ColorBGRA> (theY, theX);
aPixel.r() = Standard_Byte(theColor.r() * 255.0f);
aPixel.a() = Standard_Byte(theColor.a() * 255.0f);
return;
}
- case ImgRGB32:
+ case Image_Format_RGB32:
{
Image_ColorRGB32& aPixel = ChangeValue<Image_ColorRGB32> (theY, theX);
aPixel.r() = Standard_Byte(theColor.r() * 255.0f);
aPixel.a_() = 255;
return;
}
- case ImgBGR32:
+ case Image_Format_BGR32:
{
Image_ColorBGR32& aPixel = ChangeValue<Image_ColorBGR32> (theY, theX);
aPixel.r() = Standard_Byte(theColor.r() * 255.0f);
aPixel.a_() = 255;
return;
}
- case ImgRGB:
+ case Image_Format_RGB:
{
Image_ColorRGB& aPixel = ChangeValue<Image_ColorRGB> (theY, theX);
aPixel.r() = Standard_Byte(theColor.r() * 255.0f);
aPixel.b() = Standard_Byte(theColor.b() * 255.0f);
return;
}
- case ImgBGR:
+ case Image_Format_BGR:
{
Image_ColorBGR& aPixel = ChangeValue<Image_ColorBGR> (theY, theX);
aPixel.r() = Standard_Byte(theColor.r() * 255.0f);
aPixel.b() = Standard_Byte(theColor.b() * 255.0f);
return;
}
- case ImgGray:
+ case Image_Format_Gray:
{
ChangeValue<Standard_Byte> (theY, theX) = Standard_Byte(theColor.r() * 255.0f);
return;
}
- case ImgAlpha:
+ case Image_Format_Alpha:
{
ChangeValue<Standard_Byte> (theY, theX) = Standard_Byte(theColor.a() * 255.0f);
return;
}
- case ImgUNKNOWN:
+ case Image_Format_UNKNOWN:
{
return;
}
{
switch (theImage.Format())
{
- case Image_PixMap::ImgBGR32:
- case Image_PixMap::ImgRGB32:
- case Image_PixMap::ImgBGRA:
- case Image_PixMap::ImgRGBA:
+ case Image_Format_BGR32:
+ case Image_Format_RGB32:
+ case Image_Format_BGRA:
+ case Image_Format_RGBA:
{
- const bool toResetAlpha = theImage.Format() == Image_PixMap::ImgBGR32
- || theImage.Format() == Image_PixMap::ImgRGB32;
+ const bool toResetAlpha = theImage.Format() == Image_Format_BGR32
+ || theImage.Format() == Image_Format_RGB32;
for (Standard_Size aRow = 0; aRow < theImage.SizeY(); ++aRow)
{
for (Standard_Size aCol = 0; aCol < theImage.SizeX(); ++aCol)
}
return true;
}
- case Image_PixMap::ImgBGR:
- case Image_PixMap::ImgRGB:
+ case Image_Format_BGR:
+ case Image_Format_RGB:
{
for (Standard_Size aRow = 0; aRow < theImage.SizeY(); ++aRow)
{
}
return true;
}
- case Image_PixMap::ImgBGRF:
- case Image_PixMap::ImgRGBF:
- case Image_PixMap::ImgBGRAF:
- case Image_PixMap::ImgRGBAF:
+ case Image_Format_BGRF:
+ case Image_Format_RGBF:
+ case Image_Format_BGRAF:
+ case Image_Format_RGBAF:
{
for (Standard_Size aRow = 0; aRow < theImage.SizeY(); ++aRow)
{
#ifndef _Image_PixMap_H__
#define _Image_PixMap_H__
+#include <Image_Format.hxx>
#include <Image_PixMapData.hxx>
#include <Standard_Transient.hxx>
#include <Quantity_ColorRGBA.hxx>
//! Class represents packed image plane.
class Image_PixMap : public Standard_Transient
{
-
+ DEFINE_STANDARD_RTTIEXT(Image_PixMap, Standard_Transient)
public:
- //! This enumeration define packed image plane formats
- typedef enum tagFormat {
- ImgUNKNOWN = 0, //!< unsupported or unknown format
- ImgGray = 1, //!< 1 byte per pixel, intensity of the color
- ImgAlpha, //!< 1 byte per pixel, transparency
- ImgRGB, //!< 3 bytes packed RGB image plane
- ImgBGR, //!< same as RGB but with different components order
- ImgRGB32, //!< 4 bytes packed RGB image plane (1 extra byte for alignment, may have undefined value)
- ImgBGR32, //!< same as RGB but with different components order
- ImgRGBA, //!< 4 bytes packed RGBA image plane
- ImgBGRA, //!< same as RGBA but with different components order
- ImgGrayF, //!< 1 float (4-bytes) per pixel (1-component plane), intensity of the color
- ImgAlphaF, //!< 1 float (4-bytes) per pixel (1-component plane), transparency
- ImgRGBF, //!< 3 floats (12-bytes) RGB image plane
- ImgBGRF, //!< same as RGBF but with different components order
- ImgRGBAF, //!< 4 floats (16-bytes) RGBA image plane
- ImgBGRAF, //!< same as RGBAF but with different components order
- } ImgFormat;
-
//! Determine Big-Endian at runtime
static inline bool IsBigEndianHost()
{
//! 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:
- //! - ImgRGB32 / ImgBGR32
- //! - ImgRGBA / ImgBGRA
- //! - ImgRGB / ImgBGR
- //! - ImgRGBF / ImgBGRF
- //! - ImgRGBAF / ImgBGRAF
+ //! - Image_Format_RGB32 / Image_Format_BGR32
+ //! - Image_Format_RGBA / Image_Format_BGRA
+ //! - Image_Format_RGB / Image_Format_BGR
+ //! - Image_Format_RGBF / Image_Format_BGRF
+ //! - Image_Format_RGBAF / Image_Format_BGRAF
Standard_EXPORT static bool SwapRgbaBgra (Image_PixMap& theImage);
public: // high-level API
- inline ImgFormat Format() const
- {
- return myImgFormat;
- }
+ Image_Format Format() const { return myImgFormat; }
//! 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).
- Standard_EXPORT void SetFormat (const ImgFormat thePixelFormat);
+ Standard_EXPORT void SetFormat (const Image_Format thePixelFormat);
//! @return image width in pixels
inline Standard_Size Width() const
//! Data will not be copied! Notice that caller should ensure
//! that data pointer will not be released during this wrapper lifetime.
//! You may call InitCopy() to perform data copying.
- Standard_EXPORT virtual bool InitWrapper (ImgFormat thePixelFormat,
+ Standard_EXPORT virtual bool InitWrapper (Image_Format thePixelFormat,
Standard_Byte* theDataPtr,
const Standard_Size theSizeX,
const Standard_Size theSizeY,
//! Initialize image plane with required dimensions.
//! Memory will be left uninitialized (performance trick).
- Standard_EXPORT virtual bool InitTrash (ImgFormat thePixelFormat,
+ Standard_EXPORT virtual bool InitTrash (Image_Format thePixelFormat,
const Standard_Size theSizeX,
const Standard_Size theSizeY,
const Standard_Size theSizeRowBytes = 0);
//! Initialize image plane with required dimensions.
//! Buffer will be zeroed (black color for most formats).
- Standard_EXPORT bool InitZero (ImgFormat thePixelFormat,
+ Standard_EXPORT bool InitZero (Image_Format thePixelFormat,
const Standard_Size theSizeX,
const Standard_Size theSizeY,
const Standard_Size theSizeRowBytes = 0,
}
//! @return bytes reserved for one pixel (may include extra bytes for alignment).
- Standard_EXPORT static Standard_Size SizePixelBytes (const Image_PixMap::ImgFormat thePixelFormat);
+ Standard_EXPORT static Standard_Size SizePixelBytes (const Image_Format thePixelFormat);
//! @return bytes reserved per row.
//! Could be larger than needed to store packed row (extra bytes for alignment etc.).
return *reinterpret_cast<ColorType_t* >(myData.ChangeValue (theRow, theCol));
}
+public:
+
+ Standard_DEPRECATED("This member is deprecated, use Image_Format enumeration instead")
+ typedef Image_Format ImgFormat;
+ 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:
Image_PixMapData myData; //!< data buffer
- ImgFormat myImgFormat; //!< pixel format
+ Image_Format myImgFormat; //!< pixel format
private:
Image_PixMap (const Image_PixMap& );
Image_PixMap& operator= (const Image_PixMap& );
-public:
-
- DEFINE_STANDARD_RTTIEXT(Image_PixMap,Standard_Transient) // Type definition
-
};
DEFINE_STANDARD_HANDLE(Image_PixMap, Standard_Transient)
// create and fill image with colors
Handle(Image_PixMap) anImage = new Image_PixMap();
- if (!anImage->InitTrash (Image_PixMap::ImgRGBA, Standard_Size(getNearestPow2 (aColorsNb)), 2))
+ if (!anImage->InitTrash (Image_Format_RGBA, Standard_Size(getNearestPow2 (aColorsNb)), 2))
{
return NULL;
}
const Standard_Integer aMaxHeight = Max (aHeight1, aHeight2);
const Standard_Integer aSize = Max (aMaxWidth, aMaxHeight);
- aResultImage->InitZero (Image_PixMap::ImgAlpha, aSize, aSize);
+ aResultImage->InitZero (Image_Format_Alpha, aSize, aSize);
if (!theImage1.IsNull())
{
const Standard_Integer aSize = Max (aWidth + 2, aHeight + 2); // includes extra margin
anImage = new Image_PixMap();
anImageA = new Image_PixMap();
- anImage ->InitZero (Image_PixMap::ImgBGRA, aSize, aSize);
- anImageA->InitZero (Image_PixMap::ImgAlpha, aSize, aSize);
+ anImage ->InitZero (Image_Format_BGRA, aSize, aSize);
+ anImageA->InitZero (Image_Format_Alpha, aSize, aSize);
// we draw a set of circles
Image_ColorBGRA aColor32;
Handle(OpenGl_Texture)& aTexture = myTextures.ChangeLast();
Image_PixMap aBlackImg;
- if (!aBlackImg.InitZero (Image_PixMap::ImgAlpha, Standard_Size(aTextureSizeX), Standard_Size(aTextureSizeY))
+ if (!aBlackImg.InitZero (Image_Format_Alpha, Standard_Size(aTextureSizeX), Standard_Size(aTextureSizeY))
|| !aTexture->Init (theCtx, aBlackImg, Graphic3d_TOT_2D)) // myTextureFormat
{
TCollection_ExtendedString aMsg;
- aMsg += "New texture intialization of size ";
+ aMsg += "New texture initialization of size ";
aMsg += aTextureSizeX;
aMsg += "x";
aMsg += aTextureSizeY;
theDataType = 0;
switch (theData.Format())
{
- case Image_PixMap::ImgGrayF:
+ case Image_Format_GrayF:
{
if (theCtx->core11 == NULL)
{
theDataType = GL_FLOAT;
return true;
}
- case Image_PixMap::ImgAlphaF:
+ case Image_Format_AlphaF:
{
if (theCtx->core11 == NULL)
{
theDataType = GL_FLOAT;
return true;
}
- case Image_PixMap::ImgRGBAF:
+ case Image_Format_RGBAF:
{
theTextFormat = GL_RGBA8; // GL_RGBA32F
thePixelFormat = GL_RGBA;
theDataType = GL_FLOAT;
return true;
}
- case Image_PixMap::ImgBGRAF:
+ case Image_Format_BGRAF:
{
if (!theCtx->IsGlGreaterEqual (1, 2) && !theCtx->extBgra)
{
theDataType = GL_FLOAT;
return true;
}
- case Image_PixMap::ImgRGBF:
+ case Image_Format_RGBF:
{
theTextFormat = GL_RGB8; // GL_RGB32F
thePixelFormat = GL_RGB;
theDataType = GL_FLOAT;
return true;
}
- case Image_PixMap::ImgBGRF:
+ case Image_Format_BGRF:
{
#if !defined(GL_ES_VERSION_2_0)
theTextFormat = GL_RGB8; // GL_RGB32F
return false;
#endif
}
- case Image_PixMap::ImgRGBA:
+ case Image_Format_RGBA:
{
theTextFormat = GL_RGBA8;
thePixelFormat = GL_RGBA;
theDataType = GL_UNSIGNED_BYTE;
return true;
}
- case Image_PixMap::ImgBGRA:
+ case Image_Format_BGRA:
{
if (!theCtx->IsGlGreaterEqual (1, 2) && !theCtx->extBgra)
{
theDataType = GL_UNSIGNED_BYTE;
return true;
}
- case Image_PixMap::ImgRGB32:
+ case Image_Format_RGB32:
{
theTextFormat = GL_RGB8;
thePixelFormat = GL_RGBA;
theDataType = GL_UNSIGNED_BYTE;
return true;
}
- case Image_PixMap::ImgBGR32:
+ case Image_Format_BGR32:
{
if (!theCtx->IsGlGreaterEqual (1, 2) && !theCtx->extBgra)
{
theDataType = GL_UNSIGNED_BYTE;
return true;
}
- case Image_PixMap::ImgRGB:
+ case Image_Format_RGB:
{
theTextFormat = GL_RGB8;
thePixelFormat = GL_RGB;
theDataType = GL_UNSIGNED_BYTE;
return true;
}
- case Image_PixMap::ImgBGR:
+ case Image_Format_BGR:
{
#if !defined(GL_ES_VERSION_2_0)
if (!theCtx->IsGlGreaterEqual (1, 2) && !theCtx->extBgra)
return false;
#endif
}
- case Image_PixMap::ImgGray:
+ case Image_Format_Gray:
{
if (theCtx->core11 == NULL)
{
theDataType = GL_UNSIGNED_BYTE;
return true;
}
- case Image_PixMap::ImgAlpha:
+ case Image_Format_Alpha:
{
if (theCtx->core11 == NULL)
{
theDataType = GL_UNSIGNED_BYTE;
return true;
}
- case Image_PixMap::ImgUNKNOWN:
+ case Image_Format_UNKNOWN:
{
return false;
}
if (theImage != NULL)
{
- myIsAlpha = theImage->Format() == Image_PixMap::ImgAlpha
- || theImage->Format() == Image_PixMap::ImgAlphaF;
+ myIsAlpha = theImage->Format() == Image_Format_Alpha
+ || theImage->Format() == Image_Format_AlphaF;
}
else
{
switch (theImage.Format())
{
#if !defined(GL_ES_VERSION_2_0)
- case Image_PixMap::ImgGray:
+ case Image_Format_Gray:
aFormat = GL_DEPTH_COMPONENT;
aType = GL_UNSIGNED_BYTE;
break;
- case Image_PixMap::ImgGrayF:
+ case Image_Format_GrayF:
aFormat = GL_DEPTH_COMPONENT;
aType = GL_FLOAT;
break;
- case Image_PixMap::ImgRGB:
+ case Image_Format_RGB:
aFormat = GL_RGB;
aType = GL_UNSIGNED_BYTE;
break;
- case Image_PixMap::ImgBGR:
+ case Image_Format_BGR:
aFormat = GL_BGR;
aType = GL_UNSIGNED_BYTE;
break;
- case Image_PixMap::ImgBGRA:
- case Image_PixMap::ImgBGR32:
+ case Image_Format_BGRA:
+ case Image_Format_BGR32:
aFormat = GL_BGRA;
aType = GL_UNSIGNED_BYTE;
break;
- case Image_PixMap::ImgBGRF:
+ case Image_Format_BGRF:
aFormat = GL_BGR;
aType = GL_FLOAT;
break;
- case Image_PixMap::ImgBGRAF:
+ case Image_Format_BGRAF:
aFormat = GL_BGRA;
aType = GL_FLOAT;
break;
#else
- case Image_PixMap::ImgGray:
- case Image_PixMap::ImgGrayF:
- case Image_PixMap::ImgBGRF:
- case Image_PixMap::ImgBGRAF:
+ case Image_Format_Gray:
+ case Image_Format_GrayF:
+ case Image_Format_BGRF:
+ case Image_Format_BGRAF:
return Standard_False;
- case Image_PixMap::ImgBGRA:
- case Image_PixMap::ImgBGR32:
+ case Image_Format_BGRA:
+ case Image_Format_BGR32:
aFormat = GL_RGBA;
aType = GL_UNSIGNED_BYTE;
toSwapRgbaBgra = true;
break;
- case Image_PixMap::ImgBGR:
- case Image_PixMap::ImgRGB:
+ case Image_Format_BGR:
+ case Image_Format_RGB:
aFormat = GL_RGBA;
aType = GL_UNSIGNED_BYTE;
toConvRgba2Rgb = true;
break;
#endif
- case Image_PixMap::ImgRGBA:
- case Image_PixMap::ImgRGB32:
+ case Image_Format_RGBA:
+ case Image_Format_RGB32:
aFormat = GL_RGBA;
aType = GL_UNSIGNED_BYTE;
break;
- case Image_PixMap::ImgRGBF:
+ case Image_Format_RGBF:
aFormat = GL_RGB;
aType = GL_FLOAT;
break;
- case Image_PixMap::ImgRGBAF:
+ case Image_Format_RGBAF:
aFormat = GL_RGBA;
aType = GL_FLOAT;
break;
- case Image_PixMap::ImgAlpha:
- case Image_PixMap::ImgAlphaF:
+ case Image_Format_Alpha:
+ case Image_Format_AlphaF:
return Standard_False; // GL_ALPHA is no more supported in core context
- case Image_PixMap::ImgUNKNOWN:
+ case Image_Format_UNKNOWN:
return Standard_False;
}
// while order in memory depends on the flag and processed by ChangeRow() method
glReadPixels (0, GLint(theImage.SizeY() - aRow - 1), GLsizei (theImage.SizeX()), 1, aFormat, aType, aRowBuffer.ChangeData());
const Image_ColorRGBA* aRowDataRgba = (const Image_ColorRGBA* )aRowBuffer.Data();
- if (theImage.Format() == Image_PixMap::ImgBGR)
+ if (theImage.Format() == Image_Format_BGR)
{
convertRowFromRgba ((Image_ColorBGR* )theImage.ChangeRow (aRow), aRowDataRgba, theImage.SizeX());
}
aTextureTypeArg.UpperCase();
if (aTextureTypeArg == "1D")
{
- anImage->InitWrapper (Image_PixMap::ImgRGB, (Standard_Byte*)aBitmap, 8, 1);
+ anImage->InitWrapper (Image_Format_RGB, (Standard_Byte*)aBitmap, 8, 1);
}
else if (aTextureTypeArg == "2D")
{
- anImage->InitTrash (Image_PixMap::ImgRGB, 8, 8);
+ anImage->InitTrash (Image_Format_RGB, 8, 8);
for (Standard_Integer aRow = 0; aRow < 8; ++aRow)
{
for (Standard_Integer aCol = 0; aCol < 8; ++aCol)
myDepthMax (-RealLast()),
myToInverse(theToInverse)
{
- myUnnormImage.InitZero (Image_PixMap::ImgGrayF, thePixMap.SizeX(), thePixMap.SizeY());
+ myUnnormImage.InitZero (Image_Format_GrayF, thePixMap.SizeX(), thePixMap.SizeY());
}
//! Accumulate the data.
|| theImage.SizeX() != Standard_Size(aTargetSize.x())
|| theImage.SizeY() != Standard_Size(aTargetSize.y()))
{
- Image_PixMap::ImgFormat aFormat = Image_PixMap::ImgUNKNOWN;
+ Image_Format aFormat = Image_Format_UNKNOWN;
switch (theParams.BufferType)
{
- case Graphic3d_BT_RGB: aFormat = Image_PixMap::ImgRGB; break;
- case Graphic3d_BT_RGBA: aFormat = Image_PixMap::ImgRGBA; break;
- case Graphic3d_BT_Depth: aFormat = Image_PixMap::ImgGrayF; break;
+ case Graphic3d_BT_RGB: aFormat = Image_Format_RGB; break;
+ case Graphic3d_BT_RGBA: aFormat = Image_Format_RGBA; break;
+ case Graphic3d_BT_Depth: aFormat = Image_Format_GrayF; break;
}
if (!theImage.InitZero (aFormat, Standard_Size(aTargetSize.x()), Standard_Size(aTargetSize.y())))
}
Image_AlienPixMap aPixMap;
- Image_PixMap::ImgFormat aFormat = Image_PixMap::ImgUNKNOWN;
+ Image_Format aFormat = Image_Format_UNKNOWN;
switch (aParams.BufferType)
{
- case Graphic3d_BT_RGB: aFormat = Image_PixMap::ImgRGB; break;
- case Graphic3d_BT_RGBA: aFormat = Image_PixMap::ImgRGBA; break;
- case Graphic3d_BT_Depth: aFormat = Image_PixMap::ImgGrayF; break;
+ case Graphic3d_BT_RGB: aFormat = Image_Format_RGB; break;
+ case Graphic3d_BT_RGBA: aFormat = Image_Format_RGBA; break;
+ case Graphic3d_BT_Depth: aFormat = Image_Format_GrayF; break;
}
switch (aStereoPair)
std::cerr << "Could not load image from file '" << aFileName << "'!\n";
return 1;
}
- if (anImage->Format() == Image_PixMap::ImgGray)
+ if (anImage->Format() == Image_Format_Gray)
{
- anImage->SetFormat (Image_PixMap::ImgAlpha);
+ anImage->SetFormat (Image_Format_Alpha);
}
- else if (anImage->Format() == Image_PixMap::ImgGrayF)
+ else if (anImage->Format() == Image_Format_GrayF)
{
- anImage->SetFormat (Image_PixMap::ImgAlphaF);
+ anImage->SetFormat (Image_Format_AlphaF);
}
anAspect = new Graphic3d_AspectMarker3d (anImage);
}
return 1;
}
- Image_PixMap::ImgFormat aFormat = Image_PixMap::ImgRGBA;
- Graphic3d_BufferType aBufferType = Graphic3d_BT_RGBA;
+ Image_Format aFormat = Image_Format_RGBA;
+ Graphic3d_BufferType aBufferType = Graphic3d_BT_RGBA;
Standard_Integer aWidth, aHeight;
aView->Window()->Size (aWidth, aHeight);
Standard_Boolean toShowHls = Standard_False;
for (Standard_Integer anIter = 3; anIter < theArgNb; ++anIter)
{
- const char* aParam = theArgVec[anIter];
- if ( strcasecmp( aParam, "rgb" ) == 0 )
+ TCollection_AsciiString aParam (theArgVec[anIter]);
+ aParam.LowerCase();
+ if (aParam == "rgb")
{
- aFormat = Image_PixMap::ImgRGB;
+ aFormat = Image_Format_RGB;
aBufferType = Graphic3d_BT_RGB;
}
- else if ( strcasecmp( aParam, "hls" ) == 0 )
+ else if (aParam == "hls")
{
- aFormat = Image_PixMap::ImgRGB;
+ aFormat = Image_Format_RGB;
aBufferType = Graphic3d_BT_RGB;
toShowHls = Standard_True;
}
- else if ( strcasecmp( aParam, "rgbf" ) == 0 )
+ else if (aParam == "rgbf")
{
- aFormat = Image_PixMap::ImgRGBF;
+ aFormat = Image_Format_RGBF;
aBufferType = Graphic3d_BT_RGB;
}
- else if ( strcasecmp( aParam, "rgba" ) == 0 )
+ else if (aParam == "rgba")
{
- aFormat = Image_PixMap::ImgRGBA;
+ aFormat = Image_Format_RGBA;
aBufferType = Graphic3d_BT_RGBA;
}
- else if ( strcasecmp( aParam, "rgbaf" ) == 0 )
+ else if (aParam == "rgbaf")
{
- aFormat = Image_PixMap::ImgRGBAF;
+ aFormat = Image_Format_RGBAF;
aBufferType = Graphic3d_BT_RGBA;
}
- else if ( strcasecmp( aParam, "depth" ) == 0 )
+ else if (aParam == "depth")
{
- aFormat = Image_PixMap::ImgGrayF;
+ aFormat = Image_Format_GrayF;
aBufferType = Graphic3d_BT_Depth;
}
- else if ( strcasecmp( aParam, "name" ) == 0 )
+ else if (aParam == "name")
{
toShowName = Standard_True;
}
TCollection_AsciiString aFile;
StdSelect_TypeOfSelectionImage aType = StdSelect_TypeOfSelectionImage_NormalizedDepth;
- Image_PixMap::ImgFormat anImgFormat = Image_PixMap::ImgBGR;
+ Image_Format anImgFormat = Image_Format_BGR;
Standard_Integer aPickedIndex = 1;
for (Standard_Integer anArgIter = 1; anArgIter < theArgsNb; ++anArgIter)
{
|| aValue == "normalizeddepth")
{
aType = StdSelect_TypeOfSelectionImage_NormalizedDepth;
- anImgFormat = Image_PixMap::ImgGrayF;
+ anImgFormat = Image_Format_GrayF;
}
if (aValue == "depthinverted"
|| aValue == "normdepthinverted"
|| aValue == "inverted")
{
aType = StdSelect_TypeOfSelectionImage_NormalizedDepthInverted;
- anImgFormat = Image_PixMap::ImgGrayF;
+ anImgFormat = Image_Format_GrayF;
}
else if (aValue == "unnormdepth"
|| aValue == "unnormalizeddepth")
{
aType = StdSelect_TypeOfSelectionImage_UnnormalizedDepth;
- anImgFormat = Image_PixMap::ImgGrayF;
+ anImgFormat = Image_Format_GrayF;
}
else if (aValue == "objectcolor"
|| aValue == "object"