From 3bf9df6b2785fa6d951086978a3e66f49427166a Mon Sep 17 00:00:00 2001 From: FluorescentCIAAfricanAmerican <0934gj3049fk@protonmail.com> Date: Wed, 22 Apr 2020 12:56:21 -0400 Subject: 1 --- bitmap/float_bm3.cpp | 108 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 bitmap/float_bm3.cpp (limited to 'bitmap/float_bm3.cpp') diff --git a/bitmap/float_bm3.cpp b/bitmap/float_bm3.cpp new file mode 100644 index 0000000..83d4630 --- /dev/null +++ b/bitmap/float_bm3.cpp @@ -0,0 +1,108 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +//===========================================================================// + +#include +#include +#include +#include +#include +#include "bitmap/float_bm.h" +#include "vstdlib/vstdlib.h" +#include "vstdlib/random.h" +#include "tier1/strtools.h" + +void FloatBitMap_t::InitializeWithRandomPixelsFromAnotherFloatBM(FloatBitMap_t const &other) +{ + for(int y=0;yPixel(x,y,c)=sum/sumweights; + } + } + return newbm; +} + +FloatImagePyramid_t::FloatImagePyramid_t(FloatBitMap_t const &src, ImagePyramidMode_t mode) +{ + memset(m_pLevels,0,sizeof(m_pLevels)); + m_nLevels=1; + m_pLevels[0]=new FloatBitMap_t(&src); + ReconstructLowerResolutionLevels(0); +} + +void FloatImagePyramid_t::ReconstructLowerResolutionLevels(int start_level) +{ + while( (m_pLevels[start_level]->Width>1) && (m_pLevels[start_level]->Height>1) ) + { + if (m_pLevels[start_level+1]) + delete m_pLevels[start_level+1]; + m_pLevels[start_level+1]=m_pLevels[start_level]->QuarterSizeWithGaussian(); + start_level++; + } + m_nLevels=start_level+1; +} + +float & FloatImagePyramid_t::Pixel(int x, int y, int component, int level) const +{ + assert(levelPixel(x,y,component); +} + +void FloatImagePyramid_t::WriteTGAs(char const *basename) const +{ + for(int l=0;lWriteTGAFile(bname_out); + } + +} + + +FloatImagePyramid_t::~FloatImagePyramid_t(void) +{ + for(int l=0;l