nr-pixblock.h File Reference
Pixel block structure. More...
Go to the source code of this file.
Classes | |
| struct | NRPixBlock |
| The pixel block struct. More... | |
Enumerations | |
| enum | NR_PIXBLOCK_SIZE { NR_PIXBLOCK_SIZE_TINY, NR_PIXBLOCK_SIZE_4K, NR_PIXBLOCK_SIZE_16K, NR_PIXBLOCK_SIZE_64K, NR_PIXBLOCK_SIZE_256K, NR_PIXBLOCK_SIZE_1M, NR_PIXBLOCK_SIZE_BIG, NR_PIXBLOCK_SIZE_STATIC } |
Size indicator. Hardcoded to max. 3 bits. More... | |
| enum | NR_PIXBLOCK_MODE { NR_PIXBLOCK_MODE_A8, NR_PIXBLOCK_MODE_R8G8B8, NR_PIXBLOCK_MODE_R8G8B8A8N, NR_PIXBLOCK_MODE_R8G8B8A8P } |
Mode indicator. Hardcoded to max. 2 bits. More... | |
Functions | |
| int | NR_PIXBLOCK_BPP (NRPixBlock *pb) |
| Returns number of bytes per pixel (1, 3, or 4). | |
| unsigned char * | NR_PIXBLOCK_PX (NRPixBlock *pb) |
| Returns pointer to pixel data. | |
| unsigned char const * | NR_PIXBLOCK_PX (NRPixBlock const *pb) |
| void | nr_pixblock_setup (NRPixBlock *pb, NR_PIXBLOCK_MODE mode, int x0, int y0, int x1, int y1, bool clear) |
| Pixbuf initialisation using g_new. | |
| void | nr_pixblock_setup_fast (NRPixBlock *pb, NR_PIXBLOCK_MODE mode, int x0, int y0, int x1, int y1, bool clear) |
| Pixbuf initialisation using homegrown memory handling ("pixelstore"). | |
| void | nr_pixblock_setup_extern (NRPixBlock *pb, NR_PIXBLOCK_MODE mode, int x0, int y0, int x1, int y1, unsigned char *px, int rs, bool empty, bool clear) |
| Pixbuf initialisation with preset values. | |
| void | nr_pixblock_release (NRPixBlock *pb) |
| Frees memory taken by pixel data in NRPixBlock. | |
| NRPixBlock * | nr_pixblock_new (NR_PIXBLOCK_MODE mode, int x0, int y0, int x1, int y1, bool clear) |
| Allocates NRPixBlock and sets it up. | |
| NRPixBlock * | nr_pixblock_new_fast (NR_PIXBLOCK_MODE mode, int x0, int y0, int x1, int y1, bool clear) |
| Allocates NRPixBlock and sets it up. | |
| NRPixBlock * | nr_pixblock_free (NRPixBlock *pb) |
| Frees all memory taken by pixblock. | |
| unsigned char * | nr_pixelstore_4K_new (bool clear, unsigned char val) |
| void | nr_pixelstore_4K_free (unsigned char *px) |
| unsigned char * | nr_pixelstore_16K_new (bool clear, unsigned char val) |
| void | nr_pixelstore_16K_free (unsigned char *px) |
| unsigned char * | nr_pixelstore_64K_new (bool clear, unsigned char val) |
| void | nr_pixelstore_64K_free (unsigned char *px) |
| unsigned char * | nr_pixelstore_256K_new (bool clear, unsigned char val) |
| void | nr_pixelstore_256K_free (unsigned char *px) |
| unsigned char * | nr_pixelstore_1M_new (bool clear, unsigned char val) |
| void | nr_pixelstore_1M_free (unsigned char *px) |
Detailed Description
Pixel block structure.
Used for low-level rendering.
Authors: (C) 1999-2002 Lauris Kaplinski <lauris@kaplinski.com> (C) 2005 Ralf Stephan <ralf@ark.in-berlin.de> (some cleanup)
This code is in the Public Domain.
Definition in file nr-pixblock.h.
Enumeration Type Documentation
| enum NR_PIXBLOCK_MODE |
Mode indicator. Hardcoded to max. 2 bits.
- Enumerator:
NR_PIXBLOCK_MODE_A8 Grayscale.
NR_PIXBLOCK_MODE_R8G8B8 8 bit RGB
NR_PIXBLOCK_MODE_R8G8B8A8N Normal 8 bit RGBA.
NR_PIXBLOCK_MODE_R8G8B8A8P Premultiplied 8 bit RGBA.
Definition at line 30 of file nr-pixblock.h.
{
NR_PIXBLOCK_MODE_A8,
NR_PIXBLOCK_MODE_R8G8B8,
NR_PIXBLOCK_MODE_R8G8B8A8N,
NR_PIXBLOCK_MODE_R8G8B8A8P
} NR_PIXBLOCK_MODE;
| enum NR_PIXBLOCK_SIZE |
Size indicator. Hardcoded to max. 3 bits.
- Enumerator:
Definition at line 18 of file nr-pixblock.h.
{
NR_PIXBLOCK_SIZE_TINY,
NR_PIXBLOCK_SIZE_4K,
NR_PIXBLOCK_SIZE_16K,
NR_PIXBLOCK_SIZE_64K,
NR_PIXBLOCK_SIZE_256K,
NR_PIXBLOCK_SIZE_1M,
NR_PIXBLOCK_SIZE_BIG,
NR_PIXBLOCK_SIZE_STATIC
} NR_PIXBLOCK_SIZE;
Function Documentation
| int NR_PIXBLOCK_BPP | ( | NRPixBlock * | pb | ) | [inline] |
Returns number of bytes per pixel (1, 3, or 4).
Definition at line 53 of file nr-pixblock.h.
References NRPixBlock::mode, NR_PIXBLOCK_MODE_A8, and NR_PIXBLOCK_MODE_R8G8B8.
Referenced by nr_blit_pixblock_mask_rgba32(), nr_blit_pixblock_pixblock_alpha(), nr_blit_pixblock_pixblock_mask(), nr_pixblock_draw_line_rgba32(), nr_pixblock_render_gray_noise(), and Inkscape::Filters::FilterGaussian::render().
{
return ((pb->mode == NR_PIXBLOCK_MODE_A8) ? 1 :
(pb->mode == NR_PIXBLOCK_MODE_R8G8B8) ? 3 : 4);
}
| NRPixBlock* nr_pixblock_free | ( | NRPixBlock * | pb | ) |
Frees all memory taken by pixblock.
- Returns:
- NULL
Definition at line 265 of file nr-pixblock.cpp.
References nr_pixblock_release().
Referenced by Inkscape::Filters::FilterGaussian::render(), and Inkscape::Filters::FilterComposite::render().
{
nr_pixblock_release (pb);
g_free (pb);
return NULL;
}
| NRPixBlock* nr_pixblock_new | ( | NR_PIXBLOCK_MODE | mode, | |
| int | x0, | |||
| int | y0, | |||
| int | x1, | |||
| int | y1, | |||
| bool | clear | |||
| ) |
Allocates NRPixBlock and sets it up.
- Returns:
- Pointer to fresh pixblock. Calls g_new() and nr_pixblock_setup(). FIXME: currently unused, delete? JG: Should be used more often! (To simplify memory management.)
Definition at line 220 of file nr-pixblock.cpp.
References NRPixBlock::data, nr_pixblock_setup(), NR_PIXBLOCK_SIZE_TINY, NRPixBlock::px, and NRPixBlock::size.
{
NRPixBlock *pb;
pb = g_new (NRPixBlock, 1);
if (!pb) return 0;
nr_pixblock_setup (pb, mode, x0, y0, x1, y1, clear);
if (pb->size!=NR_PIXBLOCK_SIZE_TINY && !pb->data.px) {
g_free(pb);
return 0;
}
return pb;
}
| NRPixBlock* nr_pixblock_new_fast | ( | NR_PIXBLOCK_MODE | mode, | |
| int | x0, | |||
| int | y0, | |||
| int | x1, | |||
| int | y1, | |||
| bool | clear | |||
| ) |
Allocates NRPixBlock and sets it up.
- Returns:
- Pointer to fresh pixblock. Calls g_new() and nr_pixblock_setup().
Definition at line 243 of file nr-pixblock.cpp.
References NRPixBlock::data, nr_pixblock_setup_fast(), NR_PIXBLOCK_SIZE_TINY, NRPixBlock::px, and NRPixBlock::size.
Referenced by Inkscape::Filters::FilterGaussian::render(), and Inkscape::Filters::FilterComposite::render().
{
NRPixBlock *pb;
pb = g_new (NRPixBlock, 1);
if (!pb) return 0;
nr_pixblock_setup_fast (pb, mode, x0, y0, x1, y1, clear);
if (pb->size!=NR_PIXBLOCK_SIZE_TINY && !pb->data.px) {
g_free(pb);
return 0;
}
return pb;
}
| unsigned char* NR_PIXBLOCK_PX | ( | NRPixBlock * | pb | ) | [inline] |
Returns pointer to pixel data.
Definition at line 61 of file nr-pixblock.h.
References NRPixBlock::data, NR_PIXBLOCK_SIZE_TINY, NRPixBlock::p, NRPixBlock::px, and NRPixBlock::size.
Referenced by clonetiler_trace_pick(), get_cached_tile_pixel(), main(), nr_arena_image_render(), nr_arena_item_invoke_render(), nr_arena_shape_clip(), nr_blit_pixblock_mask_rgba32(), nr_blit_pixblock_pixblock_alpha(), nr_blit_pixblock_pixblock_mask(), nr_create_cairo_context(), nr_gdk_draw_gray_garbage(), nr_gdk_draw_rgba32_solid(), nr_pixblock_draw_line_rgba32(), nr_pixblock_render_gray_noise(), Inkscape::Filters::performDisplacement(), Inkscape::Filters::pixelValue(), Inkscape::Filters::pixops_mix(), Inkscape::Filters::FilterTile::render(), Inkscape::Filters::FilterSpecularLighting::render(), Inkscape::Filters::FilterMorphology::render(), Inkscape::Filters::FilterImage::render(), Inkscape::Filters::FilterGaussian::render(), Inkscape::Filters::FilterFlood::render(), Inkscape::Filters::FilterDiffuseLighting::render(), Inkscape::Filters::FilterConvolveMatrix::render(), Inkscape::Filters::FilterComponentTransfer::render(), Inkscape::Filters::FilterColorMatrix::render(), Inkscape::Filters::FilterTurbulence::render_area(), sp_canvas_paint_single_buffer(), sp_dropper_context_root_handler(), sp_dyna_draw_brush(), sp_export_get_rows(), sp_flood_do_flood_fill(), sp_font_preview_expose(), sp_generate_internal_bitmap(), sp_pat_fill(), and Inkscape::Filters::FilterTurbulence::update_pixbuffer().
| unsigned char const* NR_PIXBLOCK_PX | ( | NRPixBlock const * | pb | ) | [inline] |
Definition at line 67 of file nr-pixblock.h.
References NRPixBlock::data, NR_PIXBLOCK_SIZE_TINY, NRPixBlock::p, NRPixBlock::px, and NRPixBlock::size.
{
return ((pb->size == NR_PIXBLOCK_SIZE_TINY) ?
pb->data.p : pb->data.px);
}
| void nr_pixblock_release | ( | NRPixBlock * | pb | ) |
Frees memory taken by pixel data in NRPixBlock.
- Parameters:
-
pb Pointer to pixblock.
- Precondition:
- pb and pb->data.px point to valid addresses.
According to pb->size, one of the functions for freeing the pixelstore is called. May be called regardless of how pixbuf was set up.
Definition at line 182 of file nr-pixblock.cpp.
References NRPixBlock::data, NR_PIXBLOCK_SIZE_16K, NR_PIXBLOCK_SIZE_1M, NR_PIXBLOCK_SIZE_256K, NR_PIXBLOCK_SIZE_4K, NR_PIXBLOCK_SIZE_64K, NR_PIXBLOCK_SIZE_BIG, NR_PIXBLOCK_SIZE_STATIC, NR_PIXBLOCK_SIZE_TINY, nr_pixelstore_16K_free(), nr_pixelstore_1M_free(), nr_pixelstore_256K_free(), nr_pixelstore_4K_free(), nr_pixelstore_64K_free(), NRPixBlock::px, and NRPixBlock::size.
Referenced by clonetiler_trace_pick(), nr_arena_glyphs_group_render(), nr_arena_item_invoke_render(), nr_arena_render_paintserver_fill(), nr_arena_shape_clip(), nr_arena_shape_render(), nr_gdk_draw_gray_garbage(), nr_gdk_draw_rgba32_solid(), nr_pixblock_draw_line_rgba32(), nr_pixblock_free(), Inkscape::Filters::FilterMorphology::render(), Inkscape::Filters::FilterMerge::render(), Inkscape::Filters::FilterImage::render(), Inkscape::Filters::FilterGaussian::render(), Inkscape::Filters::FilterDisplacementMap::render(), Inkscape::Filters::FilterComponentTransfer::render(), Inkscape::Filters::FilterColorMatrix::render(), Inkscape::Filters::FilterBlend::render(), render_pixbuf(), sp_canvas_arena_render(), sp_canvas_paint_single_buffer(), sp_dropper_context_root_handler(), sp_export_get_rows(), sp_flood_do_flood_fill(), sp_font_preview_expose(), sp_gradient_image_update(), sp_icon_doc_icon(), sp_pat_fill(), sp_pattern_painter_free(), Inkscape::Filters::FilterTurbulence::update_pixbuffer(), and Inkscape::Filters::FilterTurbulence::~FilterTurbulence().
{
switch (pb->size) {
case NR_PIXBLOCK_SIZE_TINY:
break;
case NR_PIXBLOCK_SIZE_4K:
nr_pixelstore_4K_free (pb->data.px);
break;
case NR_PIXBLOCK_SIZE_16K:
nr_pixelstore_16K_free (pb->data.px);
break;
case NR_PIXBLOCK_SIZE_64K:
nr_pixelstore_64K_free (pb->data.px);
break;
case NR_PIXBLOCK_SIZE_256K:
nr_pixelstore_256K_free (pb->data.px);
break;
case NR_PIXBLOCK_SIZE_1M:
nr_pixelstore_1M_free (pb->data.px);
break;
case NR_PIXBLOCK_SIZE_BIG:
g_free (pb->data.px);
break;
case NR_PIXBLOCK_SIZE_STATIC:
break;
default:
break;
}
}
| void nr_pixblock_setup | ( | NRPixBlock * | pb, | |
| NR_PIXBLOCK_MODE | mode, | |||
| int | x0, | |||
| int | y0, | |||
| int | x1, | |||
| int | y1, | |||
| bool | clear | |||
| ) |
Pixbuf initialisation using g_new.
After allocating memory, the buffer is cleared if the clear flag is set.
- Parameters:
-
pb Pointer to the pixbuf struct. mode Indicates grayscale/RGB/RGBA. clear True if buffer should be cleared.
- Precondition:
- x1>=x0 && y1>=y0 && pb!=NULL FIXME: currently unused except for nr_pixblock_new and pattern tiles, replace with _fast and delete?
Definition at line 101 of file nr-pixblock.cpp.
References NRPixBlock::area, NRPixBlock::data, NRPixBlock::empty, h, NRPixBlock::mode, NR_PIXBLOCK_MODE_R8G8B8, NR_TINY_MAX, NRPixBlock::p, NRPixBlock::px, NRPixBlock::rs, NRPixBlock::size, NRPixBlock::visible_area, dxf_input::w, NRRectL::x0, NRRectL::x1, NRRectL::y0, and NRRectL::y1.
Referenced by nr_pixblock_new(), and sp_pattern_painter_new().
{
int w, h, bpp;
size_t size;
w = x1 - x0;
h = y1 - y0;
bpp = (mode == NR_PIXBLOCK_MODE_A8) ? 1 : (mode == NR_PIXBLOCK_MODE_R8G8B8) ? 3 : 4;
size = bpp * w * h;
if (size <= NR_TINY_MAX) {
pb->size = NR_PIXBLOCK_SIZE_TINY;
if (clear) memset (pb->data.p, 0x0, size);
} else {
pb->size = NR_PIXBLOCK_SIZE_BIG;
pb->data.px = g_new (unsigned char, size);
if (clear) memset (pb->data.px, 0x0, size);
}
pb->mode = mode;
pb->empty = 1;
pb->visible_area.x0 = pb->area.x0 = x0;
pb->visible_area.y0 = pb->area.y0 = y0;
pb->visible_area.x1 = pb->area.x1 = x1;
pb->visible_area.y1 = pb->area.y1 = y1;
pb->rs = bpp * w;
}
| void nr_pixblock_setup_extern | ( | NRPixBlock * | pb, | |
| NR_PIXBLOCK_MODE | mode, | |||
| int | x0, | |||
| int | y0, | |||
| int | x1, | |||
| int | y1, | |||
| unsigned char * | px, | |||
| int | rs, | |||
| bool | empty, | |||
| bool | clear | |||
| ) |
Pixbuf initialisation with preset values.
After copying all parameters into the NRPixBlock struct, the pixel buffer is cleared if the clear flag is set.
- Parameters:
-
pb Pointer to the pixbuf struct. mode Indicates grayscale/RGB/RGBA. clear True if buffer should be cleared.
- Precondition:
- x1>=x0 && y1>=y0 && pb!=NULL
- Todo:
- How do you recognise if
px was an uncleared tiny buffer?
Definition at line 140 of file nr-pixblock.cpp.
References NRPixBlock::area, NRPixBlock::data, NRPixBlock::empty, NRPixBlock::mode, NR_PIXBLOCK_MODE_R8G8B8, NULL, NRPixBlock::px, NRPixBlock::rs, NRPixBlock::size, NRPixBlock::visible_area, dxf_input::w, NRRectL::x0, NRRectL::x1, voronoi::y, NRRectL::y0, and NRRectL::y1.
Referenced by clonetiler_trace_pick(), nr_arena_item_invoke_render(), Inkscape::Filters::FilterImage::render(), render_pixbuf(), sp_canvas_arena_render(), sp_canvas_paint_single_buffer(), sp_export_get_rows(), sp_flood_do_flood_fill(), sp_font_preview_expose(), sp_generate_internal_bitmap(), sp_gradient_image_update(), sp_icon_doc_icon(), and sp_pat_fill().
{
int w, bpp;
w = x1 - x0;
bpp = (mode == NR_PIXBLOCK_MODE_A8) ? 1 : (mode == NR_PIXBLOCK_MODE_R8G8B8) ? 3 : 4;
pb->size = NR_PIXBLOCK_SIZE_STATIC;
pb->mode = mode;
pb->empty = empty;
pb->visible_area.x0 = pb->area.x0 = x0;
pb->visible_area.y0 = pb->area.y0 = y0;
pb->visible_area.x1 = pb->area.x1 = x1;
pb->visible_area.y1 = pb->area.y1 = y1;
pb->data.px = px;
pb->rs = rs;
g_assert (pb->data.px != NULL);
if (clear) {
if (rs == bpp * w) {
if (pb->data.px)
memset (pb->data.px, 0x0, bpp * (y1 - y0) * w);
} else {
int y;
for (y = y0; y < y1; y++) {
memset (pb->data.px + (y - y0) * rs, 0x0, bpp * w);
}
}
}
}
| void nr_pixblock_setup_fast | ( | NRPixBlock * | pb, | |
| NR_PIXBLOCK_MODE | mode, | |||
| int | x0, | |||
| int | y0, | |||
| int | x1, | |||
| int | y1, | |||
| bool | clear | |||
| ) |
Pixbuf initialisation using homegrown memory handling ("pixelstore").
Pixbuf sizes are differentiated into tiny, <4K, <16K, <64K, and more, with each type having its own method of memory handling. After allocating memory, the buffer is cleared if the clear flag is set. Intended to reduce memory fragmentation.
- Parameters:
-
pb Pointer to the pixbuf struct. mode Indicates grayscale/RGB/RGBA. clear True if buffer should be cleared.
- Precondition:
- x1>=x0 && y1>=y0 && pb!=NULL
Definition at line 35 of file nr-pixblock.cpp.
References NRPixBlock::area, NRPixBlock::data, NRPixBlock::empty, h, NRPixBlock::mode, NR_PIXBLOCK_MODE_R8G8B8, nr_pixelstore_16K_new(), nr_pixelstore_1M_new(), nr_pixelstore_256K_new(), nr_pixelstore_4K_new(), nr_pixelstore_64K_new(), NR_TINY_MAX, NULL, NRPixBlock::p, NRPixBlock::px, NRPixBlock::rs, NRPixBlock::size, NRPixBlock::visible_area, dxf_input::w, NRRectL::x0, NRRectL::x1, NRRectL::y0, and NRRectL::y1.
Referenced by main(), nr_arena_glyphs_group_render(), nr_arena_item_get_background(), nr_arena_item_invoke_render(), nr_arena_render_paintserver_fill(), nr_arena_shape_clip(), nr_arena_shape_render(), nr_gdk_draw_gray_garbage(), nr_gdk_draw_rgba32_solid(), nr_pixblock_draw_line_rgba32(), nr_pixblock_new_fast(), Inkscape::Filters::Filter::render(), Inkscape::Filters::FilterTurbulence::render(), Inkscape::Filters::FilterTile::render(), Inkscape::Filters::FilterSpecularLighting::render(), Inkscape::Filters::FilterOffset::render(), Inkscape::Filters::FilterMorphology::render(), Inkscape::Filters::FilterMerge::render(), Inkscape::Filters::FilterImage::render(), Inkscape::Filters::FilterGaussian::render(), Inkscape::Filters::FilterFlood::render(), Inkscape::Filters::FilterDisplacementMap::render(), Inkscape::Filters::FilterDiffuseLighting::render(), Inkscape::Filters::FilterConvolveMatrix::render(), Inkscape::Filters::FilterComposite::render(), Inkscape::Filters::FilterComponentTransfer::render(), Inkscape::Filters::FilterColorMatrix::render(), Inkscape::Filters::FilterBlend::render(), sp_canvas_paint_single_buffer(), sp_dropper_context_root_handler(), sp_dyna_draw_brush(), sp_font_preview_expose(), and Inkscape::Filters::FilterTurbulence::update_pixbuffer().
{
int w, h, bpp;
size_t size;
w = x1 - x0;
h = y1 - y0;
bpp = (mode == NR_PIXBLOCK_MODE_A8) ? 1 : (mode == NR_PIXBLOCK_MODE_R8G8B8) ? 3 : 4;
size = bpp * w * h;
if (size <= NR_TINY_MAX) {
pb->size = NR_PIXBLOCK_SIZE_TINY;
if (clear) memset (pb->data.p, 0x0, size);
} else if (size <= 4096) {
pb->size = NR_PIXBLOCK_SIZE_4K;
pb->data.px = nr_pixelstore_4K_new (clear, 0x0);
} else if (size <= 16384) {
pb->size = NR_PIXBLOCK_SIZE_16K;
pb->data.px = nr_pixelstore_16K_new (clear, 0x0);
} else if (size <= 65536) {
pb->size = NR_PIXBLOCK_SIZE_64K;
pb->data.px = nr_pixelstore_64K_new (clear, 0x0);
} else if (size <= 262144) {
pb->size = NR_PIXBLOCK_SIZE_256K;
pb->data.px = nr_pixelstore_256K_new (clear, 0x0);
} else if (size <= 1048576) {
pb->size = NR_PIXBLOCK_SIZE_1M;
pb->data.px = nr_pixelstore_1M_new (clear, 0x0);
} else {
pb->size = NR_PIXBLOCK_SIZE_BIG;
pb->data.px = NULL;
if (size > 100000000) { // Don't even try to allocate more than 100Mb (5000x5000 RGBA
// pixels). It'll just bog the system down even if successful. FIXME:
// Can anyone suggest something better than the magic number?
g_warning ("%lu bytes requested for pixel buffer, I won't try to allocate that.", (long unsigned) size);
return;
}
pb->data.px = g_try_new (unsigned char, size);
if (pb->data.px == NULL) { // memory allocation failed
g_warning ("Could not allocate %lu bytes for pixel buffer!", (long unsigned) size);
return;
}
if (clear) memset (pb->data.px, 0x0, size);
}
pb->mode = mode;
pb->empty = 1;
pb->visible_area.x0 = pb->area.x0 = x0;
pb->visible_area.y0 = pb->area.y0 = y0;
pb->visible_area.x1 = pb->area.x1 = x1;
pb->visible_area.y1 = pb->area.y1 = y1;
pb->rs = bpp * w;
}
| void nr_pixelstore_16K_free | ( | unsigned char * | px | ) |
Definition at line 333 of file nr-pixblock.cpp.
References nr_16K_len, nr_16K_px, and nr_16K_size.
Referenced by nr_pixblock_release(), and sp_font_preview_expose().
{
if (nr_16K_len == nr_16K_size) {
nr_16K_size += NR_16K_BLOCK;
nr_16K_px = g_renew (unsigned char *, nr_16K_px, nr_16K_size);
}
nr_16K_px[nr_16K_len] = px;
nr_16K_len += 1;
}
| unsigned char* nr_pixelstore_16K_new | ( | bool | clear, | |
| unsigned char | val | |||
| ) |
Definition at line 316 of file nr-pixblock.cpp.
References nr_16K_len, and nr_16K_px.
Referenced by nr_pixblock_setup_fast(), and sp_font_preview_expose().
{
unsigned char *px;
if (nr_16K_len != 0) {
nr_16K_len -= 1;
px = nr_16K_px[nr_16K_len];
} else {
px = g_new (unsigned char, 16384);
}
if (clear) memset (px, val, 16384);
return px;
}
| void nr_pixelstore_1M_free | ( | unsigned char * | px | ) |
Definition at line 437 of file nr-pixblock.cpp.
References nr_1M_len, nr_1M_px, and nr_1M_size.
Referenced by nr_pixblock_release(), and sp_canvas_paint_single_buffer().
{
if (nr_1M_len == nr_1M_size) {
nr_1M_size += NR_1M_BLOCK;
nr_1M_px = g_renew (unsigned char *, nr_1M_px, nr_1M_size);
}
nr_1M_px[nr_1M_len] = px;
nr_1M_len += 1;
}
| unsigned char* nr_pixelstore_1M_new | ( | bool | clear, | |
| unsigned char | val | |||
| ) |
Definition at line 420 of file nr-pixblock.cpp.
References NR_1M, nr_1M_len, and nr_1M_px.
Referenced by nr_pixblock_setup_fast(), and sp_canvas_paint_single_buffer().
| void nr_pixelstore_256K_free | ( | unsigned char * | px | ) |
Definition at line 402 of file nr-pixblock.cpp.
References nr_256K_len, nr_256K_px, and nr_256K_size.
Referenced by nr_pixblock_release(), and sp_canvas_paint_single_buffer().
{
if (nr_256K_len == nr_256K_size) {
nr_256K_size += NR_256K_BLOCK;
nr_256K_px = g_renew (unsigned char *, nr_256K_px, nr_256K_size);
}
nr_256K_px[nr_256K_len] = px;
nr_256K_len += 1;
}
| unsigned char* nr_pixelstore_256K_new | ( | bool | clear, | |
| unsigned char | val | |||
| ) |
Definition at line 385 of file nr-pixblock.cpp.
References NR_256K, nr_256K_len, and nr_256K_px.
Referenced by nr_pixblock_setup_fast(), and sp_canvas_paint_single_buffer().
{
unsigned char *px;
if (nr_256K_len != 0) {
nr_256K_len -= 1;
px = nr_256K_px[nr_256K_len];
} else {
px = g_new (unsigned char, NR_256K);
}
if (clear) memset (px, val, NR_256K);
return px;
}
| void nr_pixelstore_4K_free | ( | unsigned char * | px | ) |
Definition at line 299 of file nr-pixblock.cpp.
References nr_4K_len, nr_4K_px, and nr_4K_size.
Referenced by nr_pixblock_release().
{
if (nr_4K_len == nr_4K_size) {
nr_4K_size += NR_4K_BLOCK;
nr_4K_px = g_renew (unsigned char *, nr_4K_px, nr_4K_size);
}
nr_4K_px[nr_4K_len] = px;
nr_4K_len += 1;
}
| unsigned char* nr_pixelstore_4K_new | ( | bool | clear, | |
| unsigned char | val | |||
| ) |
Definition at line 282 of file nr-pixblock.cpp.
References nr_4K_len, and nr_4K_px.
Referenced by nr_pixblock_setup_fast().
| void nr_pixelstore_64K_free | ( | unsigned char * | px | ) |
Definition at line 367 of file nr-pixblock.cpp.
References nr_64K_len, nr_64K_px, and nr_64K_size.
Referenced by nr_pixblock_release(), and sp_export_png_file().
{
if (nr_64K_len == nr_64K_size) {
nr_64K_size += NR_64K_BLOCK;
nr_64K_px = g_renew (unsigned char *, nr_64K_px, nr_64K_size);
}
nr_64K_px[nr_64K_len] = px;
nr_64K_len += 1;
}
| unsigned char* nr_pixelstore_64K_new | ( | bool | clear, | |
| unsigned char | val | |||
| ) |
Definition at line 350 of file nr-pixblock.cpp.
References nr_64K_len, and nr_64K_px.
Referenced by nr_pixblock_setup_fast(), and sp_export_png_file().
{
unsigned char *px;
if (nr_64K_len != 0) {
nr_64K_len -= 1;
px = nr_64K_px[nr_64K_len];
} else {
px = g_new (unsigned char, 65536);
}
if (clear) memset (px, val, 65536);
return px;
}
