Make clang build as silent as possible
[fvs_assignment_project.git] / include / floatfield.h
blobc434f19cebaade88881feabebdf2e2fcb53ac559
1 /*########################################################################
3 * Copyright(C) 2002-2007. All Rights Reserved.
5 * Authors: Shivang Patel
6 * Jaap de Haan(jdh)
8 * Changes: jdh -> Added support for ImageMagick that enables
9 * to export files to more than 40 formats.
10 * This is free software; you can redistribute it and/or modify it under
11 * the terms of the GNU General Public License as published by the Free
12 * Software Foundation; either version 2, or (at your option) any later
13 * version.
15 * This is distributed in the hope that it will be useful, but WITHOUT
16 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 * for more details.
20 * You should have received a copy of the GNU General Public License with
21 * the fvs source package as the
22 * file COPYING. If not, write to the Free Software Foundation, Inc.,
23 * 59 Temple Place - Suite 330, Boston, MA
24 * 02111-1307, USA.
25 * ########################################################################*/
27 #if !defined FVS__FLOAT_FIELD_HEADER__INCLUDED__
28 #define FVS__FLOAT_FIELD_HEADER__INCLUDED__
30 /* basic type definitions */
31 #include "fvstypes.h"
34 /*!
35 the implementation of the object is private and must not be known
36 by the user. Use this handle to manipulate the floating point field
37 through the functions provided hereunder.
39 typedef /*@mutable@*/ FvsHandle_t FvsFloatField_t;
42 /*!
43 Create a new floating point field object.
44 \return NULL if allocation failed, otherwise a new object handle.
45 */
46 /*@only@*/ /*@null@*/ FvsFloatField_t FloatFieldCreate(void);
49 /*!
50 Destroy an existing floating point field object.
51 \param field pointer to a floating point field object
52 \return nothing.
53 */
54 void FloatFieldDestroy(/*@only@*/ /*@out@*/ /*@null@*/ FvsFloatField_t field);
57 /*!
58 Set the size if a floating point field.
59 The memory allocation is done automatically when needed and the function
60 returns an error if it failed.
61 \param field a floating point field object
62 \param width width in pixels
63 \param height height in pixels
64 \return an error code.
65 */
66 FvsError_t FloatFieldSetSize(FvsFloatField_t field, const FvsInt_t width, const FvsInt_t height);
69 /*!
70 Copy a source image into a destination image.
71 The memory allocation and resizing is done automatically when needed.
72 \param destination a destination floating point field object
73 \param source a source floating point field object
74 \return an error code.
76 FvsError_t FloatFieldCopy(FvsFloatField_t destination, const FvsFloatField_t source);
79 /*!
80 Clear an image.
81 Resets the contents of a floating point field to zero.
82 \param field a floating point field object
83 \return an error code.
85 FvsError_t FloatFieldClear(FvsFloatField_t field);
88 /*!
89 Set all values in the floating point field to a specific value.
90 \param field a floating point field object
91 \param value the value of every pixel after the call
92 \return an error code.
94 FvsError_t FloatFieldFlood(FvsFloatField_t field, const FvsFloat_t value);
97 /*!
98 Set a floating point value in a floating point field at specified coordinates.
99 \param field a floating point field object
100 \param x x-coordinate
101 \param y y-coordinate
102 \param val value to set
103 \return nothing
105 void FloatFieldSetValue(FvsFloatField_t field, const FvsInt_t x, const FvsInt_t y, const FvsFloat_t val);
109 This function returns the value for the x and y coordinates.
110 \param field a floating point field object
111 \param x x-coordinate
112 \param y y-coordinate
113 \return the floating point value
115 FvsFloat_t FloatFieldGetValue(const FvsFloatField_t field, const FvsInt_t x, const FvsInt_t y);
119 Returns a pointer to the floating point field buffer.
120 \param field a floating point field object
121 \return a pointer to the beginning of the memory buffer
123 /*@exposed@*/ /*@null@*/ FvsFloat_t* FloatFieldGetBuffer(FvsFloatField_t field);
127 Retrieve the floating point field width.
128 \param field a floating point field object
129 \return the width in pixels
131 FvsInt_t FloatFieldGetWidth(const FvsFloatField_t field);
135 Retrieve the floating point field height.
136 \param field a floating point field object
137 \return the heigth in pixels
139 FvsInt_t FloatFieldGetHeight(const FvsFloatField_t field);
143 Get the pitch. The pitch of a floating point field is not necessary the width
144 that was specified when setting the size. In the floating point field, the value
145 at position (x,y) in the buffer is at address x + y * pitch.
146 \param field a floating point field object
147 \return the pitch in bytes
149 FvsInt_t FloatFieldGetPitch(const FvsFloatField_t field);
153 #endif /* FVS__IMAGE_HEADER__INCLUDED__ */