KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
kjb::Opengl_framebuffer_image Class Reference

#include <i_opengl_buf.h>

Inheritance diagram for kjb::Opengl_framebuffer_image:
kjb::Image

Public Member Functions

 Opengl_framebuffer_image (uint32_t x, uint32_t y, uint32_t height, uint32_t width)
 
- Public Member Functions inherited from kjb::Image
 Image (int rows=0, int cols=0)
 Construct image of specified size, defaults to zero by zero. More...
 
 Image (const kjb_c::Matrix &src)
 Construct grayscale image from c-style matrix. More...
 
 Image (const Matrix &src)
 Construct grayscale image from matrix. More...
 
 Image (const Image &src)
 Copy ctor, performs a deep copy (use sparingly) More...
 
 Image (const std::string &fname)
 Read image from a named file. More...
 
 Image (Impl_type *wrap_me)
 Wrap up an "unsafe" image so it is certain to be destroyed. More...
 
 Image (int num_rows, int num_cols, int r, int g, int b)
 Create an image with pixels initialized to the given value. More...
 
virtual ~Image ()
 Dtor simply wraps kjb_free_image() More...
 
void swap (Image &other)
 Swap the implementation of two images. More...
 
Imagescale (double factor)
 Scale the image by factor using imagemagick (deprecated). More...
 
Imagecrop (int r, int c, int num_rows, int num_cols)
 Crop this image. More...
 
void write (const std::string &fname) const
 Write to a file. More...
 
int get_num_rows () const
 Return the number of rows in the image. More...
 
int get_num_cols () const
 Return the number of columns in the image. More...
 
int get_length () const
 Return the number of elements (pixels) in the image. More...
 
Imageoperator= (const kjb_c::KJB_image &src)
 Deep copy assignment from C-type image. More...
 
Imageoperator= (const Image &src)
 Deep copy assignment. More...
 
Imageoperator+= (const Image &op2)
 Add an image from this image, in place. More...
 
Imageoperator-= (const Image &op2)
 Subtract an image from this image, in place. More...
 
Imageoperator*= (double op2)
 Multiply this image by a scalar; i.e., scale this image in channel space. More...
 
Imageoperator/= (double op2)
 Divide this image by a scalar; i.e., scale this image in channel space. More...
 
float & operator() (int row, int col, int channel)
 Unchecked access of lvalue at given row, column, and RGB_channel. More...
 
float operator() (int row, int col, int channel) const
 Unchecked access of rvalue at given row, column, and RGB_channel. More...
 
Pixel_typeoperator() (int row, int col)
 Lvalue pixel access at given row & column, no bounds-checking. The coordinates are row,column NOT x,y ! More...
 
const Pixel_typeoperator() (int row, int col) const
 Rvalue pixel access at given row & column, no bounds-checking. The coordinates are row,column NOT x,y ! More...
 
Pixel_typeoperator() (int index)
 Access lvalue at row-major index, without bounds-checking. More...
 
const Pixel_typeoperator() (int index) const
 Access rvalue at row-major index, without bounds-checking. More...
 
void invert ()
 Invert this image; i.e., dark becomes light and vice-versa. More...
 
Image get_inverted () const
 Generate an inverted version of this image (deprecated). More...
 
Matrix get_channel (int index) const
 
void check_bounds (int row, int col) const
 Test whether row, column coordinates are valid. More...
 
float & at (int row, int col, int channel)
 Access lvalue of pixel channel at row, column coordinates. More...
 
float at (int row, int col, int channel) const
 Access rvalue of pixel channel at row, column coordinates. More...
 
Pixel_typeat (int row, int col)
 Access pixel lvalue at row, column coordinates. More...
 
const Pixel_typeat (int row, int col) const
 Access pixel rvalue at row, column coordinates. More...
 
const Pixel_typeat (int index) const
 Access pixel rvalue at row-major index. More...
 
Pixel_typeat (int index)
 Access pixel lvalue at row-major index. More...
 
const Impl_typec_ptr () const
 Access a pointer to the underlying implementation. More...
 
Impl_typenon_const_c_ptr () const
 Access a pointer to the underlying implementation, use with care. More...
 
void set_c_ptr (Impl_type *iimage)
 set this matrix to point to a different c memory, freeing the previously pointed area More...
 
Matrix to_grayscale_matrix () const
 Convert this image to a single matrix by simple averaging of the pixels. More...
 
