MCPcopy Create free account
hub / github.com/colmap/colmap / SetPixel

Method SetPixel

src/colmap/sensor/bitmap.h:308–327  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

306}
307
308bool Bitmap::SetPixel(const int x,
309 const int y,
310 const BitmapColor<uint8_t>& color) {
311 if (x < 0 || x >= width_ || y < 0 || y >= height_) {
312 return false;
313 }
314
315 if (IsGrey()) {
316 data_[y * width_ + x] = color.r;
317 return true;
318 } else if (IsRGB()) {
319 uint8_t* pixel = &data_[(y * width_ + x) * channels_];
320 pixel[0] = color.r;
321 pixel[1] = color.g;
322 pixel[2] = color.b;
323 return true;
324 }
325
326 return false;
327}
328
329} // namespace colmap

Callers 15

SynthesizeImagesFunction · 0.80
CreateTestBitmapFunction · 0.80
CreateTestBitmapFunction · 0.80
TESTFunction · 0.80
WarpImageBetweenCamerasFunction · 0.80
WarpImageWithHomographyFunction · 0.80
TESTFunction · 0.80
GenerateRandomBitmapFunction · 0.80
DrawLineFunction · 0.80
ToBitmapMethod · 0.80
ToBitmapMethod · 0.80

Calls

no outgoing calls

Tested by 10

CreateTestBitmapFunction · 0.64
CreateTestBitmapFunction · 0.64
TESTFunction · 0.64
TESTFunction · 0.64
GenerateRandomBitmapFunction · 0.64
DrawLineFunction · 0.64
TESTFunction · 0.64
TEST_PFunction · 0.64
CreateImageWithSquareFunction · 0.64
CreateRandomRgbImageFunction · 0.64