Package org.gnome.gdkpixbuf
Class Pixbuf.Builder<B extends Pixbuf.Builder<B>>
java.lang.Object
io.github.jwharm.javagi.gobject.Builder<B>
org.gnome.gobject.GObject.Builder<B>
org.gnome.gdkpixbuf.Pixbuf.Builder<B>
- Type Parameters:
B
- the type of the Builder that is returned
- All Implemented Interfaces:
BuilderInterface
- Enclosing class:
Pixbuf
Inner class implementing a builder pattern to construct a GObject with
properties.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Finish building thePixbuf
object.setBitsPerSample
(int bitsPerSample) The number of bits per sample.setColorspace
(Colorspace colorspace) The color space of the pixbuf.setHasAlpha
(boolean hasAlpha) Whether the pixbuf has an alpha channel.setHeight
(int height) The number of rows of the pixbuf.setNChannels
(int nChannels) The number of samples per pixel.setPixelBytes
(Bytes pixelBytes) setPixels
(MemorySegment pixels) A pointer to the pixel data of the pixbuf.setRowstride
(int rowstride) The number of bytes between the start of a row and the start of the next row.setWidth
(int width) The number of columns of the pixbuf.Methods inherited from class org.gnome.gobject.GObject.Builder
onNotify
Methods inherited from class io.github.jwharm.javagi.gobject.Builder
addBuilderProperty, connect, connect, connectSignals, getArena, getNames, getValues
-
Constructor Details
-
Builder
protected Builder()Default constructor for aBuilder
object.
-
-
Method Details
-
build
Finish building thePixbuf
object. This will callGObject.withProperties(org.gnome.glib.Type, java.lang.String[], org.gnome.gobject.Value[])
to create a new GObject instance, which is then cast toPixbuf
.- Overrides:
build
in classGObject.Builder<B extends Pixbuf.Builder<B>>
- Returns:
- a new instance of
Pixbuf
with the properties that were set in the Builder object.
-
setBitsPerSample
The number of bits per sample.Currently only 8 bit per sample are supported.
- Parameters:
bitsPerSample
- the value for thebits-per-sample
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setColorspace
The color space of the pixbuf.Currently, only
GDK_COLORSPACE_RGB
is supported.- Parameters:
colorspace
- the value for thecolorspace
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setHasAlpha
Whether the pixbuf has an alpha channel.- Parameters:
hasAlpha
- the value for thehas-alpha
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setHeight
The number of rows of the pixbuf.- Parameters:
height
- the value for theheight
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setNChannels
The number of samples per pixel.Currently, only 3 or 4 samples per pixel are supported.
- Parameters:
nChannels
- the value for then-channels
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setPixelBytes
-
setPixels
A pointer to the pixel data of the pixbuf.- Parameters:
pixels
- the value for thepixels
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setRowstride
The number of bytes between the start of a row and the start of the next row.This number must (obviously) be at least as large as the width of the pixbuf.
- Parameters:
rowstride
- the value for therowstride
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setWidth
The number of columns of the pixbuf.- Parameters:
width
- the value for thewidth
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-