PetaVision  Alpha
PV::Image Class Reference
Inheritance diagram for PV::Image:
PV::Buffer< float >

Public Types

enum  Anchor
 

Public Member Functions

 Image (std::string filename)
 
 Image (const std::vector< float > &data, int width, int height, int channels)
 
std::vector< float > asVector () const
 
floatconst at (int x, int y, int feature) const
 
floatconst at (int k) const
 
void convertToColor (bool alphaChannel)
 
void convertToGray (bool alphaChannel)
 
void crop (int newWidth, int newHeight, enum Anchor anchor)
 
void flip (bool xFlip, bool yFlip)
 
int getFeatures () const
 
int getHeight () const
 
float getPixelA (int x, int y)
 
float getPixelB (int x, int y)
 
float getPixelG (int x, int y)
 
float getPixelR (int x, int y)
 
int getTotalElements () const
 
int getWidth () const
 
void grow (int newWidth, int newHeight, enum Anchor anchor)
 
void read (std::string filename)
 
void resize (int width, int height, int features)
 
void set (int x, int y, int feature, floatvalue)
 
void set (int k, floatvalue)
 
void set (const std::vector< float > &vector, int width, int height, int features)
 
void set (const float *data, int width, int height, int features)
 
void set (Buffer< float > other)
 
void setPixel (int x, int y, float r, float g, float b)
 
void setPixel (int x, int y, float r, float g, float b, float a)
 
void translate (int offsetX, int offsetY)
 
void write (std::string filename)
 

Static Public Attributes

static constexpr const float mBToGray = 0.11f
 
static constexpr const float mGToGray = 0.59f
 
static constexpr const float mRToGray = 0.30f
 

Protected Member Functions

int index (int x, int y, int f) const
 

Static Protected Member Functions

static int getAnchorX (enum Anchor anchor, int smallerWidth, int biggerWidth)
 
static int getAnchorY (enum Anchor anchor, int smallerHeight, int biggerHeight)
 

Protected Attributes

const int mAPos = 3
 
const int mBPos = 2
 
std::vector< float > mData
 
int mFeatures
 
const int mGPos = 1
 
int mHeight
 
const int mRPos = 0
 
int mWidth
 

Detailed Description

Definition at line 14 of file Image.hpp.


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