ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
colmap::Bitmap Class Reference

#include <bitmap.h>

Public Member Functions

 Bitmap ()
 
 Bitmap (const Bitmap &other)
 
 Bitmap (Bitmap &&other)
 
 Bitmap (FIBITMAP *data)
 
Bitmapoperator= (const Bitmap &other)
 
Bitmapoperator= (Bitmap &&other)
 
bool Allocate (const int width, const int height, const bool as_rgb)
 
void Deallocate ()
 
const FIBITMAP * Data () const
 
FIBITMAP * Data ()
 
int Width () const
 
int Height () const
 
int Channels () const
 
unsigned int BitsPerPixel () const
 
unsigned int ScanWidth () const
 
bool IsRGB () const
 
bool IsGrey () const
 
size_t NumBytes () const
 
std::vector< uint8_t > ConvertToRawBits () const
 
std::vector< uint8_t > ConvertToRowMajorArray () const
 
std::vector< uint8_t > ConvertToColMajorArray () const
 
bool GetPixel (const int x, const int y, BitmapColor< uint8_t > *color) const
 
bool SetPixel (const int x, const int y, const BitmapColor< uint8_t > &color)
 
const uint8_t * GetScanline (const int y) const
 
void Fill (const BitmapColor< uint8_t > &color)
 
bool InterpolateNearestNeighbor (const double x, const double y, BitmapColor< uint8_t > *color) const
 
bool InterpolateBilinear (const double x, const double y, BitmapColor< float > *color) const
 
bool ExifCameraModel (std::string *camera_model) const
 
bool ExifFocalLength (double *focal_length) const
 
bool ExifLatitude (double *latitude) const
 
bool ExifLongitude (double *longitude) const
 
bool ExifAltitude (double *altitude) const
 
bool Read (const std::string &path, const bool as_rgb=true)
 
bool Write (const std::string &path, const FREE_IMAGE_FORMAT format=FIF_UNKNOWN, const int flags=0) const
 
void Smooth (const float sigma_x, const float sigma_y)
 
void Rescale (const int new_width, const int new_height, const FREE_IMAGE_FILTER filter=FILTER_BILINEAR)
 
Bitmap Clone () const
 
Bitmap CloneAsGrey () const
 
Bitmap CloneAsRGB () const
 
void CloneMetadata (Bitmap *target) const
 
bool ReadExifTag (const FREE_IMAGE_MDMODEL model, const std::string &tag_name, std::string *result) const
 

Detailed Description

Definition at line 51 of file bitmap.h.

Constructor & Destructor Documentation

◆ Bitmap() [1/4]

colmap::Bitmap::Bitmap ( )

Definition at line 69 of file bitmap.cc.

Referenced by Clone(), CloneAsGrey(), and CloneAsRGB().

◆ Bitmap() [2/4]

colmap::Bitmap::Bitmap ( const Bitmap other)

Definition at line 72 of file bitmap.cc.

◆ Bitmap() [3/4]

colmap::Bitmap::Bitmap ( Bitmap &&  other)

Definition at line 78 of file bitmap.cc.

◆ Bitmap() [4/4]

colmap::Bitmap::Bitmap ( FIBITMAP *  data)
explicit

Definition at line 85 of file bitmap.cc.

References data.

Member Function Documentation

◆ Allocate()

◆ BitsPerPixel()

unsigned int colmap::Bitmap::BitsPerPixel ( ) const
inline

Definition at line 253 of file bitmap.h.

Referenced by BOOST_AUTO_TEST_CASE(), and ConvertToRawBits().

◆ Channels()

int colmap::Bitmap::Channels ( ) const
inline

Definition at line 251 of file bitmap.h.

Referenced by BOOST_AUTO_TEST_CASE().

◆ Clone()

Bitmap colmap::Bitmap::Clone ( ) const

Definition at line 586 of file bitmap.cc.

References Bitmap().

Referenced by BOOST_AUTO_TEST_CASE(), CloneAsGrey(), and CloneAsRGB().

◆ CloneAsGrey()

Bitmap colmap::Bitmap::CloneAsGrey ( ) const

Definition at line 588 of file bitmap.cc.

References Bitmap(), Clone(), and IsGrey().

Referenced by BOOST_AUTO_TEST_CASE(), and colmap::DetectLineSegments().

◆ CloneAsRGB()

Bitmap colmap::Bitmap::CloneAsRGB ( ) const

Definition at line 596 of file bitmap.cc.

References Bitmap(), Clone(), and IsRGB().

Referenced by BOOST_AUTO_TEST_CASE().

◆ CloneMetadata()

void colmap::Bitmap::CloneMetadata ( Bitmap target) const

Definition at line 604 of file bitmap.cc.

References Data().

Referenced by colmap::RectifyAndUndistortStereoImages(), and colmap::UndistortImage().

◆ ConvertToColMajorArray()

std::vector< uint8_t > colmap::Bitmap::ConvertToColMajorArray ( ) const

Definition at line 162 of file bitmap.cc.

References x, and y.

Referenced by BOOST_AUTO_TEST_CASE().

◆ ConvertToRawBits()

std::vector< uint8_t > colmap::Bitmap::ConvertToRawBits ( ) const

Definition at line 136 of file bitmap.cc.

References BitsPerPixel(), and ScanWidth().

