annotate libmpcodecs/vf_palette.c @ 11332:62020e28e45b

Sync
author lumag
date Thu, 30 Oct 2003 15:31:57 +0000
parents e9a2af584986
children 4ff38d168c2f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5774
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
1 #include <stdio.h>
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
2 #include <stdlib.h>
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
3 #include <string.h>
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
4 #include <inttypes.h>
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
5
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
6 #include "../config.h"
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
7 #include "../mp_msg.h"
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
8
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
9 #include "img_format.h"
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
10 #include "mp_image.h"
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
11 #include "vf.h"
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
12
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
13 #include "../postproc/rgb2rgb.h"
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
14
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
15 //===========================================================================//
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
16
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
17 static unsigned int bgr_list[]={
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
18 IMGFMT_BGR32,
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
19 IMGFMT_BGR24,
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
20 IMGFMT_BGR16,
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
21 IMGFMT_BGR15,
6188
39a9515c633a warning fixes, patch by Ulrich Hecht <uli@suse.de>
arpi
parents: 5774
diff changeset
22 0
5774
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
23 };
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
24 static unsigned int rgb_list[]={
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
25 IMGFMT_RGB32,
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
26 IMGFMT_RGB24,
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
27 IMGFMT_RGB16,
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
28 IMGFMT_RGB15,
6188
39a9515c633a warning fixes, patch by Ulrich Hecht <uli@suse.de>
arpi
parents: 5774
diff changeset
29 0
5774
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
30 };
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
31
6232
f8e0eac1256c grayscaled palette support
arpi
parents: 6188
diff changeset
32 static unsigned int gray_pal[256];
f8e0eac1256c grayscaled palette support
arpi
parents: 6188
diff changeset
33
5774
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
34 static unsigned int find_best(struct vf_instance_s* vf, unsigned int fmt){
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
35 unsigned int best=0;
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
36 int ret;
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
37 unsigned int* p;
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
38 if(fmt==IMGFMT_BGR8) p=bgr_list;
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
39 else if(fmt==IMGFMT_RGB8) p=rgb_list;
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
40 else return 0;
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
41 while(*p){
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
42 ret=vf->next->query_format(vf->next,*p);
9276
9fd44bc91631 move some verbose msg to dbg2
arpi
parents: 7368
diff changeset
43 mp_msg(MSGT_VFILTER,MSGL_DBG2,"[%s] query(%s) -> %d\n",vf->info->name,vo_format_name(*p),ret&3);
7160
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
44 if(ret&VFCAP_CSP_SUPPORTED_BY_HW){ best=*p; break;} // no conversion -> bingo!
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
45 if(ret&VFCAP_CSP_SUPPORTED && !best) best=*p; // best with conversion
5774
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
46 ++p;
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
47 }
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
48 return best;
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
49 }
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
50
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
51 //===========================================================================//
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
52
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
53 struct vf_priv_s {
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
54 unsigned int fmt;
9276
9fd44bc91631 move some verbose msg to dbg2
arpi
parents: 7368
diff changeset
55 int pal_msg;
5774
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
56 };
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
57
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
58 static int config(struct vf_instance_s* vf,
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
59 int width, int height, int d_width, int d_height,
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
60 unsigned int flags, unsigned int outfmt){
7160
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
61 if (!vf->priv->fmt)
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
62 vf->priv->fmt=find_best(vf,outfmt);
5774
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
63 if(!vf->priv->fmt){
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
64 // no matching fmt, so force one...
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
65 if(outfmt==IMGFMT_RGB8) vf->priv->fmt=IMGFMT_RGB32;
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
66 else if(outfmt==IMGFMT_BGR8) vf->priv->fmt=IMGFMT_BGR32;
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
67 else return 0;
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
68 }
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
69 return vf_next_config(vf,width,height,d_width,d_height,flags,vf->priv->fmt);
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
70 }
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
71
7368
a894e99c1e51 changing return type of put_image void->int
arpi
parents: 7333
diff changeset
72 static int put_image(struct vf_instance_s* vf, mp_image_t *mpi){
5774
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
73 mp_image_t *dmpi;
6481
24465b749d2a report if no palette
alex
parents: 6232
diff changeset
74
5774
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
75 // hope we'll get DR buffer:
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
76 dmpi=vf_get_image(vf->next,vf->priv->fmt,
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
77 MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
78 mpi->w, mpi->h);
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
79
7160
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
80 if (!mpi->planes[1])
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
81 {
9276
9fd44bc91631 move some verbose msg to dbg2
arpi
parents: 7368
diff changeset
82 if(!vf->priv->pal_msg){
9fd44bc91631 move some verbose msg to dbg2
arpi
parents: 7368
diff changeset
83 mp_msg(MSGT_VFILTER,MSGL_V,"[%s] no palette given, assuming builtin grayscale one\n",vf->info->name);
9fd44bc91631 move some verbose msg to dbg2
arpi
parents: 7368
diff changeset
84 vf->priv->pal_msg=1;
9fd44bc91631 move some verbose msg to dbg2
arpi
parents: 7368
diff changeset
85 }
7160
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
86 mpi->planes[1] = (unsigned char*)gray_pal;
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
87 }
6232
f8e0eac1256c grayscaled palette support
arpi
parents: 6188
diff changeset
88
5774
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
89 if(mpi->w==mpi->stride[0] && dmpi->w*(dmpi->bpp>>3)==dmpi->stride[0]){
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
90 // no stride conversion needed
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
91 switch(dmpi->imgfmt&255){
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
92 case 15:
7333
alex
parents: 7160
diff changeset
93 if (dmpi->flags & MP_IMGFLAG_SWAPPED)
7160
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
94 palette8tobgr15(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
95 else
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
96 palette8torgb15(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);
5774
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
97 break;
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
98 case 16:
7333
alex
parents: 7160
diff changeset
99 if (dmpi->flags & MP_IMGFLAG_SWAPPED)
7160
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
100 palette8tobgr16(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
101 else
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
102 palette8torgb16(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);
5774
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
103 break;
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
104 case 24:
7333
alex
parents: 7160
diff changeset
105 if (dmpi->flags & MP_IMGFLAG_SWAPPED)
7160
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
106 palette8tobgr24(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
107 else
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
108 palette8torgb24(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);
5774
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
109 break;
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
110 case 32:
7333
alex
parents: 7160
diff changeset
111 if (dmpi->flags & MP_IMGFLAG_SWAPPED)
7160
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
112 palette8tobgr32(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
113 else
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
114 palette8torgb32(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);
5774
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
115 break;
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
116 }
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
117 } else {
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
118 int y;
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
119 for(y=0;y<mpi->h;y++){
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
120 unsigned char* src=mpi->planes[0]+y*mpi->stride[0];
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
121 unsigned char* dst=dmpi->planes[0]+y*dmpi->stride[0];
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
122 switch(dmpi->imgfmt&255){
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
123 case 15:
7333
alex
parents: 7160
diff changeset
124 if (dmpi->flags & MP_IMGFLAG_SWAPPED)
7160
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
125 palette8tobgr15(src,dst,mpi->w,mpi->planes[1]);
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
126 else
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
127 palette8torgb15(src,dst,mpi->w,mpi->planes[1]);
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
128 break;
5774
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
129 case 16:
7333
alex
parents: 7160
diff changeset
130 if (dmpi->flags & MP_IMGFLAG_SWAPPED)
7160
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
131 palette8tobgr16(src,dst,mpi->w,mpi->planes[1]);
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
132 else
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
133 palette8torgb16(src,dst,mpi->w,mpi->planes[1]);
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
134 break;
5774
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
135 case 24:
7333
alex
parents: 7160
diff changeset
136 if (dmpi->flags & MP_IMGFLAG_SWAPPED)
7160
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
137 palette8tobgr24(src,dst,mpi->w,mpi->planes[1]);
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
138 else
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
139 palette8torgb24(src,dst,mpi->w,mpi->planes[1]);
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
140 break;
5774
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
141 case 32:
7333
alex
parents: 7160
diff changeset
142 if (dmpi->flags & MP_IMGFLAG_SWAPPED)
7160
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
143 palette8tobgr32(src,dst,mpi->w,mpi->planes[1]);
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
144 else
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
145 palette8torgb32(src,dst,mpi->w,mpi->planes[1]);
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
146 break;
5774
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
147 }
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
148 }
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
149 }
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
150
7368
a894e99c1e51 changing return type of put_image void->int
arpi
parents: 7333
diff changeset
151 return vf_next_put_image(vf,dmpi);
5774
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
152 }
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
153
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
154 //===========================================================================//
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
155
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
156 static int query_format(struct vf_instance_s* vf, unsigned int fmt){
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
157 int best=find_best(vf,fmt);
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
158 if(!best) return 0; // no match
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
159 return vf->next->query_format(vf->next,best);
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
160 }
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
161
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
162 static int open(vf_instance_t *vf, char* args){
6232
f8e0eac1256c grayscaled palette support
arpi
parents: 6188
diff changeset
163 unsigned int i;
5774
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
164 vf->config=config;
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
165 vf->put_image=put_image;
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
166 vf->query_format=query_format;
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
167 vf->priv=malloc(sizeof(struct vf_priv_s));
7160
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
168 memset(vf->priv, 0, sizeof(struct vf_priv_s));
6232
f8e0eac1256c grayscaled palette support
arpi
parents: 6188
diff changeset
169 for(i=0;i<256;i++) gray_pal[i]=0x01010101*i;
7160
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
170 if (args)
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
171 {
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
172 if (!strcasecmp(args,"rgb15")) vf->priv->fmt=IMGFMT_RGB15; else
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
173 if (!strcasecmp(args,"rgb16")) vf->priv->fmt=IMGFMT_RGB16; else
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
174 if (!strcasecmp(args,"rgb24")) vf->priv->fmt=IMGFMT_RGB24; else
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
175 if (!strcasecmp(args,"rgb32")) vf->priv->fmt=IMGFMT_RGB32; else
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
176 if (!strcasecmp(args,"bgr15")) vf->priv->fmt=IMGFMT_BGR15; else
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
177 if (!strcasecmp(args,"bgr16")) vf->priv->fmt=IMGFMT_BGR16; else
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
178 if (!strcasecmp(args,"bgr24")) vf->priv->fmt=IMGFMT_BGR24; else
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
179 if (!strcasecmp(args,"bgr32")) vf->priv->fmt=IMGFMT_BGR32; else
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
180 {
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
181 printf("Unknown forced format name: '%s'\n", args);
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
182 return(0);
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
183 }
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
184 }
5774
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
185 return 1;
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
186 }
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
187
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
188 vf_info_t vf_info_palette = {
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
189 "8bpp indexed (using palette) -> BGR 15/16/24/32 conversion",
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
190 "palette",
7160
447066802e64 added bgr support and support for forcing output format
alex
parents: 7127
diff changeset
191 "A'rpi & Alex",
5774
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
192 "",
9593
e9a2af584986 Add the new -vf option wich is the same as vop in reverse order.
albeu
parents: 9276
diff changeset
193 open,
e9a2af584986 Add the new -vf option wich is the same as vop in reverse order.
albeu
parents: 9276
diff changeset
194 NULL
5774
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
195 };
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
196
a300966abeb6 8bpp paletted -> 15/16/24/32 converter
arpi
parents:
diff changeset
197 //===========================================================================//