Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pike
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pikelang
pike
Commits
4b0b8c0f
Commit
4b0b8c0f
authored
25 years ago
by
Mirar (Pontus Hagland)
Browse files
Options
Downloads
Patches
Plain Diff
gd format support initiated (0.0)
Rev: src/modules/Image/encodings/gd.c:1.1
parent
998e45e0
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitattributes
+1
-0
1 addition, 0 deletions
.gitattributes
src/modules/Image/encodings/gd.c
+122
-0
122 additions, 0 deletions
src/modules/Image/encodings/gd.c
with
123 additions
and
0 deletions
.gitattributes
+
1
−
0
View file @
4b0b8c0f
...
...
@@ -182,6 +182,7 @@ testfont binary
/src/modules/Image/encodings/avs.c foreign_ident
/src/modules/Image/encodings/bmp.c foreign_ident
/src/modules/Image/encodings/configure.in foreign_ident
/src/modules/Image/encodings/gd.c foreign_ident
/src/modules/Image/encodings/gif.c foreign_ident
/src/modules/Image/encodings/gif_lzw.c foreign_ident
/src/modules/Image/encodings/gif_lzw.h foreign_ident
...
...
This diff is collapsed.
Click to expand it.
src/modules/Image/encodings/gd.c
0 → 100644
+
122
−
0
View file @
4b0b8c0f
#include
"global.h"
#include
"config.h"
#include
<math.h>
#include
<ctype.h>
#ifdef HAVE_NETINET_IN_H
#include
<netinet/in.h>
#endif
#include
"stralloc.h"
RCSID
(
"$Id: gd.c,v 1.1 1999/05/23 17:46:18 mirar Exp $"
);
#include
"pike_macros.h"
#include
"object.h"
#include
"constants.h"
#include
"interpret.h"
#include
"svalue.h"
#include
"threads.h"
#include
"array.h"
#include
"error.h"
#include
"operators.h"
#include
"builtin_functions.h"
#include
"module_support.h"
#include
"image.h"
extern
struct
program
*
image_program
;
/*
**! module Image
**! submodule GD
**!
**! Handle encoding and decoding of GD images.
**!
**! GD is the internal format of libgd by Thomas Boutell,
**! <a href=http://www.boutell.com/gd/><tt>http://www.boutell.com/gd/</tt></a>
**! It is a rather simple, uncompressed, palette
**! format.
*/
/*
**! method object decode(string data)
**! method object decode_alpha(string data)
**! method mapping decode_header(string data)
**! method mapping _decode(string data)
**! decodes a GD image
**!
**! The <ref>decode_header</ref> and <ref>_decode</ref>
**! has these elements:
**!
**! <pre>
**! "image":object - image object \
**! "alpha":object - decoded alpha |- not decode_header
**! "colortable":object - decoded palette /
**!
**! "type":"image/x-gd" - image type
**! "xsize":int - horisontal size in pixels
**! "ysize":int - vertical size in pixels
**! "alpha_index":int - index to transparancy in palette
**! -1 means no transparency
**! "colors":int - numbers of colors
**! </pre>
**!
**!
**! method string encode(object image)
**! method string encode(object image,mapping options)
**! encode a GD image
**!
**! options is a mapping with optional values:
**! <pre>
**! "colortable":object - palette to use (max 256 colors)
**! "alpha":object - alpha channel (truncated to 1 bit)
**! "alpha_index":int - index to transparancy in palette
**! </pre>
*/
void
image_gd_f_encode
(
INT32
args
)
{
error
(
"not implemented
\n
"
);
}
void
img_gd_decode
(
INT32
args
,
int
header_only
)
{
error
(
"not implemented
\n
"
);
}
static
void
image_gd_f_decode
(
INT32
args
)
{
img_gd_decode
(
args
,
0
);
push_string
(
make_shared_string
(
"image"
));
f_index
(
2
);
}
static
void
image_gd_f_decode_alpha
(
INT32
args
)
{
img_gd_decode
(
args
,
0
);
push_string
(
make_shared_string
(
"alpha"
));
f_index
(
2
);
}
static
void
image_gd_f_decode_header
(
INT32
args
)
{
img_gd_decode
(
args
,
1
);
}
static
void
image_gd_f__decode
(
INT32
args
)
{
img_gd_decode
(
args
,
0
);
}
void
init_image_avs
()
{
add_function
(
"decode"
,
image_gd_f_decode
,
tFunc
(
tStr
,
tObj
),
0
);
add_function
(
"decode_alpha"
,
image_gd_f_decode_alpha
,
tFunc
(
tStr
,
tObj
),
0
);
add_function
(
"_decode"
,
image_gd_f__decode
,
tFunc
(
tStr
,
tMapping
),
0
);
add_function
(
"encode"
,
image_gd_f_encode
,
tFunc
(
tStr
,
tObj
),
0
);
add_function
(
"decode_header"
,
image_gd_f_decode_header
,
tFunc
(
tStr
,
tMapping
),
0
);
}
void
exit_image_avs
()
{
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment