Package org.gnome.gdkpixbuf
Class Pixbuf.Builder<B extends Pixbuf.Builder<B>>
java.lang.Object
org.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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Finish building thePixbufobject.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(byte[] 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
onNotifyMethods inherited from class org.javagi.gobject.Builder
addBuilderProperty, connect, connect, connectSignals, getArena, getNames, getValues
-
Constructor Details
-
Builder
protected Builder()Default constructor for aBuilderobject.
-
-
Method Details
-
build
Finish building thePixbufobject. 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:
buildin classGObject.Builder<B extends Pixbuf.Builder<B>>- Returns:
- a new instance of
Pixbufwith 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-sampleproperty- Returns:
- the
Builderinstance is returned, to allow method chaining
-
setColorspace
The color space of the pixbuf.Currently, only
GDK_COLORSPACE_RGBis supported.- Parameters:
colorspace- the value for thecolorspaceproperty- Returns:
- the
Builderinstance is returned, to allow method chaining
-
setHasAlpha
Whether the pixbuf has an alpha channel.- Parameters:
hasAlpha- the value for thehas-alphaproperty- Returns:
- the
Builderinstance is returned, to allow method chaining
-
setHeight
The number of rows of the pixbuf.- Parameters:
height- the value for theheightproperty- Returns:
- the
Builderinstance 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-channelsproperty- Returns:
- the
Builderinstance is returned, to allow method chaining
-
setPixelBytes
-
setPixels
A pointer to the pixel data of the pixbuf.- Parameters:
pixels- the value for thepixelsproperty- Returns:
- the
Builderinstance 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 therowstrideproperty- Returns:
- the
Builderinstance is returned, to allow method chaining
-
setWidth
The number of columns of the pixbuf.- Parameters:
width- the value for thewidthproperty- Returns:
- the
Builderinstance is returned, to allow method chaining
-