1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-08 14:17:06 +03:00

Coding - Update method guards for consistency #333

Apply new regex replacement with method's guards in .cxx
Update GH workflow with style checking
This commit is contained in:
Pasukhin Dmitry
2025-02-03 12:16:00 +01:00
committed by GitHub
parent 3ce9ec7651
commit 1f386af59f
283 changed files with 4815 additions and 9694 deletions

View File

@@ -445,10 +445,8 @@ static WICPixelFormatGUID convertToWicFormat(Image_Format theFormat)
#endif
} // namespace
// =======================================================================
// function : Image_AlienPixMap
// purpose :
// =======================================================================
//=================================================================================================
Image_AlienPixMap::Image_AlienPixMap()
#ifdef HAVE_WINCODEC
: myPalette(NULL)
@@ -459,19 +457,15 @@ Image_AlienPixMap::Image_AlienPixMap()
SetTopDown(false);
}
// =======================================================================
// function : ~Image_AlienPixMap
// purpose :
// =======================================================================
//=================================================================================================
Image_AlienPixMap::~Image_AlienPixMap()
{
Clear();
}
// =======================================================================
// function : InitWrapper
// purpose :
// =======================================================================
//=================================================================================================
bool Image_AlienPixMap::InitWrapper(Image_Format,
Standard_Byte*,
const Standard_Size,
@@ -482,10 +476,8 @@ bool Image_AlienPixMap::InitWrapper(Image_Format,
return false;
}
// =======================================================================
// function : InitTrash
// purpose :
// =======================================================================
//=================================================================================================
#ifdef HAVE_FREEIMAGE
bool Image_AlienPixMap::InitTrash(Image_Format thePixelFormat,
const Standard_Size theSizeX,
@@ -562,10 +554,8 @@ bool Image_AlienPixMap::InitTrash(Image_Format thePixelFormat,
}
#endif
// =======================================================================
// function : InitCopy
// purpose :
// =======================================================================
//=================================================================================================
bool Image_AlienPixMap::InitCopy(const Image_PixMap& theCopy)
{
if (&theCopy == this)
@@ -601,10 +591,8 @@ bool Image_AlienPixMap::InitCopy(const Image_PixMap& theCopy)
return false;
}
// =======================================================================
// function : Clear
// purpose :
// =======================================================================
//=================================================================================================
void Image_AlienPixMap::Clear()
{
Image_PixMap::Clear();
@@ -629,10 +617,8 @@ void Image_AlienPixMap::Clear()
#endif
}
// =======================================================================
// function : IsTopDownDefault
// purpose :
// =======================================================================
//=================================================================================================
bool Image_AlienPixMap::IsTopDownDefault()
{
#ifdef HAVE_FREEIMAGE
@@ -644,10 +630,8 @@ bool Image_AlienPixMap::IsTopDownDefault()
#endif
}
// =======================================================================
// function : Load
// purpose :
// =======================================================================
//=================================================================================================
#ifdef HAVE_FREEIMAGE
bool Image_AlienPixMap::Load(const Standard_Byte* theData,
const Standard_Size theLength,
@@ -1031,10 +1015,8 @@ bool Image_AlienPixMap::Load(const Standard_Byte*,
}
#endif
// =======================================================================
// function : savePPM
// purpose :
// =======================================================================
//=================================================================================================
bool Image_AlienPixMap::savePPM(const TCollection_AsciiString& theFileName) const
{
if (IsEmpty())
@@ -1075,10 +1057,8 @@ bool Image_AlienPixMap::savePPM(const TCollection_AsciiString& theFileName) cons
return true;
}
// =======================================================================
// function : convertData
// purpose :
// =======================================================================
//=================================================================================================
#ifdef HAVE_WINCODEC
static bool convertData(const Image_AlienPixMap& theSrcPixMapData,
const WICPixelFormatGUID& theFormat,
@@ -1132,10 +1112,8 @@ static bool convertData(const Image_AlienPixMap& theSrcPixMapData,
}
#endif
// =======================================================================
// function : Save
// purpose :
// =======================================================================
//=================================================================================================
bool Image_AlienPixMap::Save(Standard_Byte* theBuffer,
const Standard_Size theLength,
const TCollection_AsciiString& theFileName)
@@ -1557,10 +1535,8 @@ bool Image_AlienPixMap::Save(std::ostream& theStream, const TCollection_AsciiStr
#endif
}
// =======================================================================
// function : AdjustGamma
// purpose :
// =======================================================================
//=================================================================================================
bool Image_AlienPixMap::AdjustGamma(const Standard_Real theGammaCorr)
{
#ifdef HAVE_FREEIMAGE
@@ -1572,10 +1548,8 @@ bool Image_AlienPixMap::AdjustGamma(const Standard_Real theGammaCorr)
}
#ifdef HAVE_FREEIMAGE
// =======================================================================
// function : GetImageToDump
// purpose :
// =======================================================================
//=================================================================================================
FIBITMAP* Image_AlienPixMap::getImageToDump(const Standard_Integer theFormat)
{
FIBITMAP* anImageToDump = myLibImage;

View File

@@ -64,10 +64,8 @@ struct Image_DDSParser::DDSFileHeader
uint32_t Reserved2;
};
// =======================================================================
// function : Load
// purpose :
// =======================================================================
//=================================================================================================
Handle(Image_CompressedPixMap) Image_DDSParser::Load(
const Handle(Image_SupportedFormats)& theSupported,
const TCollection_AsciiString& theFile,
@@ -135,10 +133,8 @@ Handle(Image_CompressedPixMap) Image_DDSParser::Load(
return aDef;
}
// =======================================================================
// function : Load
// purpose :
// =======================================================================
//=================================================================================================
Handle(Image_CompressedPixMap) Image_DDSParser::Load(
const Handle(Image_SupportedFormats)& theSupported,
const Handle(NCollection_Buffer)& theBuffer,
@@ -187,10 +183,8 @@ Handle(Image_CompressedPixMap) Image_DDSParser::Load(
return aDef;
}
// =======================================================================
// function : parseHeader
// purpose :
// =======================================================================
//=================================================================================================
Handle(Image_CompressedPixMap) Image_DDSParser::parseHeader(const DDSFileHeader& theHeader)
{
if (theHeader.Size != 124 || theHeader.Width == 0 || theHeader.Height == 0

View File

@@ -62,10 +62,8 @@ static bool isBlackPixel(const Image_PixMap& theData, Standard_Size theY, Standa
} // namespace
// =======================================================================
// function : Image_Diff
// purpose :
// =======================================================================
//=================================================================================================
Image_Diff::Image_Diff()
: myColorTolerance(0.0),
myIsBorderFilterOn(Standard_False)
@@ -73,19 +71,15 @@ Image_Diff::Image_Diff()
//
}
// =======================================================================
// function : ~Image_Diff
// purpose :
// =======================================================================
//=================================================================================================
Image_Diff::~Image_Diff()
{
releaseGroupsOfDiffPixels();
}
// =======================================================================
// function : Init
// purpose :
// =======================================================================
//=================================================================================================
Standard_Boolean Image_Diff::Init(const Handle(Image_PixMap)& theImageRef,
const Handle(Image_PixMap)& theImageNew,
const Standard_Boolean theToBlackWhite)
@@ -118,10 +112,8 @@ Standard_Boolean Image_Diff::Init(const Handle(Image_PixMap)& theImageRef,
return Standard_True;
}
// =======================================================================
// function : Init
// purpose :
// =======================================================================
//=================================================================================================
Standard_Boolean Image_Diff::Init(const TCollection_AsciiString& theImgPathRef,
const TCollection_AsciiString& theImgPathNew,
const Standard_Boolean theToBlackWhite)
@@ -136,10 +128,8 @@ Standard_Boolean Image_Diff::Init(const TCollection_AsciiString& theImgPathRef,
return Init(anImgRef, anImgNew, theToBlackWhite);
}
// =======================================================================
// function : Compare
// purpose :
// =======================================================================
//=================================================================================================
Standard_Integer Image_Diff::Compare()
{
// Number of different pixels (by color)
@@ -249,10 +239,8 @@ Standard_Integer Image_Diff::Compare()
return aNbDiffColors;
}
// =======================================================================
// function : SaveDiffImage
// purpose :
// =======================================================================
//=================================================================================================
Standard_Boolean Image_Diff::SaveDiffImage(Image_PixMap& theDiffImage) const
{
if (myImageRef.IsNull() || myImageNew.IsNull())
@@ -380,10 +368,8 @@ Standard_Boolean Image_Diff::SaveDiffImage(Image_PixMap& theDiffImage) const
return Standard_True;
}
// =======================================================================
// function : SaveDiffImage
// purpose :
// =======================================================================
//=================================================================================================
Standard_Boolean Image_Diff::SaveDiffImage(const TCollection_AsciiString& theDiffPath) const
{
if (myImageRef.IsNull() || myImageNew.IsNull() || theDiffPath.IsEmpty())
@@ -402,10 +388,8 @@ Standard_Boolean Image_Diff::SaveDiffImage(const TCollection_AsciiString& theDif
return aDiff.Save(theDiffPath);
}
// =======================================================================
// function : ignoreBorderEffect
// purpose :
// =======================================================================
//=================================================================================================
Standard_Integer Image_Diff::ignoreBorderEffect()
{
if (myImageRef.IsNull() || myImageNew.IsNull())
@@ -557,10 +541,8 @@ Standard_Integer Image_Diff::ignoreBorderEffect()
return aNbDiffColors;
}
// =======================================================================
// function : releaseGroupsOfDiffPixels
// purpose :
// =======================================================================
//=================================================================================================
void Image_Diff::releaseGroupsOfDiffPixels()
{
myGroupsOfDiffPixels.Clear();

View File

@@ -94,66 +94,52 @@ static const Image_FormatInfo Image_Table_ImageFormats[Image_CompressedFormat_NB
IMPLEMENT_STANDARD_RTTIEXT(Image_PixMapData, NCollection_Buffer)
IMPLEMENT_STANDARD_RTTIEXT(Image_PixMap, Standard_Transient)
// =======================================================================
// function : DefaultAllocator
// purpose :
// =======================================================================
//=================================================================================================
const Handle(NCollection_BaseAllocator)& Image_PixMap::DefaultAllocator()
{
static const Handle(NCollection_BaseAllocator) THE_ALLOC = new NCollection_AlignedAllocator(16);
return THE_ALLOC;
}
// =======================================================================
// function : ImageFormatToString
// purpose :
// =======================================================================
//=================================================================================================
Standard_CString Image_PixMap::ImageFormatToString(Image_Format theFormat)
{
return Image_Table_ImageFormats[theFormat].Name;
}
// =======================================================================
// function : ImageFormatToString
// purpose :
// =======================================================================
//=================================================================================================
Standard_CString Image_PixMap::ImageFormatToString(Image_CompressedFormat theFormat)
{
return Image_Table_ImageFormats[theFormat].Name;
}
// =======================================================================
// function : Image_PixMap
// purpose :
// =======================================================================
//=================================================================================================
Image_PixMap::Image_PixMap()
: myImgFormat(Image_Format_Gray)
{
//
}
// =======================================================================
// function : ~Image_PixMap
// purpose :
// =======================================================================
//=================================================================================================
Image_PixMap::~Image_PixMap()
{
Clear();
}
// =======================================================================
// function : SizePixelBytes
// purpose :
// =======================================================================
//=================================================================================================
Standard_Size Image_PixMap::SizePixelBytes(const Image_Format thePixelFormat)
{
return Image_Table_ImageFormats[thePixelFormat].PixelSize;
}
// =======================================================================
// function : SetFormat
// purpose :
// =======================================================================
//=================================================================================================
void Image_PixMap::SetFormat(Image_Format thePixelFormat)
{
if (myImgFormat == thePixelFormat)
@@ -170,10 +156,8 @@ void Image_PixMap::SetFormat(Image_Format thePixelFormat)
myImgFormat = thePixelFormat;
}
// =======================================================================
// function : InitWrapper3D
// purpose :
// =======================================================================
//=================================================================================================
bool Image_PixMap::InitWrapper3D(Image_Format thePixelFormat,
Standard_Byte* theDataPtr,
const NCollection_Vec3<Standard_Size>& theSizeXYZ,
@@ -195,10 +179,8 @@ bool Image_PixMap::InitWrapper3D(Image_Format thePixel
return true;
}
// =======================================================================
// function : InitWrapper
// purpose :
// =======================================================================
//=================================================================================================
bool Image_PixMap::InitWrapper(Image_Format thePixelFormat,
Standard_Byte* theDataPtr,
const Standard_Size theSizeX,
@@ -211,10 +193,8 @@ bool Image_PixMap::InitWrapper(Image_Format thePixelFormat,
theSizeRowBytes);
}
// =======================================================================
// function : InitTrash3D
// purpose :
// =======================================================================
//=================================================================================================
bool Image_PixMap::InitTrash3D(Image_Format thePixelFormat,
const NCollection_Vec3<Standard_Size>& theSizeXYZ,
const Standard_Size theSizeRowBytes)
@@ -237,10 +217,8 @@ bool Image_PixMap::InitTrash3D(Image_Format thePixelFo
return !myData.IsEmpty();
}
// =======================================================================
// function : InitTrash
// purpose :
// =======================================================================
//=================================================================================================
bool Image_PixMap::InitTrash(Image_Format thePixelFormat,
const Standard_Size theSizeX,
const Standard_Size theSizeY,
@@ -251,10 +229,8 @@ bool Image_PixMap::InitTrash(Image_Format thePixelFormat,
theSizeRowBytes);
}
// =======================================================================
// function : InitZero3D
// purpose :
// =======================================================================
//=================================================================================================
bool Image_PixMap::InitZero3D(Image_Format thePixelFormat,
const NCollection_Vec3<Standard_Size>& theSizeXYZ,
const Standard_Size theSizeRowBytes,
@@ -278,10 +254,8 @@ bool Image_PixMap::InitZero3D(Image_Format thePixelFor
return true;
}
// =======================================================================
// function : InitCopy
// purpose :
// =======================================================================
//=================================================================================================
bool Image_PixMap::InitCopy(const Image_PixMap& theCopy)
{
if (&theCopy == this)
@@ -309,10 +283,8 @@ bool Image_PixMap::InitCopy(const Image_PixMap& theCopy)
return true;
}
// =======================================================================
// function : Clear
// purpose :
// =======================================================================
//=================================================================================================
void Image_PixMap::Clear()
{
Handle(NCollection_BaseAllocator) anEmptyAlloc;
@@ -323,10 +295,8 @@ void Image_PixMap::Clear()
nullptr);
}
// =======================================================================
// function : ColorFromRawPixel
// purpose :
// =======================================================================
//=================================================================================================
Quantity_ColorRGBA Image_PixMap::ColorFromRawPixel(const Standard_Byte* theRawValue,
const Image_Format theFormat,
const Standard_Boolean theToLinearize)
@@ -490,10 +460,8 @@ Quantity_ColorRGBA Image_PixMap::ColorFromRawPixel(const Standard_Byte* theRaw
return Quantity_ColorRGBA(0.0f, 0.0f, 0.0f, 0.0f); // transparent
}
// =======================================================================
// function : ColorToRawPixel
// purpose :
// =======================================================================
//=================================================================================================
void Image_PixMap::ColorToRawPixel(Standard_Byte* theRawValue,
const Image_Format theFormat,
const Quantity_ColorRGBA& theColor,
@@ -685,10 +653,8 @@ void Image_PixMap::ColorToRawPixel(Standard_Byte* theRawValue,
}
}
// =======================================================================
// function : SwapRgbaBgra
// purpose :
// =======================================================================
//=================================================================================================
bool Image_PixMap::SwapRgbaBgra(Image_PixMap& theImage)
{
switch (theImage.Format())
@@ -762,10 +728,8 @@ bool Image_PixMap::SwapRgbaBgra(Image_PixMap& theImage)
}
}
// =======================================================================
// function : ToBlackWhite
// purpose :
// =======================================================================
//=================================================================================================
void Image_PixMap::ToBlackWhite(Image_PixMap& theImage)
{
switch (theImage.Format())
@@ -852,10 +816,8 @@ void Image_PixMap::ToBlackWhite(Image_PixMap& theImage)
}
}
// =======================================================================
// function : FlipY
// purpose :
// =======================================================================
//=================================================================================================
bool Image_PixMap::FlipY(Image_PixMap& theImage)
{
if (theImage.IsEmpty() || theImage.SizeX() == 0 || theImage.SizeY() == 0)

View File

@@ -15,10 +15,8 @@
IMPLEMENT_STANDARD_RTTIEXT(Image_SupportedFormats, Standard_Transient)
// =======================================================================
// function : Image_SupportedFormats
// purpose :
// =======================================================================
//=================================================================================================
Image_SupportedFormats::Image_SupportedFormats()
: myFormats(Image_Format_UNKNOWN, Image_CompressedFormat_NB - 1),
myHasCompressed(false)

View File

@@ -23,10 +23,8 @@
IMPLEMENT_STANDARD_RTTIEXT(Image_Texture, Standard_Transient)
// ================================================================
// Function : Image_Texture
// Purpose :
// ================================================================
//=================================================================================================
Image_Texture::Image_Texture(const TCollection_AsciiString& theFileName)
: myImagePath(theFileName),
myOffset(-1),
@@ -39,10 +37,8 @@ Image_Texture::Image_Texture(const TCollection_AsciiString& theFileName)
}
}
// ================================================================
// Function : Image_Texture
// Purpose :
// ================================================================
//=================================================================================================
Image_Texture::Image_Texture(const TCollection_AsciiString& theFileName,
int64_t theOffset,
int64_t theLength)
@@ -59,10 +55,8 @@ Image_Texture::Image_Texture(const TCollection_AsciiString& theFileName,
}
}
// ================================================================
// Function : Image_Texture
// Purpose :
// ================================================================
//=================================================================================================
Image_Texture::Image_Texture(const Handle(NCollection_Buffer)& theBuffer,
const TCollection_AsciiString& theId)
: myBuffer(theBuffer),
@@ -75,10 +69,8 @@ Image_Texture::Image_Texture(const Handle(NCollection_Buffer)& theBuffer,
}
}
// ================================================================
// Function : ReadCompressedImage
// Purpose :
// ================================================================
//=================================================================================================
Handle(Image_CompressedPixMap) Image_Texture::ReadCompressedImage(
const Handle(Image_SupportedFormats)& theSupported) const
{
@@ -106,10 +98,8 @@ Handle(Image_CompressedPixMap) Image_Texture::ReadCompressedImage(
return Image_DDSParser::Load(theSupported, myImagePath, 0);
}
// ================================================================
// Function : ReadImage
// Purpose :
// ================================================================
//=================================================================================================
Handle(Image_PixMap) Image_Texture::ReadImage(const Handle(Image_SupportedFormats)&) const
{
Handle(Image_PixMap) anImage;
@@ -133,10 +123,8 @@ Handle(Image_PixMap) Image_Texture::ReadImage(const Handle(Image_SupportedFormat
return anImage;
}
// ================================================================
// Function : loadImageFile
// Purpose :
// ================================================================
//=================================================================================================
Handle(Image_PixMap) Image_Texture::loadImageFile(const TCollection_AsciiString& thePath) const
{
Handle(Image_AlienPixMap) anImage = new Image_AlienPixMap();
@@ -147,10 +135,8 @@ Handle(Image_PixMap) Image_Texture::loadImageFile(const TCollection_AsciiString&
return anImage;
}
// ================================================================
// Function : loadImageBuffer
// Purpose :
// ================================================================
//=================================================================================================
Handle(Image_PixMap) Image_Texture::loadImageBuffer(const Handle(NCollection_Buffer)& theBuffer,
const TCollection_AsciiString& theId) const
{
@@ -172,10 +158,8 @@ Handle(Image_PixMap) Image_Texture::loadImageBuffer(const Handle(NCollection_Buf
return anImage;
}
// ================================================================
// Function : loadImageOffset
// Purpose :
// ================================================================
//=================================================================================================
Handle(Image_PixMap) Image_Texture::loadImageOffset(const TCollection_AsciiString& thePath,
int64_t theOffset,
int64_t theLength) const
@@ -212,10 +196,8 @@ Handle(Image_PixMap) Image_Texture::loadImageOffset(const TCollection_AsciiStrin
return anImage;
}
// ================================================================
// Function : MimeType
// Purpose :
// ================================================================
//=================================================================================================
TCollection_AsciiString Image_Texture::MimeType() const
{
const TCollection_AsciiString aType = ProbeImageFileFormat();
@@ -238,10 +220,8 @@ TCollection_AsciiString Image_Texture::MimeType() const
return TCollection_AsciiString();
}
// ================================================================
// Function : ProbeImageFileFormat
// Purpose :
// ================================================================
//=================================================================================================
TCollection_AsciiString Image_Texture::ProbeImageFileFormat() const
{
static const Standard_Size THE_PROBE_SIZE = 20;
@@ -320,10 +300,8 @@ TCollection_AsciiString Image_Texture::ProbeImageFileFormat() const
return "";
}
// ================================================================
// Function : WriteImage
// Purpose :
// ================================================================
//=================================================================================================
Standard_Boolean Image_Texture::WriteImage(const TCollection_AsciiString& theFile)
{
const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
@@ -350,10 +328,8 @@ Standard_Boolean Image_Texture::WriteImage(const TCollection_AsciiString& theFil
return true;
}
// ================================================================
// Function : WriteImage
// Purpose :
// ================================================================
//=================================================================================================
Standard_Boolean Image_Texture::WriteImage(std::ostream& theStream,
const TCollection_AsciiString& theFile)
{