<commit_before>// Copyright 2008 <NAME>, all rights reserved.
//
// Concrete image classes.
//
extern "C" {
//#include "opencv/cv.h"
#include "opencv/highgui.h"
}

#include <string>

#include "libmv/public/base.h"
#include "libmv/public/image.h"

namespace libmv {

// Private class that wraps an IplImage
class LibmvImage : public Image {
 public:
  // Takes ownership of image.
  LibmvImage(IplImage *image)
    : image_(image) {};

  ~LibmvImage() {
    cvReleaseImage(&image_);
  }
  char *Pixels() {
    return image_->imageData;
  }
  int Width() {
    return image_->width;
  }
  int Height() {
    return image_->height;
  }
  int Depth() {
    return image_->depth;
  }
 private:
  LibmvImage();
  IplImage *image_;
};

Image *LoadImage(const char *filename) {
  IplImage *image = cvLoadImage(filename);
  if (image) {
    return new LibmvImage(image);
  }
  return NULL;
}

Image *LoadImage(const string &filename) {
  return LoadImage(filename.c_str());
}

// TESTING
//#include <vil/vil_image_view.h>
//#include <vil/vil_load.h>
//#include <vil/vil_save.h>
//#include <vil/vil_convert.h>

/*
typedef vil_image_view<float> Image;

Image Image_load(const char *filename)
{
        vil_image_view<vxl_byte> tmp;
        tmp = vil_load(filename);
        Image res(tmp.ni(),tmp.nj(),1,tmp.nplanes());
        vil_convert_cast(tmp,res);
        return res;
}
void Image_save(const Image &im, const char *filename)
{
        vil_image_view<vxl_byte> tmp(im.ni(),im.nj(),1,im.nplanes());
        vil_convert_cast(im,tmp);
        vil_save(tmp,filename);
}
*/
// END TESTING

}  // namespace libmv
<commit_msg>Remove VXL test code I left in by accident.<commit_after>// Copyright 2008 <NAME>, all rights reserved.
//
// Concrete image classes. For now based on OpenCV.

extern "C" {
#include "opencv/highgui.h"
}

#include <string>

#include "libmv/public/base.h"
#include "libmv/public/image.h"

namespace libmv {

// Private class that wraps an IplImage
class LibmvImage : public Image {
 public:
  // Takes ownership of image.
  LibmvImage(IplImage *image)
    : image_(image) {};

  ~LibmvImage() {
    cvReleaseImage(&image_);
  }
  char *Pixels() {
    return image_->imageData;
  }
  int Width() {
    return image_->width;
  }
  int Height() {
    return image_->height;
  }
  int Depth() {
    return image_->depth;
  }
 private:
  LibmvImage();
  IplImage *image_;
};

Image *LoadImage(const char *filename) {
  IplImage *image = cvLoadImage(filename);
  if (image) {
    return new LibmvImage(image);
  }
  return NULL;
}

Image *LoadImage(const string &filename) {
  return LoadImage(filename.c_str());
}
}  // namespace libmv

{'fraction_non_alphanumeric': 0.146046159667045, 'fraction_numerical': 0.0037835792659856224, 'mean_word_length': 3.355848434925865, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4411633', 'n_tokens_mistral': 960, 'n_tokens_neox': 934, 'n_words': 221}