cplot.c File Reference


Detailed Description

C functions for 2D plotting directly to a compressed bitmap.

Author:
Glenn D. MacGougan (GDM)
Date:
2008-04-18
Since:
2007-12-19
"LICENSE INFORMATION"
Copyright (c) 2007, refer to 'author' doxygen tags
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided the following conditions are met:

THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file cplot.c.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include <float.h>
#include "cplot.h"

Go to the source code of this file.

Data Structures

struct  CPLOT_structBitmapFileHeader
 The BITMAP file header struct. More...
struct  CPLOT_structBitmapInfoHeader
 The BITMAP file info struct. More...

Defines

#define CPLOT_SIZEOF_BITMAPFILEHEADER   (14)
 True size of disk (one byte packing required).
#define CPLOT_SIZEOF_BITMAPINFOHEADER   (40)
 True size of disk (one byte packing required).
#define CPLOT_LARGEFONT   (14)
 The width and height of CPLOT's large font.
#define CPLOT_LARGEFONT_NBYTES   (196)
 The number of bytes in a large font letter.
#define CPLOT_SMALLFONT_HGT   (7)
 The heigHt of CPLOT's small font.
#define CPLOT_SMALLFONT_WIDTH   (6)
 The width of CPLOT's small font.
#define CPLOT_SMALLFONT_NBYTES   (42)
 The number of bytes in a small font letter.
#define CPLOT_PIXELS_PER_CM   (38)
 The number of pixels per centimeter.
#define CPLOT_POINT_SIZE   (5)
 The width/height for a point [pixels].
#define CPLOT_LARGEPOINT_SIZE   (8)
 The width/height for a large point [pixels].
#define CPLOT_DEFAULT_PLOT_WIDTH_CM   (15)
 The default plot width [cm].
#define CPLOT_DEFAULT_PLOT_HEIGHT_CM   (13)
 The default plot height [cm].

Functions

BOOL CPLOT_BYTE_MTX_Zero (CPLOT_structByteMatrix *dst)
 zero the entire matrix
BOOL CPLOT_BYTE_MTX_Fill (CPLOT_structByteMatrix *dst, const byte value)
 fills the matrix with the given value
BOOL CPLOT_PlotOptionsInit (CPLOT_structPlotOptions *Opt)
 Initialize the general plotting options.
BOOL CPLOT_Init (CPLOT *P)
 Initialize the main CPLOT data container.
BOOL CPLOT_SaveToFile (CPLOT *P, const char *FileName)
 Once plotting is complete, save the bitmap to the file specified.
BOOL CPLOT_SetPlotOptions (CPLOT *P, CPLOT_structPlotOptions *opt)
 Set all the general plotting options.
BOOL CPLOT_Plot (CPLOT *P, CPLOT_structSeries *Series)
 Plot a data series. Call this function repeatedly for each data series.


Define Documentation

#define CPLOT_DEFAULT_PLOT_HEIGHT_CM   (13)

The default plot height [cm].

Definition at line 104 of file cplot.c.

#define CPLOT_DEFAULT_PLOT_WIDTH_CM   (15)

The default plot width [cm].

Definition at line 103 of file cplot.c.

#define CPLOT_LARGEFONT   (14)

The width and height of CPLOT's large font.

Definition at line 92 of file cplot.c.

#define CPLOT_LARGEFONT_NBYTES   (196)

The number of bytes in a large font letter.

Definition at line 93 of file cplot.c.

#define CPLOT_LARGEPOINT_SIZE   (8)

The width/height for a large point [pixels].

Definition at line 101 of file cplot.c.

#define CPLOT_PIXELS_PER_CM   (38)

The number of pixels per centimeter.

Definition at line 98 of file cplot.c.

#define CPLOT_POINT_SIZE   (5)

The width/height for a point [pixels].

Definition at line 100 of file cplot.c.

#define CPLOT_SIZEOF_BITMAPFILEHEADER   (14)

True size of disk (one byte packing required).

Definition at line 66 of file cplot.c.

#define CPLOT_SIZEOF_BITMAPINFOHEADER   (40)

True size of disk (one byte packing required).

Definition at line 67 of file cplot.c.

#define CPLOT_SMALLFONT_HGT   (7)

The heigHt of CPLOT's small font.

Definition at line 94 of file cplot.c.

#define CPLOT_SMALLFONT_NBYTES   (42)

The number of bytes in a small font letter.

Definition at line 96 of file cplot.c.

#define CPLOT_SMALLFONT_WIDTH   (6)

The width of CPLOT's small font.

Definition at line 95 of file cplot.c.


Function Documentation

BOOL CPLOT_BYTE_MTX_Fill ( CPLOT_structByteMatrix dst,
const byte  value 
)

fills the matrix with the given value

Definition at line 2848 of file cplot.c.

BOOL CPLOT_BYTE_MTX_Zero ( CPLOT_structByteMatrix dst  ) 

zero the entire matrix

Definition at line 2726 of file cplot.c.

BOOL CPLOT_Init ( CPLOT P  ) 

Initialize the main CPLOT data container.

Returns:
TRUE(1) if successful, FALSE(0) otherwise.

Definition at line 2882 of file cplot.c.

BOOL CPLOT_Plot ( CPLOT P,
CPLOT_structSeries Series 
)

Plot a data series. Call this function repeatedly for each data series.

Returns:
TRUE(1) if successful, FALSE(0) otherwise.

Definition at line 5681 of file cplot.c.

BOOL CPLOT_PlotOptionsInit ( CPLOT_structPlotOptions Opt  ) 

Initialize the general plotting options.

Returns:
TRUE(1) if successful, FALSE(0) otherwise.

Definition at line 2867 of file cplot.c.

BOOL CPLOT_SaveToFile ( CPLOT P,
const char *  FileName 
)

Once plotting is complete, save the bitmap to the file specified.

Returns:
TRUE(1) if successful, FALSE(0) otherwise.

Definition at line 5343 of file cplot.c.

BOOL CPLOT_SetPlotOptions ( CPLOT P,
CPLOT_structPlotOptions opt 
)

Set all the general plotting options.

Returns:
TRUE(1) if successful, FALSE(0) otherwise.

Definition at line 5665 of file cplot.c.