Project

General

Profile

Bug #489

Transparency parameter not taken into account in _CPbitmap24 (LIB2DOS24)

Added by tony almost 4 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
09/30/2014
Due date:
% Done:

100%

Estimated time:
4.00 h
Spent time:

Description

Bug: see Subject
Workaround: use _SCPbitmap

History

#1 Updated by arkeon almost 4 years ago

Did you check the function code ?

#2 Updated by arkeon almost 4 years ago

Ho no this is not a bug.
_CPbitmap24 copy an objBitmap not an alphaBitmap

An alphaBitmap is composed of an objBitmap and an objBitmap8 for alpha channel.
so to copy an alphaBitmap you must get the separated components and copy the ObjBitmap and then the ObjBitmap8 to finally recreate an alphaBitmap.

or what you mean by "Transparency" is something else ?

#3 Updated by tony almost 4 years ago

arkeon wrote:

Ho no this is not a bug.
_CPbitmap24 copy an objBitmap not an alphaBitmap

An alphaBitmap is composed of an objBitmap and an objBitmap8 for alpha channel.
so to copy an alphaBitmap you must get the separated components and copy the ObjBitmap and then the ObjBitmap8 to finally recreate an alphaBitmap.

or what you mean by "Transparency" is something else ?

The transparency is the color transparency parameter which tells what should be copied or not from the source bitmap. So nothing to do with alphabitmaps, just with basic bitmaps (ObjBitmap)

#4 Updated by tony almost 4 years ago

  • Assignee set to tony

#5 Updated by tony almost 4 years ago

tony wrote:

arkeon wrote:

Ho no this is not a bug.
_CPbitmap24 copy an objBitmap not an alphaBitmap

An alphaBitmap is composed of an objBitmap and an objBitmap8 for alpha channel.
so to copy an alphaBitmap you must get the separated components and copy the ObjBitmap and then the ObjBitmap8 to finally recreate an alphaBitmap.

or what you mean by "Transparency" is something else ?

The transparency is the color transparency parameter which tells what should be copied or not from the source bitmap. So nothing to do with alphabitmaps, just with basic bitmaps (ObjBitmap)

I assigned this bug to myself. I'll have a look at it as soon as possible.

#6 Updated by arkeon almost 4 years ago

srcColor = _COLOR_BGR_TO_I ((char)BS->bits[scx], (char)BS->bits[scx+1], (char)BS->bits[scx+2]);
if ((couleur == NIL) || (srcColor != couleur)) {
BD->bits [ dcx ] = BS->bits [ scx ] ;
BD->bits [ dcx+1 ] = BS->bits [ scx+1 ] ;
BD->bits [ dcx+2 ] = BS->bits [ scx+2 ] ;
}

a small debug with _COLOR_BGR_TO_I comparison value should be easy.

#7 Updated by tony almost 4 years ago

arkeon wrote:

srcColor = _COLOR_BGR_TO_I ((char)BS->bits[scx], (char)BS->bits[scx+1], (char)BS->bits[scx+2]);
if ((couleur == NIL) || (srcColor != couleur)) {
BD->bits [ dcx ] = BS->bits [ scx ] ;
BD->bits [ dcx+1 ] = BS->bits [ scx+1 ] ;
BD->bits [ dcx+2 ] = BS->bits [ scx+2 ] ;
}

a small debug with _COLOR_BGR_TO_I comparison value should be easy.

Which file and which function ? please...

I had a very quick look (no real debugging) at the LIBOS2D dll and found functions that properly (or so it seemed) used the "couleur" (color) variable. But there must be some corruption somewhere.

#8 Updated by arkeon almost 4 years ago

bitmap.c

function GRCopyBitmap line 3608

#9 Updated by tony almost 4 years ago

  • Status changed from New to Feedback

Correction committed.
Transparency color was not taken into account if source and destination bitmaps had the same dimensions.

#10 Updated by tony almost 4 years ago

  • Status changed from Feedback to Closed
  • % Done changed from 0 to 100
  • Estimated time set to 4.00 h

Also available in: Atom PDF