aboutsummaryrefslogtreecommitdiffstats
path: root/com32/lib/jpeg/tinyjpeg.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2006-09-05 17:06:14 -0700
committerH. Peter Anvin <hpa@zytor.com>2006-09-05 17:06:14 -0700
commit23f602a07a570de8a3a356b6b156fe036c38ab27 (patch)
treedf0746687069b53ef0ffa6ccfee955b67ad184c9 /com32/lib/jpeg/tinyjpeg.c
parent0cd5e05574453627bc9d5fba7bb9c6a6b2d3dd22 (diff)
downloadsyslinux.git-23f602a07a570de8a3a356b6b156fe036c38ab27.tar.gz
syslinux.git-23f602a07a570de8a3a356b6b156fe036c38ab27.tar.xz
syslinux.git-23f602a07a570de8a3a356b6b156fe036c38ab27.zip
Augment tinyjpeg so that we can decode straight into the buffer;
clear the screen on startup.
Diffstat (limited to 'com32/lib/jpeg/tinyjpeg.c')
-rw-r--r--com32/lib/jpeg/tinyjpeg.c38
1 files changed, 29 insertions, 9 deletions
diff --git a/com32/lib/jpeg/tinyjpeg.c b/com32/lib/jpeg/tinyjpeg.c
index ca180a03..a93a5125 100644
--- a/com32/lib/jpeg/tinyjpeg.c
+++ b/com32/lib/jpeg/tinyjpeg.c
@@ -787,12 +787,6 @@ int tinyjpeg_decode(struct jdec_private *priv,
const decode_MCU_fct *decode_mcu_table;
convert_colorspace_fct convert_to_pixfmt;
- /* To keep gcc happy initialize some array */
- bytes_per_mcu[1] = 0;
- bytes_per_mcu[2] = 0;
- bytes_per_blocklines[1] = 0;
- bytes_per_blocklines[2] = 0;
-
decode_mcu_table = pixfmt->decode_mcu_table;
/* Fix: check return value */
@@ -864,15 +858,17 @@ void tinyjpeg_get_size(struct jdec_private *priv, unsigned int *width, unsigned
*height = priv->height;
}
-int tinyjpeg_get_components(struct jdec_private *priv, unsigned char **components)
+int tinyjpeg_get_components(struct jdec_private *priv, unsigned char **components, unsigned int ncomponents)
{
int i;
- for (i=0; priv->components[i] && i<COMPONENTS; i++)
+ if (ncomponents > COMPONENTS)
+ ncomponents = COMPONENTS;
+ for (i=0; i<ncomponents; i++)
components[i] = priv->components[i];
return 0;
}
-int tinyjpeg_set_components(struct jdec_private *priv, unsigned char **components, unsigned int ncomponents)
+int tinyjpeg_set_components(struct jdec_private *priv, unsigned char * const *components, unsigned int ncomponents)
{
int i;
if (ncomponents > COMPONENTS)
@@ -882,6 +878,30 @@ int tinyjpeg_set_components(struct jdec_private *priv, unsigned char **component
return 0;
}
+int tinyjpeg_get_bytes_per_row(struct jdec_private *priv,
+ unsigned int *bytes,
+ unsigned int ncomponents)
+{
+ int i;
+ if (ncomponents > COMPONENTS)
+ ncomponents = COMPONENTS;
+ for (i=0; i<ncomponents; i++)
+ bytes[i] = priv->bytes_per_row[i];
+ return 0;
+}
+
+int tinyjpeg_set_bytes_per_row(struct jdec_private *priv,
+ const unsigned int *bytes,
+ unsigned int ncomponents)
+{
+ int i;
+ if (ncomponents > COMPONENTS)
+ ncomponents = COMPONENTS;
+ for (i=0; i<ncomponents; i++)
+ priv->bytes_per_row[i] = bytes[i];
+ return 0;
+}
+
int tinyjpeg_set_flags(struct jdec_private *priv, int flags)
{
int oldflags = priv->flags;