Matrix to_grayscale_matrix (double r_w, double g_w, double b_w) const
 Convert this image to a single matrix by weighted averaging of the pixels. More...
 
Matrix to_channel_matrix (RGB_channel channel) const
 Convert this image to a single matrix by simple averaging of the pixels. More...
 
Int_matrix to_color_matrix (double scale=1.0) const
 Convert this image to a single matrix containing RGBA values. The first eight least significant bits are red, the next least least significant octet is green, and so on. More...
 
void from_color_matrix (const Int_matrix &m)
 Construct an image from a matrix containing RGBA values. Each element of matrix m is an integer which consists of ... More...
 
void from_color_matrices (const Matrix &red, const Matrix &green, const Matrix &blue)
 Contruct an image from three matrices representing red, green, blue channels. More...
 
template<class InputIterator >
Vector intensity_histogram (InputIterator first, InputIterator last) const
 Computes the intensity histogram of a region – given by a range of pairs – of this image. More...
 
void draw_point (int row, int col, int width, Pixel_type p)
 Draw a point on the image. More...
 
void draw_line_segment (int row_from, int col_from, int row_to, int col_to, int width, Pixel_type p)
 Draw a line segment on the image. More...
 
void draw_arrow (const Vector &src, const Vector &dest, const Image::Pixel_type pixel)
 Draw an arrow from src to dest. More...
 
template<class Iterator >
void draw_polyline (Iterator begin, Iterator end, int width, Pixel_type p)
 Draw a polyline on the image, i.e., a chain of line segments. More...
 
void draw_aa_rectangle (int first_row, int first_col, int last_row, int last_col, Pixel_type p)
 Draw a solid, axis-aligned rectangle on the image. More...
 
void draw_aa_rectangle_outline (int first_row, int first_col, int last_row, int last_col, Pixel_type p)
 Draw the outline of an, axis-aligned rectangle on the image. More...
 
void draw_circle (int center_row, int center_col, int radius, int line_width, Pixel_type p)
 Draw a circle on the image. More...
 
void draw_disk (int center_row, int center_col, int radius, Pixel_type p)
 draw a disk (a filled circle) on the image, of a given color. More...
 
int draw_text_center (int row, int col, const std::string &text, const std::string &font_file="times14")
 Draw the text on the image. More...
 
int draw_text_top_left (int row, int col, const std::string &text, const std::string &font_file="times14")
 Draw the text on the image. More...
 
void draw_image (const kjb_c::KJB_image *overlay, int row=0, int col=0, int scale=1)
 Overlay another image on this image, with an optional offset. More...
 
void draw_image (const Image &overlay, int row=0, int col=0, int scale=1)
 This is an overload of draw_image() taking a C-style pointer. More...
 
int display (const std::string &title=std::string()) const
 Show the image and return an image number (for closing later). More...
 
int get_flags () const
 return copy of the "flags" field of underlying KJB_image object More...
 
int set_flags (int new_flags)
 set "flags" field of underlying KJB_image; return previous flags More...
 

Additional Inherited Members

- Public Types inherited from kjb::Image
enum  RGB_channel { RED, GREEN, BLUE, END_CHANNELS }
 Constants for accessing color channels via number, with at(). More...
 
typedef kjb_c::KJB_image Impl_type
 
typedef kjb_c::Pixel Pixel_type
 
- Static Public Member Functions inherited from kjb::Image
static Image create_zero_image (int rows, int cols)
 Create an empty image of valid zero pixels, r=g=b=0. More...
 
static Image create_initialized_image (int rows, int cols, int r, int g, int b)
 Create an empty image with pixels initialized to (r, g, b) More...
 
- Protected Attributes inherited from kjb::Image
Impl_typem_image
 

Detailed Description

Class for constructing an image from the opengl framebuffer

Note
This method is DEPRECATED in favor of the kjb::opengl::framebuffer_to_image() function.
Deprecated:

Do not use this class in new code.

Constructor & Destructor Documentation

kjb::Opengl_framebuffer_image::Opengl_framebuffer_image ( uint32_t  x,
uint32_t  y,
uint32_t  width,
uint32_t  height 
)

Initialize image from opengl framebuffer

Note
Should re-implement this using Joe's faster offscreen buffer code
This method is DEPRECATED in favor of the kjb::opengl::framebuffer_to_image() function.

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