iOS: implement Image Pixel
This commit is contained in:
@@ -2316,7 +2316,30 @@ var Image = /** @class */ (function (_super) {
|
||||
Image.prototype.getImagePixels = function (context) {
|
||||
return this.nativeChannel(context, "getImagePixels")();
|
||||
};
|
||||
<<<<<<< HEAD
|
||||
__decorate$b([
|
||||
=======
|
||||
Image.prototype.setImagePixels = function (context, imagePixels) {
|
||||
if (Environment.platform === 'iOS') {
|
||||
imagePixels.pixels = context.function2Id(function () {
|
||||
return imagePixels.pixels;
|
||||
});
|
||||
}
|
||||
return this.nativeChannel(context, "setImagePixels")(imagePixels);
|
||||
};
|
||||
Image.prototype.toModel = function () {
|
||||
var ret = _super.prototype.toModel.call(this);
|
||||
if (Environment.platform === 'iOS') {
|
||||
if (Reflect.has(ret.props, "imagePixels")) {
|
||||
var imagePixels = Reflect.get(ret.props, "imagePixels");
|
||||
var pixels_1 = imagePixels.pixels;
|
||||
imagePixels.pixels = this.callback2Id(function () { return pixels_1; });
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
__decorate$a([
|
||||
>>>>>>> 60c3fff0... iOS: implement Image Pixel
|
||||
Property,
|
||||
__metadata$b("design:type", Object)
|
||||
], Image.prototype, "imagePixels", void 0);
|
||||
|
@@ -1726,6 +1726,25 @@ class Image extends View {
|
||||
getImagePixels(context) {
|
||||
return this.nativeChannel(context, "getImagePixels")();
|
||||
}
|
||||
setImagePixels(context, imagePixels) {
|
||||
if (Environment.platform === 'iOS') {
|
||||
imagePixels.pixels = context.function2Id(() => {
|
||||
return imagePixels.pixels;
|
||||
});
|
||||
}
|
||||
return this.nativeChannel(context, "setImagePixels")(imagePixels);
|
||||
}
|
||||
toModel() {
|
||||
const ret = super.toModel();
|
||||
if (Environment.platform === 'iOS') {
|
||||
if (Reflect.has(ret.props, "imagePixels")) {
|
||||
const imagePixels = Reflect.get(ret.props, "imagePixels");
|
||||
const pixels = imagePixels.pixels;
|
||||
imagePixels.pixels = this.callback2Id(() => pixels);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
__decorate$b([
|
||||
Property,
|
||||
|
@@ -3254,6 +3254,25 @@ class Image extends View {
|
||||
getImagePixels(context) {
|
||||
return this.nativeChannel(context, "getImagePixels")();
|
||||
}
|
||||
setImagePixels(context, imagePixels) {
|
||||
if (Environment.platform === 'iOS') {
|
||||
imagePixels.pixels = context.function2Id(() => {
|
||||
return imagePixels.pixels;
|
||||
});
|
||||
}
|
||||
return this.nativeChannel(context, "setImagePixels")(imagePixels);
|
||||
}
|
||||
toModel() {
|
||||
const ret = super.toModel();
|
||||
if (Environment.platform === 'iOS') {
|
||||
if (Reflect.has(ret.props, "imagePixels")) {
|
||||
const imagePixels = Reflect.get(ret.props, "imagePixels");
|
||||
const pixels = imagePixels.pixels;
|
||||
imagePixels.pixels = this.callback2Id(() => pixels);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
__decorate$b([
|
||||
Property,
|
||||
|
Reference in New Issue
Block a user