71 explicit CVImage(
const string& imageFilename,
72 bool flipVertical =
true,
73 bool loadGrayscaleIntoAlpha =
false);
84 bool isContinuous =
true);
85 void load(
const string& filename,
86 bool flipVertical =
true,
87 bool loadGrayscaleIntoAlpha =
false);
88 bool load(
int inWidth,
95 void savePNG(
const string& filename,
96 int compressionLevel = 6,
98 bool convertBGR2RGB =
true);
99 void saveJPG(
const string& filename,
100 int compressionLevel = 95,
102 bool convertBGR2RGB =
true);
113 void fill(uchar r, uchar g, uchar b);
114 void fill(uchar r, uchar g, uchar b, uchar a);
115 void crop(
float targetWdivH,
int& cropW,
int& cropH);
140 bool isContinuous =
false);
CVPixelFormatGL
Pixel format according to OpenGL pixel format defines.
vector< CVImage * > CVVImage
vector< cv::Vec3f > CVVVec3f
vector< cv::Vec4f > CVVVec4f
OpenCV image class with the same interface as the former SLImage class.
uint _bytesPerPixel
Number of bytes per pixel.
CVImage(const CVVVec4f &colors)
void resize(int width, int height)
CVVec4f getPixelf(float x, float y)
void setPixeliRGB(int x, int y, CVVec3f color)
setPixeli sets the RGB pixel color at the integer pixel coordinate x, y
void fill(uchar r, uchar g, uchar b)
Fills the image with a certain rgb color.
void flipX()
Flip X coordinates used to make JPEGs from top-left to bottom-left images.
CVPixelFormatGL _format
OpenGL pixel format.
void setPixeliRGBA(int x, int y, CVVec4f color)
setPixeli sets the RGBA pixel color at the integer pixel coordinate x, y
void clearData()
Deletes all data and resets the image parameters.
uint _bytesPerLine
Number of bytes per line (stride)
static string typeString(int cvMatTypeInt)
Returns the cv::Mat.type()) as string.
void savePNG(const string &filename, int compressionLevel=6, bool flipY=true, bool convertBGR2RGB=true)
Save as PNG at a certain compression level (0-9)
static int glPixelFormat2cvType(CVPixelFormatGL pixelFormatGL)
Converts OpenGL pixel format to OpenCV mat type.
uint _bytesPerImage
Number of bytes per image.
static CVPixelFormatGL cvType2glPixelFormat(int cvType)
Converts OpenCV mat type to OpenGL pixel format.
CVVec4f getPixeli(int x, int y)
getPixeli returns the pixel color at the integer pixel coordinate x, y
void saveJPG(const string &filename, int compressionLevel=95, bool flipY=true, bool convertBGR2RGB=true)
Save as JPG at a certain compression level (0-100)
string _path
path on the filesystem
CVMat _cvMat
OpenCV mat matrix image type.
void convertTo(int cvDataType)
Converts the data type of the cvMat.
bool allocate(int width, int height, CVPixelFormatGL pixelFormatGL, bool isContinuous=true)
Memory allocation function.
void flipY()
Flip Y coordinates used to make JPEGs from top-left to bottom-left images.
void load(const string &filename, bool flipVertical=true, bool loadGrayscaleIntoAlpha=false)
Loads the image with the appropriate image loader.
void setPixeli(int x, int y, CVVec4f color)
setPixeli sets the RGB pixel color at the integer pixel coordinate x, y
uint _bytesInFile
Number of bytes in file.
void crop(float targetWdivH, int &cropW, int &cropH)
string _name
Image name (e.g. from the filename)
CVImage()
Default constructor.