code
stringlengths 11
173k
| docstring
stringlengths 2
593k
| func_name
stringlengths 2
189
| language
stringclasses 1
value | repo
stringclasses 844
values | path
stringlengths 11
294
| url
stringlengths 60
339
| license
stringclasses 4
values |
---|---|---|---|---|---|---|---|
public boolean isSubpixel() {
try {
Stats.onNativeCall();
return _nIsSubpixel(_ptr);
} finally {
Reference.reachabilityFence(this);
}
} |
@return true if glyphs may be drawn at sub-pixel offsets
| Font::isSubpixel | java | JetBrains/skija | shared/java/Font.java | https://github.com/JetBrains/skija/blob/master/shared/java/Font.java | Apache-2.0 |
public boolean areMetricsLinear() {
try {
Stats.onNativeCall();
return _nAreMetricsLinear(_ptr);
} finally {
Reference.reachabilityFence(this);
}
} |
@return true if font and glyph metrics are requested to be linearly scalable
| Font::areMetricsLinear | java | JetBrains/skija | shared/java/Font.java | https://github.com/JetBrains/skija/blob/master/shared/java/Font.java | Apache-2.0 |
public boolean isEmboldened() {
try {
Stats.onNativeCall();
return _nIsEmboldened(_ptr);
} finally {
Reference.reachabilityFence(this);
}
} |
Returns true if bold is approximated by increasing the stroke width when creating glyph
bitmaps from outlines.
@return true if bold is approximated through stroke width
| Font::isEmboldened | java | JetBrains/skija | shared/java/Font.java | https://github.com/JetBrains/skija/blob/master/shared/java/Font.java | Apache-2.0 |
public boolean isBaselineSnapped() {
try {
Stats.onNativeCall();
return _nIsBaselineSnapped(_ptr);
} finally {
Reference.reachabilityFence(this);
}
} |
Returns true if baselines will be snapped to pixel positions when the current transformation
matrix is axis aligned.
@return true if baselines may be snapped to pixels
| Font::isBaselineSnapped | java | JetBrains/skija | shared/java/Font.java | https://github.com/JetBrains/skija/blob/master/shared/java/Font.java | Apache-2.0 |
public Font setAutoHintingForced(boolean value) {
Stats.onNativeCall();
_nSetAutoHintingForced(_ptr, value);
return this;
} |
Sets whether to always hint glyphs. If forceAutoHinting is set, instructs the font manager to always hint glyphs. Only affects platforms that use FreeType as the font manager.
@param value setting to always hint glyphs
@return this
| Font::setAutoHintingForced | java | JetBrains/skija | shared/java/Font.java | https://github.com/JetBrains/skija/blob/master/shared/java/Font.java | Apache-2.0 |
public Font setBitmapsEmbedded(boolean value) {
Stats.onNativeCall();
_nSetBitmapsEmbedded(_ptr, value);
return this;
} |
Requests, but does not require, to use bitmaps in fonts instead of outlines.
@param value setting to use bitmaps in fonts
@return this
| Font::setBitmapsEmbedded | java | JetBrains/skija | shared/java/Font.java | https://github.com/JetBrains/skija/blob/master/shared/java/Font.java | Apache-2.0 |
public Font setSubpixel(boolean value) {
Stats.onNativeCall();
_nSetSubpixel(_ptr, value);
return this;
} |
Requests, but does not require, that glyphs respect sub-pixel positioning.
@param value setting for sub-pixel positioning
@return this
| Font::setSubpixel | java | JetBrains/skija | shared/java/Font.java | https://github.com/JetBrains/skija/blob/master/shared/java/Font.java | Apache-2.0 |
public Font setMetricsLinear(boolean value) {
Stats.onNativeCall();
_nSetMetricsLinear(_ptr, value);
return this;
} |
Requests, but does not require, linearly scalable font and glyph metrics.
For outline fonts 'true' means font and glyph metrics should ignore hinting and rounding.
Note that some bitmap formats may not be able to scale linearly and will ignore this flag.
@param value setting for linearly scalable font and glyph metrics.
@return this
| Font::setMetricsLinear | java | JetBrains/skija | shared/java/Font.java | https://github.com/JetBrains/skija/blob/master/shared/java/Font.java | Apache-2.0 |
public Font setEmboldened(boolean value) {
Stats.onNativeCall();
_nSetEmboldened(_ptr, value);
return this;
} |
Increases stroke width when creating glyph bitmaps to approximate a bold typeface.
@param value setting for bold approximation
@return this
| Font::setEmboldened | java | JetBrains/skija | shared/java/Font.java | https://github.com/JetBrains/skija/blob/master/shared/java/Font.java | Apache-2.0 |
public Font setBaselineSnapped(boolean value) {
Stats.onNativeCall();
_nSetBaselineSnapped(_ptr, value);
return this;
} |
Requests that baselines be snapped to pixels when the current transformation matrix is axis
aligned.
@param value setting for baseline snapping to pixels
@return this
| Font::setBaselineSnapped | java | JetBrains/skija | shared/java/Font.java | https://github.com/JetBrains/skija/blob/master/shared/java/Font.java | Apache-2.0 |
public FontEdging getEdging() {
try {
Stats.onNativeCall();
return FontEdging._values[_nGetEdging(_ptr)];
} finally {
Reference.reachabilityFence(this);
}
} |
Whether edge pixels draw opaque or with partial transparency.
| Font::getEdging | java | JetBrains/skija | shared/java/Font.java | https://github.com/JetBrains/skija/blob/master/shared/java/Font.java | Apache-2.0 |
public Font setEdging(FontEdging value) {
Stats.onNativeCall();
_nSetEdging(_ptr, value.ordinal());
return this;
} |
Requests, but does not require, that edge pixels draw opaque or with
partial transparency.
| Font::setEdging | java | JetBrains/skija | shared/java/Font.java | https://github.com/JetBrains/skija/blob/master/shared/java/Font.java | Apache-2.0 |
public FontHinting getHinting() {
try {
Stats.onNativeCall();
return FontHinting._values[_nGetHinting(_ptr)];
} finally {
Reference.reachabilityFence(this);
}
} |
@return level of glyph outline adjustment
| Font::getHinting | java | JetBrains/skija | shared/java/Font.java | https://github.com/JetBrains/skija/blob/master/shared/java/Font.java | Apache-2.0 |
public Font setHinting(FontHinting value) {
Stats.onNativeCall();
_nSetHinting(_ptr, value.ordinal());
return this;
} |
Sets level of glyph outline adjustment. Does not check for valid values of hintingLevel.
| Font::setHinting | java | JetBrains/skija | shared/java/Font.java | https://github.com/JetBrains/skija/blob/master/shared/java/Font.java | Apache-2.0 |
public Font makeWithSize(float size) {
return new Font(getTypeface(), size, getScaleX(), getSkewX());
} |
Returns a font with the same attributes of this font, but with the specified size.
| Font::makeWithSize | java | JetBrains/skija | shared/java/Font.java | https://github.com/JetBrains/skija/blob/master/shared/java/Font.java | Apache-2.0 |
public float getSize() {
try {
Stats.onNativeCall();
return _nGetSize(_ptr);
} finally {
Reference.reachabilityFence(this);
}
} |
@return text size in points
| Font::getSize | java | JetBrains/skija | shared/java/Font.java | https://github.com/JetBrains/skija/blob/master/shared/java/Font.java | Apache-2.0 |
public float getScaleX() {
try {
Stats.onNativeCall();
return _nGetScaleX(_ptr);
} finally {
Reference.reachabilityFence(this);
}
} |
@return text scale on x-axis. Default value is 1
| Font::getScaleX | java | JetBrains/skija | shared/java/Font.java | https://github.com/JetBrains/skija/blob/master/shared/java/Font.java | Apache-2.0 |
public float getSkewX() {
try {
Stats.onNativeCall();
return _nGetSkewX(_ptr);
} finally {
Reference.reachabilityFence(this);
}
} |
@return text skew on x-axis. Default value is 0
| Font::getSkewX | java | JetBrains/skija | shared/java/Font.java | https://github.com/JetBrains/skija/blob/master/shared/java/Font.java | Apache-2.0 |
public Font setTypeface(@Nullable Typeface typeface) {
try {
Stats.onNativeCall();
_nSetTypeface(_ptr, Native.getPtr(typeface));
return this;
} finally {
Reference.reachabilityFence(typeface);
}
} |
Sets Typeface to typeface. Pass null to use the default typeface.
| Font::setTypeface | java | JetBrains/skija | shared/java/Font.java | https://github.com/JetBrains/skija/blob/master/shared/java/Font.java | Apache-2.0 |
public Font setSize(float value) {
Stats.onNativeCall();
_nSetSize(_ptr, value);
return this;
} |
Sets text size in points. Has no effect if value is not greater than or equal to zero.
| Font::setSize | java | JetBrains/skija | shared/java/Font.java | https://github.com/JetBrains/skija/blob/master/shared/java/Font.java | Apache-2.0 |
public Font setScaleX(float value) {
Stats.onNativeCall();
_nSetScaleX(_ptr, value);
return this;
} |
Sets text scale on x-axis. Default value is 1.
| Font::setScaleX | java | JetBrains/skija | shared/java/Font.java | https://github.com/JetBrains/skija/blob/master/shared/java/Font.java | Apache-2.0 |
public Font setSkewX(float value) {
Stats.onNativeCall();
_nSetSkewX(_ptr, value);
return this;
} |
Sets text skew on x-axis. Default value is 0.
| Font::setSkewX | java | JetBrains/skija | shared/java/Font.java | https://github.com/JetBrains/skija/blob/master/shared/java/Font.java | Apache-2.0 |
public short[] getStringGlyphs(String s) {
return getUTF32Glyphs(s.codePoints().toArray());
} |
Converts text into glyph indices.
@return the corresponding glyph ids for each character.
| Font::getStringGlyphs | java | JetBrains/skija | shared/java/Font.java | https://github.com/JetBrains/skija/blob/master/shared/java/Font.java | Apache-2.0 |
public short[] getUTF32Glyphs(int[] uni) {
try {
Stats.onNativeCall();
return _nGetUTF32Glyphs(_ptr, uni);
} finally {
Reference.reachabilityFence(this);
}
} |
Given an array of UTF32 character codes, return their corresponding glyph IDs.
@return the corresponding glyph IDs for each character.
| Font::getUTF32Glyphs | java | JetBrains/skija | shared/java/Font.java | https://github.com/JetBrains/skija/blob/master/shared/java/Font.java | Apache-2.0 |
public short getUTF32Glyph(int unichar) {
try {
Stats.onNativeCall();
return _nGetUTF32Glyph(_ptr, unichar);
} finally {
Reference.reachabilityFence(this);
}
} |
@return the glyph that corresponds to the specified unicode code-point (in UTF32 encoding). If the unichar is not supported, returns 0
| Font::getUTF32Glyph | java | JetBrains/skija | shared/java/Font.java | https://github.com/JetBrains/skija/blob/master/shared/java/Font.java | Apache-2.0 |
public int getStringGlyphsCount(String s) {
try {
Stats.onNativeCall();
return _nGetStringGlyphsCount(_ptr, s);
} finally {
Reference.reachabilityFence(this);
}
} |
@return number of glyphs represented by text
| Font::getStringGlyphsCount | java | JetBrains/skija | shared/java/Font.java | https://github.com/JetBrains/skija/blob/master/shared/java/Font.java | Apache-2.0 |
public Rect measureText(String s) {
return measureText(s, null);
} |
@return the bounding box of text
| Font::measureText | java | JetBrains/skija | shared/java/Font.java | https://github.com/JetBrains/skija/blob/master/shared/java/Font.java | Apache-2.0 |
public Rect measureText(String s, Paint p) {
try {
Stats.onNativeCall();
return _nMeasureText(_ptr, s, Native.getPtr(p));
} finally {
Reference.reachabilityFence(this);
Reference.reachabilityFence(p);
}
} |
@param p stroke width or PathEffect may modify the advance with
@return the bounding box of text
| Font::measureText | java | JetBrains/skija | shared/java/Font.java | https://github.com/JetBrains/skija/blob/master/shared/java/Font.java | Apache-2.0 |
public float[] getWidths(short[] glyphs) {
try {
Stats.onNativeCall();
return _nGetWidths(_ptr, glyphs);
} finally {
Reference.reachabilityFence(this);
}
} |
Retrieves the advances for each glyph
| Font::getWidths | java | JetBrains/skija | shared/java/Font.java | https://github.com/JetBrains/skija/blob/master/shared/java/Font.java | Apache-2.0 |
public Rect[] getBounds(short[] glyphs) {
return getBounds(glyphs, null);
} |
Retrieves the bounds for each glyph
| Font::getBounds | java | JetBrains/skija | shared/java/Font.java | https://github.com/JetBrains/skija/blob/master/shared/java/Font.java | Apache-2.0 |
public Rect[] getBounds(short[] glyphs, Paint p) {
try {
Stats.onNativeCall();
return _nGetBounds(_ptr, glyphs, Native.getPtr(p));
} finally {
Reference.reachabilityFence(this);
Reference.reachabilityFence(p);
}
} |
Retrieves the bounds for each glyph
| Font::getBounds | java | JetBrains/skija | shared/java/Font.java | https://github.com/JetBrains/skija/blob/master/shared/java/Font.java | Apache-2.0 |
public Point[] getPositions(short[] glyphs) {
try {
Stats.onNativeCall();
return _nGetPositions(_ptr, glyphs, 0, 0);
} finally {
Reference.reachabilityFence(this);
}
} |
Retrieves the positions for each glyph.
| Font::getPositions | java | JetBrains/skija | shared/java/Font.java | https://github.com/JetBrains/skija/blob/master/shared/java/Font.java | Apache-2.0 |
public Point[] getPositions(short[] glyphs, Point offset) {
try {
Stats.onNativeCall();
return _nGetPositions(_ptr, glyphs, offset._x, offset._y);
} finally {
Reference.reachabilityFence(this);
}
} |
Retrieves the positions for each glyph, beginning at the specified origin.
| Font::getPositions | java | JetBrains/skija | shared/java/Font.java | https://github.com/JetBrains/skija/blob/master/shared/java/Font.java | Apache-2.0 |
public float[] getXPositions(short[] glyphs) {
try {
Stats.onNativeCall();
return _nGetXPositions(_ptr, glyphs, 0);
} finally {
Reference.reachabilityFence(this);
}
} |
Retrieves the x-positions for each glyph.
| Font::getXPositions | java | JetBrains/skija | shared/java/Font.java | https://github.com/JetBrains/skija/blob/master/shared/java/Font.java | Apache-2.0 |
public float[] getXPositions(short[] glyphs, float offset) {
try {
Stats.onNativeCall();
return _nGetXPositions(_ptr, glyphs, offset);
} finally {
Reference.reachabilityFence(this);
}
} |
Retrieves the x-positions for each glyph, beginning at the specified origin.
| Font::getXPositions | java | JetBrains/skija | shared/java/Font.java | https://github.com/JetBrains/skija/blob/master/shared/java/Font.java | Apache-2.0 |
public Path[] getPaths(short[] glyphs) {
try {
Stats.onNativeCall();
return _nGetPaths(_ptr, glyphs);
} finally {
Reference.reachabilityFence(this);
}
} |
Return glyph outlines, some of which might be null.
| Font::getPaths | java | JetBrains/skija | shared/java/Font.java | https://github.com/JetBrains/skija/blob/master/shared/java/Font.java | Apache-2.0 |
public FontMetrics getMetrics() {
try {
Stats.onNativeCall();
return _nGetMetrics(_ptr);
} finally {
Reference.reachabilityFence(this);
}
} |
Returns FontMetrics associated with Typeface. Results are scaled by text size but does not take into account
dimensions required by text scale, text skew, fake bold, style stroke, and {@link PathEffect}.
| Font::getMetrics | java | JetBrains/skija | shared/java/Font.java | https://github.com/JetBrains/skija/blob/master/shared/java/Font.java | Apache-2.0 |
public float getSpacing() {
try {
Stats.onNativeCall();
return _nGetSpacing(_ptr);
} finally {
Reference.reachabilityFence(this);
}
} |
Returns the recommended spacing between lines: the sum of metrics descent, ascent, and leading.
Result is scaled by text size but does not take into account dimensions required by stroking and SkPathEffect.
| Font::getSpacing | java | JetBrains/skija | shared/java/Font.java | https://github.com/JetBrains/skija/blob/master/shared/java/Font.java | Apache-2.0 |
public Canvas beginRecording(Rect bounds) {
try {
Stats.onNativeCall();
return new Canvas(_nBeginRecording(_ptr, bounds._left, bounds._top, bounds._right, bounds._bottom), false, this);
} finally {
Reference.reachabilityFence(this);
}
} |
Returns the canvas that records the drawing commands.
@param bounds the cull rect used when recording this picture. Any drawing the falls outside
of this rect is undefined, and may be drawn or it may not.
@return the canvas.
| PictureRecorder::beginRecording | java | JetBrains/skija | shared/java/PictureRecorder.java | https://github.com/JetBrains/skija/blob/master/shared/java/PictureRecorder.java | Apache-2.0 |
public Picture finishRecordingAsPicture() {
try {
Stats.onNativeCall();
return new Picture(_nFinishRecordingAsPicture(_ptr));
} finally {
Reference.reachabilityFence(this);
}
} |
<p>Signal that the caller is done recording. This invalidates the canvas returned by
{@link #beginRecording(Rect)}/{@link #getRecordingCanvas()}.</p>
<p>The returned picture is immutable. If during recording drawables were added to the canvas,
these will have been "drawn" into a recording canvas, so that this resulting picture will
reflect their current state, but will not contain a live reference to the drawables
themselves.</p>
| PictureRecorder::finishRecordingAsPicture | java | JetBrains/skija | shared/java/PictureRecorder.java | https://github.com/JetBrains/skija/blob/master/shared/java/PictureRecorder.java | Apache-2.0 |
public Picture finishRecordingAsPicture(@NotNull Rect cull) {
try {
Stats.onNativeCall();
return new Picture(_nFinishRecordingAsPictureWithCull(_ptr, cull._left, cull._top, cull._right, cull._bottom));
} finally {
Reference.reachabilityFence(this);
}
} |
Signal that the caller is done recording, and update the cull rect to use for bounding
box hierarchy (BBH) generation. The behavior is the same as calling
{@link #finishRecordingAsPicture()}, except that this method updates the cull rect
initially passed into {@link #beginRecording(Rect)}.
@param cull the new culling rectangle to use as the overall bound for BBH generation
and subsequent culling operations.
@return the picture containing the recorded content.
| PictureRecorder::finishRecordingAsPicture | java | JetBrains/skija | shared/java/PictureRecorder.java | https://github.com/JetBrains/skija/blob/master/shared/java/PictureRecorder.java | Apache-2.0 |
public FontStyleSet matchFamily(String familyName) {
try {
Stats.onNativeCall();
return new FontStyleSet(_nMatchFamily(_ptr, familyName));
} finally {
Reference.reachabilityFence(this);
}
} |
The caller must call {@link #close()} on the returned object.
Never returns null; will return an empty set if the name is not found.
Passing null as the parameter will return the default system family.
Note that most systems don't have a default system family, so passing null will often
result in the empty set.
It is possible that this will return a style set not accessible from
{@link #makeStyleSet(int)} due to hidden or auto-activated fonts.
| FontMgr::matchFamily | java | JetBrains/skija | shared/java/FontMgr.java | https://github.com/JetBrains/skija/blob/master/shared/java/FontMgr.java | Apache-2.0 |
public Typeface matchFamilyStyleCharacter(@Nullable String familyName, FontStyle style, @Nullable String[] bcp47, int character) {
try {
Stats.onNativeCall();
long ptr = _nMatchFamilyStyleCharacter(_ptr, familyName, style._value, bcp47, character);
return ptr == 0 ? null : new Typeface(ptr);
} finally {
Reference.reachabilityFence(this);
}
} |
Use the system fallback to find a typeface for the given character.
Note that bcp47 is a combination of ISO 639, 15924, and 3166-1 codes,
so it is fine to just pass a ISO 639 here.
Will return null if no family can be found for the character
in the system fallback.
Passing `null` as the parameter for `familyName` will return the
default system font.
bcp47[0] is the least significant fallback, bcp47[bcp47.length-1] is the
most significant. If no specified bcp47 codes match, any font with the
requested character will be matched.
| FontMgr::matchFamilyStyleCharacter | java | JetBrains/skija | shared/java/FontMgr.java | https://github.com/JetBrains/skija/blob/master/shared/java/FontMgr.java | Apache-2.0 |
public Typeface makeFromData(Data data) {
return makeFromData(data, 0);
} |
Create a typeface for the specified data and TTC index (pass 0 for none)
or null if the data is not recognized. The caller must call {@link #close()} on
the returned object if it is not null.
| FontMgr::makeFromData | java | JetBrains/skija | shared/java/FontMgr.java | https://github.com/JetBrains/skija/blob/master/shared/java/FontMgr.java | Apache-2.0 |
public static FontMgr getDefault() {
return _DefaultHolder.INSTANCE;
} |
Return the default fontmgr.
| FontMgr::getDefault | java | JetBrains/skija | shared/java/FontMgr.java | https://github.com/JetBrains/skija/blob/master/shared/java/FontMgr.java | Apache-2.0 |
public static BreakIterator makeCharacterInstance() {
return makeCharacterInstance(null);
} |
Returns a new BreakIterator instance for character breaks for the default locale.
| BreakIterator::makeCharacterInstance | java | JetBrains/skija | shared/java/BreakIterator.java | https://github.com/JetBrains/skija/blob/master/shared/java/BreakIterator.java | Apache-2.0 |
public static BreakIterator makeCharacterInstance(String locale) {
Stats.onNativeCall();
return new BreakIterator(_nMake(0, locale)); // UBRK_CHARACTER
} |
Returns a new BreakIterator instance for character breaks for the given locale.
| BreakIterator::makeCharacterInstance | java | JetBrains/skija | shared/java/BreakIterator.java | https://github.com/JetBrains/skija/blob/master/shared/java/BreakIterator.java | Apache-2.0 |
public static BreakIterator makeWordInstance() {
return makeWordInstance(null);
} |
Returns a new BreakIterator instance for word breaks for the default locale.
| BreakIterator::makeWordInstance | java | JetBrains/skija | shared/java/BreakIterator.java | https://github.com/JetBrains/skija/blob/master/shared/java/BreakIterator.java | Apache-2.0 |
public static BreakIterator makeWordInstance(String locale) {
Stats.onNativeCall();
return new BreakIterator(_nMake(1, locale)); // UBRK_WORD
} |
Returns a new BreakIterator instance for word breaks for the given locale.
| BreakIterator::makeWordInstance | java | JetBrains/skija | shared/java/BreakIterator.java | https://github.com/JetBrains/skija/blob/master/shared/java/BreakIterator.java | Apache-2.0 |
public static BreakIterator makeLineInstance() {
return makeLineInstance(null);
} |
Returns a new BreakIterator instance for line breaks for the default locale.
| BreakIterator::makeLineInstance | java | JetBrains/skija | shared/java/BreakIterator.java | https://github.com/JetBrains/skija/blob/master/shared/java/BreakIterator.java | Apache-2.0 |
public static BreakIterator makeLineInstance(String locale) {
Stats.onNativeCall();
return new BreakIterator(_nMake(2, locale)); // UBRK_LINE
} |
Returns a new BreakIterator instance for line breaks for the given locale.
| BreakIterator::makeLineInstance | java | JetBrains/skija | shared/java/BreakIterator.java | https://github.com/JetBrains/skija/blob/master/shared/java/BreakIterator.java | Apache-2.0 |
public static BreakIterator makeSentenceInstance() {
return makeSentenceInstance(null);
} |
Returns a new BreakIterator instance for sentence breaks for the default locale.
| BreakIterator::makeSentenceInstance | java | JetBrains/skija | shared/java/BreakIterator.java | https://github.com/JetBrains/skija/blob/master/shared/java/BreakIterator.java | Apache-2.0 |
public static BreakIterator makeSentenceInstance(String locale) {
Stats.onNativeCall();
return new BreakIterator(_nMake(3, locale)); // UBRK_SENTENCE
} |
Returns a new BreakIterator instance for sentence breaks for the given locale.
| BreakIterator::makeSentenceInstance | java | JetBrains/skija | shared/java/BreakIterator.java | https://github.com/JetBrains/skija/blob/master/shared/java/BreakIterator.java | Apache-2.0 |
public int current() {
try {
Stats.onNativeCall();
return _nCurrent(_ptr);
} finally {
Reference.reachabilityFence(this);
}
} |
Returns character index of the text boundary that was most recently
returned by {@link next()}, {@link next(int)}, {@link previous()},
{@link first()}, {@link last()}, {@link following(int)} or
{@link preceding(int)}. If any of these methods returns
{@link BreakIterator#DONE} because either first or last text boundary
has been reached, it returns the first or last text boundary depending
on which one is reached.
| BreakIterator::current | java | JetBrains/skija | shared/java/BreakIterator.java | https://github.com/JetBrains/skija/blob/master/shared/java/BreakIterator.java | Apache-2.0 |
public int next() {
try {
Stats.onNativeCall();
return _nNext(_ptr);
} finally {
Reference.reachabilityFence(this);
}
} |
Returns the boundary following the current boundary. If the current
boundary is the last text boundary, it returns {@link BreakIterator#DONE}
and the iterator's current position is unchanged. Otherwise, the
iterator's current position is set to the boundary following the current
boundary.
| BreakIterator::next | java | JetBrains/skija | shared/java/BreakIterator.java | https://github.com/JetBrains/skija/blob/master/shared/java/BreakIterator.java | Apache-2.0 |
public int next(int n) {
int result = 0;
if (n > 0) {
for (; n > 0 && result != DONE; --n) {
result = next();
}
} else if (n < 0) {
for (; n < 0 && result != DONE; ++n) {
result = previous();
}
} else {
result = current();
}
return result;
} |
Advances the iterator either forward or backward the specified number of steps.
Negative values move backward, and positive values move forward. This is
equivalent to repeatedly calling next() or previous().
@param n The number of steps to move. The sign indicates the direction
(negative is backwards, and positive is forwards).
@return The character offset of the boundary position n boundaries away from
the current one.
| BreakIterator::next | java | JetBrains/skija | shared/java/BreakIterator.java | https://github.com/JetBrains/skija/blob/master/shared/java/BreakIterator.java | Apache-2.0 |
public int previous() {
try {
Stats.onNativeCall();
return _nPrevious(_ptr);
} finally {
Reference.reachabilityFence(this);
}
} |
Returns the boundary following the current boundary. If the current
boundary is the last text boundary, it returns {@link BreakIterator#DONE}
and the iterator's current position is unchanged. Otherwise, the
iterator's current position is set to the boundary following the current
boundary.
| BreakIterator::previous | java | JetBrains/skija | shared/java/BreakIterator.java | https://github.com/JetBrains/skija/blob/master/shared/java/BreakIterator.java | Apache-2.0 |
public int first() {
try {
Stats.onNativeCall();
return _nFirst(_ptr);
} finally {
Reference.reachabilityFence(this);
}
} |
Returns the first boundary. The iterator's current position is set to the first text boundary.
| BreakIterator::first | java | JetBrains/skija | shared/java/BreakIterator.java | https://github.com/JetBrains/skija/blob/master/shared/java/BreakIterator.java | Apache-2.0 |
public int last() {
try {
Stats.onNativeCall();
return _nLast(_ptr);
} finally {
Reference.reachabilityFence(this);
}
} |
Returns the last boundary. The iterator's current position is set to the last text boundary.
| BreakIterator::last | java | JetBrains/skija | shared/java/BreakIterator.java | https://github.com/JetBrains/skija/blob/master/shared/java/BreakIterator.java | Apache-2.0 |
public int preceding(int offset) {
try {
Stats.onNativeCall();
return _nPreceding(_ptr, offset);
} finally {
Reference.reachabilityFence(this);
}
} |
Returns the last boundary preceding the specified character offset.
If the specified offset is equal to the first text boundary, it returns
{@link BreakIterator#DONE} and the iterator's current position is
unchanged. Otherwise, the iterator's current position is set to the
returned boundary. The value returned is always less than the offset or
the value {@link BreakIterator#DONE}.
| BreakIterator::preceding | java | JetBrains/skija | shared/java/BreakIterator.java | https://github.com/JetBrains/skija/blob/master/shared/java/BreakIterator.java | Apache-2.0 |
public int following(int offset) {
try {
Stats.onNativeCall();
return _nFollowing(_ptr, offset);
} finally {
Reference.reachabilityFence(this);
}
} |
Returns the first boundary following the specified character offset.
If the specified offset is equal to the last text boundary, it returns
{@link BreakIterator#DONE} and the iterator's current position is
unchanged. Otherwise, the iterator's current position is set to the
returned boundary. The value returned is always greater than the offset or
the value {@link BreakIterator#DONE}.
| BreakIterator::following | java | JetBrains/skija | shared/java/BreakIterator.java | https://github.com/JetBrains/skija/blob/master/shared/java/BreakIterator.java | Apache-2.0 |
public boolean isBoundary(int offset) {
try {
Stats.onNativeCall();
return _nIsBoundary(_ptr, offset);
} finally {
Reference.reachabilityFence(this);
}
} |
Returns true if the specified character offset is a text boundary.
| BreakIterator::isBoundary | java | JetBrains/skija | shared/java/BreakIterator.java | https://github.com/JetBrains/skija/blob/master/shared/java/BreakIterator.java | Apache-2.0 |
public int getRuleStatus() {
try {
Stats.onNativeCall();
return _nGetRuleStatus(_ptr);
} finally {
Reference.reachabilityFence(this);
}
} |
For rule-based BreakIterators, return the status tag from the
break rule that determined the boundary at the current iteration position.
<p>
For break iterator types that do not support a rule status,
a default value of 0 is returned.
<p>
@return The status from the break rule that determined the boundary
at the current iteration position.
| BreakIterator::getRuleStatus | java | JetBrains/skija | shared/java/BreakIterator.java | https://github.com/JetBrains/skija/blob/master/shared/java/BreakIterator.java | Apache-2.0 |
public int[] getRuleStatuses() {
try {
Stats.onNativeCall();
return _nGetRuleStatuses(_ptr);
} finally {
Reference.reachabilityFence(this);
}
} |
For RuleBasedBreakIterators, get the status (tag) values from the break rule(s)
that determined the the boundary at the current iteration position.
<p>
For break iterator types that do not support rule status,
no values are returned.
@return an array with the status values.
| BreakIterator::getRuleStatuses | java | JetBrains/skija | shared/java/BreakIterator.java | https://github.com/JetBrains/skija/blob/master/shared/java/BreakIterator.java | Apache-2.0 |
public void setText(String text) {
try {
Stats.onNativeCall();
_text = new U16String(text);
_nSetText(_ptr, Native.getPtr(_text));
} finally {
Reference.reachabilityFence(this);
Reference.reachabilityFence(_text);
}
} |
Set a new text string to be scanned. The current scan position is reset to {@link first()}.
| BreakIterator::setText | java | JetBrains/skija | shared/java/BreakIterator.java | https://github.com/JetBrains/skija/blob/master/shared/java/BreakIterator.java | Apache-2.0 |
public int getGenerationId() {
try {
Stats.onNativeCall();
return _nGetGenerationId(_ptr);
} finally {
Reference.reachabilityFence(this);
}
} |
<p>Return a unique value for this instance. If two calls to this return the same value,
it is presumed that calling the draw() method will render the same thing as well.</p>
<p>Subclasses that change their state should call notifyDrawingChanged() to ensure that
a new value will be returned the next time it is called.</p>
| Drawable::getGenerationId | java | JetBrains/skija | shared/java/Drawable.java | https://github.com/JetBrains/skija/blob/master/shared/java/Drawable.java | Apache-2.0 |
public int getBytesPerPixel() {
switch (this) {
case UNKNOWN: return 0;
case ALPHA_8: return 1;
case RGB_565: return 2;
case ARGB_4444: return 2;
case RGBA_8888: return 4;
case BGRA_8888: return 4;
case RGB_888X: return 4;
case RGBA_1010102: return 4;
case RGB_101010X: return 4;
case BGRA_1010102: return 4;
case BGR_101010X: return 4;
case GRAY_8: return 1;
case RGBA_F16NORM: return 8;
case RGBA_F16: return 8;
case RGBA_F32: return 16;
case R8G8_UNORM: return 2;
case A16_UNORM: return 2;
case R16G16_UNORM: return 4;
case A16_FLOAT: return 2;
case R16G16_FLOAT: return 4;
case R16G16B16A16_UNORM: return 8;
}
throw new RuntimeException("Unreachable");
} |
Returns the number of bytes required to store a pixel, including unused padding.
Returns zero for {@link #UNKNOWN}.
@return bytes per pixel
| ColorType::getBytesPerPixel | java | JetBrains/skija | shared/java/ColorType.java | https://github.com/JetBrains/skija/blob/master/shared/java/ColorType.java | Apache-2.0 |
public boolean isAlwaysOpaque() {
Stats.onNativeCall();
return _nIsAlwaysOpaque(ordinal());
} |
Returns true if ColorType always decodes alpha to 1.0, making the pixel
fully opaque. If true, ColorType does not reserve bits to encode alpha.
@return true if alpha is always set to 1.0
| ColorType::isAlwaysOpaque | java | JetBrains/skija | shared/java/ColorType.java | https://github.com/JetBrains/skija/blob/master/shared/java/ColorType.java | Apache-2.0 |
public TextBlobBuilder() {
this(_nMake());
Stats.onNativeCall();
} |
Constructs empty TextBlobBuilder. By default, TextBlobBuilder has no runs.
@see <a href="https://fiddle.skia.org/c/@TextBlobBuilder_empty_constructor">https://fiddle.skia.org/c/@TextBlobBuilder_empty_constructor</a>
| TextBlobBuilder::TextBlobBuilder | java | JetBrains/skija | shared/java/TextBlobBuilder.java | https://github.com/JetBrains/skija/blob/master/shared/java/TextBlobBuilder.java | Apache-2.0 |
public TextBlobBuilder appendRun(Font font, String text, float x, float y) {
return appendRun(font, font.getStringGlyphs(text), x, y, null);
} |
Glyphs are positioned on a baseline at (x, y), using font metrics to
determine their relative placement.
@param font Font used for this run
@param text Text to append in this run
@param x horizontal offset within the blob
@param y vertical offset within the blob
@return this
| TextBlobBuilder::appendRun | java | JetBrains/skija | shared/java/TextBlobBuilder.java | https://github.com/JetBrains/skija/blob/master/shared/java/TextBlobBuilder.java | Apache-2.0 |
public TextBlobBuilder appendRun(Font font, String text, float x, float y, @Nullable Rect bounds) {
return appendRun(font, font.getStringGlyphs(text), x, y, bounds);
} |
<p>Glyphs are positioned on a baseline at (x, y), using font metrics to
determine their relative placement.</p>
<p>bounds defines an optional bounding box, used to suppress drawing when TextBlob
bounds does not intersect Surface bounds. If bounds is null, TextBlob bounds
is computed from (x, y) and glyphs metrics.</p>
@param font Font used for this run
@param text Text to append in this run
@param x horizontal offset within the blob
@param y vertical offset within the blob
@param bounds optional run bounding box
@return this
| TextBlobBuilder::appendRun | java | JetBrains/skija | shared/java/TextBlobBuilder.java | https://github.com/JetBrains/skija/blob/master/shared/java/TextBlobBuilder.java | Apache-2.0 |
public TextBlobBuilder appendRun(Font font, short[] glyphs, float x, float y, @Nullable Rect bounds) {
try {
Stats.onNativeCall();
_nAppendRun(_ptr, Native.getPtr(font), glyphs, x, y, bounds);
return this;
} finally {
Reference.reachabilityFence(font);
}
} |
<p>Glyphs are positioned on a baseline at (x, y), using font metrics to
determine their relative placement.</p>
<p>bounds defines an optional bounding box, used to suppress drawing when TextBlob
bounds does not intersect Surface bounds. If bounds is null, TextBlob bounds
is computed from (x, y) and glyphs metrics.</p>
@param font Font used for this run
@param glyphs glyphs in this run
@param x horizontal offset within the blob
@param y vertical offset within the blob
@param bounds optional run bounding box
@return this
| TextBlobBuilder::appendRun | java | JetBrains/skija | shared/java/TextBlobBuilder.java | https://github.com/JetBrains/skija/blob/master/shared/java/TextBlobBuilder.java | Apache-2.0 |
public TextBlobBuilder appendRunPosH(Font font, short[] glyphs, float[] xs, float y) {
return appendRunPosH(font, glyphs, xs, y, null);
} |
<p>Glyphs are positioned on a baseline at y, using x-axis positions from xs.</p>
@param font Font used for this run
@param glyphs glyphs in this run
@param xs horizontal positions on glyphs within the blob
@param y vertical offset within the blob
@return this
| TextBlobBuilder::appendRunPosH | java | JetBrains/skija | shared/java/TextBlobBuilder.java | https://github.com/JetBrains/skija/blob/master/shared/java/TextBlobBuilder.java | Apache-2.0 |
public TextBlobBuilder appendRunPosH(Font font, short[] glyphs, float[] xs, float y, @Nullable Rect bounds) {
try {
assert glyphs.length == xs.length : "glyphs.length " + glyphs.length + " != xs.length " + xs.length;
Stats.onNativeCall();
_nAppendRunPosH(_ptr, Native.getPtr(font), glyphs, xs, y, bounds);
return this;
} finally {
Reference.reachabilityFence(font);
}
} |
<p>Glyphs are positioned on a baseline at y, using x-axis positions from xs.</p>
<p>bounds defines an optional bounding box, used to suppress drawing when TextBlob
bounds does not intersect Surface bounds. If bounds is null, TextBlob bounds
is computed from (x, y) and glyphs metrics.</p>
@param font Font used for this run
@param glyphs glyphs in this run
@param xs horizontal positions of glyphs within the blob
@param y vertical offset within the blob
@param bounds optional run bounding box
@return this
| TextBlobBuilder::appendRunPosH | java | JetBrains/skija | shared/java/TextBlobBuilder.java | https://github.com/JetBrains/skija/blob/master/shared/java/TextBlobBuilder.java | Apache-2.0 |
public TextBlobBuilder appendRunPos(Font font, short[] glyphs, Point[] pos) {
return appendRunPos(font, glyphs, pos, null);
} |
<p>Glyphs are positioned at positions from pos.</p>
@param font Font used for this run
@param glyphs glyphs in this run
@param pos positions of glyphs within the blob
@return this
| TextBlobBuilder::appendRunPos | java | JetBrains/skija | shared/java/TextBlobBuilder.java | https://github.com/JetBrains/skija/blob/master/shared/java/TextBlobBuilder.java | Apache-2.0 |
public TextBlobBuilder appendRunPos(Font font, short[] glyphs, Point[] pos, @Nullable Rect bounds) {
try {
assert glyphs.length == pos.length : "glyphs.length " + glyphs.length + " != pos.length " + pos.length;
float[] floatPos = new float[pos.length * 2];
for (int i = 0; i < pos.length; ++i) {
floatPos[i * 2] = pos[i]._x;
floatPos[i * 2 + 1] = pos[i]._y;
}
Stats.onNativeCall();
_nAppendRunPos(_ptr, Native.getPtr(font), glyphs, floatPos, bounds);
return this;
} finally {
Reference.reachabilityFence(font);
}
} |
<p>Glyphs are positioned at positions from pos.</p>
<p>bounds defines an optional bounding box, used to suppress drawing when TextBlob
bounds does not intersect Surface bounds. If bounds is null, TextBlob bounds
is computed from (x, y) and glyphs metrics.</p>
@param font Font used for this run
@param glyphs glyphs in this run
@param pos positions of glyphs within the blob
@param bounds optional run bounding box
@return this
| TextBlobBuilder::appendRunPos | java | JetBrains/skija | shared/java/TextBlobBuilder.java | https://github.com/JetBrains/skija/blob/master/shared/java/TextBlobBuilder.java | Apache-2.0 |
public Paint() {
super(_nMake(), _FinalizerHolder.PTR);
Stats.onNativeCall();
} |
Constructs SkPaint with default values.
@see <a href="https://fiddle.skia.org/c/@Paint_empty_constructor">https://fiddle.skia.org/c/@Paint_empty_constructor</a>
| Paint::Paint | java | JetBrains/skija | shared/java/Paint.java | https://github.com/JetBrains/skija/blob/master/shared/java/Paint.java | Apache-2.0 |
public boolean isAntiAlias() {
try {
Stats.onNativeCall();
return _nIsAntiAlias(_ptr);
} finally {
Reference.reachabilityFence(this);
}
} |
Returns true if pixels on the active edges of Path may be drawn with partial transparency.
@return antialiasing state
| Paint::isAntiAlias | java | JetBrains/skija | shared/java/Paint.java | https://github.com/JetBrains/skija/blob/master/shared/java/Paint.java | Apache-2.0 |
public boolean isDither() {
try {
Stats.onNativeCall();
return _nIsDither(_ptr);
} finally {
Reference.reachabilityFence(this);
}
} |
@return true if color error may be distributed to smooth color transition.
| Paint::isDither | java | JetBrains/skija | shared/java/Paint.java | https://github.com/JetBrains/skija/blob/master/shared/java/Paint.java | Apache-2.0 |
public int getColor() {
try {
Stats.onNativeCall();
return _nGetColor(_ptr);
} finally {
Reference.reachabilityFence(this);
}
} |
Retrieves alpha and RGB, unpremultiplied, packed into 32 bits.
Use helpers {@link Color#getA(int)}, {@link Color#getR(int)}, {@link Color#getG(int)}, and {@link Color#getB(int)} to extract
a color component.
@return unpremultiplied ARGB
| Paint::getColor | java | JetBrains/skija | shared/java/Paint.java | https://github.com/JetBrains/skija/blob/master/shared/java/Paint.java | Apache-2.0 |
public float getAlphaf() {
return getColor4f().getA();
} |
Retrieves alpha from the color used when stroking and filling.
@return alpha ranging from 0f, fully transparent, to 1f, fully opaque
| Paint::getAlphaf | java | JetBrains/skija | shared/java/Paint.java | https://github.com/JetBrains/skija/blob/master/shared/java/Paint.java | Apache-2.0 |
public int getAlpha() {
return Math.round(getAlphaf() * 255f);
} |
Retrieves alpha from the color used when stroking and filling.
@return alpha ranging from 0, fully transparent, to 255, fully opaque
| Paint::getAlpha | java | JetBrains/skija | shared/java/Paint.java | https://github.com/JetBrains/skija/blob/master/shared/java/Paint.java | Apache-2.0 |
public float getStrokeWidth() {
try {
Stats.onNativeCall();
return _nGetStrokeWidth(_ptr);
} finally {
Reference.reachabilityFence(this);
}
} |
Returns the thickness of the pen used by Paint to outline the shape.
@return zero for hairline, greater than zero for pen thickness
| Paint::getStrokeWidth | java | JetBrains/skija | shared/java/Paint.java | https://github.com/JetBrains/skija/blob/master/shared/java/Paint.java | Apache-2.0 |
public float getStrokeMiter() {
try {
Stats.onNativeCall();
return _nGetStrokeMiter(_ptr);
} finally {
Reference.reachabilityFence(this);
}
} |
Returns the limit at which a sharp corner is drawn beveled.
@return zero and greater miter limit
| Paint::getStrokeMiter | java | JetBrains/skija | shared/java/Paint.java | https://github.com/JetBrains/skija/blob/master/shared/java/Paint.java | Apache-2.0 |
public boolean isSrcOver() {
return getBlendMode() == BlendMode.SRC_OVER;
} |
@return true if BlendMode is BlendMode.SRC_OVER, the default.
| Paint::isSrcOver | java | JetBrains/skija | shared/java/Paint.java | https://github.com/JetBrains/skija/blob/master/shared/java/Paint.java | Apache-2.0 |
public boolean hasNothingToDraw() {
try {
Stats.onNativeCall();
return _nHasNothingToDraw(_ptr);
} finally {
Reference.reachabilityFence(this);
}
} |
<p>Returns true if Paint prevents all drawing;
otherwise, the Paint may or may not allow drawing.</p>
<p>Returns true if, for example, BlendMode combined with alpha computes a
new alpha of zero.</p>
@return true if Paint prevents all drawing
@see <a href="https://fiddle.skia.org/c/@Paint_nothingToDraw">https://fiddle.skia.org/c/@Paint_nothingToDraw</a>
| Paint::hasNothingToDraw | java | JetBrains/skija | shared/java/Paint.java | https://github.com/JetBrains/skija/blob/master/shared/java/Paint.java | Apache-2.0 |
public int getWidth() {
try {
Stats.onNativeCall();
return _nGetWidth(_ptr);
} finally {
Reference.reachabilityFence(this);
}
} |
<p>Returns pixel count in each row; may be zero or greater.</p>
@return number of pixel columns
@see <a href="https://fiddle.skia.org/c/@Surface_width">https://fiddle.skia.org/c/@Surface_width</a>
| Surface::getWidth | java | JetBrains/skija | shared/java/Surface.java | https://github.com/JetBrains/skija/blob/master/shared/java/Surface.java | Apache-2.0 |
public int getHeight() {
try {
Stats.onNativeCall();
return _nGetHeight(_ptr);
} finally {
Reference.reachabilityFence(this);
}
} |
<p>Returns pixel row count; may be zero or greater.</p>
@return number of pixel rows
@see <a href="https://fiddle.skia.org/c/@Surface_height">https://fiddle.skia.org/c/@Surface_height</a>
| Surface::getHeight | java | JetBrains/skija | shared/java/Surface.java | https://github.com/JetBrains/skija/blob/master/shared/java/Surface.java | Apache-2.0 |
public int getGenerationId() {
try {
Stats.onNativeCall();
return _nGenerationId(_ptr);
} finally {
Reference.reachabilityFence(this);
}
} |
<p>Returns unique value identifying the content of Surface.</p>
<p>Returned value changes each time the content changes.
Content is changed by drawing, or by calling notifyContentWillChange().</p>
@return unique content identifier
| Surface::getGenerationId | java | JetBrains/skija | shared/java/Surface.java | https://github.com/JetBrains/skija/blob/master/shared/java/Surface.java | Apache-2.0 |
public void notifyContentWillChange(ContentChangeMode mode) {
try {
Stats.onNativeCall();
_nNotifyContentWillChange(_ptr, mode.ordinal());
} finally {
Reference.reachabilityFence(this);
}
} |
<p>Notifies that Surface contents will be changed by code outside of Skia.</p>
<p>Subsequent calls to generationID() return a different value.</p>
@see <a href="https://fiddle.skia.org/c/@Surface_notifyContentWillChange">https://fiddle.skia.org/c/@Surface_notifyContentWillChange</a>
| Surface::notifyContentWillChange | java | JetBrains/skija | shared/java/Surface.java | https://github.com/JetBrains/skija/blob/master/shared/java/Surface.java | Apache-2.0 |
public Image makeImageSnapshot() {
try {
Stats.onNativeCall();
return new Image(_nMakeImageSnapshot(_ptr));
} finally {
Reference.reachabilityFence(this);
}
} |
<p>Returns Image capturing Surface contents.</p>
<p>Subsequent drawing to Surface contents are not captured.
Image allocation is accounted for if Surface was created with SkBudgeted::kYes.</p>
@return Image initialized with Surface contents
@see <a href="https://fiddle.skia.org/c/@Surface_makeImageSnapshot">https://fiddle.skia.org/c/@Surface_makeImageSnapshot</a>
| Surface::makeImageSnapshot | java | JetBrains/skija | shared/java/Surface.java | https://github.com/JetBrains/skija/blob/master/shared/java/Surface.java | Apache-2.0 |
public void draw(Canvas canvas, int x, int y, Paint paint) {
try {
Stats.onNativeCall();
_nDraw(_ptr, Native.getPtr(canvas), x, y, Native.getPtr(paint));
} finally {
Reference.reachabilityFence(this);
Reference.reachabilityFence(canvas);
Reference.reachabilityFence(paint);
}
} |
<p>Draws Surface contents to canvas, with its top-left corner at (x, y).</p>
<p>If Paint paint is not null, apply ColorFilter, alpha, ImageFilter, and BlendMode.</p>
@param canvas Canvas drawn into
@param x horizontal offset in Canvas
@param y vertical offset in Canvas
@param paint Paint containing BlendMode, ColorFilter, ImageFilter, and so on; or null
@see <a href="https://fiddle.skia.org/c/@Surface_draw">https://fiddle.skia.org/c/@Surface_draw</a>
| Surface::draw | java | JetBrains/skija | shared/java/Surface.java | https://github.com/JetBrains/skija/blob/master/shared/java/Surface.java | Apache-2.0 |
public boolean readPixels(Bitmap bitmap, int srcX, int srcY) {
try {
Stats.onNativeCall();
return _nReadPixels(_ptr, Native.getPtr(bitmap), srcX, srcY);
} finally {
Reference.reachabilityFence(this);
Reference.reachabilityFence(bitmap);
}
} |
<p>Copies Rect of pixels from Surface into bitmap.</p>
<p>Source Rect corners are (srcX, srcY) and Surface (width(), height()).
Destination Rect corners are (0, 0) and (bitmap.width(), bitmap.height()).
Copies each readable pixel intersecting both rectangles, without scaling,
converting to bitmap.colorType() and bitmap.alphaType() if required.</p>
<p>Pixels are readable when Surface is raster, or backed by a GPU.</p>
<p>The destination pixel storage must be allocated by the caller.</p>
<p>Pixel values are converted only if ColorType and AlphaType do not match.
Only pixels within both source and destination rectangles are copied.
dst contents outside Rect intersection are unchanged.</p>
<p>Pass negative values for srcX or srcY to offset pixels across or down destination.</p>
<p>Does not copy, and returns false if:</p>
<ul>
<li>Source and destination rectangles do not intersect.</li>
<li>Surface pixels could not be converted to dst.colorType() or dst.alphaType().</li>
<li>dst pixels could not be allocated.</li>
<li>dst.rowBytes() is too small to contain one row of pixels.</li>
</ul>
@param bitmap storage for pixels copied from SkSurface
@param srcX offset into readable pixels on x-axis; may be negative
@param srcY offset into readable pixels on y-axis; may be negative
@return true if pixels were copied
@see <a href="https://fiddle.skia.org/c/@Surface_readPixels_3">https://fiddle.skia.org/c/@Surface_readPixels_3</a>
| Surface::readPixels | java | JetBrains/skija | shared/java/Surface.java | https://github.com/JetBrains/skija/blob/master/shared/java/Surface.java | Apache-2.0 |
public void writePixels(Bitmap bitmap, int x, int y) {
try {
Stats.onNativeCall();
_nWritePixels(_ptr, Native.getPtr(bitmap), x, y);
} finally {
Reference.reachabilityFence(this);
Reference.reachabilityFence(bitmap);
}
} |
<p>Copies Rect of pixels from the src Bitmap to the Surface.</p>
<p>Source Rect corners are (0, 0) and (src.width(), src.height()).
Destination Rect corners are (dstX, dstY) and (dstX + Surface width(), dstY + Surface height()).</p>
<p>Copies each readable pixel intersecting both rectangles, without scaling,
converting to Surface colorType() and Surface alphaType() if required.</p>
@param bitmap storage for pixels to copy to Surface
@param x x-axis position relative to Surface to begin copy; may be negative
@param y y-axis position relative to Surface to begin copy; may be negative
@see <a href="https://fiddle.skia.org/c/@Surface_writePixels_2">https://fiddle.skia.org/c/@Surface_writePixels_2</a>
| Surface::writePixels | java | JetBrains/skija | shared/java/Surface.java | https://github.com/JetBrains/skija/blob/master/shared/java/Surface.java | Apache-2.0 |
public void flushAndSubmit() {
try {
Stats.onNativeCall();
_nFlushAndSubmit(_ptr, false);
} finally {
Reference.reachabilityFence(this);
}
} |
<p>Call to ensure all reads/writes of the surface have been issued to the underlying 3D API.</p>
<p>Skia will correctly order its own draws and pixel operations.
This must to be used to ensure correct ordering when the surface backing store is accessed
outside Skia (e.g. direct use of the 3D API or a windowing system).
DirectContext has additional flush and submit methods that apply to all surfaces and images created from
a DirectContext.
| Surface::flushAndSubmit | java | JetBrains/skija | shared/java/Surface.java | https://github.com/JetBrains/skija/blob/master/shared/java/Surface.java | Apache-2.0 |
public void flushAndSubmit(boolean syncCpu) {
try {
Stats.onNativeCall();
_nFlushAndSubmit(_ptr, syncCpu);
} finally {
Reference.reachabilityFence(this);
}
} |
<p>Call to ensure all reads/writes of the surface have been issued to the underlying 3D API.</p>
<p>Skia will correctly order its own draws and pixel operations.
This must to be used to ensure correct ordering when the surface backing store is accessed
outside Skia (e.g. direct use of the 3D API or a windowing system).
DirectContext has additional flush and submit methods that apply to all surfaces and images created from
a DirectContext.
@param syncCpu a flag determining if cpu should be synced
| Surface::flushAndSubmit | java | JetBrains/skija | shared/java/Surface.java | https://github.com/JetBrains/skija/blob/master/shared/java/Surface.java | Apache-2.0 |
public boolean isUnique() {
try {
Stats.onNativeCall();
return _nUnique(_ptr);
} finally {
Reference.reachabilityFence(this);
}
} |
<p>May return true if the caller is the only owner.</p>
<p>Ensures that all previous owner's actions are complete.</p>
| Surface::isUnique | java | JetBrains/skija | shared/java/Surface.java | https://github.com/JetBrains/skija/blob/master/shared/java/Surface.java | Apache-2.0 |
public boolean isInverse() {
return this == INVERSE_WINDING || this == INVERSE_EVEN_ODD;
} |
Returns if FillType describes area outside Path geometry. The inverse fill area
extends indefinitely.
@return true if FillType is {@link #INVERSE_WINDING} or {@link #INVERSE_EVEN_ODD}
| PathFillMode::isInverse | java | JetBrains/skija | shared/java/PathFillMode.java | https://github.com/JetBrains/skija/blob/master/shared/java/PathFillMode.java | Apache-2.0 |
public PathFillMode inverse() {
switch (this) {
case WINDING:
return INVERSE_WINDING;
case EVEN_ODD:
return INVERSE_EVEN_ODD;
case INVERSE_WINDING:
return WINDING;
case INVERSE_EVEN_ODD:
return EVEN_ODD;
default:
throw new RuntimeException("Unreachable");
}
} |
Returns the inverse fill type. The inverse of FillType describes the area
unmodified by the original FillType.
@return inverse FillType
| PathFillMode::inverse | java | JetBrains/skija | shared/java/PathFillMode.java | https://github.com/JetBrains/skija/blob/master/shared/java/PathFillMode.java | Apache-2.0 |
default int getWidth() {
return getImageInfo()._width;
} |
Returns pixel count in each row. Should be equal or less than
getRowBytes() / getImageInfo().getBytesPerPixel().
May be less than getPixelRef().getWidth(). Will not exceed getPixelRef().getWidth() less
@return pixel width in ImageInfo
| getWidth | java | JetBrains/skija | shared/java/IHasImageInfo.java | https://github.com/JetBrains/skija/blob/master/shared/java/IHasImageInfo.java | Apache-2.0 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.