bmpacc2.cxx (9f62ea84) bmpacc2.cxx (87bc88d3)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 18 unchanged lines hidden (view full) ---

27#include <vcl/bmpacc.hxx>
28
29// ----------------
30// - BitmapAccess -
31// ----------------
32
33IMPL_FORMAT_GETPIXEL_NOMASK( _1BIT_MSB_PAL )
34{
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 18 unchanged lines hidden (view full) ---

27#include <vcl/bmpacc.hxx>
28
29// ----------------
30// - BitmapAccess -
31// ----------------
32
33IMPL_FORMAT_GETPIXEL_NOMASK( _1BIT_MSB_PAL )
34{
35 return( pScanline[ nX >> 3 ] & ( 1 << ( 7 - ( nX & 7 ) ) ) ? 1 : 0 );
35 return BitmapColor( pScanline[ nX >> 3 ] & ( 1 << ( 7 - ( nX & 7 ) ) ) ? 1 : 0 );
36}
37
38// ------------------------------------------------------------------
39
40IMPL_FORMAT_SETPIXEL_NOMASK( _1BIT_MSB_PAL )
41{
42 sal_uInt8& rByte = pScanline[ nX >> 3 ];
43
44 ( rBitmapColor.GetIndex() & 1 ) ? ( rByte |= 1 << ( 7 - ( nX & 7 ) ) ) :
45 ( rByte &= ~( 1 << ( 7 - ( nX & 7 ) ) ) );
46}
47
48// ------------------------------------------------------------------
49
50IMPL_FORMAT_GETPIXEL_NOMASK( _1BIT_LSB_PAL )
51{
36}
37
38// ------------------------------------------------------------------
39
40IMPL_FORMAT_SETPIXEL_NOMASK( _1BIT_MSB_PAL )
41{
42 sal_uInt8& rByte = pScanline[ nX >> 3 ];
43
44 ( rBitmapColor.GetIndex() & 1 ) ? ( rByte |= 1 << ( 7 - ( nX & 7 ) ) ) :
45 ( rByte &= ~( 1 << ( 7 - ( nX & 7 ) ) ) );
46}
47
48// ------------------------------------------------------------------
49
50IMPL_FORMAT_GETPIXEL_NOMASK( _1BIT_LSB_PAL )
51{
52 return( pScanline[ nX >> 3 ] & ( 1 << ( nX & 7 ) ) ? 1 : 0 );
52 return BitmapColor( pScanline[ nX >> 3 ] & ( 1 << ( nX & 7 ) ) ? 1 : 0 );
53}
54
55// ------------------------------------------------------------------
56
57IMPL_FORMAT_SETPIXEL_NOMASK( _1BIT_LSB_PAL )
58{
59 sal_uInt8& rByte = pScanline[ nX >> 3 ];
60
61 ( rBitmapColor.GetIndex() & 1 ) ? ( rByte |= 1 << ( nX & 7 ) ) :
62 ( rByte &= ~( 1 << ( nX & 7 ) ) );
63}
64
65// ------------------------------------------------------------------
66
67IMPL_FORMAT_GETPIXEL_NOMASK( _4BIT_MSN_PAL )
68{
53}
54
55// ------------------------------------------------------------------
56
57IMPL_FORMAT_SETPIXEL_NOMASK( _1BIT_LSB_PAL )
58{
59 sal_uInt8& rByte = pScanline[ nX >> 3 ];
60
61 ( rBitmapColor.GetIndex() & 1 ) ? ( rByte |= 1 << ( nX & 7 ) ) :
62 ( rByte &= ~( 1 << ( nX & 7 ) ) );
63}
64
65// ------------------------------------------------------------------
66
67IMPL_FORMAT_GETPIXEL_NOMASK( _4BIT_MSN_PAL )
68{
69 return( ( pScanline[ nX >> 1 ] >> ( nX & 1 ? 0 : 4 ) ) & 0x0f );
69 return BitmapColor( ( pScanline[ nX >> 1 ] >> ( nX & 1 ? 0 : 4 ) ) & 0x0f );
70}
71
72// ------------------------------------------------------------------
73
74IMPL_FORMAT_SETPIXEL_NOMASK( _4BIT_MSN_PAL )
75{
76 sal_uInt8& rByte = pScanline[ nX >> 1 ];
77
78 ( nX & 1 ) ? ( rByte &= 0xf0, rByte |= ( rBitmapColor.GetIndex() & 0x0f ) ) :
79 ( rByte &= 0x0f, rByte |= ( rBitmapColor.GetIndex() << 4 ) );
80}
81
82// ------------------------------------------------------------------
83
84IMPL_FORMAT_GETPIXEL_NOMASK( _4BIT_LSN_PAL )
85{
70}
71
72// ------------------------------------------------------------------
73
74IMPL_FORMAT_SETPIXEL_NOMASK( _4BIT_MSN_PAL )
75{
76 sal_uInt8& rByte = pScanline[ nX >> 1 ];
77
78 ( nX & 1 ) ? ( rByte &= 0xf0, rByte |= ( rBitmapColor.GetIndex() & 0x0f ) ) :
79 ( rByte &= 0x0f, rByte |= ( rBitmapColor.GetIndex() << 4 ) );
80}
81
82// ------------------------------------------------------------------
83
84IMPL_FORMAT_GETPIXEL_NOMASK( _4BIT_LSN_PAL )
85{
86 return( ( pScanline[ nX >> 1 ] >> ( nX & 1 ? 4 : 0 ) ) & 0x0f );
86 return BitmapColor( ( pScanline[ nX >> 1 ] >> ( nX & 1 ? 4 : 0 ) ) & 0x0f );
87}
88
89// ------------------------------------------------------------------
90
91IMPL_FORMAT_SETPIXEL_NOMASK( _4BIT_LSN_PAL )
92{
93 sal_uInt8& rByte = pScanline[ nX >> 1 ];
94
95 ( nX & 1 ) ? ( rByte &= 0x0f, rByte |= ( rBitmapColor.GetIndex() << 4 ) ) :
96 ( rByte &= 0xf0, rByte |= ( rBitmapColor.GetIndex() & 0x0f ) );
97}
98
99// ------------------------------------------------------------------
100
101IMPL_FORMAT_GETPIXEL_NOMASK( _8BIT_PAL )
102{
87}
88
89// ------------------------------------------------------------------
90
91IMPL_FORMAT_SETPIXEL_NOMASK( _4BIT_LSN_PAL )
92{
93 sal_uInt8& rByte = pScanline[ nX >> 1 ];
94
95 ( nX & 1 ) ? ( rByte &= 0x0f, rByte |= ( rBitmapColor.GetIndex() << 4 ) ) :
96 ( rByte &= 0xf0, rByte |= ( rBitmapColor.GetIndex() & 0x0f ) );
97}
98
99// ------------------------------------------------------------------
100
101IMPL_FORMAT_GETPIXEL_NOMASK( _8BIT_PAL )
102{
103 return pScanline[ nX ];
103 return BitmapColor( pScanline[ nX ] );
104}
105
106// ------------------------------------------------------------------
107
108IMPL_FORMAT_SETPIXEL_NOMASK( _8BIT_PAL )
109{
110 pScanline[ nX ] = rBitmapColor.GetIndex();
111}

--- 216 unchanged lines hidden ---
104}
105
106// ------------------------------------------------------------------
107
108IMPL_FORMAT_SETPIXEL_NOMASK( _8BIT_PAL )
109{
110 pScanline[ nX ] = rBitmapColor.GetIndex();
111}

--- 216 unchanged lines hidden ---