Extended Library of general Image class algorithm

Source: Internet
Author: User
Tags bool

This is a more alternative image library, which itself does not provide for the Image object encapsulation, only in the form of similar plug-ins to provide you with image processing algorithm encapsulation and progress display, while the Image object encapsulation needs to be provided by the user. This image library platform is irrelevant, theoretically it can be applied to any existing C + + image class. (The specific principle see oneself flops: crazybit Development Notes (i): Design of the data structure and algorithm separation).

How to use

In order to use this image library, you must make some simple changes to the image class at hand (in view of the efficiency factor, I did not provide a virtual interface for everyone to inherit, but by allowing the user to modify the code to achieve it.) ):

1, from the existing image class (such as Cximage, Cdib ... ) Derive fcobjimage (I think your class is also called the probability of this name is lower than the probability of water on Mars).

2. You must implement the following functions in the Fcobjimage class (most of which are very simple to take property operations):

Prototype

Function description

Fcobjimage () Default constructor
Fcobjimage (const Fcobjimage & IMG) Copy Constructors
Fcobjimage & operator= (const fcobjimage & IMGSRC) Assignment operations
BOOL isvalidimage () const Whether this image object is valid
UINT16 colorbits () const Number of color digits of the image (1,4,8,16,24,32)
DWORD GetPitch () const Number of bytes per line of image
BYTE * getbits (int iline = 0) const Get the Iline line pointer, upper left corner (0,0), Top-down
BYTE * getbits (int x, int y) const Gets the pointer to the (X,Y) point, the upper-left corner (0,0), Top-down, from left to right
BOOL Isinside (int x, int y) const Coordinates (X,Y) inside the image
int Width () const Wide
int Height () const High
BOOL Create (int iwidth, int iheight, WORD wcolorbit) Create an empty image
static void Foocopypalette (Fcobjimage & dibdest, const Fcobjimage & DIBSRC) <=8bit Image Copy Palette

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.