1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0028441: Coding Rules - move out nested Image_PixMap::ImgFormat enumeration to dedicated enum Image_Format

Enumeration Image_PixMap::ImgFormat, previously declared as nested
enumeration within class *Image_PixMap*,
has been moved to global namespace as Image_Format following OCCT coding rules.

The enumeration values have suffix Image_Format_ and preserve
previous name scheme for easy renaming of old values.
E.g. Image_PixMap::ImgGray become Image_Format_Gray.
Old definitions are preserved as depreacated aliases to the new ones.
This commit is contained in:
kgv
2017-02-05 13:47:27 +03:00
committed by bugmaster
parent e6afb53983
commit dc858f4c5a
25 changed files with 307 additions and 274 deletions

View File

@@ -492,8 +492,8 @@ Graphic3d_HatchStyle::Graphic3d_HatchStyle (const Handle(Image_PixMap)& thePatte
{
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);

View File

@@ -94,11 +94,11 @@ Handle(TColStd_HArray1OfByte) Graphic3d_MarkerImage::GetBitMapArray (const Stand
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;
}
@@ -142,7 +142,7 @@ const Handle(Image_PixMap)& Graphic3d_MarkerImage::GetImage()
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);
@@ -169,15 +169,15 @@ const Handle(Image_PixMap)& Graphic3d_MarkerImage::GetImageAlpha()
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++)

View File

@@ -57,7 +57,7 @@ public:
//!
//! 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.
@@ -73,7 +73,7 @@ public:
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; }
@@ -110,7 +110,7 @@ protected:
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
};