Referenced by colmap::ExtractSiftFeaturesGPU().

◆ ConvertToRowMajorArray()

std::vector< uint8_t > colmap::Bitmap::ConvertToRowMajorArray ( ) const

◆ Data() [1/2]

FIBITMAP * colmap::Bitmap::Data ( )
inline

Definition at line 246 of file bitmap.h.

◆ Data() [2/2]

const FIBITMAP * colmap::Bitmap::Data ( ) const
inline

Definition at line 247 of file bitmap.h.

Referenced by BOOST_AUTO_TEST_CASE(), CloneMetadata(), and colmap::mvs::Image::Rescale().

◆ Deallocate()

void colmap::Bitmap::Deallocate ( )

Definition at line 121 of file bitmap.cc.

Referenced by BOOST_AUTO_TEST_CASE().

◆ ExifAltitude()

bool colmap::Bitmap::ExifAltitude ( double *  altitude) const

Definition at line 472 of file bitmap.cc.

References ReadExifTag(), and result.

Referenced by colmap::ImageReader::Next().

◆ ExifCameraModel()

bool colmap::Bitmap::ExifCameraModel ( std::string *  camera_model) const

Definition at line 306 of file bitmap.cc.

References ReadExifTag(), and patch::to_string().

Referenced by colmap::ImageReader::Next().

◆ ExifFocalLength()

bool colmap::Bitmap::ExifFocalLength ( double *  focal_length) const

Definition at line 336 of file bitmap.cc.

References colmap::CameraDatabase::QuerySensorWidth(), ReadExifTag(), and result.

Referenced by colmap::ImageReader::Next().

◆ ExifLatitude()

bool colmap::Bitmap::ExifLatitude ( double *  latitude) const

Definition at line 416 of file bitmap.cc.

References ReadExifTag(), result, colmap::StringToLower(), and colmap::StringTrim().

Referenced by colmap::ImageReader::Next().

◆ ExifLongitude()

bool colmap::Bitmap::ExifLongitude ( double *  longitude) const

Definition at line 444 of file bitmap.cc.

References ReadExifTag(), result, colmap::StringToLower(), and colmap::StringTrim().

Referenced by colmap::ImageReader::Next().

◆ Fill()

void colmap::Bitmap::Fill ( const BitmapColor< uint8_t > &  color)

◆ GetPixel()

bool colmap::Bitmap::GetPixel ( const int  x,
const int  y,
BitmapColor< uint8_t > *  color 
) const

Definition at line 178 of file bitmap.cc.

References color, IsGrey(), IsRGB(), x, and y.

Referenced by colmap::BitmapToQImageRGB(), BOOST_AUTO_TEST_CASE(), and InterpolateNearestNeighbor().

◆ GetScanline()

const uint8_t * colmap::Bitmap::GetScanline ( const int  y) const

Definition at line 220 of file bitmap.cc.

References y.

Referenced by BOOST_AUTO_TEST_CASE().

◆ Height()

◆ InterpolateBilinear()

◆ InterpolateNearestNeighbor()

bool colmap::Bitmap::InterpolateNearestNeighbor ( const double  x,
const double  y,
BitmapColor< uint8_t > *  color 
) const

Definition at line 241 of file bitmap.cc.

References color, GetPixel(), x, and y.

Referenced by BOOST_AUTO_TEST_CASE().

◆ IsGrey()

◆ IsRGB()

◆ NumBytes()

size_t colmap::Bitmap::NumBytes ( ) const

Definition at line 128 of file bitmap.cc.

References ScanWidth().

Referenced by BOOST_AUTO_TEST_CASE().

◆ operator=() [1/2]

Bitmap & colmap::Bitmap::operator= ( Bitmap &&  other)

Definition at line 94 of file bitmap.cc.

◆ operator=() [2/2]

Bitmap & colmap::Bitmap::operator= ( const Bitmap other)

Definition at line 87 of file bitmap.cc.

◆ Read()

◆ ReadExifTag()

bool colmap::Bitmap::ReadExifTag ( const FREE_IMAGE_MDMODEL  model,
const std::string &  tag_name,
std::string *  result 
) const

Definition at line 610 of file bitmap.cc.

References result.

Referenced by ExifAltitude(), ExifCameraModel(), ExifFocalLength(), ExifLatitude(), and ExifLongitude().

◆ Rescale()

void colmap::Bitmap::Rescale ( const int  new_width,
const int  new_height,
const FREE_IMAGE_FILTER  filter = FILTER_BILINEAR 
)

◆ ScanWidth()

unsigned int colmap::Bitmap::ScanWidth ( ) const
inline

Definition at line 257 of file bitmap.h.

Referenced by ConvertToRawBits(), colmap::ExtractSiftFeaturesGPU(), and NumBytes().

◆ SetPixel()

◆ Smooth()

void colmap::Bitmap::Smooth ( const float  sigma_x,
const float  sigma_y 
)

Definition at line 553 of file bitmap.cc.

References x, and y.

Referenced by BOOST_AUTO_TEST_CASE().

◆ Width()

◆ Write()

bool colmap::Bitmap::Write ( const std::string &  path,
const FREE_IMAGE_FORMAT  format = FIF_UNKNOWN,
const int  flags = 0 
) const

Definition at line 523 of file bitmap.cc.

References format, and cloudViewer::t::geometry::path.


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