libDXF 0.0.1
A library with DXF related functions written in C.
|
Definition of DXF color values. More...
#include "global.h"
Go to the source code of this file.
Data Structures | |
struct | DxfRGBColor |
Definition of a color. More... | |
Functions | |
char * | dxf_RGB_color_get_name (int RGB_color_hex_triplet) |
Return the color name according to the Wikipedia List of Colors. | |
DxfRGBColor * | dxf_RGB_color_new () |
Allocate memory for a DXF color. | |
DxfRGBColor * | dxf_RGB_color_set (int red, int green, int blue) |
Set the passed integer values for a DXF color. | |
int | dxf_ACI_init (DxfRGBColor *ACI[DXF_COLOR_INDEX_MAX_NUMBER_OF_COLORS]) |
Initialise an array of colors according to the AutoCAD Color Index (ACI). | |
int | dxf_RGB_to_triplet (int red, int green, int blue) |
Convert the passed integer values to a hexadecimal triplet. | |
int | dxf_RGB_color_free (DxfRGBColor *RGB_color) |
Free the allocated memory for a DXF DxfRGBColor and all it's data fields. | |
void | dxf_RGB_color_free_chain (DxfRGBColor *colors) |
Free the allocated memory for a chain of DXF COLOR entities and all their data fields. |
Definition of DXF color values.
These definitions contain the following:
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Drawing eXchange Format (DXF) is a defacto industry standard for the exchange of drawing files between various Computer Aided Drafting programs.
DXF is an industry standard designed by Autodesk(TM).
For more details see http://www.autodesk.com.
Definition in file color.h.
char* dxf_RGB_color_get_name | ( | int | RGB_color_hex_triplet | ) |
Return the color name according to the Wikipedia List of Colors.
These color names are defined by Wikipedia's List of colors.
NULL
if unknown. RGB_color_hex_triplet | dxf_RGB_color_hex_triplet is assumed to contain the hexadecimal values as in red value, green value, blue value in the order 0xRRGGBB (contains no alpha values). |
Definition at line 515 of file color.c.
References DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
Referenced by dxf_RGB_color_set().
DxfRGBColor* dxf_RGB_color_new | ( | ) |
Allocate memory for a DXF color.
Fill the memory contents with zeros.
Definition at line 44 of file color.c.
References _, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
Referenced by dxf_RGB_color_set().
DxfRGBColor* dxf_RGB_color_set | ( | int | red, |
int | green, | ||
int | blue | ||
) |
Set the passed integer values for a DXF color.
red | Red value for the color. |
green | Green value for the color. |
blue | Blue value for the color. |
Definition at line 78 of file color.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_RGB_color_get_name(), dxf_RGB_color_new(), and dxf_RGB_to_triplet().
Referenced by dxf_ACI_init().
int dxf_ACI_init | ( | DxfRGBColor * | ACI[DXF_COLOR_INDEX_MAX_NUMBER_OF_COLORS] | ) |
Initialise an array of colors according to the AutoCAD Color Index (ACI).
These colors are defined by red value, green value, blue value and contain no alpha value (see also http://www.isctex.com/acadcolors.php).
Definition at line 158 of file color.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and dxf_RGB_color_set().
int dxf_RGB_to_triplet | ( | int | red, |
int | green, | ||
int | blue | ||
) |
Convert the passed integer values to a hexadecimal triplet.
red | Red value for the color. |
green | Green value for the color. |
blue | Blue value for the color. |
Definition at line 449 of file color.c.
References _, DXF_DEBUG_BEGIN, and DXF_DEBUG_END.
Referenced by dxf_RGB_color_set().
int dxf_RGB_color_free | ( | DxfRGBColor * | RGB_color | ) |
Free the allocated memory for a DXF DxfRGBColor
and all it's data fields.
EXIT_SUCCESS
when done, or EXIT_FAILURE
when an error occurred. RGB_color | Pointer to the memory occupied by the DXF RGB Color. |
Definition at line 2220 of file color.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, and DxfRGBColor::name.
Referenced by dxf_RGB_color_free_chain().
void dxf_RGB_color_free_chain | ( | DxfRGBColor * | colors | ) |
Free the allocated memory for a chain of DXF COLOR
entities and all their data fields.
colors | a pointer to the chain of DXF COLOR entities. |
Definition at line 2266 of file color.c.
References _, DXF_DEBUG_BEGIN, DXF_DEBUG_END, dxf_RGB_color_free(), and DxfRGBColor::next.