Opened 5 years ago

Closed 5 years ago

#705 closed enhancement (fixed)

iff: support masking

Reported by: ami_stuff Owned by:
Priority: wish Component: avcodec
Version: git-master Keywords: iff
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

SDL_image

IMG_lbm:

		/* If nbcolors < 2^nbplanes, repeat the colormap */
		/* This happens when pictures have a stencil mask */
		if ( nbrcolorsfinal > (1<<bmhd.planes) ) {
			nbrcolorsfinal = (1<<bmhd.planes);
		}
		for ( i=nbcolors; i < (Uint32)nbrcolorsfinal; i++ )
		{
			Image->format->palette->colors[i].r = Image->format->palette->colors[i%nbcolors].r;
			Image->format->palette->colors[i].g = Image->format->palette->colors[i%nbcolors].g;
			Image->format->palette->colors[i].b = Image->format->palette->colors[i%nbcolors].b;
		}

http://www.libsdl.org/projects/SDL_image/

http://hg.libsdl.org/SDL_image/rev/a6565b353095

C:\>ffmpeg -i peterface.iff
ffmpeg version N-35295-gb55dd10, Copyright (c) 2000-2011 the FFmpeg developers
  built on Nov 30 2011 00:52:52 with gcc 4.6.2
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-ru
ntime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libope
ncore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable-libgsm --en
able-libmp3lame --enable-libopenjpeg --enable-librtmp --enable-libschroedinger -
-enable-libspeex --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwben
c --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-
libxvid --enable-zlib
  libavutil    51. 29. 1 / 51. 29. 1
  libavcodec   53. 39. 1 / 53. 39. 1
  libavformat  53. 22. 0 / 53. 22. 0
  libavdevice  53.  4. 0 / 53.  4. 0
  libavfilter   2. 50. 0 /  2. 50. 0
  libswscale    2.  1. 0 /  2.  1. 0
  libpostproc  51.  2. 0 / 51.  2. 0
[iff_byterun1 @ 020B90E0] Masking not supported
    Last message repeated 1 times
[IFF @ 020B2320] Estimating duration from bitrate, this may be inaccurate
Input #0, IFF, from 'peterface.iff':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: iff_byterun1 (ILBM / 0x4D424C49), rgba, 270x202, SAR 10:
11 DAR 1350:1111, 90k tbr, 90k tbn, 90k tbc
At least one output file must be specified

Attachments (4)

peterface.iff (38.0 KB) - added by ami_stuff 5 years ago.
peterface.bmp (160.2 KB) - added by ami_stuff 5 years ago.
peterface_8bit.iff (55.8 KB) - added by ami_stuff 5 years ago.
mask1_5bpp.IFF (36.8 KB) - added by ami_stuff 5 years ago.

Download all attachments as: .zip

Change History (9)

Changed 5 years ago by ami_stuff

Changed 5 years ago by ami_stuff

comment:1 Changed 5 years ago by cehoyos

  • Component changed from undetermined to avcodec
  • Priority changed from normal to wish
  • Reproduced by developer set
  • Status changed from new to open
  • Type changed from defect to enhancement
  • Version changed from unspecified to git-master

comment:2 Changed 5 years ago by pross

for info: that iff file is 24bpp with masking enabled. Do you have any samples with <= 8bpp with masking enabled. Cheers

comment:3 Changed 5 years ago by ami_stuff

Actually the attached file is in HAM6 mode. I will try to find <= 8bpp, but I'm not sure how successful I will be.

Please look as well on this code (loadimage.c):

http://aminet.net/package/gfx/show/LoadImage

		/* Very well, nobody told me that DPaint and Aegis Images
		 * are allowed to save their own home-brewn BODY chunks
		 * if the transparent colour is nonzero or the
		 * stencil/behind function is used. In this case the
		 * interleaved plane data is immediately followed by
		 * a bitmask which is to clear out all unwanted pixels
		 * after the image is drawn. To support this attitude
		 * we increment the depth of the image to give the
		 * reader access to a blank pointer the bitmask will
		 * be sent to.
		 */

	if(BMHeader -> masking == 1)
		Depth++;
Last edited 5 years ago by cehoyos (previous) (diff)

Changed 5 years ago by ami_stuff

comment:4 Changed 5 years ago by ami_stuff

I've created 8bit iff file with masking in DPaint.

Changed 5 years ago by ami_stuff

comment:5 Changed 5 years ago by cehoyos

  • Keywords iff added
  • Resolution set to fixed
  • Status changed from open to closed

Fixed by Peter Ross.

Note: See TracTickets for help on using tickets.