Project

General

Profile

Actions

Bug #489

closed

Transparency parameter not taken into account in _CPbitmap24 (LIB2DOS24)

Added by tony about 10 years ago. Updated about 10 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

Actions #1

Updated by arkeon about 10 years ago

Did you check the function code ?

Actions #2

Updated by arkeon about 10 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 ?

Actions #3

Updated by tony about 10 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)

Actions #4

Updated by tony about 10 years ago

  • Assignee set to tony
Actions #5

Updated by tony about 10 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.

Actions #6

Updated by arkeon about 10 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.

Actions #7

Updated by tony about 10 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.

Actions #8

Updated by arkeon about 10 years ago

bitmap.c

function GRCopyBitmap line 3608

Actions #9

Updated by tony about 10 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.

Actions #10

Updated by tony about 10 years ago

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

Also available in: Atom PDF